summaryrefslogtreecommitdiff
path: root/mwcc_decomp.h
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2022-10-10 04:01:30 +0100
committerAsh Wolf <ninji@wuffs.org>2022-10-10 04:01:30 +0100
commit7d4bee5f8f28b72610c8518e5cb9dc145c68b816 (patch)
tree0376d1965f6c22c636541732685a4c21fcffec89 /mwcc_decomp.h
parentaf15bf78ad6b0663db22c507d4abcdd7b83dfb8a (diff)
downloadMWCC-7d4bee5f8f28b72610c8518e5cb9dc145c68b816.tar.gz
MWCC-7d4bee5f8f28b72610c8518e5cb9dc145c68b816.zip
add fully matched Parameter.c
Diffstat (limited to '')
-rw-r--r--mwcc_decomp.h106
1 files changed, 30 insertions, 76 deletions
diff --git a/mwcc_decomp.h b/mwcc_decomp.h
index e462bae..dcafa5b 100644
--- a/mwcc_decomp.h
+++ b/mwcc_decomp.h
@@ -86,7 +86,7 @@ typedef struct GENERIC_T {
char flags;
char *myname;
PARAM_T *next;
- void (*parse)(); // TODO missing sig
+ int (*parse)(const char *opt, void *var, const char *pstr, int flags);
void *var;
char *help;
} GENERIC_T;
@@ -95,7 +95,7 @@ typedef struct SETTING_T {
char flags;
char *myname;
PARAM_T *next;
- void (*parse)(); // TODO missing sig
+ int (*parse)(const char *a, const char *b); // TODO name these args
char *valuename;
} SETTING_T;
typedef struct TOGGLE_T {
@@ -256,8 +256,8 @@ enum {
PARAMWHICH_FilePath = 2,
PARAMWHICH_Number = 3,
PARAMWHICH_String = 4,
- PARAMWHICH_5 = 5,
- PARAMWHICH_6 = 6,
+ PARAMWHICH_Id = 5,
+ PARAMWHICH_Sym = 6,
PARAMWHICH_OnOff = 7,
PARAMWHICH_OffOn = 8,
PARAMWHICH_Mask = 9,
@@ -266,14 +266,29 @@ enum {
PARAMWHICH_SetString = 0xC,
PARAMWHICH_Generic = 0xD,
PARAMWHICH_IfArg = 0xE,
- PARAMWHICH_Setting = 0xF
+ PARAMWHICH_Setting = 0xF,
+ PARAMWHICH_MAX = 0x10
};
enum {
PARAMFLAGS_1 = 1,
PARAMFLAGS_2 = 2,
PARAMFLAGS_3 = 3,
PARAMFLAGS_4 = 4,
- PARAMFLAGS_8 = 8
+ PARAMFLAGS_8 = 8,
+ PARAMFLAGS_10 = 0x10,
+ PARAMFLAGS_12 = 0x12
+};
+enum {
+ PARAMPARSEFLAGS_0 = 0,
+ PARAMPARSEFLAGS_1 = 1,
+ PARAMPARSEFLAGS_2 = 2,
+ PARAMPARSEFLAGS_4 = 4,
+ PARAMPARSEFLAGS_8 = 8,
+ PARAMPARSEFLAGS_10 = 0x10,
+ PARAMPARSEFLAGS_20 = 0x20,
+ PARAMPARSEFLAGS_40 = 0x40,
+ PARAMPARSEFLAGS_80 = 0x80,
+ PARAMPARSEFLAGS_100 = 0x100
};
enum {
SLFLAGS_1 = 1,
@@ -1745,85 +1760,24 @@ extern void CLPProgress(short errid, ...);
extern void CLPStatus(short errid, ...);
extern void CLPFatalError(const char *format, ...);
+extern char curopt[1024];
+
/********************************/
/* Utils.c */
-extern int my_tolower(char c);
-extern int my_isdigit(char c);
-extern int my_isalpha(char c);
-extern int my_isalnum(char c);
-extern int my_isxdigit(char c);
+// something is weird with these parameters
+// they're supposed to be just "char"...
+extern int my_tolower(unsigned char c);
+extern int my_isdigit(unsigned char c);
+extern int my_isalpha(unsigned char c);
+extern int my_isalnum(unsigned char c);
+extern int my_isxdigit(unsigned char c);
extern char *Utils_SpellList(char *list, char *buffer, char opts);
extern int Utils_CompareOptionString(const char *a, const char *b, int cased, int sticky);
/********************************/
/* Parameter.c */
-//static int Param_None();
-//static void DescHelpParam_None(PARAM_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_None();
-
-//static void DescHelpParam_Number(NUM_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_Number();
-//static int Param_Number(NUM_T *p, const char *pstr);
-
-//static void DescHelpParam_FTypeCreator(FTYPE_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_FTypeCreator();
-//static int Param_FTypeCreator(FTYPE_T *p, const char *pstr);
-
-//static void DescHelpParam_String(STRING_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_String();
-//static int Param_String(STRING_T *p, const char *pstr);
-
-//static void DescHelpParam_ID_or_SYM(STRING_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_ID_or_SYM();
-//static int Param_ID_or_SYM(STRING_T *p, const char *pstr);
-
-//static void DescHelpParam_OnOff(ONOFF_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_OnOff();
-//static int Param_OnOff(ONOFF_T *p, const char *pstr);
-
-//static void DescHelpParam_OffOn(ONOFF_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_OffOn();
-//static int Param_OffOn(OFFON_T *p, const char *pstr);
-
-//static void DescHelpParam_FilePath(FILEPATH_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_FilePath();
-//static int Param_FilePath(FILEPATH_T *p, const char *pstr);
-
-//static void DescHelpParam_Mask(MASK_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_Mask(MASK_T *p);
-//static int Param_Mask(MASK_T *p, const char *pstr, int flags);
-
-//static void DescHelpParam_Toggle(TOGGLE_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_Toggle(TOGGLE_T *p);
-//static int Param_Toggle(TOGGLE_T *p, const char *pstr);
-
-//static void DescHelpParam_Set(SET_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_Set(SET_T *p);
-//static int Param_Set(SET_T *p, const char *pstr, int flags);
-
-//static void DescHelpParam_SetString(SETSTRING_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_SetString(SETSTRING_T *p);
-//static int Param_SetString(SETSTRING_T *p, const char *pstr, int flags);
-
-//static void DescHelpParam_Generic(GENERIC_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_Generic(GENERIC_T *p);
-//static int Param_Generic(GENERIC_T *p, const char *pstr, int flags);
-
-//static void DescHelpParam_Setting(SETTING_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_Setting(SETTING_T *p);
-//static int Param_Setting(SETTING_T *p, const char *pstr, int flags);
-
-//static void DescHelpParam_IfArg(IFARG_T *p, const char **desc, const char **help, const char **defaul);
-//static int CompareParam_IfArg(IFARG_T *p);
-//static int Param_IfArg(IFARG_T *p, const char *pstr, int flags);
-
-//static int Param_Parse(PARAM_T *param, const char *cparam, int flags);
extern void Param_DescHelp(PARAM_T *param, const char **desc, const char **help, const char **defaul);
extern int Param_Compare(PARAM_T *param);
-//static void Param_PushParam(const char *param);
-//static void Param_PopParam();
-//static Boolean Param_IsNonTextFile(const char *fname, Boolean warn);
-//static int Param_GetArgument(PARAM_T *param, const char *cparam, int exec);
extern int Params_Parse(PARAM_T *param, int flags);
extern void Param_Error(short id, ...);
extern void Param_Warning(short id, ...);