Updated PCI IDs to latest snapshot.
[tangerine.git] / workbench / libs / openurl / Cmd / SmartReadArgs.h
blob9cc525116269c9f1cb6f0552cee9b2fd4bc59047
1 #ifndef SMARTREADARGS_H
2 #define SMARTREADARGS_H
3 /*
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
13 #ifndef EXEC_TYPES_H
14 #include <exec/types.h>
15 #endif
17 #ifndef DOS_RDARGS_H
18 #include <dos/rdargs.h>
19 #endif
21 #ifndef DOS_DOS_H
22 #include <dos/dos.h>
23 #endif
25 #ifndef WORKBENCH_STARTUP_H
26 #include <workbench/startup.h>
27 #endif
29 struct SmartArgs
31 /* Readargs template */
32 STRPTR sa_Template;
34 /* Pointer to the parameter array */
35 IPTR *sa_Parameter;
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
43 * used instead. */
44 STRPTR sa_Window;
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 */
51 ULONG sa_Flags;
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. */
58 STRPTR sa_Buffer;
60 /* Size of the above buffer. If buffer == NULL, this size is used to
61 * allocate the buffer. */
62 ULONG sa_BufferSize;
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 */