home *** CD-ROM | disk | FTP | other *** search
/ Amiga Elysian Archive / AmigaElysianArchive.iso / newlibs / cclib.lzh / iolib.h < prev    next >
C/C++ Source or Header  |  1989-09-25  |  2KB  |  91 lines

  1. #ifndef IOLIB_H
  2. #define IOLIB_H 1
  3.  
  4. /*-------------------------------------------------------------------------+
  5.  |                                       |
  6.  | Name:    iolib.h                               |
  7.  | Purpose: the structure that gets attached to your task's user data      |
  8.  |                                       |
  9.  | Author:  RWA                    Date: 8/89           |
  10.  +-------------------------------------------------------------------------*/
  11.  
  12. #ifndef EXEC_MEMORY_H
  13. #include <exec/memory.h>
  14. #endif
  15.  
  16. #ifndef LIBRARIES_DOS_H
  17. #include <libraries/dos.h>
  18. #endif
  19.  
  20. #ifndef EXEC_TASKS_H
  21. #include <exec/tasks.h>
  22. #endif
  23.  
  24. #ifndef STDLIST_H
  25. #include "stdlist.h"
  26. #endif
  27.  
  28. #ifndef HEAPMEM_H
  29. #include "heapmem.h"
  30. #endif
  31.  
  32. #ifndef STDIO_H
  33. #include "stdio.h"
  34. #endif
  35.  
  36. #ifndef TIME_H
  37. #include "time.h"
  38. #endif
  39.  
  40. typedef struct    /* task_UserData */
  41. {
  42. void *old_ud;             /* points to the old user data */
  43. struct Task *parent;         /* points to your task */
  44. _list RAM;             /* list of allocated memory, see MemBlk */
  45. HEADER base, *allocp;         /* used for heap managment */
  46. long *blocksize;         /* points to minimum heap block size */
  47. LastFree lastfree;         /* the last free'd block of heap memory */
  48. _list OpenFiles;         /* a list of FileDesc, see below */
  49. _list StreamFiles;         /* a list of FILE, see stdio.h */
  50. FILE **stdout, **stdin, **stderr;/* pointers to standard IO stream files */
  51. void *scnfp;             /* used internally by fprintf etc. */
  52. long *errno;             /* pointer to global errno in app. */
  53. void (*abort_func)();            /* abort function for ^C etc. (_exit) */
  54. void *wbmsg;             /* pointer to workbench startup message */
  55. short _argc, _arg_len;         /* for CLI arguments */
  56. char **_argv, *_arg_lin;     /* for CLI arguments */
  57. char *scanpoint;         /* used internally by strtok */
  58. char *tempname;          /* used internally by tmpnam */
  59. short scnlast;             /* used internally by gchar etc. */
  60. struct tm tm;             /* used by time routines */
  61. clock_t start;             /* ticks at program start */
  62. char buffer[80];         /* buffer for general use */
  63. void *scdir_mem;         /* memory used by scdir */
  64. } task_UserData;
  65.  
  66. /* This is a what a "file handle" points to, I am cheating by
  67.  * putting pointers to this in a long integer. */
  68.  
  69. typedef struct
  70. {
  71. struct FileHandle *fh;
  72. short mode;
  73. } FileDesc;
  74.  
  75. /* This is what the RAM list consists of. It is a linked list of RAM
  76.  * that has been allocated from Amiga EXEC with the AllocMem function.
  77.  * The size field is the size in bytes that was allocated, and is followed
  78.  * by the allocated block.
  79.  */
  80.  
  81. typedef struct
  82. {
  83. _node n;
  84. long size;
  85. } MemBlk;
  86.  
  87.  
  88. #endif
  89.  
  90.  
  91.