Lines Matching refs:protoset
370 static size_t protoset_index(const char * const *protoset, const char *proto) in protoset_index() argument
372 const char * const *p = protoset; in protoset_index()
379 return p - protoset; in protoset_index()
383 static void protoset_set(const char **protoset, const char *proto) in protoset_set() argument
386 size_t n = protoset_index(protoset, proto); in protoset_set()
388 if(!protoset[n]) { in protoset_set()
390 protoset[n] = proto; in protoset_set()
391 protoset[n + 1] = NULL; in protoset_set()
397 static void protoset_clear(const char **protoset, const char *proto) in protoset_clear() argument
400 size_t n = protoset_index(protoset, proto); in protoset_clear()
402 if(protoset[n]) { in protoset_clear()
403 size_t m = protoset_index(protoset, NULL) - 1; in protoset_clear()
405 protoset[n] = protoset[m]; in protoset_clear()
406 protoset[m] = NULL; in protoset_clear()
430 const char **protoset; in proto2num() local
444 protoset = malloc((proto_count + 1) * sizeof(*protoset)); in proto2num()
445 if(!protoset) { in proto2num()
451 protoset[0] = NULL; in proto2num()
456 protoset_set(protoset, p); in proto2num()
480 free((char *) protoset); in proto2num()
488 protoset[0] = NULL; in proto2num()
492 memcpy((char *) protoset, in proto2num()
493 built_in_protos, (proto_count + 1) * sizeof(*protoset)); in proto2num()
503 protoset_clear(protoset, p); in proto2num()
506 protoset[0] = NULL; in proto2num()
509 protoset_set(protoset, p); in proto2num()
516 protoset[0] = NULL; in proto2num()
524 qsort((char *) protoset, protoset_index(protoset, NULL), sizeof(*protoset), in proto2num()
528 for(proto = 0; protoset[proto] && !result; proto++) in proto2num()
529 result = curlx_dyn_addf(&obuf, "%s,", protoset[proto]); in proto2num()
530 free((char *) protoset); in proto2num()