]> eyrie.org Git - kerberos/krb5-strength.git/blob - cracklib/packer.h
Remove a bunch of useless or unnecessary deviations from upstream. Redo
[kerberos/krb5-strength.git] / cracklib / packer.h
1 /*
2  * This program is copyright Alec Muffett 1993. The author disclaims all 
3  * responsibility or liability with respect to it's usage or its effect 
4  * upon hardware or computer systems, and maintains copyright as set out 
5  * in the "LICENCE" document which accompanies distributions of Crack v4.0 
6  * and upwards.
7  */
8
9 #include <stdio.h>
10 #include <ctype.h>
11
12 #define STRINGSIZE      1024
13 #define TRUNCSTRINGSIZE (STRINGSIZE/4)
14
15 typedef unsigned char int8;
16 typedef unsigned short int int16;
17 typedef unsigned long int int32;
18 #ifndef NUMWORDS
19 #define NUMWORDS        16
20 #endif
21 #define MAXWORDLEN      32
22 #define MAXBLOCKLEN     (MAXWORDLEN * NUMWORDS)
23
24 struct pi_header
25 {
26     int32 pih_magic;
27     int32 pih_numwords;
28     int16 pih_blocklen;
29     int16 pih_pad;
30 };
31
32 typedef struct
33 {
34     FILE *ifp;
35     FILE *dfp;
36     FILE *wfp;
37
38     int32 flags;
39 #define PFOR_WRITE      0x0001
40 #define PFOR_FLUSH      0x0002
41 #define PFOR_USEHWMS    0x0004
42
43     int32 hwms[256];
44
45     struct pi_header header;
46
47     int count;
48     char data[NUMWORDS][MAXWORDLEN];
49 } PWDICT;
50
51 #define PW_WORDS(x) ((x)->header.pih_numwords)
52 #define PIH_MAGIC 0x70775631
53
54 extern PWDICT *PWOpen();
55 extern char *Mangle();
56 extern char *FascistCheck();
57
58 #define CRACK_TOLOWER(a)        (isupper(a)?tolower(a):(a)) 
59 #define CRACK_TOUPPER(a)        (islower(a)?toupper(a):(a)) 
60 #define STRCMP(a,b)             strcmp((a),(b))