Add Heimdal compile_et extensions from Philipp Thomas <pthomas@suse.de>

bitmap-optimize
Theodore Ts'o 2003-08-01 08:59:40 -04:00
parent 1f9a60c251
commit 44104b2b37
14 changed files with 141 additions and 11 deletions

View File

@ -1,3 +1,7 @@
2003-08-01 Philipp Thomas <pthomas@suse.de>
* et_c.awk, et_h.awk: Add Heimdal compile_et extensions
2003-07-25 Theodore Ts'o <tytso@mit.edu>
* Release of E2fsprogs 1.34

View File

@ -68,10 +68,16 @@ c2n["_"]=63
/^#/ { next }
/^[ \t]*(error_table|et)[ \t]+[a-zA-Z][a-zA-Z0-9_]+/ {
table_number = 0
table_name = $2
mod_base = 1000000
for(i=1; i<=length(table_name); i++) {
table_number=(table_number*char_shift)+c2n[substr(table_name,i,1)]
if (NF > 2) {
table_name = $3
base_name = $2
} else {
table_name = $2
base_name = table_name
}
for(i=1; i<=length(base_name); i++) {
table_number=(table_number*char_shift)+c2n[substr(base_name,i,1)]
}
# We start playing *_high, *low games here because the some
@ -136,6 +142,11 @@ c2n["_"]=63
continuation = 0;
}
/^[ \t]*(error_code|ec)[ \t]+[A-Z_0-9]+,[^ \t]/ {
# Be tolerant to missing whitespace after `,' ...
sub(/,/, ", ")
}
/^[ \t]*(error_code|ec)[ \t]+[A-Z_0-9]+,[ \t]*$/ {
table_item_count++
skipone=1
@ -180,6 +191,10 @@ c2n["_"]=63
skipone=0
}
/^[ \t]*(prefix)$/ {
prefix_str = ""
}
/^[ \t]*(prefix)[ \t]+[A-Z_0-9]+/ {
prefix_str = $2 "_"
}
@ -229,7 +244,7 @@ END {
print " }" > outfile
print "}" > outfile
print "" > outfile
print "/* For Heimdall compatibility */" > outfile
print "/* For Heimdal compatibility */" > outfile
print "void initialize_" table_name "_error_table_r(struct et_list **list)" > outfile
print "{" > outfile
print " struct et_list *et, **end;" > outfile

View File

@ -68,10 +68,16 @@ c2n["_"]=63
/^#/ { next }
/^[ \t]*(error_table|et)[ \t]+[a-zA-Z][a-zA-Z0-9_]+/ {
table_number = 0
table_name = $2
mod_base = 1000000
for(i=1; i<=length(table_name); i++) {
table_number=(table_number*char_shift)+c2n[substr(table_name,i,1)]
if (NF > 2) {
table_name = $3
base_name = $2
} else {
table_name = $2
base_name = table_name
}
for(i=1; i<=length(base_name); i++) {
table_number=(table_number*char_shift)+c2n[substr(base_name,i,1)]
}
# We start playing *_high, *low games here because the some
# awk programs do not have the necessary precision (sigh)
@ -126,6 +132,9 @@ c2n["_"]=63
}
/^[ \t]*(error_code|ec)[ \t]+[A-Z_0-9]+,/ {
# Be tolerant to missing whitespace after `,' ...
sub(/,/, ", ")
tag=prefix_str substr($2,1,length($2)-1)
if (curr_high == 0) {
printf "#define %-40s (%dL)\n", tag, \
@ -146,6 +155,10 @@ c2n["_"]=63
}
}
/^[ \t]*(prefix)$/ {
prefix_str = ""
}
/^[ \t]*(prefix)[ \t]+[A-Z_0-9]+/ {
prefix_str = $2 "_"
}
@ -168,6 +181,10 @@ c2n["_"]=63
END {
print "extern const struct error_table et_" table_name "_error_table;" > outfile
print "extern void initialize_" table_name "_error_table(void);" > outfile
print "" > outfile
print "/* For compatibility with Heimdal */" > outfile
print "extern void initialize_" table_name "_error_table_r(void);" > outfile
print "" > outfile
if (tab_base_high == 0) {
print "#define ERROR_TABLE_BASE_" table_name " (" \
sprintf("%d", tab_base_sign*tab_base_low) \

View File

@ -35,7 +35,7 @@ void initialize_ovk_error_table(void) {
}
}
/* For Heimdall compatibility */
/* For Heimdal compatibility */
void initialize_ovk_error_table_r(struct et_list **list)
{
struct et_list *et, **end;

View File

@ -8,6 +8,10 @@
#define CHPASS_UTIL_PASSWORD_IN_DICTIONARY (43787520L)
extern const struct error_table et_ovk_error_table;
extern void initialize_ovk_error_table(void);
/* For compatibility with Heimdal */
extern void initialize_ovk_error_table_r(void);
#define ERROR_TABLE_BASE_ovk (43787520L)
/* for compatibility with older versions... */

View File

@ -0,0 +1,53 @@
/*
* heimdal3.c:
* This file is automatically generated; please do not edit it.
*/
#include <stdlib.h>
static const char * const text[] = {
"Test message 1",
"Test message 2",
0
};
struct error_table {
char const * const * msgs;
long base;
int n_msgs;
};
struct et_list {
struct et_list *next;
const struct error_table * table;
};
extern struct et_list *_et_list;
const struct error_table et_h3test_error_table = { text, 43787520L, 2 };
static struct et_list link = { 0, 0 };
void initialize_h3test_error_table(void);
void initialize_h3test_error_table(void) {
if (!link.table) {
link.next = _et_list;
link.table = &et_h3test_error_table;
_et_list = &link;
}
}
/* For Heimdal compatibility */
void initialize_h3test_error_table_r(struct et_list **list)
{
struct et_list *et, **end;
for (end = list, et = *list; et; end = &et->next, et = et->next)
if (et->table->msgs == text)
return;
et = malloc(sizeof(struct et_list));
if (et == 0)
return;
et->table = &et_h3test_error_table;
et->next = 0;
*end = et;
}

View File

@ -0,0 +1,5 @@
error_table ovk h3test
prefix H3TEST
ec TEST1, "Test message 1"
ec TEST2, "Test message 2"
end

View File

@ -0,0 +1,20 @@
/*
* heimdal3.h:
* This file is automatically generated; please do not edit it.
*/
#include <et/com_err.h>
#define H3TEST_TEST1 (43787520L)
#define H3TEST_TEST2 (43787521L)
extern const struct error_table et_h3test_error_table;
extern void initialize_h3test_error_table(void);
/* For compatibility with Heimdal */
extern void initialize_h3test_error_table_r(void);
#define ERROR_TABLE_BASE_h3test (43787520L)
/* for compatibility with older versions... */
#define init_h3test_err_tbl initialize_h3test_error_table
#define h3test_err_base ERROR_TABLE_BASE_h3test

View File

@ -116,7 +116,7 @@ void initialize_krb_error_table(void) {
}
}
/* For Heimdall compatibility */
/* For Heimdal compatibility */
void initialize_krb_error_table_r(struct et_list **list)
{
struct et_list *et, **end;

View File

@ -53,6 +53,10 @@
#define KRBET_KNAME_FMT (39525457L)
extern const struct error_table et_krb_error_table;
extern void initialize_krb_error_table(void);
/* For compatibility with Heimdal */
extern void initialize_krb_error_table_r(void);
#define ERROR_TABLE_BASE_krb (39525376L)
/* for compatibility with older versions... */

View File

@ -102,7 +102,7 @@ void initialize_kadm_error_table(void) {
}
}
/* For Heimdall compatibility */
/* For Heimdal compatibility */
void initialize_kadm_error_table_r(struct et_list **list)
{
struct et_list *et, **end;

View File

@ -47,6 +47,10 @@
#define KADM_PASS_Q_DICT (-1783126205L)
extern const struct error_table et_kadm_error_table;
extern void initialize_kadm_error_table(void);
/* For compatibility with Heimdal */
extern void initialize_kadm_error_table_r(void);
#define ERROR_TABLE_BASE_kadm (-1783126272L)
/* for compatibility with older versions... */

View File

@ -56,7 +56,7 @@ void initialize_krb_error_table(void) {
}
}
/* For Heimdall compatibility */
/* For Heimdal compatibility */
void initialize_krb_error_table_r(struct et_list **list)
{
struct et_list *et, **end;

View File

@ -29,6 +29,10 @@
#define KRB_SKDC_CANT (39525397L)
extern const struct error_table et_krb_error_table;
extern void initialize_krb_error_table(void);
/* For compatibility with Heimdal */
extern void initialize_krb_error_table_r(void);
#define ERROR_TABLE_BASE_krb (39525376L)
/* for compatibility with older versions... */