Debian Codegraph @

testcases/include/mech_to_str.h

raw
1 /*
2 * COPYRIGHT (c) International Business Machines Corp. 2013-2017
3 *
4 * This program is provided under the terms of the Common Public License,
5 * version 1.0 (CPL-1.0). Any use, reproduction or distribution for this
6 * software constitutes recipient's acceptance of CPL-1.0 terms which can be
7 * found in the file LICENSE file or at
8 * https://opensource.org/licenses/cpl1.0.php
9 */
10
11 #ifndef _MECH_TO_STR_
12 #define _MECH_TO_STR_
13 #include "pkcs11types.h"
14 #include <mechtable.h>
15
16 static inline const char *mech_to_str(CK_ULONG mech)
17 {
18 const struct mechrow *row = mechrow_from_numeric(mech);
19
20 if (row)
21 return row->string;
22 return "(unknown mech)";
23 }
24
25 #endif