revert between 56095 -> 55830 in arch
[AROS.git] / external / openurl / cmd / SmartReadArgs.h
blob0e8b9105c2601dd6a9ab25d685d5af335cf327bf
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 #include "SDI_compiler.h"
31 struct SmartArgs
33 /* Readargs template */
34 CONST_STRPTR sa_Template;
36 /* Pointer to the parameter array */
37 IPTR *sa_Parameter;
39 /* Specifies which parameter should contain the files passed with the
40 * WBStartup message; use -1 for none */
41 LONG sa_FileParameter;
43 /* Window description to open, if this is started from workbench or NULL
44 * for no window. If a WINDOW tooltype is specifies in the icon, it is
45 * used instead. */
46 STRPTR sa_Window;
48 /* Use this RDArgs structure instead of allocating a new. This can be
49 * used to specify extended help. */
50 struct RDArgs *sa_RDArgs;
52 /* Some flags, see below for possible values */
53 ULONG sa_Flags;
55 /* Pointer to the RDArgs structure returned from the ReadArgs() call */
56 struct RDArgs *sa_FreeArgs;
58 /* Pointer to a buffer to use for the WBStartup. If this is NULL, a
59 * buffer is allocated automatically. */
60 STRPTR sa_Buffer;
62 /* Size of the above buffer. If buffer == NULL, this size is used to
63 * allocate the buffer. */
64 ULONG sa_BufferSize;
66 /* The fields below are for internal use by SmartReadArgs() only */
68 STRPTR sa_ActualPtr; /* Current write location in sa_Buffer */
69 STRPTR sa_EndPtr; /* Pointer to the end of sa_Buffer */
70 BPTR sa_WindowFH; /* Window filehandle, MUST BE NULL */
71 BPTR sa_OldOutput; /* Old output filehandle MUST BE NULL */
72 BPTR sa_OldInput; /* Old input filehandle MUST BE NULL */
73 struct WBArg *sa_WBArg; /* wbargs for erda_FileParameter */
74 LONG sa_NumArgs; /* number of wbargs */
77 #define SA_MINIMUM_BUFFER_SIZE 1024
79 /* Flags to be used with SmartArgs.sa_Flags */
81 /* Indicate, that the program was started from Workbench */
82 #define SAF_WORKBENCH (1<<0)
84 /* SmartArgs.sa_RDArgs is allocated by AllocDosObject() */
85 #define SAF_ALLOCRDARGS (1<<1)
87 /* SmartArgs.sa_Buffer is allocated by SmartReadArgs() */
88 #define SAF_ALLOCBUFFER (1<<2)
90 /* SmartArgs.sa_Window is allocated by SmartReadArgs() */
91 #define SAF_ALLOCWINDOW (1<<3)
93 /* ------------------------------ prototypes ------------------------------ */
95 LONG SmartReadArgs(struct WBStartup *wb_startup, struct SmartArgs * smart_args);
96 void SmartFreeArgs(struct SmartArgs *smart_args);
98 #endif /* !SMARTREADARGS_H */