RetroZilla/security/nss/lib/util/utilpars.h
Roy Tam 0310c45fa3 cherry-picked mozilla NSS upstream changes (to rev 46bd290c):
bug1061701, bug1210361, bug1210364, bug1210380, bug1210389, bug1009429, bug1211444, bug1180096, bug1210484, bug1211915, bug1211725, bug1213931, bug1214806, bug1214762, bug1214777, bug1214841, bug1214834, bug1213948, bug1213980, bug1192028, bug1202868, bug1214829, bug1026688, bug1214825, bug1216318
2020-01-07 20:22:09 +08:00

61 lines
2.8 KiB
C

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