php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
file.h File Reference
#include "config.h"
#include <stdint.h>
#include <stdio.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/param.h>
#include <sys/stat.h>
#include <stdarg.h>

Go to the source code of this file.

Data Structures

struct  buffer
 
union  VALUETYPE
 
struct  magic
 
struct  mlist
 
struct  level_info
 
struct  cont
 
struct  magic_set
 
struct  magic_set::out
 
struct  file_pushbuf_t
 

Macros

#define __STDC_LIMIT_MACROS
 
#define __STDC_FORMAT_MACROS
 
#define SIZE_T_FORMAT   "z"
 
#define INT64_T_FORMAT   "ll"
 
#define INTMAX_T_FORMAT   "j"
 
#define ENABLE_CONDITIONALS
 
#define MAGIC   "/etc/magic"
 
#define PATHSEP   ':'
 
#define file_private   static
 
#define file_public
 
#define file_protected
 
#define __arraycount(a)
 
#define __GNUC_PREREQ__(x, y)
 
#define __attribute__(a)
 
#define MIN(a, b)
 
#define MAX(a, b)
 
#define O_CLOEXEC   0
 
#define FD_CLOEXEC   1
 
#define MAX_CTIME    CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
 
#define FILE_BADSIZE   CAST(size_t, ~0ul)
 
#define MAXDESC   64 /* max len of text description/MIME type */
 
#define MAXMIME   80 /* max len of text MIME type */
 
#define MAXstring   128 /* max len of "string" types */
 
#define MAGICNO   0xF11E041C
 
#define VERSIONNO   18
 
#define FILE_MAGICSIZE   376
 
#define FILE_GUID_SIZE   sizeof("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")
 
#define FILE_LOAD   0
 
#define FILE_CHECK   1
 
#define FILE_COMPILE   2
 
#define FILE_LIST   3
 
#define INDIR   0x01 /* if '(...)' appears */
 
#define OFFADD   0x02 /* if '>&' or '>...(&' appears */
 
#define INDIROFFADD   0x04 /* if '>&(' appears */
 
#define UNSIGNED   0x08 /* comparison is unsigned */
 
#define NOSPACE   0x10 /* suppress space character before output */
 
#define BINTEST
 
#define TEXTTEST   0x40 /* for passing to file_softmagic */
 
#define OFFNEGATIVE   0x80 /* relative to the end of file */
 
#define FILE_INVALID   0
 
#define FILE_BYTE   1
 
#define FILE_SHORT   2
 
#define FILE_DEFAULT   3
 
#define FILE_LONG   4
 
#define FILE_STRING   5
 
#define FILE_DATE   6
 
#define FILE_BESHORT   7
 
#define FILE_BELONG   8
 
#define FILE_BEDATE   9
 
#define FILE_LESHORT   10
 
#define FILE_LELONG   11
 
#define FILE_LEDATE   12
 
#define FILE_PSTRING   13
 
#define FILE_LDATE   14
 
#define FILE_BELDATE   15
 
#define FILE_LELDATE   16
 
#define FILE_REGEX   17
 
#define FILE_BESTRING16   18
 
#define FILE_LESTRING16   19
 
#define FILE_SEARCH   20
 
#define FILE_MEDATE   21
 
#define FILE_MELDATE   22
 
#define FILE_MELONG   23
 
#define FILE_QUAD   24
 
#define FILE_LEQUAD   25
 
#define FILE_BEQUAD   26
 
#define FILE_QDATE   27
 
#define FILE_LEQDATE   28
 
#define FILE_BEQDATE   29
 
#define FILE_QLDATE   30
 
#define FILE_LEQLDATE   31
 
#define FILE_BEQLDATE   32
 
#define FILE_FLOAT   33
 
#define FILE_BEFLOAT   34
 
#define FILE_LEFLOAT   35
 
#define FILE_DOUBLE   36
 
#define FILE_BEDOUBLE   37
 
#define FILE_LEDOUBLE   38
 
#define FILE_BEID3   39
 
#define FILE_LEID3   40
 
#define FILE_INDIRECT   41
 
#define FILE_QWDATE   42
 
#define FILE_LEQWDATE   43
 
#define FILE_BEQWDATE   44
 
#define FILE_NAME   45
 
#define FILE_USE   46
 
#define FILE_CLEAR   47
 
#define FILE_DER   48
 
#define FILE_GUID   49
 
#define FILE_OFFSET   50
 
#define FILE_BEVARINT   51
 
#define FILE_LEVARINT   52
 
#define FILE_MSDOSDATE   53
 
#define FILE_LEMSDOSDATE   54
 
#define FILE_BEMSDOSDATE   55
 
#define FILE_MSDOSTIME   56
 
#define FILE_LEMSDOSTIME   57
 
#define FILE_BEMSDOSTIME   58
 
#define FILE_OCTAL   59
 
#define FILE_NAMES_SIZE   60 /* size of array to contain all names */
 
#define IS_LIBMAGIC_STRING(t)
 
#define FILE_FMT_NONE   0
 
#define FILE_FMT_NUM   1 /* "cduxXi" */
 
#define FILE_FMT_STR   2 /* "s" */
 
#define FILE_FMT_QUAD   3 /* "ll" */
 
#define FILE_FMT_FLOAT   4 /* "eEfFgG" */
 
#define FILE_FMT_DOUBLE   5 /* "eEfFgG" */
 
#define FILE_FACTOR_OP_PLUS   '+'
 
#define FILE_FACTOR_OP_MINUS   '-'
 
#define FILE_FACTOR_OP_TIMES   '*'
 
#define FILE_FACTOR_OP_DIV   '/'
 
#define FILE_FACTOR_OP_NONE   '\0'
 
#define FILE_OPS   "&|^+-*/%"
 
#define FILE_OPAND   0
 
#define FILE_OPOR   1
 
#define FILE_OPXOR   2
 
#define FILE_OPADD   3
 
#define FILE_OPMINUS   4
 
#define FILE_OPMULTIPLY   5
 
#define FILE_OPDIVIDE   6
 
#define FILE_OPMODULO   7
 
#define FILE_OPS_MASK   0x07 /* mask for above ops */
 
#define FILE_UNUSED_1   0x08
 
#define FILE_UNUSED_2   0x10
 
#define FILE_OPSIGNED   0x20
 
#define FILE_OPINVERSE   0x40
 
#define FILE_OPINDIRECT   0x80
 
#define COND_NONE   0
 
#define COND_IF   1
 
#define COND_ELIF   2
 
#define COND_ELSE   3
 
#define num_mask   _u._mask
 
#define str_range   _u._s._count
 
#define str_flags   _u._s._flags
 
#define BIT(A)
 
#define STRING_COMPACT_WHITESPACE   BIT(0)
 
#define STRING_COMPACT_OPTIONAL_WHITESPACE   BIT(1)
 
#define STRING_IGNORE_LOWERCASE   BIT(2)
 
#define STRING_IGNORE_UPPERCASE   BIT(3)
 
#define REGEX_OFFSET_START   BIT(4)
 
#define STRING_TEXTTEST   BIT(5)
 
#define STRING_BINTEST   BIT(6)
 
#define PSTRING_1_BE   BIT(7)
 
#define PSTRING_1_LE   BIT(7)
 
#define PSTRING_2_BE   BIT(8)
 
#define PSTRING_2_LE   BIT(9)
 
#define PSTRING_4_BE   BIT(10)
 
#define PSTRING_4_LE   BIT(11)
 
#define REGEX_LINE_COUNT   BIT(11)
 
#define PSTRING_LEN    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
 
#define PSTRING_LENGTH_INCLUDES_ITSELF   BIT(12)
 
#define STRING_TRIM   BIT(13)
 
#define STRING_FULL_WORD   BIT(14)
 
#define CHAR_COMPACT_WHITESPACE   'W'
 
#define CHAR_COMPACT_OPTIONAL_WHITESPACE   'w'
 
#define CHAR_IGNORE_LOWERCASE   'c'
 
#define CHAR_IGNORE_UPPERCASE   'C'
 
#define CHAR_REGEX_OFFSET_START   's'
 
#define CHAR_TEXTTEST   't'
 
#define CHAR_TRIM   'T'
 
#define CHAR_FULL_WORD   'f'
 
#define CHAR_BINTEST   'b'
 
#define CHAR_PSTRING_1_BE   'B'
 
#define CHAR_PSTRING_1_LE   'B'
 
#define CHAR_PSTRING_2_BE   'H'
 
#define CHAR_PSTRING_2_LE   'h'
 
#define CHAR_PSTRING_4_BE   'L'
 
#define CHAR_PSTRING_4_LE   'l'
 
#define CHAR_PSTRING_LENGTH_INCLUDES_ITSELF   'J'
 
#define STRING_IGNORE_CASE   (STRING_IGNORE_LOWERCASE|STRING_IGNORE_UPPERCASE)
 
#define STRING_DEFAULT_RANGE   100
 
#define INDIRECT_RELATIVE   BIT(0)
 
#define CHAR_INDIRECT_RELATIVE   'r'
 
#define CAST(T, b)
 
#define RCAST(T, b)
 
#define CCAST(T, b)
 
#define MAGIC_SETS   2
 
#define EVENT_HAD_ERR   0x01
 
#define FILE_BYTES_MAX   (7 * 1024 * 1024)/* how much of the file to look at */
 
#define FILE_ELF_NOTES_MAX   256
 
#define FILE_ELF_PHNUM_MAX   2048
 
#define FILE_ELF_SHNUM_MAX   32768
 
#define FILE_ELF_SHSIZE_MAX   (128 * 1024 * 1024)
 
#define FILE_INDIR_MAX   50
 
#define FILE_NAME_MAX   50
 
#define FILE_REGEX_MAX   8192
 
#define FILE_ENCODING_MAX   (64 * 1024)
 
#define file_locale_used   __attribute__((__unused__))
 
#define FILE_T_LOCAL   1
 
#define FILE_T_WINDOWS   2
 
#define O_BINARY   0
 
#define O_NONBLOCK   0
 
#define FILE_RCSID(id)
 
#define __RCSID(a)
 

Typedefs

typedef unsigned long file_unichar_t
 

Functions

file_protected const char * file_fmtdatetime (char *, size_t, uint64_t, int)
 
file_protected const char * file_fmtdate (char *, size_t, uint16_t)
 
file_protected const char * file_fmttime (char *, size_t, uint16_t)
 
file_protected const char * file_fmtvarint (char *, size_t, const unsigned char *, int)
 
file_protected const char * file_fmtnum (char *, size_t, const char *, int)
 
file_protected struct magic_setfile_ms_alloc (int)
 
file_protected void file_ms_free (struct magic_set *)
 
file_protected int file_buffer (struct magic_set *, php_stream *, zend_stat_t *, const char *, const void *, size_t)
 
file_protected int file_fsmagic (struct magic_set *, const char *, zend_stat_t *)
 
file_protected int file_pipe2file (struct magic_set *, int, const void *, size_t)
 
file_protected int file_vprintf (struct magic_set *, const char *, va_list) __attribute__((__format__(__printf__
 
file_protected int file_protected int file_separator (struct magic_set *)
 
file_protected char * file_copystr (char *, size_t, size_t, const char *)
 
file_protected int file_checkfmt (char *, size_t, const char *)
 
file_protected size_t file_printedlen (const struct magic_set *)
 
file_protected int file_print_guid (char *, size_t, const uint64_t *)
 
file_protected int file_parse_guid (const char *, uint64_t *)
 
file_protected int file_replace (struct magic_set *, const char *, const char *)
 
file_protected int file_printf (struct magic_set *, const char *,...) __attribute__((__format__(__printf__
 
file_protected int file_protected int file_reset (struct magic_set *, int)
 
file_protected int file_tryelf (struct magic_set *, const struct buffer *)
 
file_protected int file_trycdf (struct magic_set *, const struct buffer *)
 
file_protected int file_ascmagic (struct magic_set *, const struct buffer *, int)
 
file_protected int file_ascmagic_with_encoding (struct magic_set *, const struct buffer *, file_unichar_t *, size_t, const char *, const char *, int)
 
file_protected int file_encoding (struct magic_set *, const struct buffer *, file_unichar_t **, size_t *, const char **, const char **, const char **)
 
file_protected int file_is_json (struct magic_set *, const struct buffer *)
 
file_protected int file_is_csv (struct magic_set *, const struct buffer *, int, const char *)
 
file_protected int file_is_simh (struct magic_set *, const struct buffer *)
 
file_protected int file_is_tar (struct magic_set *, const struct buffer *)
 
file_protected int file_softmagic (struct magic_set *, const struct buffer *, uint16_t *, uint16_t *, int, int)
 
file_protected int file_apprentice (struct magic_set *, const char *, int)
 
file_protected size_t file_magic_strength (const struct magic *, size_t)
 
file_protected int buffer_apprentice (struct magic_set *, struct magic **, size_t *, size_t)
 
file_protected int file_magicfind (struct magic_set *, const char *, struct mlist *)
 
file_protected uint64_t file_signextend (struct magic_set *, struct magic *, uint64_t)
 
file_protected uintmax_t file_varint2uintmax_t (const unsigned char *, int, size_t *)
 
file_protected void file_badread (struct magic_set *)
 
file_protected void file_badseek (struct magic_set *)
 
file_protected void file_oomem (struct magic_set *, size_t)
 
file_protected void file_error (struct magic_set *, int, const char *,...) __attribute__((__format__(__printf__
 
file_protected void file_protected void file_magerror (struct magic_set *, const char *,...) __attribute__((__format__(__printf__
 
file_protected void file_protected void file_protected void file_magwarn (struct magic_set *, const char *,...) __attribute__((__format__(__printf__
 
file_protected void file_protected void file_protected void file_protected void file_mdump (struct magic *)
 
file_protected void file_showstr (FILE *, const char *, size_t)
 
file_protected size_t file_mbswidth (struct magic_set *, const char *)
 
file_protected const char * file_getbuffer (struct magic_set *)
 
file_protected ssize_t sread (int, void *, size_t, int)
 
file_protected int file_check_mem (struct magic_set *, unsigned int)
 
file_protected int file_looks_utf8 (const unsigned char *, size_t, file_unichar_t *, size_t *)
 
file_protected size_t file_pstring_length_size (struct magic_set *, const struct magic *)
 
file_protected size_t file_pstring_get_length (struct magic_set *, const struct magic *, const char *)
 
file_protected char * file_printable (struct magic_set *, char *, size_t, const char *, size_t)
 
file_protected int file_pipe_closexec (int *)
 
file_protected int file_clear_closexec (int)
 
file_protected char * file_strtrim (char *)
 
file_protected void buffer_init (struct buffer *, int, const zend_stat_t *, const void *, size_t)
 
file_protected void buffer_fini (struct buffer *)
 
file_protected int buffer_fill (const struct buffer *)
 
file_protected file_pushbuf_tfile_push_buffer (struct magic_set *)
 
file_protected char * file_pop_buffer (struct magic_set *, file_pushbuf_t *)
 
size_t strlcpy (char *, const char *, size_t)
 
size_t strlcat (char *, const char *, size_t)
 
char * strcasestr (const char *, const char *)
 
ssize_t getline (char **, size_t *, FILE *)
 
ssize_t getdelim (char **, size_t *, int, FILE *)
 
char * ctime_r (const time_t *, char *)
 
char * asctime_r (const struct tm *, char *)
 

Variables

const char * file_names []
 
const size_t file_nnames
 

Macro Definition Documentation

◆ __arraycount

#define __arraycount ( a)
Value:
(sizeof(a) / sizeof(a[0]))
$obj a
Definition test.php:84

Definition at line 116 of file file.h.

◆ __attribute__

#define __attribute__ ( a)

Definition at line 131 of file file.h.

◆ __GNUC_PREREQ__

#define __GNUC_PREREQ__ ( x,
y )
Value:
0

Definition at line 125 of file file.h.

◆ __RCSID

#define __RCSID ( a)

Definition at line 663 of file file.h.

◆ __STDC_FORMAT_MACROS

#define __STDC_FORMAT_MACROS

Definition at line 50 of file file.h.

◆ __STDC_LIMIT_MACROS

#define __STDC_LIMIT_MACROS

Definition at line 47 of file file.h.

◆ BINTEST

#define BINTEST
Value:
0x20 /* test is for a binary type (set only
for top-level tests) */

Definition at line 211 of file file.h.

◆ BIT

#define BIT ( A)
Value:
(1 << (A))
#define A(x, l, r)
Definition hash_gost.c:85

Definition at line 370 of file file.h.

◆ CAST

#define CAST ( T,
b )
Value:
((T)(b))
#define T
Definition encoding.c:236

Definition at line 425 of file file.h.

◆ CCAST

#define CCAST ( T,
b )
Value:
((T)(uintptr_t)(b))

Definition at line 427 of file file.h.

◆ CHAR_BINTEST

#define CHAR_BINTEST   'b'

Definition at line 398 of file file.h.

◆ CHAR_COMPACT_OPTIONAL_WHITESPACE

#define CHAR_COMPACT_OPTIONAL_WHITESPACE   'w'

Definition at line 391 of file file.h.

◆ CHAR_COMPACT_WHITESPACE

#define CHAR_COMPACT_WHITESPACE   'W'

Definition at line 390 of file file.h.

◆ CHAR_FULL_WORD

#define CHAR_FULL_WORD   'f'

Definition at line 397 of file file.h.

◆ CHAR_IGNORE_LOWERCASE

#define CHAR_IGNORE_LOWERCASE   'c'

Definition at line 392 of file file.h.

◆ CHAR_IGNORE_UPPERCASE

#define CHAR_IGNORE_UPPERCASE   'C'

Definition at line 393 of file file.h.

◆ CHAR_INDIRECT_RELATIVE

#define CHAR_INDIRECT_RELATIVE   'r'

Definition at line 410 of file file.h.

◆ CHAR_PSTRING_1_BE

#define CHAR_PSTRING_1_BE   'B'

Definition at line 399 of file file.h.

◆ CHAR_PSTRING_1_LE

#define CHAR_PSTRING_1_LE   'B'

Definition at line 400 of file file.h.

◆ CHAR_PSTRING_2_BE

#define CHAR_PSTRING_2_BE   'H'

Definition at line 401 of file file.h.

◆ CHAR_PSTRING_2_LE

#define CHAR_PSTRING_2_LE   'h'

Definition at line 402 of file file.h.

◆ CHAR_PSTRING_4_BE

#define CHAR_PSTRING_4_BE   'L'

Definition at line 403 of file file.h.

◆ CHAR_PSTRING_4_LE

#define CHAR_PSTRING_4_LE   'l'

Definition at line 404 of file file.h.

◆ CHAR_PSTRING_LENGTH_INCLUDES_ITSELF

#define CHAR_PSTRING_LENGTH_INCLUDES_ITSELF   'J'

Definition at line 405 of file file.h.

◆ CHAR_REGEX_OFFSET_START

#define CHAR_REGEX_OFFSET_START   's'

Definition at line 394 of file file.h.

◆ CHAR_TEXTTEST

#define CHAR_TEXTTEST   't'

Definition at line 395 of file file.h.

◆ CHAR_TRIM

#define CHAR_TRIM   'T'

Definition at line 396 of file file.h.

◆ COND_ELIF

#define COND_ELIF   2

Definition at line 337 of file file.h.

◆ COND_ELSE

#define COND_ELSE   3

Definition at line 338 of file file.h.

◆ COND_IF

#define COND_IF   1

Definition at line 336 of file file.h.

◆ COND_NONE

#define COND_NONE   0

Definition at line 335 of file file.h.

◆ ENABLE_CONDITIONALS

#define ENABLE_CONDITIONALS

Definition at line 89 of file file.h.

◆ EVENT_HAD_ERR

#define EVENT_HAD_ERR   0x01

Definition at line 460 of file file.h.

◆ FD_CLOEXEC

#define FD_CLOEXEC   1

Definition at line 148 of file file.h.

◆ FILE_BADSIZE

#define FILE_BADSIZE   CAST(size_t, ~0ul)

Definition at line 161 of file file.h.

◆ FILE_BEDATE

#define FILE_BEDATE   9

Definition at line 231 of file file.h.

◆ FILE_BEDOUBLE

#define FILE_BEDOUBLE   37

Definition at line 259 of file file.h.

◆ FILE_BEFLOAT

#define FILE_BEFLOAT   34

Definition at line 256 of file file.h.

◆ FILE_BEID3

#define FILE_BEID3   39

Definition at line 261 of file file.h.

◆ FILE_BELDATE

#define FILE_BELDATE   15

Definition at line 237 of file file.h.

◆ FILE_BELONG

#define FILE_BELONG   8

Definition at line 230 of file file.h.

◆ FILE_BEMSDOSDATE

#define FILE_BEMSDOSDATE   55

Definition at line 277 of file file.h.

◆ FILE_BEMSDOSTIME

#define FILE_BEMSDOSTIME   58

Definition at line 280 of file file.h.

◆ FILE_BEQDATE

#define FILE_BEQDATE   29

Definition at line 251 of file file.h.

◆ FILE_BEQLDATE

#define FILE_BEQLDATE   32

Definition at line 254 of file file.h.

◆ FILE_BEQUAD

#define FILE_BEQUAD   26

Definition at line 248 of file file.h.

◆ FILE_BEQWDATE

#define FILE_BEQWDATE   44

Definition at line 266 of file file.h.

◆ FILE_BESHORT

#define FILE_BESHORT   7

Definition at line 229 of file file.h.

◆ FILE_BESTRING16

#define FILE_BESTRING16   18

Definition at line 240 of file file.h.

◆ FILE_BEVARINT

#define FILE_BEVARINT   51

Definition at line 273 of file file.h.

◆ FILE_BYTE

#define FILE_BYTE   1

Definition at line 223 of file file.h.

◆ FILE_BYTES_MAX

#define FILE_BYTES_MAX   (7 * 1024 * 1024)/* how much of the file to look at */

Definition at line 486 of file file.h.

◆ FILE_CHECK

#define FILE_CHECK   1

Definition at line 173 of file file.h.

◆ FILE_CLEAR

#define FILE_CLEAR   47

Definition at line 269 of file file.h.

◆ FILE_COMPILE

#define FILE_COMPILE   2

Definition at line 174 of file file.h.

◆ FILE_DATE

#define FILE_DATE   6

Definition at line 228 of file file.h.

◆ FILE_DEFAULT

#define FILE_DEFAULT   3

Definition at line 225 of file file.h.

◆ FILE_DER

#define FILE_DER   48

Definition at line 270 of file file.h.

◆ FILE_DOUBLE

#define FILE_DOUBLE   36

Definition at line 258 of file file.h.

◆ FILE_ELF_NOTES_MAX

#define FILE_ELF_NOTES_MAX   256

Definition at line 488 of file file.h.

◆ FILE_ELF_PHNUM_MAX

#define FILE_ELF_PHNUM_MAX   2048

Definition at line 489 of file file.h.

◆ FILE_ELF_SHNUM_MAX

#define FILE_ELF_SHNUM_MAX   32768

Definition at line 490 of file file.h.

◆ FILE_ELF_SHSIZE_MAX

#define FILE_ELF_SHSIZE_MAX   (128 * 1024 * 1024)

Definition at line 491 of file file.h.

◆ FILE_ENCODING_MAX

#define FILE_ENCODING_MAX   (64 * 1024)

Definition at line 495 of file file.h.

◆ FILE_FACTOR_OP_DIV

#define FILE_FACTOR_OP_DIV   '/'

Definition at line 315 of file file.h.

◆ FILE_FACTOR_OP_MINUS

#define FILE_FACTOR_OP_MINUS   '-'

Definition at line 313 of file file.h.

◆ FILE_FACTOR_OP_NONE

#define FILE_FACTOR_OP_NONE   '\0'

Definition at line 316 of file file.h.

◆ FILE_FACTOR_OP_PLUS

#define FILE_FACTOR_OP_PLUS   '+'

Definition at line 312 of file file.h.

◆ FILE_FACTOR_OP_TIMES

#define FILE_FACTOR_OP_TIMES   '*'

Definition at line 314 of file file.h.

◆ FILE_FLOAT

#define FILE_FLOAT   33

Definition at line 255 of file file.h.

◆ FILE_FMT_DOUBLE

#define FILE_FMT_DOUBLE   5 /* "eEfFgG" */

Definition at line 301 of file file.h.

◆ FILE_FMT_FLOAT

#define FILE_FMT_FLOAT   4 /* "eEfFgG" */

Definition at line 300 of file file.h.

◆ FILE_FMT_NONE

#define FILE_FMT_NONE   0

Definition at line 296 of file file.h.

◆ FILE_FMT_NUM

#define FILE_FMT_NUM   1 /* "cduxXi" */

Definition at line 297 of file file.h.

◆ FILE_FMT_QUAD

#define FILE_FMT_QUAD   3 /* "ll" */

Definition at line 299 of file file.h.

◆ FILE_FMT_STR

#define FILE_FMT_STR   2 /* "s" */

Definition at line 298 of file file.h.

◆ FILE_GUID

#define FILE_GUID   49

Definition at line 271 of file file.h.

◆ FILE_GUID_SIZE

#define FILE_GUID_SIZE   sizeof("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX")

Definition at line 170 of file file.h.

◆ FILE_INDIR_MAX

#define FILE_INDIR_MAX   50

Definition at line 492 of file file.h.

◆ FILE_INDIRECT

#define FILE_INDIRECT   41

Definition at line 263 of file file.h.

◆ FILE_INVALID

#define FILE_INVALID   0

Definition at line 222 of file file.h.

◆ FILE_LDATE

#define FILE_LDATE   14

Definition at line 236 of file file.h.

◆ FILE_LEDATE

#define FILE_LEDATE   12

Definition at line 234 of file file.h.

◆ FILE_LEDOUBLE

#define FILE_LEDOUBLE   38

Definition at line 260 of file file.h.

◆ FILE_LEFLOAT

#define FILE_LEFLOAT   35

Definition at line 257 of file file.h.

◆ FILE_LEID3

#define FILE_LEID3   40

Definition at line 262 of file file.h.

◆ FILE_LELDATE

#define FILE_LELDATE   16

Definition at line 238 of file file.h.

◆ FILE_LELONG

#define FILE_LELONG   11

Definition at line 233 of file file.h.

◆ FILE_LEMSDOSDATE

#define FILE_LEMSDOSDATE   54

Definition at line 276 of file file.h.

◆ FILE_LEMSDOSTIME

#define FILE_LEMSDOSTIME   57

Definition at line 279 of file file.h.

◆ FILE_LEQDATE

#define FILE_LEQDATE   28

Definition at line 250 of file file.h.

◆ FILE_LEQLDATE

#define FILE_LEQLDATE   31

Definition at line 253 of file file.h.

◆ FILE_LEQUAD

#define FILE_LEQUAD   25

Definition at line 247 of file file.h.

◆ FILE_LEQWDATE

#define FILE_LEQWDATE   43

Definition at line 265 of file file.h.

◆ FILE_LESHORT

#define FILE_LESHORT   10

Definition at line 232 of file file.h.

◆ FILE_LESTRING16

#define FILE_LESTRING16   19

Definition at line 241 of file file.h.

◆ FILE_LEVARINT

#define FILE_LEVARINT   52

Definition at line 274 of file file.h.

◆ FILE_LIST

#define FILE_LIST   3

Definition at line 175 of file file.h.

◆ FILE_LOAD

#define FILE_LOAD   0

Definition at line 172 of file file.h.

◆ file_locale_used

#define file_locale_used   __attribute__((__unused__))

Definition at line 501 of file file.h.

◆ FILE_LONG

#define FILE_LONG   4

Definition at line 226 of file file.h.

◆ FILE_MAGICSIZE

#define FILE_MAGICSIZE   376

Definition at line 168 of file file.h.

◆ FILE_MEDATE

#define FILE_MEDATE   21

Definition at line 243 of file file.h.

◆ FILE_MELDATE

#define FILE_MELDATE   22

Definition at line 244 of file file.h.

◆ FILE_MELONG

#define FILE_MELONG   23

Definition at line 245 of file file.h.

◆ FILE_MSDOSDATE

#define FILE_MSDOSDATE   53

Definition at line 275 of file file.h.

◆ FILE_MSDOSTIME

#define FILE_MSDOSTIME   56

Definition at line 278 of file file.h.

◆ FILE_NAME

#define FILE_NAME   45

Definition at line 267 of file file.h.

◆ FILE_NAME_MAX

#define FILE_NAME_MAX   50

Definition at line 493 of file file.h.

◆ FILE_NAMES_SIZE

#define FILE_NAMES_SIZE   60 /* size of array to contain all names */

Definition at line 282 of file file.h.

◆ FILE_OCTAL

#define FILE_OCTAL   59

Definition at line 281 of file file.h.

◆ FILE_OFFSET

#define FILE_OFFSET   50

Definition at line 272 of file file.h.

◆ FILE_OPADD

#define FILE_OPADD   3

Definition at line 322 of file file.h.

◆ FILE_OPAND

#define FILE_OPAND   0

Definition at line 319 of file file.h.

◆ FILE_OPDIVIDE

#define FILE_OPDIVIDE   6

Definition at line 325 of file file.h.

◆ FILE_OPINDIRECT

#define FILE_OPINDIRECT   0x80

Definition at line 332 of file file.h.

◆ FILE_OPINVERSE

#define FILE_OPINVERSE   0x40

Definition at line 331 of file file.h.

◆ FILE_OPMINUS

#define FILE_OPMINUS   4

Definition at line 323 of file file.h.

◆ FILE_OPMODULO

#define FILE_OPMODULO   7

Definition at line 326 of file file.h.

◆ FILE_OPMULTIPLY

#define FILE_OPMULTIPLY   5

Definition at line 324 of file file.h.

◆ FILE_OPOR

#define FILE_OPOR   1

Definition at line 320 of file file.h.

◆ FILE_OPS

#define FILE_OPS   "&|^+-*/%"

Definition at line 318 of file file.h.

◆ FILE_OPS_MASK

#define FILE_OPS_MASK   0x07 /* mask for above ops */

Definition at line 327 of file file.h.

◆ FILE_OPSIGNED

#define FILE_OPSIGNED   0x20

Definition at line 330 of file file.h.

◆ FILE_OPXOR

#define FILE_OPXOR   2

Definition at line 321 of file file.h.

◆ file_private

#define file_private   static

Definition at line 101 of file file.h.

◆ file_protected

#define file_protected

Definition at line 111 of file file.h.

◆ FILE_PSTRING

#define FILE_PSTRING   13

Definition at line 235 of file file.h.

◆ file_public

#define file_public

Definition at line 109 of file file.h.

◆ FILE_QDATE

#define FILE_QDATE   27

Definition at line 249 of file file.h.

◆ FILE_QLDATE

#define FILE_QLDATE   30

Definition at line 252 of file file.h.

◆ FILE_QUAD

#define FILE_QUAD   24

Definition at line 246 of file file.h.

◆ FILE_QWDATE

#define FILE_QWDATE   42

Definition at line 264 of file file.h.

◆ FILE_RCSID

#define FILE_RCSID ( id)
Value:
static const char *rcsid(const char *p) { \
return rcsid(p = id); \
}
p
Definition session.c:1105

Definition at line 654 of file file.h.

◆ FILE_REGEX

#define FILE_REGEX   17

Definition at line 239 of file file.h.

◆ FILE_REGEX_MAX

#define FILE_REGEX_MAX   8192

Definition at line 494 of file file.h.

◆ FILE_SEARCH

#define FILE_SEARCH   20

Definition at line 242 of file file.h.

◆ FILE_SHORT

#define FILE_SHORT   2

Definition at line 224 of file file.h.

◆ FILE_STRING

#define FILE_STRING   5

Definition at line 227 of file file.h.

◆ FILE_T_LOCAL

#define FILE_T_LOCAL   1

Definition at line 509 of file file.h.

◆ FILE_T_WINDOWS

#define FILE_T_WINDOWS   2

Definition at line 510 of file file.h.

◆ FILE_UNUSED_1

#define FILE_UNUSED_1   0x08

Definition at line 328 of file file.h.

◆ FILE_UNUSED_2

#define FILE_UNUSED_2   0x10

Definition at line 329 of file file.h.

◆ FILE_USE

#define FILE_USE   46

Definition at line 268 of file file.h.

◆ INDIR

#define INDIR   0x01 /* if '(...)' appears */

Definition at line 206 of file file.h.

◆ INDIRECT_RELATIVE

#define INDIRECT_RELATIVE   BIT(0)

Definition at line 409 of file file.h.

◆ INDIROFFADD

#define INDIROFFADD   0x04 /* if '>&(' appears */

Definition at line 208 of file file.h.

◆ INT64_T_FORMAT

#define INT64_T_FORMAT   "ll"

Definition at line 73 of file file.h.

◆ INTMAX_T_FORMAT

#define INTMAX_T_FORMAT   "j"

Definition at line 74 of file file.h.

◆ IS_LIBMAGIC_STRING

#define IS_LIBMAGIC_STRING ( t)
Value:
((t) == FILE_STRING || \
(t) == FILE_PSTRING || \
(t) == FILE_BESTRING16 || \
(t) == FILE_LESTRING16 || \
(t) == FILE_REGEX || \
(t) == FILE_SEARCH || \
(t) == FILE_INDIRECT || \
(t) == FILE_NAME || \
(t) == FILE_USE || \
(t) == FILE_OCTAL)
#define FILE_PSTRING
Definition file.h:235
#define FILE_SEARCH
Definition file.h:242
#define FILE_USE
Definition file.h:268
#define FILE_BESTRING16
Definition file.h:240
#define FILE_STRING
Definition file.h:227
#define FILE_LESTRING16
Definition file.h:241
#define FILE_INDIRECT
Definition file.h:263
#define FILE_NAME
Definition file.h:267
#define FILE_REGEX
Definition file.h:239
#define FILE_OCTAL
Definition file.h:281

Definition at line 284 of file file.h.

◆ MAGIC

#define MAGIC   "/etc/magic"

Definition at line 92 of file file.h.

◆ MAGIC_SETS

#define MAGIC_SETS   2

Definition at line 444 of file file.h.

◆ MAGICNO

#define MAGICNO   0xF11E041C

Definition at line 166 of file file.h.

◆ MAX

#define MAX ( a,
b )
Value:
(((a) > (b)) ? (a) : (b))

Definition at line 140 of file file.h.

◆ MAX_CTIME

#define MAX_CTIME    CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)

Definition at line 158 of file file.h.

◆ MAXDESC

#define MAXDESC   64 /* max len of text description/MIME type */

Definition at line 162 of file file.h.

◆ MAXMIME

#define MAXMIME   80 /* max len of text MIME type */

Definition at line 163 of file file.h.

◆ MAXstring

#define MAXstring   128 /* max len of "string" types */

Definition at line 164 of file file.h.

◆ MIN

#define MIN ( a,
b )
Value:
(((a) < (b)) ? (a) : (b))

Definition at line 136 of file file.h.

◆ NOSPACE

#define NOSPACE   0x10 /* suppress space character before output */

Definition at line 210 of file file.h.

◆ num_mask

#define num_mask   _u._mask

Definition at line 355 of file file.h.

◆ O_BINARY

#define O_BINARY   0

Definition at line 643 of file file.h.

◆ O_CLOEXEC

#define O_CLOEXEC   0

Definition at line 144 of file file.h.

◆ O_NONBLOCK

#define O_NONBLOCK   0

Definition at line 646 of file file.h.

◆ OFFADD

#define OFFADD   0x02 /* if '>&' or '>...(&' appears */

Definition at line 207 of file file.h.

◆ OFFNEGATIVE

#define OFFNEGATIVE   0x80 /* relative to the end of file */

Definition at line 213 of file file.h.

◆ PATHSEP

#define PATHSEP   ':'

Definition at line 98 of file file.h.

◆ PSTRING_1_BE

#define PSTRING_1_BE   BIT(7)

Definition at line 378 of file file.h.

◆ PSTRING_1_LE

#define PSTRING_1_LE   BIT(7)

Definition at line 379 of file file.h.

◆ PSTRING_2_BE

#define PSTRING_2_BE   BIT(8)

Definition at line 380 of file file.h.

◆ PSTRING_2_LE

#define PSTRING_2_LE   BIT(9)

Definition at line 381 of file file.h.

◆ PSTRING_4_BE

#define PSTRING_4_BE   BIT(10)

Definition at line 382 of file file.h.

◆ PSTRING_4_LE

#define PSTRING_4_LE   BIT(11)

Definition at line 383 of file file.h.

◆ PSTRING_LEN

Definition at line 385 of file file.h.

◆ PSTRING_LENGTH_INCLUDES_ITSELF

#define PSTRING_LENGTH_INCLUDES_ITSELF   BIT(12)

Definition at line 387 of file file.h.

◆ RCAST

#define RCAST ( T,
b )
Value:
((T)(uintptr_t)(b))

Definition at line 426 of file file.h.

◆ REGEX_LINE_COUNT

#define REGEX_LINE_COUNT   BIT(11)

Definition at line 384 of file file.h.

◆ REGEX_OFFSET_START

#define REGEX_OFFSET_START   BIT(4)

Definition at line 375 of file file.h.

◆ SIZE_T_FORMAT

#define SIZE_T_FORMAT   "z"

Definition at line 72 of file file.h.

◆ str_flags

#define str_flags   _u._s._flags

Definition at line 357 of file file.h.

◆ str_range

#define str_range   _u._s._count

Definition at line 356 of file file.h.

◆ STRING_BINTEST

#define STRING_BINTEST   BIT(6)

Definition at line 377 of file file.h.

◆ STRING_COMPACT_OPTIONAL_WHITESPACE

#define STRING_COMPACT_OPTIONAL_WHITESPACE   BIT(1)

Definition at line 372 of file file.h.

◆ STRING_COMPACT_WHITESPACE

#define STRING_COMPACT_WHITESPACE   BIT(0)

Definition at line 371 of file file.h.

◆ STRING_DEFAULT_RANGE

#define STRING_DEFAULT_RANGE   100

Definition at line 407 of file file.h.

◆ STRING_FULL_WORD

#define STRING_FULL_WORD   BIT(14)

Definition at line 389 of file file.h.

◆ STRING_IGNORE_CASE

Definition at line 406 of file file.h.

◆ STRING_IGNORE_LOWERCASE

#define STRING_IGNORE_LOWERCASE   BIT(2)

Definition at line 373 of file file.h.

◆ STRING_IGNORE_UPPERCASE

#define STRING_IGNORE_UPPERCASE   BIT(3)

Definition at line 374 of file file.h.

◆ STRING_TEXTTEST

#define STRING_TEXTTEST   BIT(5)

Definition at line 376 of file file.h.

◆ STRING_TRIM

#define STRING_TRIM   BIT(13)

Definition at line 388 of file file.h.

◆ TEXTTEST

#define TEXTTEST   0x40 /* for passing to file_softmagic */

Definition at line 212 of file file.h.

◆ UNSIGNED

#define UNSIGNED   0x08 /* comparison is unsigned */

Definition at line 209 of file file.h.

◆ VERSIONNO

#define VERSIONNO   18

Definition at line 167 of file file.h.

Typedef Documentation

◆ file_unichar_t

typedef unsigned long file_unichar_t

Definition at line 506 of file file.h.

Function Documentation

◆ asctime_r()

char * asctime_r ( const struct tm * ,
char *  )

◆ buffer_apprentice()

file_protected int buffer_apprentice ( struct magic_set * ,
struct magic ** ,
size_t * ,
size_t  )

◆ buffer_fill()

file_protected int buffer_fill ( const struct buffer * bb)

Definition at line 66 of file buffer.c.

◆ buffer_fini()

file_protected void buffer_fini ( struct buffer * b)

Definition at line 58 of file buffer.c.

◆ buffer_init()

file_protected void buffer_init ( struct buffer * b,
int fd,
const zend_stat_t * st,
const void * data,
size_t len )

Definition at line 42 of file buffer.c.

◆ ctime_r()

char * ctime_r ( const time_t * ,
char *  )

◆ file_apprentice()

file_protected int file_apprentice ( struct magic_set * ms,
const char * fn,
int action )

Definition at line 663 of file apprentice.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.

◆ file_badread()

file_protected void file_badread ( struct magic_set * ms)

Definition at line 243 of file funcs.c.

◆ file_badseek()

file_protected void file_badseek ( struct magic_set * ms)

Definition at line 237 of file funcs.c.

◆ file_buffer()

file_protected int file_buffer ( struct magic_set * ,
php_stream * ,
zend_stat_t * ,
const char * ,
const void * ,
size_t  )

◆ file_check_mem()

file_protected int file_check_mem ( struct magic_set * ms,
unsigned int level )

Definition at line 626 of file funcs.c.

◆ file_checkfmt()

file_protected int file_checkfmt ( char * msg,
size_t mlen,
const char * fmt )

Definition at line 94 of file funcs.c.

◆ file_clear_closexec()

file_protected int file_clear_closexec ( int fd)

Definition at line 835 of file funcs.c.

◆ file_copystr()

file_protected char * file_copystr ( char * buf,
size_t blen,
size_t width,
const char * str )

Definition at line 55 of file funcs.c.

◆ file_encoding()

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

Definition at line 75 of file encoding.c.

◆ file_error()

file_protected void file_error ( struct magic_set * ,
int ,
const char * ,
... )

◆ file_fmtdate()

file_protected const char * file_fmtdate ( char * buf,
size_t bsize,
uint16_t v )

Definition at line 314 of file print.c.

◆ file_fmtdatetime()

file_protected const char * file_fmtdatetime ( char * buf,
size_t bsize,
uint64_t v,
int flags )

Definition at line 272 of file print.c.

◆ file_fmtnum()

file_protected const char * file_fmtnum ( char * buf,
size_t blen,
const char * us,
int base )

Definition at line 353 of file print.c.

◆ file_fmttime()

file_protected const char * file_fmttime ( char * buf,
size_t bsize,
uint16_t v )

Definition at line 333 of file print.c.

◆ file_fmtvarint()

file_protected const char * file_fmtvarint ( char * buf,
size_t blen,
const unsigned char * us,
int t )

Definition at line 264 of file print.c.

◆ file_fsmagic()

file_protected int file_fsmagic ( struct magic_set * ms,
const char * fn,
zend_stat_t * sb )

Definition at line 90 of file fsmagic.c.

◆ file_getbuffer()

file_protected const char * file_getbuffer ( struct magic_set * ms)

Definition at line 548 of file funcs.c.

◆ file_is_csv()

file_protected int file_is_csv ( struct magic_set * ms,
const struct buffer * b,
int looks_text,
const char * code )

Definition at line 133 of file is_csv.c.

◆ file_is_json()

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

Definition at line 422 of file is_json.c.

◆ file_is_simh()

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

Definition at line 149 of file is_simh.c.

◆ file_is_tar()

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

Definition at line 63 of file is_tar.c.

◆ file_looks_utf8()

file_protected int file_looks_utf8 ( const unsigned char * buf,
size_t nbytes,
file_unichar_t * ubuf,
size_t * ulen )

Definition at line 350 of file encoding.c.

◆ file_magerror()

file_protected void file_protected void file_magerror ( struct magic_set * ,
const char * ,
... )

◆ file_magic_strength()

file_protected size_t file_magic_strength ( const struct magic * ,
size_t  )

◆ file_magicfind()

file_protected int file_magicfind ( struct magic_set * ms,
const char * name,
struct mlist * v )

Definition at line 3651 of file apprentice.c.

◆ file_magwarn()

file_protected void file_protected void file_protected void file_magwarn ( struct magic_set * ,
const char * ,
... )

◆ file_mbswidth()

file_protected size_t file_mbswidth ( struct magic_set * ,
const char *  )

◆ file_mdump()

Definition at line 50 of file print.c.

◆ file_ms_alloc()

file_protected struct magic_set * file_ms_alloc ( int flags)

Definition at line 549 of file apprentice.c.

◆ file_ms_free()

file_protected void file_ms_free ( struct magic_set * ms)

Definition at line 526 of file apprentice.c.

◆ file_oomem()

file_protected void file_oomem ( struct magic_set * ms,
size_t len )

Definition at line 230 of file funcs.c.

◆ file_parse_guid()

file_protected int file_parse_guid ( const char * s,
uint64_t * guid )

Definition at line 769 of file funcs.c.

◆ file_pipe2file()

file_protected int file_pipe2file ( struct magic_set * ,
int ,
const void * ,
size_t  )

◆ file_pipe_closexec()

file_protected int file_pipe_closexec ( int * )

◆ file_pop_buffer()

file_protected char * file_pop_buffer ( struct magic_set * ms,
file_pushbuf_t * pb )

Definition at line 714 of file funcs.c.

◆ file_print_guid()

file_protected int file_print_guid ( char * str,
size_t len,
const uint64_t * guid )

Definition at line 794 of file funcs.c.

◆ file_printable()

file_protected char * file_printable ( struct magic_set * ms,
char * buf,
size_t bufsiz,
const char * str,
size_t slen )

Definition at line 738 of file funcs.c.

◆ file_printedlen()

file_protected size_t file_printedlen ( const struct magic_set * ms)

Definition at line 649 of file funcs.c.

◆ file_printf()

file_protected int file_printf ( struct magic_set * ,
const char * ,
... )

◆ file_pstring_get_length()

file_protected size_t file_pstring_get_length ( struct magic_set * ms,
const struct magic * m,
const char * ss )

Definition at line 3598 of file apprentice.c.

◆ file_pstring_length_size()

file_protected size_t file_pstring_length_size ( struct magic_set * ms,
const struct magic * m )

Definition at line 3579 of file apprentice.c.

◆ file_push_buffer()

file_protected file_pushbuf_t * file_push_buffer ( struct magic_set * ms)

Definition at line 692 of file funcs.c.

◆ file_replace()

file_protected int file_replace ( struct magic_set * ms,
const char * pat,
const char * rep )

Definition at line 655 of file funcs.c.

◆ file_reset()

file_protected int file_protected int file_reset ( struct magic_set * ms,
int checkloaded )

Definition at line 523 of file funcs.c.

◆ file_separator()

file_protected int file_protected int file_separator ( struct magic_set * ms)

Definition at line 252 of file funcs.c.

◆ file_showstr()

file_protected void file_showstr ( FILE * fp,
const char * s,
size_t len )

Definition at line 3119 of file apprentice.c.

◆ file_signextend()

file_protected uint64_t file_signextend ( struct magic_set * ms,
struct magic * m,
uint64_t v )

Definition at line 1578 of file apprentice.c.

◆ file_softmagic()

file_protected int file_softmagic ( struct magic_set * ms,
const struct buffer * b,
uint16_t * indir_count,
uint16_t * name_count,
int mode,
int text )

Definition at line 119 of file softmagic.c.

◆ file_strtrim()

file_protected char * file_strtrim ( char * str)

Definition at line 844 of file funcs.c.

◆ file_trycdf()

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

Definition at line 530 of file readcdf.c.

◆ file_tryelf()

file_protected int file_tryelf ( struct magic_set * ,
const struct buffer *  )

◆ file_varint2uintmax_t()

file_protected uintmax_t file_varint2uintmax_t ( const unsigned char * us,
int t,
size_t * l )

Definition at line 3529 of file apprentice.c.

◆ file_vprintf()

file_protected int file_vprintf ( struct magic_set * ,
const char * ,
va_list  )

◆ getdelim()

ssize_t getdelim ( char ** ,
size_t * ,
int ,
FILE *  )

◆ getline()

ssize_t getline ( char ** ,
size_t * ,
FILE *  )

◆ sread()

file_protected ssize_t sread ( int ,
void * ,
size_t ,
int  )

◆ strcasestr()

char * strcasestr ( const char * s,
const char * find )

Definition at line 67 of file strcasestr.c.

◆ strlcat()

size_t strlcat ( char * ,
const char * ,
size_t  )

◆ strlcpy()

size_t strlcpy ( char * ,
const char * ,
size_t  )

Variable Documentation

◆ file_names

const char* file_names[]
extern

Definition at line 114 of file apprentice.c.

◆ file_nnames

const size_t file_nnames
extern

Definition at line 115 of file apprentice.c.