Path: blob/main/crypto/heimdal/lib/asn1/gen_locl.h
34889 views
/*1* Copyright (c) 1997-2005 Kungliga Tekniska Högskolan2* (Royal Institute of Technology, Stockholm, Sweden).3* All rights reserved.4*5* Redistribution and use in source and binary forms, with or without6* modification, are permitted provided that the following conditions7* are met:8*9* 1. Redistributions of source code must retain the above copyright10* notice, this list of conditions and the following disclaimer.11*12* 2. Redistributions in binary form must reproduce the above copyright13* notice, this list of conditions and the following disclaimer in the14* documentation and/or other materials provided with the distribution.15*16* 3. Neither the name of the Institute nor the names of its contributors17* may be used to endorse or promote products derived from this software18* without specific prior written permission.19*20* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND21* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE22* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE23* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE24* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL25* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS26* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)27* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT28* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY29* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF30* SUCH DAMAGE.31*/3233/* $Id$ */3435#ifndef __GEN_LOCL_H__36#define __GEN_LOCL_H__3738#include <config.h>3940#include <assert.h>41#include <stdio.h>42#include <stdlib.h>43#include <string.h>44#include <limits.h>45#include <ctype.h>46#include <time.h>47#include <errno.h>48#include <err.h>49#include <roken.h>50#include "hash.h"51#include "symbol.h"52#include "asn1-common.h"53#include "der.h"54#include "der-private.h"5556void generate_type (const Symbol *);57void generate_constant (const Symbol *);58void generate_type_encode (const Symbol *);59void generate_type_decode (const Symbol *);60void generate_type_free (const Symbol *);61void generate_type_length (const Symbol *);62void generate_type_copy (const Symbol *);63void generate_type_seq (const Symbol *);64void generate_glue (const Type *, const char*);6566const char *classname(Der_class);67const char *valuename(Der_class, int);6869void gen_compare_defval(const char *, struct value *);70void gen_assign_defval(const char *, struct value *);717273void init_generate (const char *, const char *);74const char *get_filename (void);75void close_generate(void);76void add_import(const char *);77void add_export(const char *);78int is_export(const char *);79int yyparse(void);80int is_primitive_type(int);8182int preserve_type(const char *);83int seq_type(const char *);8485void generate_header_of_codefile(const char *);86void close_codefile(void);8788int is_template_compat (const Symbol *);89void generate_template(const Symbol *);90void gen_template_import(const Symbol *);919293extern FILE *privheaderfile, *headerfile, *codefile, *logfile, *templatefile;94extern int support_ber;95extern int template_flag;96extern int rfc1510_bitstring;97extern int one_code_file;9899extern int error_flag;100101#endif /* __GEN_LOCL_H__ */102103104