5eee234b477ed74599b35af7cbad1de195fae16b kent Sat Jan 21 14:18:32 2017 -0800 Adding cmpStringOrder routine to force order to conform to a predefined explicit nonalphabetical order. diff --git src/inc/common.h src/inc/common.h index 508ccc3..a28e4cd 100644 --- src/inc/common.h +++ src/inc/common.h @@ -1053,31 +1053,35 @@ /* returns pointer to the first string and advances pointer to next in list of strings dilimited by 1 null and terminated by 2 nulls. */ int cntStringsInList(char *pStrings); /* returns count of strings in a list of strings dilimited by 1 null and terminated by 2 nulls. */ int stringArrayIx(char *string, char *array[], int arraySize); /* Return index of string in array or -1 if not there. */ int ptArrayIx(void *pt, void *array, int arraySize); /* Return index of pt in array or -1 if not there. */ #define stringIx(string, array) stringArrayIx( (string), (array), ArraySize(array)) +int cmpStringOrder(char *a, char *b, char **orderFields, int orderCount); +/* Compare two strings to sort in same order as orderedFields. If strings are + * not in order, will sort them to be after all ordered fields, alphabetically */ /* Some stuff that is left out of GNU .h files!? */ + #ifndef SEEK_SET #define SEEK_SET 0 #endif #ifndef SEEK_CUR #define SEEK_CUR 1 #endif #ifndef SEEK_END #define SEEK_END 2 #endif #ifndef FILEPATH_H void splitPath(char *path, char dir[PATH_LEN], char name[FILENAME_LEN], char extension[FILEEXT_LEN]);