Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

ascmagic.c File Reference

#include "system.h"
#include "file.h"
#include "names.h"
#include "tar.h"
#include "debug.h"

Go to the source code of this file.

Defines

#define isodigit(c)   ( ((c) >= '0') && ((c) <= '7') )
#define MAXLINELEN   300
#define ISSPC(x)
#define F   0
#define T   1
#define I   2
#define X   3

Typedefs

typedef unsigned long unichar

Functions

const char * rcsid (const char *p)
int from_oct (int digs, char *where)
int is_tar (const fmagic fm)
int looks_ascii (const unsigned char *buf, int nb, unichar *ubuf, int *ulen)
int looks_latin1 (const unsigned char *buf, int nb, unichar *ubuf, int *ulen)
int looks_extended (const unsigned char *buf, int nb, unichar *ubuf, int *ulen)
int looks_utf8 (const unsigned char *buf, int nb, unichar *ubuf, int *ulen)
int looks_unicode (const unsigned char *buf, int nb, unichar *ubuf, int *ulen)
void from_ebcdic (const unsigned char *buf, int nb, unsigned char *otp)
int fmagicAMatch (const unsigned char *s, const unichar *us, int ulen)
int fmagicA (fmagic fm)

Variables

char text_chars [256]
unsigned char ebcdic_to_ascii []


Define Documentation

#define F   0
 

Definition at line 190 of file ascmagic.c.

#define I   2
 

Definition at line 192 of file ascmagic.c.

Referenced by looks_extended().

#define isodigit  )     ( ((c) >= '0') && ((c) <= '7') )
 

Definition at line 51 of file ascmagic.c.

Referenced by from_oct().

#define ISSPC  ) 
 

Value:

((x) == ' ' || (x) == '\t' || (x) == '\r' || (x) == '\n' \
                  || (x) == 0x85 || (x) == '\f')

Definition at line 135 of file ascmagic.c.

Referenced by fmagicA().

#define MAXLINELEN   300
 

Definition at line 134 of file ascmagic.c.

#define T   1
 

Definition at line 191 of file ascmagic.c.

Referenced by looks_extended(), and looks_latin1().

#define X   3
 

Definition at line 193 of file ascmagic.c.


Typedef Documentation

typedef unsigned long unichar
 

Definition at line 132 of file ascmagic.c.

Referenced by fmagicA(), and looks_utf8().


Function Documentation

int fmagicA fmagic  fm  ) 
 

Definition at line 513 of file ascmagic.c.

References fmagic_s::buf, file_printf(), fmagic_s::flags, fmagic, FMAGIC_FLAGS_MIME, fmagicAMatch(), from_ebcdic(), HOWMANY, is_tar(), ISSPC, looks_ascii(), looks_extended(), looks_latin1(), looks_unicode(), looks_utf8(), names::name, fmagic_s::nb, names::type, and unichar.

Referenced by fmagicF().

int fmagicAMatch const unsigned char *  s,
const unichar us,
int  ulen
[static]
 

Definition at line 493 of file ascmagic.c.

Referenced by fmagicA().

void from_ebcdic const unsigned char *  buf,
int  nb,
unsigned char *  otp
[static]
 

Definition at line 480 of file ascmagic.c.

References ebcdic_to_ascii.

Referenced by fmagicA().

int from_oct int  digs,
char *  where
[static]
 

Definition at line 60 of file ascmagic.c.

References isodigit.

Referenced by is_tar().

int is_tar const fmagic  fm  )  [static]
 

Definition at line 92 of file ascmagic.c.

References fmagic_s::buf, record::charptr, record::header::chksum, fmagic, from_oct(), record::header, record::header::magic, fmagic_s::nb, and TARMAGIC.

Referenced by fmagicA().

int looks_ascii const unsigned char *  buf,
int  nb,
unichar ubuf,
int *  ulen
[static]
 

Definition at line 220 of file ascmagic.c.

References text_chars.

Referenced by fmagicA().

int looks_extended const unsigned char *  buf,
int  nb,
unichar ubuf,
int *  ulen
[static]
 

Definition at line 266 of file ascmagic.c.

References I, T, and text_chars.

Referenced by fmagicA().

int looks_latin1 const unsigned char *  buf,
int  nb,
unichar ubuf,
int *  ulen
[static]
 

Definition at line 243 of file ascmagic.c.

References T, and text_chars.

Referenced by fmagicA().

int looks_unicode const unsigned char *  buf,
int  nb,
unichar ubuf,
int *  ulen
[static]
 

Definition at line 355 of file ascmagic.c.

References text_chars.

Referenced by fmagicA().

int looks_utf8 const unsigned char *  buf,
int  nb,
unichar ubuf,
int *  ulen
[static]
 

Definition at line 289 of file ascmagic.c.

References text_chars, and unichar.

Referenced by fmagicA().

const char* rcsid const char *  p  )  [inline, static]
 

Definition at line 43 of file ascmagic.c.


Variable Documentation

unsigned char ebcdic_to_ascii[] [static]
 

Initial value:

 {
  0,   1,   2,   3, 156,   9, 134, 127, 151, 141, 142,  11,  12,  13,  14,  15,
 16,  17,  18,  19, 157, 133,   8, 135,  24,  25, 146, 143,  28,  29,  30,  31,
128, 129, 130, 131, 132,  10,  23,  27, 136, 137, 138, 139, 140,   5,   6,   7,
144, 145,  22, 147, 148, 149, 150,   4, 152, 153, 154, 155,  20,  21, 158,  26,
' ', 160, 161, 162, 163, 164, 165, 166, 167, 168, 213, '.', '<', '(', '+', '|',
'&', 169, 170, 171, 172, 173, 174, 175, 176, 177, '!', '$', '*', ')', ';', '~',
'-', '/', 178, 179, 180, 181, 182, 183, 184, 185, 203, ',', '%', '_', '>', '?',
186, 187, 188, 189, 190, 191, 192, 193, 194, '`', ':', '#', '@', '\'','=', '"',
195, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 196, 197, 198, 199, 200, 201,
202, 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', '^', 204, 205, 206, 207, 208,
209, 229, 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 210, 211, 212, '[', 214, 215,
216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, ']', 230, 231,
'{', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 232, 233, 234, 235, 236, 237,
'}', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 238, 239, 240, 241, 242, 243,
'\\',159, 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 244, 245, 246, 247, 248, 249,
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 250, 251, 252, 253, 254, 255
}

Definition at line 420 of file ascmagic.c.

Referenced by from_ebcdic().

char text_chars[256] [static]
 

Initial value:

 {
        
         0  ,  0  ,  0  ,  0  ,  0  ,  0  ,  0  ,  1  ,  1  ,  1  ,  1  ,  0  ,  1  ,  1  ,  0  ,  0  ,  
        
         0  ,  0  ,  0  ,  0  ,  0  ,  0  ,  0  ,  0  ,  0  ,  0  ,  0  ,  1  ,  0  ,  0  ,  0  ,  0  ,  
         1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  
         1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  
         1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  
         1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  
         1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  
         1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  1  ,  0  ,  
        
         3  ,  3  ,  3  ,  3  ,  3  ,  1  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  
         3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  3  ,  
         2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  
         2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  
         2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  
         2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  
         2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  
         2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2  ,  2     
}

Definition at line 196 of file ascmagic.c.

Referenced by looks_ascii(), looks_extended(), looks_latin1(), looks_unicode(), and looks_utf8().


Generated on Sun Aug 20 07:15:08 2006 for rpm by  doxygen 1.3.9.1