home *** CD-ROM | disk | FTP | other *** search
/ Amiga MA Magazine 1998 #6 / amigamamagazinepolishissue1998.iso / coders / biblioteki / c_library / extrdargs / extrdargs.h < prev    next >
C/C++ Source or Header  |  1977-12-31  |  4KB  |  90 lines

  1. #ifndef EXTRDARGS_H
  2. #define EXTRDARGS_H
  3. /*
  4. ** $PROJECT: CLI/Workbench ReadArgs()
  5. **
  6. ** $VER: extrdargs.h 1.2 (08.01.95)
  7. **
  8. ** by
  9. **
  10. ** Stefan Ruppert , Windthorststraße 5 , 65439 Flörsheim , GERMANY
  11. **
  12. ** (C) Copyright 1994,1995
  13. ** All Rights Reserved !
  14. **
  15. ** $HISTORY:
  16. **
  17. ** 08.01.95 : 001.002 : changed to ExtReadArgs()
  18. ** 04.09.94 : 001.001 : bumped to version 1
  19. ** 04.09.94 : 000.001 : initial
  20. */
  21.  
  22. #ifndef EXEC_TYPES_H
  23. #include <exec/types.h>
  24. #endif
  25.  
  26. #ifndef DOS_RDARGS_H
  27. #include <dos/rdargs.h>
  28. #endif
  29.  
  30. #ifndef DOS_DOS_H
  31. #include <dos/dos.h>
  32. #endif
  33.  
  34. struct ExtRDArgs
  35. {
  36.    STRPTR erda_Template;            /* readargs template */
  37.    LONG *erda_Parameter;            /* pointer to the parameter array */
  38.    LONG erda_FileParameter;         /* which parameter should contain the files passed
  39.                                      * with the WBStartup message or -1 for none
  40.                                      */
  41.    STRPTR erda_Window;              /* window description to open, if this is started
  42.                                      * from workbench or NULL for no window !
  43.                                      * If in the ToolTypes exists a WINDOW variable
  44.                                      * this is used, instead of the default here !
  45.                                      */
  46.    struct RDArgs *erda_RDArgs;      /* use this RDArgs structure instead of allocating
  47.                                      * a new, so you can provide extended help !
  48.                                      */
  49.    ULONG erda_Flags;                /* some flags see below */
  50.    struct RDArgs *erda_FreeArgs;    /* pointer to the RDArgs structure returned from
  51.                                      * the ReadArgs() call !
  52.                                      */
  53.    STRPTR erda_Buffer;              /* pointer to a buffer to use for the WB startup or
  54.                                      * NULL, so the ExtReadArgs() will allocated !
  55.                                      */
  56.    ULONG erda_BufferSize;           /* buffersize of the buffer, or if buffer == NULL
  57.                                      * the size, which should be used to allocate the
  58.                                      * buffer !
  59.                                      */
  60.    STRPTR erda_ActualPtr;           /* actual pointer in the erda_Buffer */
  61.    STRPTR erda_EndPtr;              /* pointer to the end of the erda_Buffer */
  62.  
  63.    BPTR erda_WindowFH;              /* window filehandle MUST BE NULL */
  64.    BPTR erda_OldOutput;             /* old output filehandle MUST BE NULL */
  65.    BPTR erda_OldInput;              /* old input filehandle MUST BE NULL */
  66.  
  67.    struct WBArg *erda_WBArg;        /* wbargs for erda_FileParameter */
  68.    LONG erda_NumArgs;               /* number of wbargs */
  69. };
  70.  
  71. #define ERDA_MIN_BUFFER_SIZE        1024
  72.  
  73. #define ERDAF_WORKBENCH    (1<<0)   /* indicate, that the program is started from the
  74.                                      * Workbench !
  75.                                      */
  76. #define ERDAF_ALLOCRDARGS  (1<<1)   /* args->erda_RDArgs is allocated through
  77.                                      * AllocDosObject()
  78.                                      */
  79. #define ERDAF_ALLOCBUFFER  (1<<2)   /* args->erda_Buffer is allocated from FinalReadArgs() */
  80.  
  81. #define ERDAF_ALLOCWINDOW  (1<<3)   /* args->erda_Window if allocated from FinalReadArgs() */
  82.  
  83. /* ------------------------------ prototypes ------------------------------ */
  84.  
  85. LONG ExtReadArgs(LONG ac,STRPTR *av,struct ExtRDArgs *args);
  86. void ExtFreeArgs(struct ExtRDArgs *args);
  87.  
  88. #endif /* !EXTRDARGS_H */
  89.  
  90.