VirtualBox

source: vbox/trunk/src/libs/openssl-3.0.3/apps/lib/names.c@ 95218

最後變更 在這個檔案從95218是 94320,由 vboxsync 提交於 3 年 前

libs/openssl-3.0.1: Export to OSE and fix copyright headers in Makefiles, bugref:10128

檔案大小: 1.1 KB
 
1/*
2 * Copyright 2019-2020 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#include <string.h>
11#include <openssl/bio.h>
12#include <openssl/safestack.h>
13#include "names.h"
14
15#ifdef _WIN32
16# define strcasecmp _stricmp
17#endif
18
19int name_cmp(const char * const *a, const char * const *b)
20{
21 return strcasecmp(*a, *b);
22}
23
24void collect_names(const char *name, void *vdata)
25{
26 STACK_OF(OPENSSL_CSTRING) *names = vdata;
27
28 sk_OPENSSL_CSTRING_push(names, name);
29}
30
31void print_names(BIO *out, STACK_OF(OPENSSL_CSTRING) *names)
32{
33 int i = sk_OPENSSL_CSTRING_num(names);
34 int j;
35
36 sk_OPENSSL_CSTRING_sort(names);
37 if (i > 1)
38 BIO_printf(out, "{ ");
39 for (j = 0; j < i; j++) {
40 const char *name = sk_OPENSSL_CSTRING_value(names, j);
41
42 if (j > 0)
43 BIO_printf(out, ", ");
44 BIO_printf(out, "%s", name);
45 }
46 if (i > 1)
47 BIO_printf(out, " }");
48}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette