1 #ifndef SMARTREADARGS_H
2 #define SMARTREADARGS_H
4 * SmartReadArgs.h -- CLI/Workbench transparent ReadArgs()
6 * $VER: SmartReadArgs.h 1.3 (2.9.98)
8 * Copyright 1998 by Thomas Aglassinger <agi@sbox.tu-graz.ac.at>
10 * Based on ExtReadArgs Copyright 1994,1995 by Stefan Ruppert
14 #include <exec/types.h>
18 #include <dos/rdargs.h>
25 #ifndef WORKBENCH_STARTUP_H
26 #include <workbench/startup.h>
31 /* Readargs template */
34 /* Pointer to the parameter array */
37 /* Specifies which parameter should contain the files passed with the
38 * WBStartup message; use -1 for none */
39 LONG sa_FileParameter
;
41 /* Window description to open, if this is started from workbench or NULL
42 * for no window. If a WINDOW tooltype is specifies in the icon, it is
46 /* Use this RDArgs structure instead of allocating a new. This can be
47 * used to specify extended help. */
48 struct RDArgs
*sa_RDArgs
;
50 /* Some flags, see below for possible values */
53 /* Pointer to the RDArgs structure returned from the ReadArgs() call */
54 struct RDArgs
*sa_FreeArgs
;
56 /* Pointer to a buffer to use for the WBStartup. If this is NULL, a
57 * buffer is allocated automatically. */
60 /* Size of the above buffer. If buffer == NULL, this size is used to
61 * allocate the buffer. */
64 /* The fields below are for internal use by SmartReadArgs() only */
66 STRPTR sa_ActualPtr
; /* Current write location in sa_Buffer */
67 STRPTR sa_EndPtr
; /* Pointer to the end of sa_Buffer */
68 BPTR sa_WindowFH
; /* Window filehandle, MUST BE NULL */
69 BPTR sa_OldOutput
; /* Old output filehandle MUST BE NULL */
70 BPTR sa_OldInput
; /* Old input filehandle MUST BE NULL */
71 struct WBArg
*sa_WBArg
; /* wbargs for erda_FileParameter */
72 LONG sa_NumArgs
; /* number of wbargs */
75 #define SA_MINIMUM_BUFFER_SIZE 1024
77 /* Flags to be used with SmartArgs.sa_Flags */
79 /* Indicate, that the program was started from Workbench */
80 #define SAF_WORKBENCH (1<<0)
82 /* SmartArgs.sa_RDArgs is allocated by AllocDosObject() */
83 #define SAF_ALLOCRDARGS (1<<1)
85 /* SmartArgs.sa_Buffer is allocated by SmartReadArgs() */
86 #define SAF_ALLOCBUFFER (1<<2)
88 /* SmartArgs.sa_Window is allocated by SmartReadArgs() */
89 #define SAF_ALLOCWINDOW (1<<3)
91 /* ------------------------------ prototypes ------------------------------ */
93 LONG
SmartReadArgs(struct WBStartup
*wb_startup
, struct SmartArgs
* smart_args
);
94 void SmartFreeArgs(struct SmartArgs
*smart_args
);
96 #endif /* !SMARTREADARGS_H */