remove libasn1.h

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@10750 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2001-09-27 16:23:15 +00:00
parent b6f1d52a01
commit cee81d995f
6 changed files with 40 additions and 110 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -49,6 +49,8 @@
#include <errno.h>
#include <roken.h>
#include <libasn1.h>
#include <asn1-common.h>
#include <asn1_err.h>
#include <der.h>
#endif /* __DER_LOCL_H__ */

View File

@@ -43,6 +43,27 @@ static const char *orig_filename;
static char header[1024];
static char headerbase[1024] = STEM;
/*
* list of all IMPORTs
*/
struct import {
const char *module;
struct import *next;
};
static struct import *imports = NULL;
void
add_import (const char *module)
{
struct import *tmp = emalloc (sizeof(*tmp));
tmp->module = module;
tmp->next = imports;
imports = tmp;
}
const char *
filename (void)
{
@@ -388,6 +409,7 @@ generate_type_header (const Symbol *s)
void
generate_type (const Symbol *s)
{
struct import *i;
char *filename;
asprintf (&filename, "%s_%s.x", STEM, s->gen_name);
@@ -399,16 +421,23 @@ generate_type (const Symbol *s)
fprintf (codefile,
"/* Generated from %s */\n"
"/* Do not edit */\n\n"
"#include \"libasn1.h\"\n\n"
#if 0
"#include <stdio.h>\n"
"#include <stdlib.h>\n"
"#include <time.h>\n"
"#include <" STEM ".h>\n\n"
"#include <errno.h>\n",
orig_filename);
for (i = imports; i != NULL; i = i->next)
fprintf (codefile,
"#include <%s_asn1.h>\n",
i->module);
fprintf (codefile,
"#include <%s.h>\n",
headerbase);
fprintf (codefile,
"#include <asn1_err.h>\n"
"#include <der.h>\n"
#endif
,orig_filename);
"#include <parse_units.h>\n\n");
generate_type_header (s);
generate_type_encode (s);
generate_type_decode (s);

View File

@@ -66,6 +66,7 @@ void generate_glue (const Symbol *s);
void init_generate (const char *filename, const char *basename);
const char *filename (void);
void close_generate(void);
void add_import(const char *module);
int yyparse(void);
extern FILE *headerfile, *codefile, *logfile;

View File

@@ -1,51 +0,0 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* $Id$ */
#ifndef __LIBASN1_H__
#define __LIBASN1_H__
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include "krb5_asn1.h"
#include "der.h"
#include "asn1_err.h"
#include <parse_units.h>
#endif /* __LIBASN1_H__ */

View File

@@ -102,6 +102,7 @@ referencenames : IDENT ',' referencenames
;
imports_decl : IMPORTS referencenames FROM IDENT ';'
{ add_import($4); }
;
type_decl : IDENT EEQUAL type

View File

@@ -1,52 +0,0 @@
/*
* Copyright (c) 1997 - 2001 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the Institute nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/* $Id$ */
#ifndef __LIBASN1_H__
#define __LIBASN1_H__
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <krb5_asn1.h>
#include <der.h>
#include "hdb_asn1.h"
#include <asn1_err.h>
#include <parse_units.h>
#endif /* __LIBASN1_H__ */