php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
ascmagic.c File Reference
#include "file.h"
#include "magic.h"
#include <string.h>
#include <ctype.h>
#include <stdlib.h>

Go to the source code of this file.

Macros

#define MAXLINELEN   300 /* longest sane line length */
 
#define ISSPC(x)
 

Functions

file_private unsigned char * encode_utf8 (unsigned char *, size_t, file_unichar_t *, size_t)
 
file_private size_t trim_nuls (const unsigned char *, size_t)
 
file_protected int file_ascmagic (struct magic_set *ms, const struct buffer *b, int text)
 
file_protected int file_ascmagic_with_encoding (struct magic_set *ms, const struct buffer *b, file_unichar_t *ubuf, size_t ulen, const char *code, const char *type, int text)
 

Macro Definition Documentation

◆ ISSPC

#define ISSPC ( x)
Value:
((x) == ' ' || (x) == '\t' || (x) == '\r' || (x) == '\n' \
|| (x) == 0x85 || (x) == '\f')

Definition at line 50 of file ascmagic.c.

◆ MAXLINELEN

#define MAXLINELEN   300 /* longest sane line length */

Definition at line 49 of file ascmagic.c.

Function Documentation

◆ encode_utf8()

file_private unsigned char * encode_utf8 ( unsigned char * buf,
size_t len,
file_unichar_t * ubuf,
size_t ulen )

Definition at line 338 of file ascmagic.c.

◆ file_ascmagic()

file_protected int file_ascmagic ( struct magic_set * ms,
const struct buffer * b,
int text )

Definition at line 71 of file ascmagic.c.

◆ file_ascmagic_with_encoding()

file_protected int file_ascmagic_with_encoding ( struct magic_set * ms,
const struct buffer * b,
file_unichar_t * ubuf,
size_t ulen,
const char * code,
const char * type,
int text )

Definition at line 105 of file ascmagic.c.

◆ trim_nuls()

file_private size_t trim_nuls ( const unsigned char * buf,
size_t nbytes )

Definition at line 62 of file ascmagic.c.