summaryrefslogtreecommitdiffstats
path: root/src/windows/leashdll/leasherr.c
blob: da06b5a8a9bb30869c191a02c5acdcf52ba1e075 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
// ATTENTION: someone in the past edited this file manually
// I am continuing this tradition just to get the release out. 3/6/97
// This needs to be revisited and repaired!!!XXXX
// pbh


 /*
 * leasherr.c
 * This file is the C file for leasherr.et.
 * Please do not edit it as it is automatically generated.
 */

#include <stdlib.h>
#include <windows.h>

static const char* const text[] = {
	"Only one instance of Leash can be run at a time.",
	"Principal invalid.",
	"Realm failed.",
	"Instance invalid.",
	"Realm invalid.",
	"Unexpected end of Kerberos memory storage.",
	"Warning! Your Kerberos tickets expire soon.",
	"You did not type the same new password.",
	"You can only use printable characters in a password.",
	"Fatal error; cannot run this program.",
	"Couldn't initialize WinSock.",
	"Couldn't find the timeserver host entry.",
	"Couldn't open a socket.",
	"Couldn't connect to timeserver.",
	"Couldn't get time from server.",
	"Couldn't get local time of day.",
	"Couldn't set local time of day.",
	"Error while receiving time from server.",
	"Protocol problem with timeserver.",
	"The time was already reset. Try using a different program to synchronize the time.",
    0
};

typedef LPSTR (*err_func)(int, long);
struct error_table {
    char const * const * msgs;
    err_func func;
    long base;
    int n_msgs;
};
struct et_list {
#ifdef WINDOWS
	HANDLE next;
#else
	struct et_list *next;
#endif
	const struct error_table * table;
};

static const struct error_table et = { text, (err_func)0, 40591872L, 20 };

#ifdef WINDOWS
void initialize_lsh_error_table(HANDLE *__et_list) {
//    struct et_list *_link,*_et_list;
    struct et_list *_link;
    HANDLE ghlink;

    ghlink=GlobalAlloc(GHND,sizeof(struct et_list));
    _link=GlobalLock(ghlink);
    _link->next=*__et_list;
    _link->table=&et;
    GlobalUnlock(ghlink);
    *__et_list=ghlink;
}
#else
void initialize_lsh_error_table(struct et_list **__et_list) {
    struct et_list *_link;

    _link=malloc(sizeof(struct et_list));
    _link->next=*__et_list;
    _link->table=&et;
    *__et_list=_link;
}
#endif

#ifdef WINDOWS

void Leash_initialize_krb_error_func(err_func func, HANDLE *__et_list)
{
}

void Leash_initialize_kadm_error_table(HANDLE *__et_list)
{
}
#else
#include <krberr.h>

void Leash_initialize_krb_error_func(err_func func, struct et_list **__et_list)
{
    (*pinitialize_krb_error_func)(func,__et_list);
}

#include <kadm_err.h>

void Leash_initialize_kadm_error_table(struct et_list **__et_list)
{
    initialize_kadm_error_table(__et_list);
}
#endif