Move initialisation from generated code.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@3161 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1997-08-26 20:34:24 +00:00
parent 0b67bf62c5
commit 9c87108706
2 changed files with 44 additions and 0 deletions

View File

@@ -41,6 +41,7 @@
RCSID("$Id$");
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <error.h>
@@ -55,6 +56,27 @@ com_right(struct error_table *list, long code)
return NULL;
}
void
initialize_error_table(struct error_table **list,
const char **messages,
int num_errors,
long base)
{
struct error_table *et;
for(et = *list; et; et = et->next)
if(et->msgs == messages)
return;
et = malloc(sizeof(*et));
if (et == NULL)
return;
et->msgs = messages;
et->n_msgs = num_errors;
et->base = base;
et->next = *list;
*list = et;
}
void
free_error_table(struct error_table *et)
{

View File

@@ -41,6 +41,7 @@
RCSID("$Id$");
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <error.h>
@@ -55,6 +56,27 @@ com_right(struct error_table *list, long code)
return NULL;
}
void
initialize_error_table(struct error_table **list,
const char **messages,
int num_errors,
long base)
{
struct error_table *et;
for(et = *list; et; et = et->next)
if(et->msgs == messages)
return;
et = malloc(sizeof(*et));
if (et == NULL)
return;
et->msgs = messages;
et->n_msgs = num_errors;
et->base = base;
et->next = *list;
*list = et;
}
void
free_error_table(struct error_table *et)
{