home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Mint / mntlib32.zoo / lib.h < prev    next >
C/C++ Source or Header  |  1993-05-23  |  3KB  |  115 lines

  1. /*
  2.  * library-specific stuff
  3.  */
  4. #ifndef _LIB_H
  5. #define _LIB_H
  6.  
  7. #ifndef _COMPILER_H
  8. #include <compiler.h>
  9. #endif
  10.  
  11. #include <stdio.h>    /* for FILE   */
  12. #include <time.h>    /* for time_t */
  13.  
  14. /* filename mapping function type */
  15. #ifndef __FNMAP
  16. #define __FNMAP
  17. typedef int (*fnmapfunc_t) __PROTO((const char *, char *));
  18. #endif
  19.  
  20. __EXTERN int        _unx2dos __PROTO((const char *, char *));
  21. __EXTERN int        _dos2unx __PROTO((const char *, char *));
  22. #ifndef __MINT__
  23. __EXTERN int        unx2dos __PROTO((const char *, char *));
  24. __EXTERN int        dos2unx __PROTO((const char *, char *));
  25. __EXTERN void        fnmapfunc __PROTO((fnmapfunc_t u2dos, fnmapfunc_t dos2u));
  26. #endif
  27. __EXTERN int        _path_dos2unx __PROTO((const char *, char *));
  28. __EXTERN int        _path_unx2dos __PROTO((const char *, char *));
  29.  
  30. __EXTERN long        _write      __PROTO((int, const void *, unsigned long));
  31. __EXTERN long        _read      __PROTO((int, void *, unsigned long));
  32. #ifndef __MINT__
  33. __EXTERN int        console_input_status __PROTO((int));
  34. __EXTERN unsigned int    console_read_byte __PROTO((int));
  35. __EXTERN void        console_write_byte __PROTO((int, int));
  36. #else
  37. __EXTERN int    _console_read_byte __PROTO((int));
  38. __EXTERN void    _console_write_byte __PROTO((int, int));
  39. #endif
  40.  
  41. __EXTERN time_t        _dostime __PROTO((time_t));
  42. __EXTERN time_t        _unixtime __PROTO((unsigned int, unsigned int));
  43.  
  44. __EXTERN char *        findfile __PROTO((char *, char *, char **));
  45.  
  46. __EXTERN char *        _itoa __PROTO((int, char *, int));
  47. __EXTERN char *        _ltoa __PROTO((long, char *, int));
  48. __EXTERN char *        _ultoa __PROTO((unsigned long, char *, int));
  49.  
  50. __EXTERN int        _doprnt __PROTO((FILE *, const char *, __VA_LIST__));
  51.  
  52. #ifdef __MINT__
  53. __EXTERN int    _scanf __PROTO((void *, int (*)(void *),
  54.             int (*)(int, void *), unsigned char *, __VA_LIST__));
  55. #endif
  56.  
  57. __EXTERN long        get_sysvar __PROTO((void *var));
  58. __EXTERN void        set_sysvar_to_long __PROTO((void *var, long val));
  59.  
  60. __EXTERN void        _setstack __PROTO((char *));
  61. __EXTERN __EXITING     __exit __PROTO((long status));
  62.  
  63. /* from the TOS GCC library */
  64. /* 5/5/92 sb -- definitions needed in malloc.c and realloc.c */
  65.  
  66. struct mem_chunk 
  67.     {
  68.     long valid;
  69. #define VAL_FREE  0xf4ee0abcL
  70. #define VAL_ALLOC 0xa11c0abcL
  71.  
  72.     struct mem_chunk *next;
  73.     unsigned long size;
  74.     };
  75.  
  76. /* linked list of free blocks */
  77.  
  78. extern struct mem_chunk _mchunk_free_list;
  79.  
  80. /* status of open files (for isatty, et al.) */
  81.  
  82. #ifdef __MINT__
  83.  
  84. #define __NHANDLES 40
  85.  
  86. struct __open_file {
  87.     short    status;        /* whether or not it's a tty */
  88.     short    flags;        /* if a tty, its flags */
  89. };
  90.  
  91. #else
  92.  
  93. #define __NHANDLES    80
  94. struct __open_file {
  95.     unsigned short append:1;    /* 1 if O_APPEND set for this file */
  96.     unsigned short nodelay:1;    /* 1 if O_NDELAY set for this file */
  97.     unsigned short pipe:1;      /* 1 if O_PIPE set for this file */
  98.     unsigned short eclose:1;    /* 1 if close on exec is set for this file */
  99.     unsigned short status:2;    /* status FH_UNKNOWN | ISATTY | ISAFILE */
  100.     char       *filename;    /* filename of open file */
  101. };
  102.  
  103. #endif /* __MINT__ */
  104.  
  105. extern struct __open_file __open_stat[];
  106.   /* NOTE: this array is indexed by (__OPEN_INDEX(fd)) */
  107.  
  108. #define __OPEN_INDEX(x)    (((short)(x)) + 3)
  109.  
  110. #define FH_UNKNOWN    0
  111. #define FH_ISATTY    1
  112. #define FH_ISAFILE    2
  113.  
  114. #endif /* _LIB_H */
  115.