andre@0: /* This Source Code Form is subject to the terms of the Mozilla Public andre@0: * License, v. 2.0. If a copy of the MPL was not distributed with this andre@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ andre@0: andre@0: #ifndef _UTILPARS_H_ andre@0: #define _UTILPARS_H_ 1 andre@0: andre@0: #include "utilparst.h" andre@0: #include "plarena.h" andre@0: andre@0: /* handle a module db request */ andre@0: char ** NSSUTIL_DoModuleDBFunction(unsigned long function,char *parameters, void *args); andre@0: andre@0: /* parsing functions */ andre@0: char *NSSUTIL_ArgFetchValue(char *string, int *pcount); andre@0: char *NSSUTIL_ArgStrip(char *c); andre@0: char *NSSUTIL_ArgGetParamValue(char *paramName,char *parameters); andre@0: char *NSSUTIL_ArgSkipParameter(char *string); andre@0: char *NSSUTIL_ArgGetLabel(char *inString, int *next); andre@0: long NSSUTIL_ArgDecodeNumber(char *num); andre@0: PRBool NSSUTIL_ArgIsBlank(char c); andre@0: PRBool NSSUTIL_ArgHasFlag(char *label, char *flag, char *parameters); andre@0: long NSSUTIL_ArgReadLong(char *label,char *params, long defValue, andre@0: PRBool *isdefault); andre@0: andre@0: /* quoting functions */ andre@0: int NSSUTIL_EscapeSize(const char *string, char quote); andre@0: char *NSSUTIL_Escape(const char *string, char quote); andre@0: int NSSUTIL_QuoteSize(const char *string, char quote); andre@0: char *NSSUTIL_Quote(const char *string, char quote); andre@0: int NSSUTIL_DoubleEscapeSize(const char *string, char quote1, char quote2); andre@0: char *NSSUTIL_DoubleEscape(const char *string, char quote1, char quote2); andre@0: andre@0: unsigned long NSSUTIL_ArgParseSlotFlags(char *label,char *params); andre@0: struct NSSUTILPreSlotInfoStr *NSSUTIL_ArgParseSlotInfo(PLArenaPool *arena, andre@0: char *slotParams, int *retCount); andre@0: char * NSSUTIL_MkSlotString(unsigned long slotID, unsigned long defaultFlags, andre@0: unsigned long timeout, unsigned char askpw_in, andre@0: PRBool hasRootCerts, PRBool hasRootTrust); andre@0: SECStatus NSSUTIL_ArgParseModuleSpec(char *modulespec, char **lib, char **mod, andre@0: char **parameters, char **nss); andre@0: char *NSSUTIL_MkModuleSpec(char *dllName, char *commonName, andre@0: char *parameters, char *NSS); andre@0: void NSSUTIL_ArgParseCipherFlags(unsigned long *newCiphers,char *cipherList); andre@0: char * NSSUTIL_MkNSSString(char **slotStrings, int slotCount, PRBool internal, andre@0: PRBool isFIPS, PRBool isModuleDB, PRBool isModuleDBOnly, andre@0: PRBool isCritical, unsigned long trustOrder, andre@0: unsigned long cipherOrder, unsigned long ssl0, unsigned long ssl1); andre@0: andre@0: /* andre@0: * private functions for softoken. andre@0: */ andre@0: char * _NSSUTIL_GetSecmodName(char *param, NSSDBType *dbType, char **appName, char **filename,PRBool *rw); andre@0: const char *_NSSUTIL_EvaluateConfigDir(const char *configdir, NSSDBType *dbType, char **app); andre@0: andre@0: #endif /* _UTILPARS_H_ */