Subversion Repositories Kolibri OS

Rev

Rev 2570 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
717 mikedld 1
;;================================================================================================;;
2
;;//// libio.asm //// (c) mike.dld, 2006-2008 ////////////////////////////////////////////////////;;
3
;;================================================================================================;;
4
;;                                                                                                ;;
5
;; This file is part of Common development libraries (Libs-Dev).                                  ;;
6
;;                                                                                                ;;
7
;; Libs-Dev is free software: you can redistribute it and/or modify it under the terms of the GNU ;;
1001 diamond 8
;; Lesser General Public License as published by the Free Software Foundation, either version 2.1 ;;
9
;; of the License, or (at your option) any later version.                                         ;;
717 mikedld 10
;;                                                                                                ;;
11
;; Libs-Dev is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without  ;;
12
;; even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  ;;
1001 diamond 13
;; Lesser General Public License for more details.                                                ;;
717 mikedld 14
;;                                                                                                ;;
1001 diamond 15
;; You should have received a copy of the GNU Lesser General Public License along with Libs-Dev.  ;;
16
;; If not, see .                                                    ;;
717 mikedld 17
;;                                                                                                ;;
18
;;================================================================================================;;
19
;;                                                                                                ;;
845 mikedld 20
;; 2008-08-06 (mike.dld)                                                                          ;;
21
;;   changes:                                                                                     ;;
22
;;     - split private procs into libio_p.asm, added comments                                     ;;
717 mikedld 23
;; 2007-12-10 (mike.dld)                                                                          ;;
24
;;   changes:                                                                                     ;;
25
;;     - almost fully incompatible with previous version since return values were changed.        ;;
26
;;       now they are more C-like                                                                 ;;
27
;;   notes:                                                                                       ;;
28
;;     - `file.err` is not yet available                                                          ;;
29
;; 2007-09-26 (mike.dld)                                                                          ;;
30
;;   changes:                                                                                     ;;
31
;;     - modified `file.size` a bit (according to changes in FileInfo struct)                     ;;
32
;;     - added `file.find_first`, `file.find_next`, `file.find_close`                             ;;
33
;;   notes:                                                                                       ;;
34
;;     - `file.aux.match_wildcard` is exported only for testing purposes, don't                   ;;
35
;;       use it since it may be removed or renamed in next versions                               ;;
36
;;                                                                                                ;;
37
;;================================================================================================;;
38
 
39
 
2570 hidnplayr 40
 
717 mikedld 41
format MS COFF
42
 
43
public @EXPORT as 'EXPORTS'
44
 
45
include '../../../../proc32.inc'
46
include '../../../../macros.inc'
2570 hidnplayr 47
purge section,mov,add,sub
717 mikedld 48
 
49
include 'libio.inc'
50
include 'libio_p.inc'
51
 
52
section '.flat' code readable align 16
53
 
845 mikedld 54
include 'libio_p.asm'
717 mikedld 55
 
56
;;================================================================================================;;
57
proc file.find_first _dir, _mask, _attr ;/////////////////////////////////////////////////////////;;
58
;;------------------------------------------------------------------------------------------------;;
59
;? Find first file with matching attributes and mask in specified directory                       ;;
60
;;------------------------------------------------------------------------------------------------;;
845 mikedld 61
;> _dir = directory path to search in                                                     ;;
62
;> _mask = file mask, with use of wildcards                                               ;;
63
;> _attr = file attributes mask (combination of FA_* constants)                            ;;
717 mikedld 64
;;------------------------------------------------------------------------------------------------;;
845 mikedld 65
;< eax = 0 (error) / matched file data pointer (acts as find descriptor)               ;;
717 mikedld 66
;;================================================================================================;;
2570 hidnplayr 67
        push    ebx edx
717 mikedld 68
 
2570 hidnplayr 69
        invoke  mem.alloc, sizeof.FindFileBlock
70
        or      eax, eax
71
        jz      .exit.error
72
        mov     edx, eax
73
        mov     ebx, [_attr]
74
        mov     [edx + FindFileBlock.Options.Attributes], ebx
75
        mov     ebx, [_mask]
76
        mov     [edx + FindFileBlock.Options.Mask], ebx
717 mikedld 77
 
2570 hidnplayr 78
        lea     ebx, [edx + FindFileBlock.InfoBlock]
79
        mov     [ebx + FileInfoBlock.Function], F70_READ_D
80
        mov     [ebx + FileInfoBlock.Count], 1
81
        lea     eax, [edx + FindFileBlock.Header]
82
        mov     [ebx + FileInfoBlock.Buffer], eax
83
        mov     eax, [_dir]
84
        mov     [ebx + FileInfoBlock.FileName], eax
717 mikedld 85
 
2570 hidnplayr 86
        stdcall libio._.find_matching_file, edx
87
        pop     edx ebx
88
        ret
717 mikedld 89
 
90
  .exit.error:
2570 hidnplayr 91
        xor     eax, eax
92
        pop     edx ebx
93
        ret
717 mikedld 94
endp
95
 
96
;;================================================================================================;;
97
proc file.find_next _findd ;//////////////////////////////////////////////////////////////////////;;
98
;;------------------------------------------------------------------------------------------------;;
99
;? Find next file matching criteria                                                               ;;
100
;;------------------------------------------------------------------------------------------------;;
845 mikedld 101
;> _findd = find descriptor (see `file.find_first`)                                    ;;
717 mikedld 102
;;------------------------------------------------------------------------------------------------;;
845 mikedld 103
;< eax = 0 (error) / matched file data pointer (acts as find descriptor)               ;;
717 mikedld 104
;;================================================================================================;;
2570 hidnplayr 105
        mov     eax, [_findd]
106
        add     eax, -sizeof.FileInfoHeader
107
        inc     [eax + FindFileBlock.InfoBlock.Position]
108
        stdcall libio._.find_matching_file, eax
109
        ret
717 mikedld 110
endp
111
 
112
;;================================================================================================;;
113
proc file.find_close _findd ;/////////////////////////////////////////////////////////////////////;;
114
;;------------------------------------------------------------------------------------------------;;
115
;? Close find descriptor and free memory                                                          ;;
116
;;------------------------------------------------------------------------------------------------;;
845 mikedld 117
;> _findd = find descriptor (see `file.find_first`)                                    ;;
717 mikedld 118
;;------------------------------------------------------------------------------------------------;;
119
;< eax = result of memory freeing routine                                                         ;;
120
;;================================================================================================;;
2570 hidnplayr 121
        mov     eax, [_findd]
122
        add     eax, -sizeof.FileInfoHeader
123
        invoke  mem.free, eax
124
        ret
717 mikedld 125
endp
126
 
127
;;================================================================================================;;
128
proc file.size _name ;////////////////////////////////////////////////////////////////////////////;;
129
;;------------------------------------------------------------------------------------------------;;
130
;? Get file size                                                                                  ;;
131
;;------------------------------------------------------------------------------------------------;;
845 mikedld 132
;> _name = path to file (full or relative)                                                ;;
717 mikedld 133
;;------------------------------------------------------------------------------------------------;;
2406 dunkaist 134
;< ebx = -1 (error) / file size (in bytes, up to 2G)                                       ;;
717 mikedld 135
;;------------------------------------------------------------------------------------------------;;
136
;# call `file.err` to obtain extended error information                                           ;;
137
;;================================================================================================;;
138
locals
139
  loc_info FileInfoBlock
140
endl
141
 
2570 hidnplayr 142
        lea     ebx, [loc_info]
143
        invoke  mem.alloc, 40
144
        push    eax
145
        mov     [ebx + FileInfoBlock.Function], F70_GETATTR_FD
146
        mov     [ebx + FileInfoBlock.Buffer], eax
147
        mov     byte[ebx + FileInfoBlock.FileName - 1], 0
148
        mov     eax, [_name]
149
        mov     [ebx + FileInfoBlock.FileName], eax
150
        mcall   70
151
        pop     ebx
152
        push    eax
153
        mov     eax, ebx
154
        mov     ebx, [ebx + FileInfo.FileSizeLow]
155
        invoke  mem.free, eax
156
        pop     eax
157
        ret
717 mikedld 158
endp
159
 
160
;;================================================================================================;;
161
proc file.open _name, _mode ;/////////////////////////////////////////////////////////////////////;;
162
;;------------------------------------------------------------------------------------------------;;
163
;? Open file                                                                                      ;;
164
;;------------------------------------------------------------------------------------------------;;
845 mikedld 165
;> _name = path to file (full or relative)                                                ;;
166
;> _mode = mode to open file in (combination of O_* constants)                             ;;
167
;>   O_BINARY - don't change read/written data in any way (default)                               ;;
168
;>   O_READ - open file for reading                                                               ;;
169
;>   O_WRITE - open file for writing                                                              ;;
170
;>   O_CREATE - create file if it doesn't exist, open otherwise                                   ;;
171
;>   O_SHARE - allow simultaneous access by using different file descriptors (not implemented)    ;;
172
;>   O_TEXT - replace newline chars with LF (overrides O_BINARY, not implemented)                 ;;
717 mikedld 173
;;------------------------------------------------------------------------------------------------;;
845 mikedld 174
;< eax = 0 (error) / file descriptor                                           ;;
717 mikedld 175
;;------------------------------------------------------------------------------------------------;;
176
;# call `file.err` to obtain extended error information                                           ;;
177
;;================================================================================================;;
178
locals
179
  loc_info FileInfoBlock
180
  loc_buf  rb 40
181
endl
182
 
2570 hidnplayr 183
        push    ebx esi edi
717 mikedld 184
 
2570 hidnplayr 185
        xor     ebx, ebx
186
        invoke  mem.alloc, sizeof.InternalFileInfo
187
        or      eax, eax
188
        jz      .exit_error
189
        mov     ebx, eax
190
        push    [_mode]
191
        pop     [ebx + InternalFileInfo.Mode]
192
        mov     [ebx + InternalFileInfo.Position], 0
193
        lea     edi, [ebx + InternalFileInfo.FileName]
194
        mov     esi, [_name]
195
        mov     ecx, 260 / 4
196
        cld
197
        rep     movsd
717 mikedld 198
 
199
  .get_info:
2570 hidnplayr 200
        push    ebx
201
        mov     [loc_info.Function], F70_GETATTR_FD
202
        lea     eax, [loc_buf]
203
        mov     [loc_info.Buffer], eax
204
        mov     byte[loc_info.FileName - 1], 0
205
        mov     eax, [_name]
206
        mov     [loc_info.FileName], eax
207
        lea     ebx, [loc_info]
208
        mcall   70
209
        pop     ebx
210
        or      eax, eax
211
        jz      @f
212
        cmp     eax, 6
213
        jne     .exit_error.ex
717 mikedld 214
    @@:
2570 hidnplayr 215
        mov     eax, ebx
216
        pop     edi esi ebx
217
        ret
717 mikedld 218
 
219
  .exit_error.ex:
2570 hidnplayr 220
        test    [_mode], O_CREATE
221
        jz      .exit_error
222
        push    ebx
223
        mov     [loc_info.Function], F70_CREATE_F
224
        xor     eax, eax
225
        mov     [loc_info.Position], eax
226
        mov     [loc_info.Flags], eax
227
        mov     [loc_info.Count], eax
228
        lea     ebx, [loc_info]
229
        mcall   70
230
        pop     ebx
231
        or      eax, eax
232
        jz      .get_info
717 mikedld 233
 
234
  .exit_error:
2570 hidnplayr 235
        invoke  mem.free, ebx
236
        xor     eax, eax
237
        pop     edi esi ebx
238
        ret
717 mikedld 239
endp
240
 
241
;;================================================================================================;;
242
proc file.read _filed, _buf, _buflen ;////////////////////////////////////////////////////////////;;
243
;;------------------------------------------------------------------------------------------------;;
244
;? Read data from file                                                                            ;;
245
;;------------------------------------------------------------------------------------------------;;
845 mikedld 246
;> _filed = file descriptor (see `file.open`)                                  ;;
247
;> _buf = buffer to put read data to                                                       ;;
248
;> _buflen = buffer size (number of bytes to be read from file)                            ;;
717 mikedld 249
;;------------------------------------------------------------------------------------------------;;
845 mikedld 250
;< eax = -1 (error) / number of bytes read                                                 ;;
717 mikedld 251
;;------------------------------------------------------------------------------------------------;;
252
;# call `file.err` to obtain extended error information                                           ;;
253
;;================================================================================================;;
254
locals
255
  loc_info FileInfoBlock
256
endl
257
 
2570 hidnplayr 258
        push    ebx esi edi
717 mikedld 259
 
2570 hidnplayr 260
        mov     ebx, [_filed]
261
        test    [ebx + InternalFileInfo.Mode], O_READ
262
        jz      .exit_error
717 mikedld 263
 
2570 hidnplayr 264
        xor     eax, eax
265
        mov     [loc_info.Function], F70_READ_F
266
        mov     [loc_info.Flags], eax
267
        mov     byte[loc_info.FileName - 1], al
268
        push    [ebx+InternalFileInfo.Position] [_buflen] [_buf]
269
        pop     [loc_info.Buffer] [loc_info.Count] [loc_info.Position]
270
        lea     eax, [ebx + InternalFileInfo.FileName]
271
        mov     [loc_info.FileName], eax
272
        lea     ebx, [loc_info]
273
        mcall   70
274
        or      eax, eax
275
        jz      @f
276
        cmp     eax, 6
277
        jne     .exit_error
717 mikedld 278
    @@:
2570 hidnplayr 279
        mov     eax, ebx
280
        mov     ebx, [_filed]
281
        add     [ebx + InternalFileInfo.Position], eax
282
        pop     edi esi ebx
283
        ret
717 mikedld 284
 
285
  .exit_error:
2570 hidnplayr 286
        or      eax, -1
287
        pop     edi esi ebx
288
        ret
717 mikedld 289
endp
290
 
291
;;================================================================================================;;
292
proc file.write _filed, _buf, _buflen ;///////////////////////////////////////////////////////////;;
293
;;------------------------------------------------------------------------------------------------;;
294
;? Write data to file                                                                             ;;
295
;;------------------------------------------------------------------------------------------------;;
845 mikedld 296
;> _filed = file descriptor (see `file.open`)                                  ;;
297
;> _buf = buffer to get write data from                                                    ;;
298
;> _buflen = buffer size (number of bytes to be written to file)                           ;;
717 mikedld 299
;;------------------------------------------------------------------------------------------------;;
845 mikedld 300
;< eax = -1 (error) / number of bytes written                                              ;;
717 mikedld 301
;;------------------------------------------------------------------------------------------------;;
302
;# call `file.err` to obtain extended error information                                           ;;
303
;;================================================================================================;;
304
locals
305
  loc_info FileInfoBlock
306
endl
307
 
2570 hidnplayr 308
        push    ebx esi edi
717 mikedld 309
 
2570 hidnplayr 310
        mov     ebx, [_filed]
311
        test    [ebx + InternalFileInfo.Mode], O_WRITE
312
        jz      .exit_error
717 mikedld 313
 
2570 hidnplayr 314
        stdcall file.eof?, [_filed]
315
        or      eax, eax
316
        js      .exit_error
317
        jz      @f
318
        stdcall file.truncate, [_filed]
717 mikedld 319
    @@:
2570 hidnplayr 320
        mov     [loc_info.Function], F70_WRITE_F
321
        xor     eax, eax
322
        mov     [loc_info.Flags], eax
323
        mov     byte[loc_info.FileName - 1], al
324
        push    [ebx + InternalFileInfo.Position] [_buflen] [_buf]
325
        pop     [loc_info.Buffer] [loc_info.Count] [loc_info.Position]
326
        lea     eax, [ebx + InternalFileInfo.FileName]
327
        mov     [loc_info.FileName], eax
328
        lea     ebx, [loc_info]
329
        mcall   70
330
        or      eax, eax
331
        jnz     .exit_error
717 mikedld 332
    @@:
2570 hidnplayr 333
        mov     eax, ebx
334
        mov     ebx, [_filed]
335
        add     [ebx + InternalFileInfo.Position],eax
336
        pop     edi esi ebx
337
        ret
717 mikedld 338
 
339
  .exit_error:
2570 hidnplayr 340
        or      eax, -1
341
        pop     edi esi ebx
342
        ret
717 mikedld 343
endp
344
 
345
;;================================================================================================;;
346
proc file.seek _filed, _where, _origin ;//////////////////////////////////////////////////////////;;
347
;;------------------------------------------------------------------------------------------------;;
348
;? Set file pointer position                                                                      ;;
349
;;------------------------------------------------------------------------------------------------;;
845 mikedld 350
;> _filed = file descriptor (see `file.open`)                                  ;;
351
;> _where = position in file (in bytes) counted from specified origin                      ;;
352
;> _origin = origin from where to set the position (one of SEEK_* constants)               ;;
717 mikedld 353
;>   SEEK_SET - from beginning of file                                                            ;;
354
;>   SEEK_CUR - from current pointer position                                                     ;;
355
;>   SEEK_END - from end of file                                                                  ;;
356
;;------------------------------------------------------------------------------------------------;;
845 mikedld 357
;< eax = -1 (error) / 0                                                                    ;;
717 mikedld 358
;;------------------------------------------------------------------------------------------------;;
359
;# call `file.err` to obtain extended error information                                           ;;
360
;;================================================================================================;;
2570 hidnplayr 361
        push    ebx ecx edx
717 mikedld 362
 
2570 hidnplayr 363
        mov     ecx, [_filed]
364
        lea     eax, [ecx + InternalFileInfo.FileName]
365
        stdcall file.size, eax
366
        or      eax, eax
367
        jnz     .exit_error
368
        mov     edx, [_where]
369
        cmp     [_origin], SEEK_SET
370
        jne     .n_set
371
        mov     [ecx + InternalFileInfo.Position], edx
372
        jmp     .exit_ok
717 mikedld 373
 
374
  .n_set:
2570 hidnplayr 375
        cmp     [_origin], SEEK_CUR
376
        jne     .n_cur
377
        add     [ecx + InternalFileInfo.Position], edx
378
        jmp     .exit_ok
717 mikedld 379
 
380
  .n_cur:
2570 hidnplayr 381
        cmp     [_origin], SEEK_END
382
        jne     .exit_error
383
        neg     edx
384
        add     edx, ebx
385
        mov     [ecx + InternalFileInfo.Position], edx
717 mikedld 386
 
387
  .exit_ok:
388
 
2570 hidnplayr 389
        cmp     [ecx + InternalFileInfo.Position], 0
390
        jge     @f
391
        mov     [ecx + InternalFileInfo.Position], 0
717 mikedld 392
    @@:
393
;       cmp     ebx, [ecx+InternalFileInfo.Position]
394
;       jae     @f
395
;       mov     [ecx + InternalFileInfo.Position], ebx
396
;   @@:
2570 hidnplayr 397
        xor     eax, eax
398
        pop     edx ecx ebx
399
        ret
717 mikedld 400
 
401
  .exit_error:
2570 hidnplayr 402
        or      eax, -1
403
        pop     edx ecx ebx
404
        ret
717 mikedld 405
endp
406
 
407
;;================================================================================================;;
408
proc file.eof? _filed ;///////////////////////////////////////////////////////////////////////////;;
409
;;------------------------------------------------------------------------------------------------;;
410
;? Determine if file pointer is at the end of file                                                ;;
411
;;------------------------------------------------------------------------------------------------;;
845 mikedld 412
;> _filed = file descriptor (see `file.open`)                                  ;;
717 mikedld 413
;;------------------------------------------------------------------------------------------------;;
845 mikedld 414
;< eax = false / true                                                                      ;;
717 mikedld 415
;;------------------------------------------------------------------------------------------------;;
416
;# call `file.err` to obtain extended error information                                           ;;
417
;;================================================================================================;;
2570 hidnplayr 418
        push    ebx ecx
717 mikedld 419
 
2570 hidnplayr 420
        mov     ecx, [_filed]
421
        lea     eax, [ecx + InternalFileInfo.FileName]
422
        stdcall file.size, eax
423
        or      eax, eax
424
        jnz     .exit_error
717 mikedld 425
 
2570 hidnplayr 426
        xor     eax, eax
427
        cmp     [ecx + InternalFileInfo.Position], ebx
428
        jb      @f
429
        inc     eax
430
    @@: pop     ecx ebx
431
        ret
717 mikedld 432
 
433
  .exit_error:
2570 hidnplayr 434
        or      eax, -1
435
        pop     ecx ebx
436
        ret
717 mikedld 437
endp
438
 
439
;;================================================================================================;;
440
proc file.truncate _filed ;///////////////////////////////////////////////////////////////////////;;
441
;;------------------------------------------------------------------------------------------------;;
442
;? Truncate file size to current file pointer position                                            ;;
443
;;------------------------------------------------------------------------------------------------;;
845 mikedld 444
;> _filed = file descriptor (see `file.open`)                                  ;;
717 mikedld 445
;;------------------------------------------------------------------------------------------------;;
845 mikedld 446
;< eax = -1 (error) / 0                                                                    ;;
717 mikedld 447
;;------------------------------------------------------------------------------------------------;;
448
;# call `file.err` to obtain extended error information                                           ;;
449
;;================================================================================================;;
450
locals
451
  loc_info FileInfoBlock
452
endl
453
 
2570 hidnplayr 454
        push    ebx esi edi
717 mikedld 455
 
2570 hidnplayr 456
        mov     ebx, [_filed]
457
        test    [ebx + InternalFileInfo.Mode], O_WRITE
458
        jz      .exit_error
717 mikedld 459
 
2570 hidnplayr 460
        mov     [loc_info.Function], F70_SETSIZE_F
461
        mov     eax, [ebx + InternalFileInfo.Position]
462
        mov     [loc_info.Position], eax
463
        xor     eax, eax
464
        mov     [loc_info.Flags], eax
465
        mov     [loc_info.Count], eax
466
        mov     [loc_info.Buffer], eax
467
        mov     byte[loc_info.FileName - 1], al
468
        lea     eax, [ebx + InternalFileInfo.FileName]
469
        mov     [loc_info.FileName], eax
470
        lea     ebx, [loc_info]
471
        mcall   70
472
        cmp     eax, 2
473
        je      .exit_error
474
        cmp     eax, 8
475
        je      .exit_error
476
    @@: xor     eax, eax
477
        pop     edi esi ebx
478
        ret
717 mikedld 479
 
480
  .exit_error:
2570 hidnplayr 481
        or      eax, -1
482
        pop     edi esi ebx
483
        ret
717 mikedld 484
endp
485
 
486
file.seteof equ file.truncate
487
 
488
;;================================================================================================;;
489
proc file.tell _filed ;///////////////////////////////////////////////////////////////////////////;;
490
;;------------------------------------------------------------------------------------------------;;
491
;? Get current file pointer position                                                              ;;
492
;;------------------------------------------------------------------------------------------------;;
845 mikedld 493
;> _filed = file descriptor (see `file.open`)                                  ;;
717 mikedld 494
;;------------------------------------------------------------------------------------------------;;
845 mikedld 495
;< eax = -1 (error) / file pointer position                                                ;;
717 mikedld 496
;;------------------------------------------------------------------------------------------------;;
497
;# call `file.err` to obtain extended error information                                           ;;
498
;;================================================================================================;;
2570 hidnplayr 499
        mov     eax, [_filed]
500
        mov     eax, [eax + InternalFileInfo.Position]
501
        ret
717 mikedld 502
endp
503
 
504
;;================================================================================================;;
505
proc file.close _filed ;//////////////////////////////////////////////////////////////////////////;;
506
;;------------------------------------------------------------------------------------------------;;
507
;? Close file                                                                                     ;;
508
;;------------------------------------------------------------------------------------------------;;
845 mikedld 509
;> _filed = file descriptor (see `file.open`)                                  ;;
717 mikedld 510
;;------------------------------------------------------------------------------------------------;;
845 mikedld 511
;< eax = -1 (error) / file pointer position                                                ;;
717 mikedld 512
;;------------------------------------------------------------------------------------------------;;
513
;# call `file.err` to obtain extended error information                                           ;;
514
;;================================================================================================;;
3130 IgorA 515
        cmp eax,32
516
        jb .exit_error
2570 hidnplayr 517
        mov     eax, [_filed]
518
        mov     [eax + InternalFileInfo.Mode], 0
519
        mov     [eax + InternalFileInfo.FileName], 0
520
        invoke  mem.free, eax
521
        xor     eax, eax
3130 IgorA 522
        jmp @f
523
        .exit_error:
524
        or      eax, -1
525
        @@:
2570 hidnplayr 526
        ret
717 mikedld 527
endp
528
 
529
 
530
;;================================================================================================;;
531
;;////////////////////////////////////////////////////////////////////////////////////////////////;;
532
;;================================================================================================;;
533
;! Exported functions section                                                                     ;;
534
;;================================================================================================;;
535
;;////////////////////////////////////////////////////////////////////////////////////////////////;;
536
;;================================================================================================;;
537
 
538
 
539
align 16
540
@EXPORT:
541
 
2570 hidnplayr 542
export                                        \
543
        libio._.init    , 'lib_init'        , \
544
        0x00040004      , 'version'         , \
545
        file.find_first , 'file_find_first' , \
546
        file.find_next  , 'file_find_next'  , \
547
        file.find_close , 'file_find_close' , \
548
        file.size       , 'file_size'       , \
549
        file.open       , 'file_open'       , \
550
        file.read       , 'file_read'       , \
551
        file.write      , 'file_write'      , \
552
        file.seek       , 'file_seek'       , \
553
        file.tell       , 'file_tell'       , \
554
        file.eof?       , 'file_iseof'      , \
555
        file.seteof     , 'file_seteof'     , \
556
        file.truncate   , 'file_truncate'   , \
557
        file.close      , 'file_close'
558