# HG changeset patch # User Matti Hamalainen # Date 1670717417 -7200 # Node ID 9f9cf5c4b474c1053f37a326aa7e16973cb90e32 # Parent 8958acd67028d2bbf0ca4df1ac18da45f4b13442 Rename functions for consistency. diff -r 8958acd67028 -r 9f9cf5c4b474 sidinfo.c --- a/sidinfo.c Sat Dec 10 23:56:07 2022 +0200 +++ b/sidinfo.c Sun Dec 11 02:10:17 2022 +0200 @@ -144,7 +144,7 @@ static const int optListN = sizeof(optList) / sizeof(optList[0]); -void argShowHelp(void) +void siArgShowHelp(void) { int index, width; @@ -200,7 +200,7 @@ } -int argMatchPSField(const char *field) +int siArgMatchPSField(const char *field) { int index, found = -1; for (index = 0; index < noptPSOptions; index++) @@ -218,9 +218,9 @@ } -int argMatchPSFieldError(const char *field) +int siArgMatchPSFieldError(const char *field) { - int found = argMatchPSField(field); + int found = siArgMatchPSField(field); switch (found) { case -1: @@ -274,7 +274,7 @@ } -bool argParsePSFields(PSFStack *stack, const char *fmt) +bool siArgParsePSFields(PSFStack *stack, const char *fmt) { const char *start = fmt; siClearStack(stack); @@ -289,7 +289,7 @@ if (field != NULL) { PSFStackItem item; - int found = argMatchPSFieldError(field); + int found = siArgMatchPSFieldError(field); th_free(field); if (found < 0) @@ -530,7 +530,7 @@ // // Parse a format string into a PSFStack structure // -static bool argParsePSFormatStr(PSFStack *stack, const char *fmt) +static bool siArgParsePSFormatStr(PSFStack *stack, const char *fmt) { const char *start = NULL; int mode = 0; @@ -584,7 +584,7 @@ fopt = th_strdup_trim(pfield + 1, TH_TRIM_BOTH); } - int ret = argMatchPSFieldError(field); + int ret = siArgMatchPSFieldError(field); if (ret >= 0) { PSFStackItem item; @@ -641,7 +641,7 @@ } -static bool argHandleOpt(const int optN, char *optArg, char *currArg) +static bool siArgHandleOpt(const int optN, char *optArg, char *currArg) { switch (optN) { @@ -679,13 +679,13 @@ break; case 20: - if (!argParsePSFields(&optFormat, optArg)) + if (!siArgParsePSFields(&optFormat, optArg)) return false; break; case 22: optFieldOutput = false; - if (!argParsePSFormatStr(&optFormat, optArg)) + if (!siArgParsePSFormatStr(&optFormat, optArg)) return false; break; @@ -1066,7 +1066,7 @@ } -bool argHandleFileDir(const char *path, const char *filename, const char *pattern) +bool siArgHandleFileDir(const char *path, const char *filename, const char *pattern) { th_stat_data sdata; char *npath; @@ -1107,7 +1107,7 @@ while ((entry = readdir(dirh)) != NULL) if (entry->d_name[0] != '.') { - if (!argHandleFileDir(npath, entry->d_name, pattern)) + if (!siArgHandleFileDir(npath, entry->d_name, pattern)) { ret = false; goto out; @@ -1128,7 +1128,7 @@ } -bool argHandleFile(char *path) +bool siArgHandleOther(char *path) { char *pattern, *filename, *pt, *npath; bool ret; @@ -1159,7 +1159,7 @@ filename = th_strdup(pt); } - ret = argHandleFileDir(npath, filename, pattern); + ret = siArgHandleFileDir(npath, filename, pattern); th_free(pattern); th_free(npath); @@ -1188,7 +1188,7 @@ // Parse command line arguments if (!th_args_process(argc, argv, optList, optListN, - argHandleOpt, NULL, OPTH_ONLY_OPTS)) + siArgHandleOpt, NULL, OPTH_ONLY_OPTS)) goto exit; // Check if HVSC path is set @@ -1212,7 +1212,7 @@ // Check if help is requested if (optShowHelp || argc < 2) { - argShowHelp(); + siArgShowHelp(); goto exit; } @@ -1279,7 +1279,7 @@ // Process files if (!th_args_process(argc, argv, optList, optListN, - NULL, argHandleFile, OPTH_ONLY_OTHER)) + NULL, siArgHandleOther, OPTH_ONLY_OTHER)) goto exit; if (optNFiles == 0)