Ignore:
Timestamp:
03/09/2011 04:55:49 PM (12 years ago)
Author:
marcus
Message:

r180 | walther | 2011-03-09 16:27:03 +0100 (Mi, 09 Mär 2011) | 3 lines

Merging most of the changes from marcus' branch. For full details please see
http://www.seismic-handler.org/portal/log/SH_SHM/branches/marcus?revs=101-106,123-171

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SH_SHM/trunk/source/sysbase.h

    r16 r341  
    4242#include "basecnst.h" 
    4343#endif 
    44  
    45  
    46  
    47 /****************************************************************** 
    48  ***                        ATARI version                       *** 
    49  ******************************************************************/ 
    50  
    51  
    52  
    53 #ifdef BC_ATARI 
    54  
    55  
    56 /* one byte integer */ 
    57 #define BYTE char 
    58  
    59 /* boolean type */ 
    60 #define BOOLEAN int 
    61  
    62 /* boolean values TRUE & FALSE */ 
    63 #ifdef BC_DEFINE_TRUE_FALSE 
    64 #define TRUE (1) 
    65 #define FALSE (0) 
    66 #endif 
    67  
    68 /* infinite loop declaration   */ 
    69 #define FOREVER for(;;) 
    70  
    71 /* status type */ 
    72 typedef int STATUS;    /* status value */ 
    73 #define Severe(s) (*(s) != 0) 
    74  
    75 /* nearest integer number to floating number */ 
    76 #define Nint(x) (int)(((x)>0)?(x)+0.5:(x)-0.5) 
    77 #define Nint32(x) (int)(((x)>0)?(x)+0.5:(x)-0.5) 
    78  
    79 /* nearest long number to floating number */ 
    80 #define Nlong(x) (long)(((x)>0)?(x)+0.5:(x)-0.5) 
    81  
    82 /* capitalize character */ 
    83 #define Cap(c) (((c)>='a' && (c)<='z') ? ((c)-32) : (c)) 
    84 #define Uncap(c) (((c)>='A' && (c)<='Z') ? ((c)+32) : (c)) 
    85  
    86 /* NULL address */ 
    87 /* #define NULL ( ( void * ) 0L ) */ 
    88  
    89 /* absolute value of number */ 
    90 #define Abs(x) ((x)<0?-(x):(x)) 
    91  
    92 /* sy_findfile parameter */ 
    93 #define SYC_FF_NAME 1 
    94 #define SYC_FF_DIR 2 
    95 #define SYC_FF_EXT 4 
    96  
    97 /* binary file type, uses GEMDOS file handle, because of mistake in FILE */ 
    98 typedef int BFILE; 
    99  
    100 /* open existing file for writing, is not yet used */ 
    101 #define SYC_OPEN_OVWR "w" 
    102  
    103 /* read logical name table */ 
    104 #define sy_lognames(f,s) fo_readtable(f,s) 
    105  
    106 /* open text file */ 
    107 #define sy_fopen(f,a) fo_fopen(f,a) 
    108  
    109 /* close text file */ 
    110 #define sy_fclose(f) fclose(f) 
    111  
    112 /* read from text file, is not yet used */ 
    113 #define sy_fread fread 
    114  
    115 /* write to text file, is not yet used */ 
    116 #define sy_fwrite fwrite 
    117  
    118 /* binary file operation failed */ 
    119 #define sy_fbfailed(f) ((f)<0) 
    120  
    121 /* delete file                   */ 
    122 /* call: sy_fdelete( filename )  */ 
    123 /*       char   *filename;  input; file to be deleted */ 
    124 /* #define sy_fdelete(a) Fdelete(a) */ 
    125 /* int Fdelete( const char fname[] ); */ 
    126 /* is now implemented as routine: */ 
    127 void sy_fdelete( char fname[] ); 
    128  
    129 /* rename file                                     */ 
    130 /* call: sy_frename( from, to )                    */ 
    131 /*       char   *from;   input; file to be renamed */ 
    132 /*       char   *to;     input; new name of file   */ 
    133 /* #define sy_frename(a,b) Frename(0,a,b) */ 
    134 /* int Frename( int zero, const char oldname[], const char newname[] ); */ 
    135 /* is now implemented as routine: */ 
    136 void sy_frename( char from[], char to[] ); 
    137  
    138 /* random string generator, not implemented */ 
    139 #define sy_randomstr(l,s) 
    140  
    141  
    142 /* system constants */ 
    143 /* ---------------- */ 
    144  
    145 /* maximum unsigned */ 
    146 #define SYC_MAXUNSG 0xffffL 
    147  
    148 /* maximum integer */ 
    149 #define SYC_MAXINT 0x7fffL 
    150  
    151 /* minimum integer */ 
    152 #define SYC_MININT 0x8000L 
    153  
    154 /* maximum long */ 
    155 #define SYC_MAXLONG 0x7fffffffL 
    156  
    157 /* minimum long */ 
    158 #define SYC_MINLONG 0x80000000L 
    159  
    160  
    161 /* system specific types */ 
    162 /* --------------------- */ 
    163  
    164 /* difference time, to measure time differences */ 
    165 typedef float DIFFTIME; 
    166  
    167  
    168 /* one global variable: Application ID */ 
    169 #ifndef __FROM_SYSCALL 
    170 extern int syv_apid; 
    171 #endif 
    172  
    173 /* include fileopen */ 
    174 #ifndef __FOUSRDEF 
    175 #include BC_FOUSRDEF 
    176 #endif 
    177  
    178  
    179  
    180 /*------------------------------------------------------------------------*/ 
    181 /*                                      prototypes of routines of module SYSCALL.C                                */ 
    182 /*------------------------------------------------------------------------*/ 
    183  
    184  
    185 void sy_initprocess( void ); 
    186  
    187 /* initialises process (ATARI AES, global memory area) 
    188  * 
    189  * no parameters 
    190  */ 
    191  
    192  
    193 /*------------------------------------------------------------------------*/ 
    194  
    195  
    196 #ifdef BC_SHARE_CPU 
    197  
    198  
    199 /*------------------------------------------------------------------------*/ 
    200  
    201  
    202  
    203 void sy_sharecpu( void ); 
    204  
    205 /* let other process get some CPU time (call to evnt_timer) 
    206  * 
    207  * no parameters 
    208  */ 
    209  
    210  
    211 /*------------------------------------------------------------------------*/ 
    212  
    213  
    214 void sy_debuginfo( char info[] ); 
    215  
    216 /* transfers debug information 
    217  * 
    218  * parameters of routine 
    219  * char          info[];   input; info string 
    220  */ 
    221  
    222  
    223 /*------------------------------------------------------------------------*/ 
    224  
    225  
    226 char *sy_getmessage( void ); 
    227  
    228 /* returns message string from external source 
    229  * 
    230  * no parameters 
    231  */ 
    232  
    233  
    234 /*------------------------------------------------------------------------*/ 
    235  
    236  
    237 #else  /* BC_SHARE_CPU */ 
    238  
    239  
    240 #define sy_sharecpu() 
    241 #define sy_debuginfo(i) 
    242 #define sy_getmessage() NULL 
    243  
    244  
    245 #endif /* BC_SHARE_CPU */ 
    246  
    247  
    248 /*------------------------------------------------------------------------*/ 
    249  
    250  
    251 void sy_gettime( char timstr[] ); 
    252  
    253 /* returns current time in time string.  The time string needs 25 
    254  * characters (including the termination byte) 
    255  * 
    256  * parameters of routine 
    257  */ 
    258  
    259  
    260 /*------------------------------------------------------------------------*/ 
    261  
    262  
    263 void sy_alert( char text[] ); 
    264  
    265 /* displays alert message text 
    266  * 
    267  * parameters of display 
    268  * char       text[];     input; text to be displayed 
    269  */ 
    270  
    271  
    272 /*------------------------------------------------------------------------*/ 
    273  
    274  
    275 void *sy_allocmem( long cnt, int size, STATUS *status ); 
    276  
    277 /* allocates memory ("cnt" objects of size "size) 
    278  * 
    279  * parameters of routine 
    280  * long     cnt;            input; number of objects 
    281  * int      size;           input; size of each object 
    282  * STATUS   *status;        output; return status 
    283  */ 
    284  
    285  
    286 /*------------------------------------------------------------------------*/ 
    287  
    288  
    289 void sy_deallocmem( void *ptr ); 
    290  
    291 /* deallocates memory, allocated by sy_allocmem 
    292  * 
    293  * parameter of routine 
    294  * void     *ptr;        input; pointer to be freed 
    295  */ 
    296  
    297  
    298 /*------------------------------------------------------------------------*/ 
    299  
    300  
    301 long sy_fbread( void *strbuf, int size, long n, BFILE fp ); 
    302  
    303 /* reads "n" objects of size "size" from binary file "fp" 
    304  * 
    305  * parameters of routine 
    306  * void     *strbuf;        output; buffer to read to 
    307  * int      size;           input; size of each object 
    308  * long     n;              input; number of objects 
    309  * BFILE    fp;             input; file descriptor 
    310  */ 
    311  
    312  
    313 /*------------------------------------------------------------------------*/ 
    314  
    315  
    316 long sy_fbwrite( void *strbuf, int size, long n, BFILE fp ); 
    317  
    318 /* writes "n" objects of size "size" to file "fp" 
    319  * 
    320  * parameters of routine 
    321  * void     *strbuf;        input; buffer to read to 
    322  * int      size;           input; size of each object 
    323  * long     n;              input; number of objects 
    324  * BFILE    fp;             input; file descriptor 
    325  */ 
    326  
    327  
    328 /*------------------------------------------------------------------------*/ 
    329  
    330  
    331 int sy_fbseek( BFILE fp, long pos, int mode ); 
    332  
    333 /* changes file position 
    334  * 
    335  * parameters of routine 
    336  * BFILE      fp;    input; file pointer 
    337  * long       pos;   input; new position 
    338  * int        mode;  input; search mode 
    339  */ 
    340  
    341  
    342 /*------------------------------------------------------------------------*/ 
    343  
    344  
    345 BFILE sy_fbopen( const char *file, const char *access ); 
    346  
    347 /* opens a binary file 
    348  * 
    349  * parameters of routine 
    350  * const char    *file;    input; filename 
    351  * const char    *access;  input; access mode 
    352  */ 
    353  
    354  
    355 /*------------------------------------------------------------------------*/ 
    356  
    357  
    358 int sy_fbclose( BFILE fp ); 
    359  
    360 /* closes binary file 
    361  * 
    362  * parameter of routine 
    363  * BFILE     fp;      input; file pointer 
    364  */ 
    365  
    366  
    367 /*------------------------------------------------------------------------*/ 
    368  
    369  
    370 void sy_findfile( int request, char wild[], char filename[] ); 
    371  
    372 /* looks for files matching wild card string "wild". Returns filename of 
    373  * file found or "\0" if not found.  "request" controls the returned 
    374  * elements.  For example the value (SYC_FF_DIR|SYC_FF_NAME|SYC_FF_EXT) 
    375  * means, that the returned string contains directory, file name and 
    376  * extension. 
    377  * 
    378  * parameters of routine 
    379  * int      request;        input; what elements (name,dir,extension) 
    380  * char     *wild;          input; wild card string 
    381  * char     *filename;      output; next file found 
    382  */ 
    383  
    384  
    385 /*------------------------------------------------------------------------*/ 
    386  
    387  
    388 void sy_system( char *cmd, STATUS *status ); 
    389  
    390 /* call to the operating system 
    391  * 
    392  * parameters of routine 
    393  * char     *cmd;           input; system command 
    394  * STATUS   *status;        output; return status 
    395  */ 
    396  
    397  
    398 /*------------------------------------------------------------------------*/ 
    399  
    400  
    401  
    402 double sy_random( double ampl ); 
    403  
    404 /* creates random number with absolute value less than (or equal to) 
    405  * "amp" 
    406  * 
    407  * parameters of routine 
    408  * double               ampl;           input; max. amplitude; if zero, a new random 
    409  *                                                                       series is started 
    410  */ 
    411  
    412  
    413 /*------------------------------------------------------------------------*/ 
    414  
    415  
    416 DIFFTIME sy_difftime( void ); 
    417  
    418 /* returns time since last sy_difftime call 
    419  */ 
    420  
    421  
    422 /*------------------------------------------------------------------------*/ 
    423  
    424  
    425 void sy_localinf( char item[], char value[], STATUS *status ); 
    426  
    427 /* machine dependend routine 
    428  * 
    429  * parameters of routine 
    430  * char       item[];     input; info item 
    431  * char       value[];    input/output; additional parameter 
    432  * STATUS     *status;    output; return status 
    433  */ 
    434  
    435  
    436 /*------------------------------------------------------------------------*/ 
    437  
    438  
    439  
    440 #endif /* BC_ATARI */ 
    441  
    442  
    443  
    444 /****************************************************************** 
    445  ***                        IBM PC version                      *** 
    446  ******************************************************************/ 
    447  
    448  
    449  
    450 #ifdef BC_IBM 
    451  
    452  
    453  
    454 /* includes */ 
    455 #include <alloc.h> 
    456  
    457 /* short integer */ 
    458 #define BYTE unsigned char 
    459  
    460 /* boolean type */ 
    461 #define BOOLEAN int 
    462  
    463 /* boolean values TRUE & FALSE */ 
    464 #ifdef BC_DEFINE_TRUE_FALSE 
    465 #define TRUE (1) 
    466 #define FALSE (0) 
    467 #endif 
    468  
    469 /* infinite loop declaration */ 
    470 #define FOREVER for(;;) 
    471  
    472 /* status type */ 
    473 #ifndef STATUS 
    474 #define STATUS int    /* status value */ 
    475 #define Severe(s) (*(s) != 0) 
    476 #endif /* STATUS */ 
    477  
    478 /* nearest integer number to floating number */ 
    479 #define Nint(x) ((x)>0 ? (int)((x)+0.5) : (int)((x)-0.5)) 
    480 #define Nint32(x) ((x)>0 ? (int)((x)+0.5) : (int)((x)-0.5)) 
    481  
    482 /* nearest long number to floating number */ 
    483 #define Nlong(x) ((x)>0 ? (long)((x)+0.5) : (long)((x)-0.5)) 
    484  
    485 /* capitalize character */ 
    486 #define Cap(c) (((c)>='a' && (c)<='z') ? ((c)-32) : (c)) 
    487 #define Uncap(c) (((c)>='A' && (c)<='Z') ? ((c)+32) : (c)) 
    488  
    489 /* absolute value of number */ 
    490 #define Abs(x) ((x)<0?-(x):(x)) 
    491  
    492 /* binary file type, here the same as text files */ 
    493 typedef FILE *BFILE; 
    494  
    495 /* sy_findfile parameter */ 
    496 #define SYC_FF_NAME 1 
    497 #define SYC_FF_DIR 2 
    498 #define SYC_FF_EXT 4 
    499  
    500 /* deallocate memory, allocated by sy_allocmem */ 
    501 #define sy_deallocmem(p) free(p) 
    502  
    503 /* open text file */ 
    504 #define sy_fopen(f,a) fopen(f,a) 
    505  
    506 /* close text file */ 
    507 #define sy_fclose(f) fclose(f) 
    508  
    509 /* read from text file, this is not yet used */ 
    510 #define sy_fread(b,s,n,f) fread(b,s,n,f) 
    511  
    512 /* write to text file, this is not yet used */ 
    513 #define sy_fwrite(b,s,n,f) fwrite(b,s,n,f) 
    514  
    515 /* read from binary file */ 
    516 #define sy_fbread(b,s,n,f) fread(b,s,n,f) 
    517  
    518 /* write to binary file */ 
    519 #define sy_fbwrite(b,s,n,f) fwrite(b,s,n,f) 
    520  
    521 /* seek on binary file */ 
    522 #define sy_fbseek(f,p,m) fseek(f,p,m) 
    523  
    524 /* open binary file */ 
    525 #define sy_fbopen(f,a) fopen(f,a) 
    526  
    527 /* close binary file */ 
    528 #define sy_fbclose(f) fclose(f) 
    529  
    530 /* binary file operation failed */ 
    531 #define sy_fbfailed(f) ((f)==NULL) 
    532  
    533 /* routine doing machine dependend things, not used here */ 
    534 #define sy_localinf(a,b,c) 
    535  
    536 /* call operating system */ 
    537 #define sy_system(c,s) system(c) 
    538  
    539 /* delete file */ 
    540 #define sy_fdelete(f) unlink(f) 
    541  
    542 /* rename file */ 
    543 #define sy_frename(f,t) rename(f,t) 
    544  
    545 /* get time differences in sec, not implemented here */ 
    546 #define sy_difftime() 1.0 
    547  
    548 /* system constants */ 
    549 /* ---------------- */ 
    550  
    551 /* maximum unsigned */ 
    552 #define SYC_MAXUNSG 0xffffffffL 
    553  
    554 /* maximum integer */ 
    555 #define SYC_MAXINT 0x7fffffffL 
    556  
    557 /* minimum integer */ 
    558 #define SYC_MININT 0x80000000L 
    559  
    560 /* maximum long */ 
    561 #define SYC_MAXLONG 0x7fffffffL 
    562  
    563 /* minimum long */ 
    564 #define SYC_MINLONG 0x80000000L 
    565  
    566 /* open existing file to overwrite, not yet used */ 
    567 #define SYC_OPEN_OVWR "r+" 
    568  
    569 /* system specific types */ 
    570 /* --------------------- */ 
    571  
    572 /* difference time, to measure difference times */ 
    573 typedef float DIFFTIME; 
    574  
    575  
    576 #define sy_alert(t) printf("%s",t) 
    577 #define sy_debuginfo(l) 
    578 #define sy_initprocess() 
    579 #define sy_sharecpu() 
    580 #define sy_gettime(t) 
    581 #define sy_getmessage() NULL 
    582  
    583  
    584 /*------------------------------------------------------------------------*/ 
    585 /*    prototypes of routines of module SYSCALL.C                          */ 
    586 /*------------------------------------------------------------------------*/ 
    587  
    588  
    589 void *sy_allocmem( long cnt, int size, STATUS *status ); 
    590  
    591 /* allocates memory ("cnt" objects of size "size) 
    592  * 
    593  * parameters of routine 
    594  * long     cnt;            input; number of objects 
    595  * int      size;           input; size of each object 
    596  * STATUS   *status;        output; return status 
    597  */ 
    598  
    599  
    600 /*------------------------------------------------------------------------*/ 
    601  
    602  
    603 void sy_findfile( int request, char wild[], char filename[] ); 
    604  
    605 /* looks for files matching wild card string "wild". Returns filename of 
    606  * file found or "\0" if not found.  "request" controls the returned 
    607  * elements.  For example the value (SYC_FF_DIR|SYC_FF_NAME|SYC_FF_EXT) 
    608  * means, that the returned string contains directory, file name and 
    609  * extension. 
    610  * 
    611  * parameters of routine 
    612  * int      request;        input; what elements (name,dir,extension) 
    613  * char     *wild;          input; wild card string 
    614  * char     *filename;      output; next file found 
    615  */ 
    616  
    617  
    618 /*------------------------------------------------------------------------*/ 
    619  
    620  
    621 double sy_random( double ampl ); 
    622  
    623 /* creates random number with absolute value less than (or equal to) 
    624  * "amp" 
    625  * 
    626  * parameters of routine 
    627  * double               ampl;           input; max. amplitude; if zero, a new random 
    628  *                                                                       series is started 
    629  */ 
    630  
    631  
    632 /*------------------------------------------------------------------------*/ 
    633  
    634  
    635 void sy_randomstr( int lth, char str[] ); 
    636  
    637 /* creates random string of length "lth" 
    638  * 
    639  * parameters of routine 
    640  * int        lth;      input; length of output string 
    641  * char       str[];    output; random string 
    642  */ 
    643  
    644  
    645 /*------------------------------------------------------------------------*/ 
    646  
    647  
    648  
    649 #endif /* BC_IBM */ 
    650  
    651  
    652  
    653 /****************************************************************** 
    654  ***                         VAX version                        *** 
    655  ******************************************************************/ 
    656  
    657  
    658  
    659 #ifdef BC_VAX 
    660  
    661  
    662  
    663 /* short integer */ 
    664 #define BYTE char 
    665  
    666 /* boolean type */ 
    667 #define BOOLEAN int 
    668  
    669 /* boolean values TRUE & FALSE */ 
    670 #ifdef BC_DEFINE_TRUE_FALSE 
    671 #define TRUE (1) 
    672 #define FALSE (0) 
    673 #endif 
    674  
    675 /* infinite loop declaration */ 
    676 #define FOREVER for(;;) 
    677  
    678 /* status type */ 
    679 #ifndef STATUS 
    680 #define STATUS int 
    681 #define Severe(s) (*(s) != 0) 
    682 #endif /* STATUS */ 
    683  
    684 /* nearest integer number to floating number */ 
    685 #define Nint(x) ((x)>0 ? (int)((x)+0.5) : (int)((x)-0.5)) 
    686 #define Nint32(x) ((x)>0 ? (int)((x)+0.5) : (int)((x)-0.5)) 
    687  
    688 /* nearest long number to floating number */ 
    689 #define Nlong(x) ((x)>0 ? (long)((x)+0.5) : (long)((x)-0.5)) 
    690  
    691 /* capitalize character */ 
    692 #define Cap(c) (((c)>='a' && (c)<='z') ? ((c)-32) : (c)) 
    693 #define Uncap(c) (((c)>='A' && (c)<='Z') ? ((c)+32) : (c)) 
    694  
    695 /* absolute value of number */ 
    696 #define Abs(x) ((x)<0?-(x):(x)) 
    697  
    698 /* read logical name table, not implemented */ 
    699 #define sy_lognames(f,s) 
    700  
    701 /* open text file */ 
    702 #define sy_fopen(f,a) fopen(f,a) 
    703  
    704 /* close text file */ 
    705 #define sy_fclose(f) fclose(f) 
    706  
    707 /* binary file type, here the same as text file */ 
    708 typedef FILE *BFILE; 
    709  
    710 /* binary file operation failed */ 
    711 #define sy_fbfailed(f) ((f)==NULL) 
    712  
    713 /* sy_findfile parameter */ 
    714 #define SYC_FF_NAME 1 
    715 #define SYC_FF_DIR 2 
    716 #define SYC_FF_EXT 4 
    717  
    718  
    719  
    720 /* system constants */ 
    721 /* ---------------- */ 
    722  
    723 /* maximum unsigned */ 
    724 #define SYC_MAXUNSG 0xffffffffL 
    725  
    726 /* maximum integer */ 
    727 #define SYC_MAXINT 0x7fffffffL 
    728  
    729 /* minimum integer */ 
    730 #define SYC_MININT 0x80000000L 
    731  
    732 /* maximum long */ 
    733 #define SYC_MAXLONG 0x7fffffffL 
    734  
    735 /* minimum long */ 
    736 #define SYC_MINLONG 0x80000000L 
    737  
    738 /* open existing file to overwrite */ 
    739 #define SYC_OPEN_OVWR "r+" 
    740  
    741 /* system specific types */ 
    742 /* --------------------- */ 
    743  
    744 /* difference time */ 
    745 typedef float DIFFTIME; 
    746  
    747  
    748 /* not implemented routines */ 
    749 #define sy_initprocess() 
    750 #define sy_sharecpu() 
    751 #define sy_debuginfo(s) 
    752 #define sy_alert(t) printf( "\n%s\n", t ) 
    753 #define sy_getmessage() NULL 
    754 #define sy_gettime(s) strcpy(s,SHC_TIMEDEFAULT) 
    755  
    756  
    757  
    758 /*------------------------------------------------------------------------*/ 
    759 /*    prototypes of routines of module SYSCALL.C                          */ 
    760 /*------------------------------------------------------------------------*/ 
    761  
    762  
    763 void *sy_allocmem( long cnt, int size, STATUS *status ); 
    764  
    765 /* allocates memory ("cnt" objects of size "size) 
    766  * 
    767  * parameters of routine 
    768  * long     cnt;            input; number of objects 
    769  * int      size;           input; size of each object 
    770  * STATUS   *status;        output; return status 
    771  */ 
    772  
    773  
    774 /*------------------------------------------------------------------------*/ 
    775  
    776  
    777 void sy_deallocmem( void *ptr ); 
    778  
    779 /* deallocates memory 
    780  * 
    781  * parameter of routine 
    782  * void     *ptr;        input; pointer to be freed 
    783  */ 
    784  
    785  
    786 /*------------------------------------------------------------------------*/ 
    787  
    788  
    789 long sy_fread( void *strbuf, int size, long n, FILE *fp ); 
    790  
    791 /* reads "n" objects of size "size" from file "fp" 
    792  * 
    793  * parameters of routine 
    794  * void     *strbuf;        output; buffer to read to 
    795  * int      size;           input; size of each object 
    796  * long     n;              input; number of objects 
    797  * FILE     *fp;            input; file descriptor 
    798  */ 
    799  
    800  
    801 /*------------------------------------------------------------------------*/ 
    802  
    803  
    804 long sy_fwrite( void *strbuf, int size, long n, FILE *fp ); 
    805  
    806 /* writes "n" objects of size "size" to file "fp" 
    807  * 
    808  * parameters of routine 
    809  * void     *strbuf;        input; buffer to read to 
    810  * int      size;           input; size of each object 
    811  * long     n;              input; number of objects 
    812  * FILE     *fp;            input; file descriptor 
    813  */ 
    814  
    815  
    816 /*------------------------------------------------------------------------*/ 
    817  
    818  
    819 long sy_fbread( void *strbuf, int size, long n, BFILE fp ); 
    820  
    821 /* reads "n" objects of size "size" from binary file "fp" 
    822  * 
    823  * parameters of routine 
    824  * void     *strbuf;        output; buffer to read to 
    825  * int      size;           input; size of each object 
    826  * long     n;              input; number of objects 
    827  * BFILE    fp;             input; file descriptor 
    828  */ 
    829  
    830  
    831 /*------------------------------------------------------------------------*/ 
    832  
    833  
    834 long sy_fbwrite( void *strbuf, int size, long n, BFILE fp ); 
    835  
    836 /* writes "n" objects of size "size" to binary file "fp" 
    837  * 
    838  * parameters of routine 
    839  * void     *strbuf;        input; buffer to read to 
    840  * int      size;           input; size of each object 
    841  * long     n;              input; number of objects 
    842  * BFILE    fp;             input; file descriptor 
    843  */ 
    844  
    845  
    846 /*------------------------------------------------------------------------*/ 
    847  
    848  
    849 int sy_fbseek( BFILE fp, long pos, int mode ); 
    850  
    851 /* changes read/write position in binary file 
    852  * 
    853  * parameters of routine 
    854  * BFILE      fp;    input; file pointer 
    855  * long       pos;   input; new position 
    856  * int        mode;  input; search mode 
    857  */ 
    858  
    859  
    860 /*------------------------------------------------------------------------*/ 
    861  
    862  
    863 BFILE sy_fbopen( const char *file, const char *access ); 
    864  
    865 /* opens a binary file 
    866  * 
    867  * parameters of routine 
    868  * const char    *file;    input; filename 
    869  * const char    *access;  input; access mode 
    870  */ 
    871  
    872  
    873 /*------------------------------------------------------------------------*/ 
    874  
    875  
    876 int sy_fbclose( BFILE fp ); 
    877  
    878 /* closes binary file 
    879  * 
    880  * parameter of routine 
    881  * BFILE     fp;      input; file pointer 
    882  */ 
    883  
    884  
    885 /*------------------------------------------------------------------------*/ 
    886  
    887  
    888 void sy_findfile( int request, char wild[], char filename[] ); 
    889  
    890 /* looks for files matching wild card string "wild". Returns filename of 
    891  * file found or "\0" if not found.  "request" controls the returned 
    892  * elements.  For example the value (SYC_FF_DIR|SYC_FF_NAME|SYC_FF_EXT) 
    893  * means, that the returned string contains directory, file name and 
    894  * extension. 
    895  * 
    896  * parameters of routine 
    897  * int      request;        input; what elements (name,dir,extension) 
    898  * char     *wild;          input; wild card string 
    899  * char     *filename;      output; next file found 
    900  */ 
    901  
    902  
    903 /*------------------------------------------------------------------------*/ 
    904  
    905  
    906 void sy_system( char *cmd, STATUS *status ); 
    907  
    908 /* call to the operating system 
    909  * 
    910  * parameters of routine 
    911  * char     *cmd;           input; system command 
    912  * STATUS   *status;        output; return status 
    913  */ 
    914  
    915  
    916 /*------------------------------------------------------------------------*/ 
    917  
    918  
    919  
    920 double sy_random( double ampl ); 
    921  
    922 /* creates random number with absolute value less than (or equal to) 
    923  * "amp" 
    924  * 
    925  * parameters of routine 
    926  * double               ampl;           input; max. amplitude; if zero, a new random 
    927  *                                                                       series is started 
    928  */ 
    929  
    930  
    931 /*------------------------------------------------------------------------*/ 
    932  
    933  
    934 DIFFTIME sy_difftime( void ); 
    935  
    936 /* returns time since last sy_difftime call 
    937  */ 
    938  
    939  
    940 /*------------------------------------------------------------------------*/ 
    941  
    942  
    943 void sy_randomstr( int lth, char str[] ); 
    944  
    945 /* creates random string of length "lth" 
    946  * 
    947  * parameters of routine 
    948  * int        lth;      input; length of output string 
    949  * char       str[];    output; random string 
    950  */ 
    951  
    952  
    953 /*------------------------------------------------------------------------*/ 
    954  
    955  
    956 void sy_fdelete( char file[] ); 
    957  
    958 /* deletes file 
    959  * 
    960  * parameters of routine 
    961  * char       file[];    input; name of file to be deleted 
    962  */ 
    963  
    964  
    965 /*----------------------------------------------------------------------------*/ 
    966  
    967  
    968 void sy_frename( char from[], char to[] ); 
    969  
    970 /* renames filename from "from" to "to" 
    971  * 
    972  * parameters of routine 
    973  * char       from[];      input; old filename 
    974  * char       to[];        input; new filename 
    975  */ 
    976  
    977  
    978 /*------------------------------------------------------------------------*/ 
    979  
    980  
    981 void sy_localinf( char item[], char value[], STATUS *status ); 
    982  
    983 /* returns local info in "value" 
    984  * 
    985  * parameters of routine 
    986  * char       item[];     input; info item 
    987  * char       value[];    output; return value 
    988  * STATUS     *status;    output; return status 
    989  */ 
    990  
    991  
    992 /*------------------------------------------------------------------------*/ 
    993  
    994  
    995  
    996 #endif /* BC_VAX */ 
    997  
    998  
    999  
    1000 /****************************************************************** 
    1001  ***                         SUN version                        *** 
    1002  ******************************************************************/ 
    1003  
    1004  
    1005  
    1006 #ifdef BC_SUN 
    1007  
    1008  
    100944 
    101045/* short integer */ 
     
    1291326 
    1292327 
    1293  
    1294 #endif /* BC_SUN */ 
    1295  
    1296  
    1297  
    1298 /****************************************************************** 
    1299  ***                              END                           *** 
    1300  ******************************************************************/ 
    1301  
    1302328#endif /* __SYSBASE */ 
    1303329 
Note: See TracChangeset for help on using the changeset viewer.