dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libkmf / ber_der / inc / kmfber_int.h
blob04b79508f1e63b5abf4e0b356fcdc1d00de3c82a
1 /*
2 * -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
4 * The contents of this file are subject to the Netscape Public License
5 * Version 1.0 (the "NPL"); you may not use this file except in
6 * compliance with the NPL. You may obtain a copy of the NPL at
7 * http://www.mozilla.org/NPL/
9 * Software distributed under the NPL is distributed on an "AS IS" basis,
10 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
11 * for the specific language governing rights and limitations under the
12 * NPL.
14 * The Initial Developer of the Original Code is Netscape
15 * Communications Corporation. Portions created by Netscape are
16 * Copyright (C) 1998-1999 Netscape Communications Corporation. All
17 * Rights Reserved.
21 * Copyright (c) 1990 Regents of the University of Michigan.
22 * All rights reserved.
24 * Redistribution and use in source and binary forms are permitted
25 * provided that this notice is preserved and that due credit is given
26 * to the University of Michigan at Ann Arbor. The name of the University
27 * may not be used to endorse or promote products derived from this
28 * software without specific prior written permission. This software
29 * is provided ``as is'' without express or implied warranty.
32 * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
33 * Use is subject to license terms.
36 #pragma ident "%Z%%M% %I% %E% SMI"
40 #ifndef _KMFBER_INT_H
41 #define _KMFBER_INT_H
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
47 #include <stdio.h>
48 #include <ctype.h>
49 #include <stdarg.h>
50 #include <stdlib.h>
52 #include <malloc.h>
53 #include <errno.h>
54 #include <sys/types.h>
55 #include <unistd.h>
57 #include <memory.h>
58 #include <string.h>
60 typedef struct seqorset {
61 ber_len_t sos_clen;
62 ber_tag_t sos_tag;
63 char *sos_first;
64 char *sos_ptr;
65 struct seqorset *sos_next;
66 } Seqorset;
67 #define NULLSEQORSET ((Seqorset *) 0)
69 #define SOS_STACK_SIZE 8 /* depth of the pre-allocated sos structure stack */
71 struct berelement {
72 char *ber_buf;
73 char *ber_ptr;
74 char *ber_end;
75 struct seqorset *ber_sos;
76 ber_tag_t ber_tag;
77 ber_len_t ber_len;
78 int ber_usertag;
79 char ber_options;
80 char *ber_rwptr;
81 BERTranslateProc ber_encode_translate_proc;
82 BERTranslateProc ber_decode_translate_proc;
83 int ber_flags;
84 #define KMFBER_FLAG_NO_FREE_BUFFER 1 /* don't free ber_buf */
85 int ber_sos_stack_posn;
86 Seqorset ber_sos_stack[SOS_STACK_SIZE];
89 /* function prototypes */
90 void ber_err_print(char *data);
92 #define THEMEMCPY(d, s, n) memmove(d, s, n)
94 #ifdef SAFEMEMCPY
95 #undef SAFEMEMCPY
96 #define SAFEMEMCPY(d, s, n) memmove(d, s, n);
97 #endif
99 /* allow the library to access the debug variable */
101 #ifdef KMFBER_DEBUG
102 extern int kmfber_debug;
103 #endif
105 #ifdef __cplusplus
107 #endif
108 #endif /* _KMFBER_INT_H */