Rizin
unix-like reverse engineering framework and cli tools
|
#include <rz_userconf.h>
#include "file.h"
#include <stdio.h>
#include <string.h>
#include <memory.h>
#include <ctype.h>
#include <stdlib.h>
#include "names.h"
Go to the source code of this file.
Macros | |
#define | MAXLINELEN 300 /* longest sane line length */ |
#define | ISSPC(x) ((x) == ' ' || (x) == '\t' || (x) == '\r' || (x) == '\n' || (x) == 0x85 || (x) == '\f') |
#define | F 0 /* character never appears in text */ |
#define | T 1 /* character appears in plain ASCII text */ |
#define | I 2 /* character appears in ISO-8859 text */ |
#define | X 3 /* character appears in non-ISO extended ASCII (Mac, IBM PC) */ |
Functions | |
static int | looks_ascii (const ut8 *, size_t, unichar *, size_t *) |
static int | looks_utf8_with_BOM (const ut8 *, size_t, unichar *, size_t *) |
int | file_looks_utf8 (const ut8 *, size_t, unichar *, size_t *) |
static int | looks_ucs16 (const ut8 *, size_t, unichar *, size_t *) |
static int | looks_latin1 (const ut8 *, size_t, unichar *, size_t *) |
static int | looks_extended (const ut8 *, size_t, unichar *, size_t *) |
static void | from_ebcdic (const ut8 *, size_t, ut8 *) |
static int | ascmatch (const ut8 *, const unichar *, size_t) |
static ut8 * | encode_utf8 (ut8 *, size_t, unichar *, size_t) |
int | file_ascmagic (RzMagic *ms, const ut8 *buf, size_t nbytes) |
Variables | |
static char | text_chars [256] |
static ut8 | ebcdic_to_ascii [] |
#define F 0 /* character never appears in text */ |
Definition at line 464 of file ascmagic.c.
#define I 2 /* character appears in ISO-8859 text */ |
Definition at line 466 of file ascmagic.c.
#define ISSPC | ( | x | ) | ((x) == ' ' || (x) == '\t' || (x) == '\r' || (x) == '\n' || (x) == 0x85 || (x) == '\f') |
Definition at line 52 of file ascmagic.c.
#define MAXLINELEN 300 /* longest sane line length */ |
Definition at line 51 of file ascmagic.c.
#define T 1 /* character appears in plain ASCII text */ |
Definition at line 465 of file ascmagic.c.
Definition at line 467 of file ascmagic.c.
Definition at line 536 of file ascmagic.c.
References test_evm::end, i, len, NULL, and ut8.
Referenced by file_ascmagic().
Definition at line 65 of file ascmagic.c.
References ascmatch(), calloc(), done, encode_utf8(), test_evm::end, file_looks_utf8(), file_oomem(), file_printf(), file_softmagic(), free(), from_ebcdic(), i, ISSPC, looks_ascii(), looks_extended(), looks_latin1(), looks_ucs16(), looks_utf8_with_BOM(), malloc(), MAXLINELEN, mime, nbytes, NNAMES, NULL, p, type, and types.
Referenced by file_buffer().
Definition at line 605 of file ascmagic.c.
References c, done, i, n, nbytes, T, and text_chars.
Referenced by file_ascmagic(), looks_utf8_with_BOM(), and set_test_type().
Definition at line 809 of file ascmagic.c.
References ebcdic_to_ascii, i, nbytes, and out.
Referenced by file_ascmagic().
Definition at line 491 of file ascmagic.c.
References i, nbytes, T, and text_chars.
Referenced by file_ascmagic().
Definition at line 518 of file ascmagic.c.
References I, i, nbytes, T, text_chars, and X.
Referenced by file_ascmagic().
Definition at line 504 of file ascmagic.c.
References I, i, nbytes, T, and text_chars.
Referenced by file_ascmagic().
Definition at line 688 of file ascmagic.c.
References i, nbytes, T, and text_chars.
Referenced by file_ascmagic().
|
static |
Definition at line 681 of file ascmagic.c.
References file_looks_utf8(), and nbytes.
Referenced by file_ascmagic().
|
static |
Definition at line 752 of file ascmagic.c.
Referenced by from_ebcdic().
|
static |
Definition at line 469 of file ascmagic.c.
Referenced by file_looks_utf8(), looks_ascii(), looks_extended(), looks_latin1(), and looks_ucs16().