home *** CD-ROM | disk | FTP | other *** search
/ CD Shareware Magazine 1996 December / CD_shareware_12-96.iso / DOS / Programa / CCDL122.ZIP / CLIBS / STDINC / LIBP.H < prev    next >
Encoding:
Text File  |  1996-08-08  |  1.9 KB  |  70 lines

  1. /* The prototypes in this file which start with _ll are OS dependent
  2.  * and some of the C functions will require them to be implemented
  3.  * notably:
  4.  *   memory allocation
  5.  *   file handling
  6.  *   time & date
  7.  *   system-level functions
  8.  *
  9.  * C functions which don't depend on the above mechanisms are self-contained
  10.  * and should work generically
  11.  */
  12.  
  13. /* Initialize the file stuff */
  14. void _ll_init(void);
  15.  
  16. /* File open close */
  17. int _ll_open(const char *__name, int flags);
  18. int _ll_creat(const char *__name, int flags);
  19. int _ll_close(int __fd);
  20.  
  21. /* Convert C-style open flags to os-style open flags */
  22. int _ll_flags(int __oldflags);
  23.  
  24. /* File read/write */
  25. int _ll_write(int __fd,void *__buf,size_t __size);
  26. int _ll_read(int __fd,void *__buf,size_t __len);
  27.  
  28. /* File positioning */
  29. size_t _ll_getpos(int __fd);
  30. int _ll_seek(int __fd, size_t __pos, int __origin);
  31.  
  32. /* File utilities */
  33. int _ll_rename(const char *__old, const char *__new);
  34. int _ll_remove(const char *__name);
  35.  
  36. /* malloc stuff */
  37. void *_ll_malloc(size_t __size);
  38. void _ll_free(void *__blk);
  39. void _ll_transfer(void);
  40.  
  41. /* System stuff */
  42. void *_ll_getenv(void);
  43. int _ll_system(const char *string);
  44.  
  45. /* Time & date stuff */
  46. void _ll_gettime(time_t *__time);
  47. long _ll_ticks(void);
  48.  
  49. /* Internal functions, already implemented */
  50. int _baseputc(int __c, FILE *__stream);
  51. int _basegetc(FILE *__stream);
  52. FILE *_basefopen(const char *name, const char *mode,FILE *stream);
  53. int _basefclose(FILE *stream,int release);
  54. int _scanf(char *buffer, const char *format,void *arglist);
  55. int _writebuf(FILE *__stream);
  56.  
  57. /* The following constants and structures govern the memory allocation
  58.  * mechanism
  59.  */
  60. #define ALLOCSIZE 100*1024
  61.  
  62. typedef struct _freelist {
  63.     size_t size;
  64.     struct _freelist *next;
  65. } FREELIST;
  66.  
  67. typedef struct _blkhead {
  68.     struct _blkhead *next;
  69.     FREELIST *list;
  70. } BLKHEAD;