securityanddataprivacytools/securitytools/openssllib/import/inc/openssl/stack.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/stack/stack.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_STACK_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_STACK_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
#ifdef  __cplusplus
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    63
extern "C" {
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
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    66
typedef struct stack_st
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
	int num;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    69
	char **data;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    70
	int sorted;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    71
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    72
	int num_alloc;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    73
	int (*comp)(const char * const *, const char * const *);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    74
	} STACK;
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    75
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    76
#define M_sk_num(sk)		((sk) ? (sk)->num:-1)
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    77
#define M_sk_value(sk,n)	((sk) ? (sk)->data[n] : NULL)
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
int sk_num(const STACK *);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    80
char *sk_value(const STACK *, int);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    81
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    82
char *sk_set(STACK *, int, char *);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    83
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    84
STACK *sk_new(int (*cmp)(const char * const *, const char * const *));
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    85
STACK *sk_new_null(void);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    86
void sk_free(STACK *);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    87
void sk_pop_free(STACK *st, void (*func)(void *));
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    88
int sk_insert(STACK *sk,char *data,int where);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    89
char *sk_delete(STACK *st,int loc);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    90
char *sk_delete_ptr(STACK *st, char *p);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    91
int sk_find(STACK *st,char *data);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    92
int sk_push(STACK *st,char *data);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    93
int sk_unshift(STACK *st,char *data);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    94
char *sk_shift(STACK *st);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    95
char *sk_pop(STACK *st);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    96
void sk_zero(STACK *st);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    97
int (*sk_set_cmp_func(STACK *sk, int (*c)(const char * const *,
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    98
			const char * const *)))
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    99
			(const char * const *, const char * const *);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   100
STACK *sk_dup(STACK *st);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   101
void sk_sort(STACK *st);
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   102
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   103
#ifdef  __cplusplus
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   104
}
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   105
#endif
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   106
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   107
#endif
de7f90723dab Fix for Bug 2442 - Symbian^2 package build failure.
Santosh V Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   108