Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-17 09:22:57

0001 /*
0002  * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
0003  *
0004  * Licensed under the Apache License 2.0 (the "License").  You may not use
0005  * this file except in compliance with the License.  You can obtain a copy
0006  * in the file LICENSE in the source distribution or at
0007  * https://www.openssl.org/source/license.html
0008  */
0009 
0010 #ifndef OPENSSL_TXT_DB_H
0011 #define OPENSSL_TXT_DB_H
0012 #pragma once
0013 
0014 #include <openssl/macros.h>
0015 #ifndef OPENSSL_NO_DEPRECATED_3_0
0016 #define HEADER_TXT_DB_H
0017 #endif
0018 
0019 #include <openssl/opensslconf.h>
0020 #include <openssl/bio.h>
0021 #include <openssl/safestack.h>
0022 #include <openssl/lhash.h>
0023 
0024 #define DB_ERROR_OK 0
0025 #define DB_ERROR_MALLOC 1
0026 #define DB_ERROR_INDEX_CLASH 2
0027 #define DB_ERROR_INDEX_OUT_OF_RANGE 3
0028 #define DB_ERROR_NO_INDEX 4
0029 #define DB_ERROR_INSERT_INDEX_CLASH 5
0030 #define DB_ERROR_WRONG_NUM_FIELDS 6
0031 
0032 #ifdef __cplusplus
0033 extern "C" {
0034 #endif
0035 
0036 typedef OPENSSL_STRING *OPENSSL_PSTRING;
0037 DEFINE_SPECIAL_STACK_OF(OPENSSL_PSTRING, OPENSSL_STRING)
0038 
0039 typedef struct txt_db_st {
0040     int num_fields;
0041     STACK_OF(OPENSSL_PSTRING) *data;
0042     LHASH_OF(OPENSSL_STRING) **index;
0043     int (**qual)(OPENSSL_STRING *);
0044     long error;
0045     long arg1;
0046     long arg2;
0047     OPENSSL_STRING *arg_row;
0048 } TXT_DB;
0049 
0050 TXT_DB *TXT_DB_read(BIO *in, int num);
0051 long TXT_DB_write(BIO *out, TXT_DB *db);
0052 int TXT_DB_create_index(TXT_DB *db, int field, int (*qual)(OPENSSL_STRING *),
0053     OPENSSL_LH_HASHFUNC hash, OPENSSL_LH_COMPFUNC cmp);
0054 void TXT_DB_free(TXT_DB *db);
0055 OPENSSL_STRING *TXT_DB_get_by_index(TXT_DB *db, int idx,
0056     OPENSSL_STRING *value);
0057 int TXT_DB_insert(TXT_DB *db, OPENSSL_STRING *value);
0058 
0059 #ifdef __cplusplus
0060 }
0061 #endif
0062 
0063 #endif