Lines Matching refs:protoset

309 static size_t protoset_index(const char * const *protoset, const char *proto)  in protoset_index()  argument
311 const char * const *p = protoset; in protoset_index()
318 return p - protoset; in protoset_index()
322 static void protoset_set(const char **protoset, const char *proto) in protoset_set() argument
325 size_t n = protoset_index(protoset, proto); in protoset_set()
327 if(!protoset[n]) { in protoset_set()
329 protoset[n] = proto; in protoset_set()
330 protoset[n + 1] = NULL; in protoset_set()
336 static void protoset_clear(const char **protoset, const char *proto) in protoset_clear() argument
339 size_t n = protoset_index(protoset, proto); in protoset_clear()
341 if(protoset[n]) { in protoset_clear()
342 size_t m = protoset_index(protoset, NULL) - 1; in protoset_clear()
344 protoset[n] = protoset[m]; in protoset_clear()
345 protoset[m] = NULL; in protoset_clear()
369 const char **protoset; in proto2num() local
383 protoset = malloc((proto_count + 1) * sizeof(*protoset)); in proto2num()
384 if(!protoset) { in proto2num()
390 protoset[0] = NULL; in proto2num()
395 protoset_set(protoset, p); in proto2num()
419 free((char *) protoset); in proto2num()
427 protoset[0] = NULL; in proto2num()
431 memcpy((char *) protoset, in proto2num()
432 built_in_protos, (proto_count + 1) * sizeof(*protoset)); in proto2num()
442 protoset_clear(protoset, p); in proto2num()
445 protoset[0] = NULL; in proto2num()
448 protoset_set(protoset, p); in proto2num()
455 protoset[0] = NULL; in proto2num()
463 qsort((char *) protoset, protoset_index(protoset, NULL), sizeof(*protoset), in proto2num()
467 for(proto = 0; protoset[proto] && !result; proto++) in proto2num()
468 result = curlx_dyn_addf(&obuf, "%s,", protoset[proto]); in proto2num()
469 free((char *) protoset); in proto2num()