Path: blob/main/crypto/openssl/include/internal/namemap.h
34879 views
/*1* Copyright 2019-2024 The OpenSSL Project Authors. All Rights Reserved.2*3* Licensed under the Apache License 2.0 (the "License"). You may not use4* this file except in compliance with the License. You can obtain a copy5* in the file LICENSE in the source distribution or at6* https://www.openssl.org/source/license.html7*/89#include "internal/cryptlib.h"1011typedef struct ossl_namemap_st OSSL_NAMEMAP;1213OSSL_NAMEMAP *ossl_namemap_stored(OSSL_LIB_CTX *libctx);1415OSSL_NAMEMAP *ossl_namemap_new(OSSL_LIB_CTX *libctx);16void ossl_namemap_free(OSSL_NAMEMAP *namemap);17int ossl_namemap_empty(OSSL_NAMEMAP *namemap);1819int ossl_namemap_add_name(OSSL_NAMEMAP *namemap, int number, const char *name);2021/*22* The number<->name relationship is 1<->many23* Therefore, the name->number mapping is a simple function, while the24* number->name mapping is an iterator.25*/26int ossl_namemap_name2num(const OSSL_NAMEMAP *namemap, const char *name);27int ossl_namemap_name2num_n(const OSSL_NAMEMAP *namemap,28const char *name, size_t name_len);29const char *ossl_namemap_num2name(const OSSL_NAMEMAP *namemap, int number,30size_t idx);31int ossl_namemap_doall_names(const OSSL_NAMEMAP *namemap, int number,32void (*fn)(const char *name, void *data),33void *data);3435/*36* A utility that handles several names in a string, divided by a given37* separator.38*/39int ossl_namemap_add_names(OSSL_NAMEMAP *namemap, int number,40const char *names, const char separator);414243