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

Go to the source code of this file.

Data Structures

struct  guid
 

Macros

#define SIZE_MAX   ((size_t)~0)
 
#define FILE_SEPARATOR   "\n- "
 
#define OCTALIFY(n, o)
 

Functions

file_protected char * file_copystr (char *buf, size_t blen, size_t width, const char *str)
 
file_private void file_clearbuf (struct magic_set *ms)
 
file_private int file_checkfield (char *msg, size_t mlen, const char *what, const char **pp)
 
file_protected int file_checkfmt (char *msg, size_t mlen, const char *fmt)
 
file_protected int file_vprintf (struct magic_set *ms, const char *fmt, va_list ap)
 
file_protected int file_printf (struct magic_set *ms, const char *fmt,...)
 
 __attribute__ ((__format__(__printf__, 3, 0)))
 
file_protected void file_error (struct magic_set *ms, int error, const char *f,...)
 
file_protected void file_magerror (struct magic_set *ms, const char *f,...)
 
file_protected void file_oomem (struct magic_set *ms, size_t len)
 
file_protected void file_badseek (struct magic_set *ms)
 
file_protected void file_badread (struct magic_set *ms)
 
file_protected int file_separator (struct magic_set *ms)
 
file_protected int file_default (struct magic_set *ms, size_t nb)
 
file_protected int file_buffer (struct magic_set *ms, php_stream *stream, zend_stat_t *st, const char *inname __attribute__((__unused__)), const void *buf, size_t nb)
 
file_protected int file_reset (struct magic_set *ms, int checkloaded)
 
file_protected const char * file_getbuffer (struct magic_set *ms)
 
file_protected int file_check_mem (struct magic_set *ms, unsigned int level)
 
file_protected size_t file_printedlen (const struct magic_set *ms)
 
file_protected int file_replace (struct magic_set *ms, const char *pat, const char *rep)
 
file_protected file_pushbuf_tfile_push_buffer (struct magic_set *ms)
 
file_protected char * file_pop_buffer (struct magic_set *ms, file_pushbuf_t *pb)
 
file_protected char * file_printable (struct magic_set *ms, char *buf, size_t bufsiz, const char *str, size_t slen)
 
file_protected int file_parse_guid (const char *s, uint64_t *guid)
 
file_protected int file_print_guid (char *str, size_t len, const uint64_t *guid)
 
file_protected int file_clear_closexec (int fd)
 
file_protected char * file_strtrim (char *str)
 

Macro Definition Documentation

◆ FILE_SEPARATOR

#define FILE_SEPARATOR   "\n- "

Definition at line 249 of file funcs.c.

◆ OCTALIFY

#define OCTALIFY ( n,
o )
Value:
/*LINTED*/ \
(void)(*(n)++ = '\\', \
*(n)++ = ((CAST(uint32_t, *(o)) >> 6) & 3) + '0', \
*(n)++ = ((CAST(uint32_t, *(o)) >> 3) & 7) + '0', \
*(n)++ = ((CAST(uint32_t, *(o)) >> 0) & 7) + '0', \
(o)++)
zend_long n
Definition ffi.c:4979
#define CAST(T, b)
Definition file.h:425
ZEND_API void(ZEND_FASTCALL *zend_touch_vm_stack_data)(void *vm_stack_data)

Definition at line 539 of file funcs.c.

◆ SIZE_MAX

#define SIZE_MAX   ((size_t)~0)

Definition at line 51 of file funcs.c.

Function Documentation

◆ __attribute__()

__attribute__ ( (__format__(__printf__, 3, 0)) )

Definition at line 185 of file funcs.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 * ms,
php_stream * stream,
zend_stat_t * st,
const char *inname __attribute__(__unused__),
const void * buf,
size_t nb )

Definition at line 317 of file funcs.c.

◆ 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_checkfield()

file_private int file_checkfield ( char * msg,
size_t mlen,
const char * what,
const char ** pp )

Definition at line 75 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_clearbuf()

file_private void file_clearbuf ( struct magic_set * ms)

Definition at line 67 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_default()

file_protected int file_default ( struct magic_set * ms,
size_t nb )

Definition at line 287 of file funcs.c.

◆ file_error()

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

Definition at line 208 of file funcs.c.

◆ file_getbuffer()

file_protected const char * file_getbuffer ( struct magic_set * ms)

Definition at line 548 of file funcs.c.

◆ file_magerror()

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

Definition at line 221 of file funcs.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_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 * ms,
const char * fmt,
... )

Definition at line 170 of file funcs.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_reset ( struct magic_set * ms,
int checkloaded )

Definition at line 523 of file funcs.c.

◆ file_separator()

file_protected int file_separator ( struct magic_set * ms)

Definition at line 252 of file funcs.c.

◆ file_strtrim()

file_protected char * file_strtrim ( char * str)

Definition at line 844 of file funcs.c.

◆ file_vprintf()

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

Definition at line 133 of file funcs.c.