securityanddataprivacytools/securitytools/openssllib/import/inc/openssl/txt_db.h
author Santosh V Patil <santosh.v.patil@nokia.com>
Mon, 19 Apr 2010 11:11:16 +0530
branchRCL_1
changeset 46 de7f90723dab
permissions -rw-r--r--
Fix for Bug 2442 - Symbian^2 package build failure.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     1
/* crypto/txt_db/txt_db.h */
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     2
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     3
 * All rights reserved.
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     4
 *
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     5
 * This package is an SSL implementation written
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     6
 * by Eric Young (eay@cryptsoft.com).
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     7
 * The implementation was written so as to conform with Netscapes SSL.
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     8
 * 
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     9
 * This library is free for commercial and non-commercial use as long as
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    10
 * the following conditions are aheared to.  The following conditions
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    11
 * apply to all code found in this distribution, be it the RC4, RSA,
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    12
 * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    13
 * included with this distribution is covered by the same copyright terms
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    14
 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    15
 * 
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    16
 * Copyright remains Eric Young's, and as such any Copyright notices in
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    17
 * the code are not to be removed.
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    18
 * If this package is used in a product, Eric Young should be given attribution
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    19
 * as the author of the parts of the library used.
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    20
 * This can be in the form of a textual message at program startup or
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    21
 * in documentation (online or textual) provided with the package.
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    22
 * 
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    23
 * Redistribution and use in source and binary forms, with or without
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    24
 * modification, are permitted provided that the following conditions
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    25
 * are met:
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    26
 * 1. Redistributions of source code must retain the copyright
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    27
 *    notice, this list of conditions and the following disclaimer.
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    28
 * 2. Redistributions in binary form must reproduce the above copyright
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    29
 *    notice, this list of conditions and the following disclaimer in the
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    30
 *    documentation and/or other materials provided with the distribution.
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    31
 * 3. All advertising materials mentioning features or use of this software
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    32
 *    must display the following acknowledgement:
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    33
 *    "This product includes cryptographic software written by
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    34
 *     Eric Young (eay@cryptsoft.com)"
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    35
 *    The word 'cryptographic' can be left out if the rouines from the library
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    36
 *    being used are not cryptographic related :-).
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    37
 * 4. If you include any Windows specific code (or a derivative thereof) from 
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    38
 *    the apps directory (application code) you must include an acknowledgement:
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    39
 *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    40
 * 
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    41
 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    42
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    43
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    44
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    45
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    46
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    47
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    48
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    49
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    50
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    51
 * SUCH DAMAGE.
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    52
 * 
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    53
 * The licence and distribution terms for any publically available version or
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    54
 * derivative of this code cannot be changed.  i.e. this code cannot simply be
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    55
 * copied and put under another distribution licence
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    56
 * [including the GNU Public Licence.]
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    57
 */
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    58
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    59
#ifndef HEADER_TXT_DB_H
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    60
#define HEADER_TXT_DB_H
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    61
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    62
#ifndef OPENSSL_NO_BIO
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    63
#include <openssl/bio.h>
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    64
#endif
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    65
#include <openssl/stack.h>
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    66
#include <openssl/lhash.h>
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    67
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    68
#define DB_ERROR_OK			0
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    69
#define DB_ERROR_MALLOC			1
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    70
#define DB_ERROR_INDEX_CLASH    	2
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    71
#define DB_ERROR_INDEX_OUT_OF_RANGE	3
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    72
#define DB_ERROR_NO_INDEX		4
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    73
#define DB_ERROR_INSERT_INDEX_CLASH    	5
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    74
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    75
#ifdef  __cplusplus
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    76
extern "C" {
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    77
#endif
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    78
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    79
typedef struct txt_db_st
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    80
	{
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    81
	int num_fields;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    82
	STACK /* char ** */ *data;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    83
	LHASH **index;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    84
	int (**qual)();
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    85
	long error;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    86
	long arg1;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    87
	long arg2;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    88
	char **arg_row;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    89
	} TXT_DB;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    90
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    91
#ifndef OPENSSL_NO_BIO
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    92
TXT_DB *TXT_DB_read(BIO *in, int num);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    93
long TXT_DB_write(BIO *out, TXT_DB *db);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    94
#else
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    95
TXT_DB *TXT_DB_read(char *in, int num);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    96
long TXT_DB_write(char *out, TXT_DB *db);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    97
#endif
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    98
int TXT_DB_create_index(TXT_DB *db,int field,int (*qual)(),
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    99
		LHASH_HASH_FN_TYPE hash, LHASH_COMP_FN_TYPE cmp);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   100
void TXT_DB_free(TXT_DB *db);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   101
char **TXT_DB_get_by_index(TXT_DB *db, int idx, char **value);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   102
int TXT_DB_insert(TXT_DB *db,char **value);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   103
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   104
#ifdef  __cplusplus
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   105
}
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   106
#endif
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   107
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   108
#endif
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   109