1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
/*
Copyright 1990-2008 Light Infocon Tecnologia S/A
Este arquivo é parte do programa LightBase - Banco de Dados Textual Documental
O LightBase é um software livre; você pode redistribui-lo e/ou modifica-lo dentro
dos termos da Licença Pública Geral GNU como publicada pela Fundação do Software
Livre (FSF); na versão 2 da Licença.
Este programa é distribuído na esperança que possa ser útil, mas SEM NENHUMA
GARANTIA; sem uma garantia implícita de ADEQUAÇÃO a qualquer MERCADO ou APLICAÇÃO
EM PARTICULAR. Veja a Licença Pública Geral GNU para maiores detalhes.
Você deve ter recebido uma cópia da Licença Pública Geral GNU versao 2, sob o
título "LICENCA.txt", junto com este programa, se não, escreva para a Fundação do
Software Livre(FSF) Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// Windows:
//
// extern "C" hALStorage newALMemory( char *buffer_name,
// char AL_HUGE *user_buffer,
// DWORD user_buffer_size )
//
// MS-DOS:
//
// extern "C" hALStorage newALMemory( char *buffer_name,
// char *user_buffer,
// int user_buffer_size )
// ARGUMENTS:
//
// name : A character string containing an arbitrary name
// name for the memory buffer.
//
// user_buffer : If you want to supply a buffer of your own, pass it
// here. Otherwise, set it to 0, and the ALMemory
// class will allocate storage as needed.
//
// user_buffer_size : If you are supplying a buffer, you have to say how
// long it is.
//
// RETURNS
//
// A handle for (pointer to) a newly created ALMemory object.
//
// DESCRIPTION
//
// This C/VB translation function provides access to the ALMemory
// constructor. Note that the constructor has the same name under
// MS-DOS and Windows, but it does have slightly different capabilities.
// Because of this, the Windows version also has different argument types.
//
// This function passes all of its arguments to the C++ constructor
// in unchanged form. It then takes the return from the function, casts
// it to a C/VB acceptable type, and returns it otherwise unchanged.
//
// This function is like all of the other translation routines in that
// it is fairly uninformative. To get the real information about what
// is happening in the constructor, take a look at the source for the
// C++ functions in MEMSTORE.CPP.
//
// REVISION HISTORY
//
// May 24, 1994 1.0A : First release
//
extern "C" hALStorage AL_FUNCTION
extern "C" hALStorage AL_FUNCTION
//
// extern "C" int ALMemoryGetBufferOwner( hALStorage this_object )
//
// ARGUMENTS:
//
// this_object : A handle for (pointer to) an ALMemory object.
//
// RETURNS
//
// An integer flag indicating whether the user owns the buffer.
//
// DESCRIPTION
//
// This C/VB translation function provides access to the C++ data member
// ALMemory::mfUserOwnsBuffer.
//
// This function first tests its only argument for correct type (when in
// debug mode), then casts and accesses the data member. The value of
// the data member is then returned unchanged to the calling C or VB
// procedure.
//
// This function is like all of the other translation routines in that
// it is fairly uninformative. To get the real information about what
// is happening in the constructor, take a look at the source for the
// C++ functions in MEMSTORE.CPP.
//
// REVISION HISTORY
//
// May 24, 1994 1.0A : First release
//
extern "C" int AL_FUNCTION
//
// extern "C" void ALMemorySetBufferOwner( hALStorage this_object,
// int user_owns_buffer )
//
// ARGUMENTS:
//
// this_object : A handle for (pointer to) an ALMemory object.
//
// user_owns_buffer : The new setting of the flag.
//
// RETURNS
//
// Nothing.
//
// DESCRIPTION
//
// This C/VB translation function provides access to the C++ data member
// ALMemory::mfUserOwnsBuffer. Why would you want to change this
// data member? Well, if the ALMemory object is currently the buffer
// owner, the buffer will be deleted when the ALMemory object is destroyed.
// You can set the owner of the buffer to be you, the user, and copy
// the pointer to it. Then you get to keep it long after the ALMemory
// object is done with it.
//
// This function first tests its only argument for correct type (when in
// debug mode), then casts and modifies the data member.
//
// This function is like all of the other translation routines in that
// it is fairly uninformative. To get the real information about what
// is happening in the constructor, take a look at the source for the
// C++ functions in MEMSTORE.CPP.
//
// REVISION HISTORY
//
// May 24, 1994 1.0A : First release
//
extern "C" void AL_FUNCTION
// WINDOWS ONLY PROCEDURE
//
// extern "C" UINT ALMemoryGetHandle( hALStorage this_object )
//
// ARGUMENTS:
//
// this_object : A handle for (pointer to) an ALMemory object.
//
// RETURNS
//
// A UINT windows memory handle.
//
// DESCRIPTION
//
// This C/VB translation function provides access to the C++ data member
// ALMemory::mhUserMemoryHandle. Under C++, this is a public data
// member that the programmer is free to access or modify.
//
// This function first tests its only argument for correct type (when in
// debug mode), then casts and accesses the data member. The value of
// the data member is then returned unchanged to the calling C or VB
// procedure.
//
// This function is like all of the other translation routines in that
// it is fairly uninformative. To get the real information about what
// is happening in the constructor, take a look at the source for the
// C++ functions in MEMSTORE.CPP.
//
// REVISION HISTORY
//
// May 24, 1994 1.0A : First release
//
extern "C" UINT AL_FUNCTION
// WINDOWS Version
//
// extern "C" long ALMemoryGetBufferSize( hALStorage this_object )
//
// MS-DOS Real Mode version
//
// extern "C" size_t ALMemoryGetBufferSize( hALStorage this_object )
//
// ARGUMENTS:
//
// this_object : A handle for (pointer to) an ALMemory object.
//
// RETURNS
//
// The size of the memory buffer being uses as a storage object. The
// type of the the size differs between Windows and Real mode DOS, simply
// because Windows can access a lot more memory, especially when
// using Win32s.
//
// DESCRIPTION
//
// This C/VB translation function provides access to the C++ data member
// ALMemory::muUserBufferSize. Under C++, this is a public data
// member that the programmer is free to access or modify.
//
// This function first tests its only argument for correct type (when in
// debug mode), then casts and accesses the data member. The value of
// the data member is then returned unchanged to the calling C or VB
// procedure.
//
// This function is like all of the other translation routines in that
// it is fairly uninformative. To get the real information about what
// is happening in the constructor, take a look at the source for the
// C++ functions in MEMSTORE.CPP.
//
// REVISION HISTORY
//
// May 24, 1994 1.0A : First release
//
extern "C" long AL_FUNCTION
extern "C" size_t AL_FUNCTION
// WINDOWS Version
//
// extern "C" char AL_HUGE * ALMemoryGetBuffer( hALStorage this_object )
//
// MS-DOS Real Mode version
//
// extern "C" char *ALMemoryGetBuffer( hALStorage this_object )
//
// ARGUMENTS:
//
// this_object : A handle for (pointer to) an ALMemory object.
//
// RETURNS
//
// A pointer to the memory buffer being uses as a storage object. The
// type of the the pointer differs between the various modes of our
// library. Under Real Dos, it is just a normal pointer. Under Win16
// it is a _huge pointer. Under Win32s, it is a flat model pointer.
//
// DESCRIPTION
//
// This C/VB translation function provides access to the C++ data member
// ALMemory::mpcUserBuffer. Under C++, this is a public data
// member that the programmer is free to access or modify.
//
// This function first tests its only argument for correct type (when in
// debug mode), then casts and accesses the data member. The value of
// the data member is then returned unchanged to the calling C or VB
// procedure.
//
// This function is like all of the other translation routines in that
// it is fairly uninformative. To get the real information about what
// is happening in the constructor, take a look at the source for the
// C++ functions in MEMSTORE.CPP.
//
// REVISION HISTORY
//
// May 24, 1994 1.0A : First release
//
extern "C" char AL_HUGE * AL_FUNCTION
extern "C" char AL_DLL_FAR *AL_FUNCTION
//
// extern "C" long ALMemoryCopyBufferVB( hALStorage this_object )
//
// ARGUMENTS:
//
// this_object : A handle for (pointer to) an ALMemory object.
//
// RETURNS
//
// A VB string that contains the contents of the memory object.
// Note that the memory object is still there, unchanged, but now
// you can easily get at it using VB.
//
// DESCRIPTION
//
// This VB translation function provides access to the data stored
// in the buffer of an ALMemory object. It does this by creating a
// VB string with a copy of the data. We don't do any checking here,
// so it is possible to abort VB if the string is too large.
//
// This function was sort of a missing link in our ability to handle
// memory objects in VB. It was always easy to convert a VB string to
// an ALMemory object, but we didn't have any good way to make the
// reverse trip.
//
// REVISION HISTORY
//
// July 7, 1994 1.0B : First release
//
// August 10, 1994 1.0B : Combined a bunch of #ifdefs into a single test
// against AL_VB
extern "C" long AL_FUNCTION