if (parameters) { moduleSpec = PR_smprintf("library=\"%s\" name=\"%s\" parameters=\"%s\" NSS=\"%s\"",dllName,commonName,parameters,nss); } else { moduleSpec = PR_smprintf("library=\"%s\" name=\"%s\" NSS=\"%s\"",dllName,commonName,nss); }
lib = pk11_formatPair("library",dllName,'\"'); name = pk11_formatPair("name",commonName,'\"'); param = pk11_formatPair("parameters",parameters,'\"'); nss = pk11_formatPair("NSS",NSS,'\"'); moduleSpec = PR_smprintf("%s %s %s %s", lib,name,param,nss); pk11_freePair(lib); pk11_freePair(name); pk11_freePair(param); pk11_freePair(nss);
pk11_mkNewModuleSpec(char *dllName, char *commonName, char *parameters, 								char *nss) {    char *moduleSpec;    if (dllName == NULL) dllName="";    if (nss == NULL) nss="";    /*     * now the final spec     */    if (parameters) {	moduleSpec = PR_smprintf("library=\"%s\" name=\"%s\" parameters=\"%s\" NSS=\"%s\"",dllName,commonName,parameters,nss);    } else {	moduleSpec = PR_smprintf("library=\"%s\" name=\"%s\" NSS=\"%s\"",dllName,commonName,nss);    }    return (moduleSpec);}