sdk-world v2026.11.05
PS2 SDK - world tier (copyleft-allowed, non-essential packages)
Loading...
Searching...
No Matches
ftmemory.h File Reference
#include <ft2build.h>
#include <freetype/fttypes.h>
#include "compiler-macros.h"

Go to the source code of this file.

Macros

#define FT_SET_ERROR(expression)
#define FT_OFFSET(base, count)
#define FT_ASSIGNP(p, val)
#define FT_DEBUG_INNER(exp)
#define FT_ASSIGNP_INNER(p, exp)
#define FT_MEM_ALLOC(ptr, size)
#define FT_MEM_FREE(ptr)
#define FT_MEM_NEW(ptr)
#define FT_MEM_REALLOC(ptr, cursz, newsz)
#define FT_MEM_QALLOC(ptr, size)
#define FT_MEM_QNEW(ptr)
#define FT_MEM_QREALLOC(ptr, cursz, newsz)
#define FT_MEM_ALLOC_MULT(ptr, count, item_size)
#define FT_MEM_REALLOC_MULT(ptr, oldcnt, newcnt, itmsz)
#define FT_MEM_QALLOC_MULT(ptr, count, item_size)
#define FT_MEM_QREALLOC_MULT(ptr, oldcnt, newcnt, itmsz)
#define FT_MEM_SET_ERROR(cond)
#define FT_MEM_SET(dest, byte, count)
#define FT_MEM_COPY(dest, source, count)
#define FT_MEM_MOVE(dest, source, count)
#define FT_MEM_ZERO(dest, count)
#define FT_ZERO(p)
#define FT_ARRAY_ZERO(dest, count)
#define FT_ARRAY_COPY(dest, source, count)
#define FT_ARRAY_MOVE(dest, source, count)
#define FT_ARRAY_MAX(ptr)
#define FT_ARRAY_CHECK(ptr, count)
#define FT_MEM_NEW_ARRAY(ptr, count)
#define FT_MEM_RENEW_ARRAY(ptr, cursz, newsz)
#define FT_MEM_QNEW_ARRAY(ptr, count)
#define FT_MEM_QRENEW_ARRAY(ptr, cursz, newsz)
#define FT_ALLOC(ptr, size)
#define FT_REALLOC(ptr, cursz, newsz)
#define FT_ALLOC_MULT(ptr, count, item_size)
#define FT_REALLOC_MULT(ptr, oldcnt, newcnt, itmsz)
#define FT_QALLOC(ptr, size)
#define FT_QREALLOC(ptr, cursz, newsz)
#define FT_QALLOC_MULT(ptr, count, item_size)
#define FT_QREALLOC_MULT(ptr, oldcnt, newcnt, itmsz)
#define FT_FREE(ptr)
#define FT_NEW(ptr)
#define FT_NEW_ARRAY(ptr, count)
#define FT_RENEW_ARRAY(ptr, curcnt, newcnt)
#define FT_QNEW(ptr)
#define FT_QNEW_ARRAY(ptr, count)
#define FT_QRENEW_ARRAY(ptr, curcnt, newcnt)
#define FT_MEM_STRDUP(dst, str)
#define FT_STRDUP(dst, str)
#define FT_MEM_DUP(dst, address, size)
#define FT_DUP(dst, address, size)
#define FT_STRCPYN(dst, src, size)

Functions

 ft_mem_alloc (FT_Memory memory, FT_Long size, FT_Error *p_error)
 ft_mem_qalloc (FT_Memory memory, FT_Long size, FT_Error *p_error)
 ft_mem_realloc (FT_Memory memory, FT_Long item_size, FT_Long cur_count, FT_Long new_count, void *block, FT_Error *p_error)
 ft_mem_qrealloc (FT_Memory memory, FT_Long item_size, FT_Long cur_count, FT_Long new_count, void *block, FT_Error *p_error)
 ft_mem_free (FT_Memory memory, const void *P)
 ft_mem_strdup (FT_Memory memory, const char *str, FT_Error *p_error)
 ft_mem_dup (FT_Memory memory, const void *address, FT_ULong size, FT_Error *p_error)
 ft_mem_strcpyn (char *dst, const char *src, FT_ULong size)

Macro Definition Documentation

◆ FT_ALLOC

#define FT_ALLOC ( ptr,
size )
Value:
FT_MEM_SET_ERROR( FT_MEM_ALLOC( ptr, size ) )

Definition at line 315 of file ftmemory.h.

◆ FT_ALLOC_MULT

#define FT_ALLOC_MULT ( ptr,
count,
item_size )
Value:
FT_MEM_SET_ERROR( FT_MEM_ALLOC_MULT( ptr, count, item_size ) )

Definition at line 321 of file ftmemory.h.

◆ FT_ARRAY_CHECK

#define FT_ARRAY_CHECK ( ptr,
count )
Value:
( (count) <= FT_ARRAY_MAX( ptr ) )

Definition at line 274 of file ftmemory.h.

◆ FT_ARRAY_COPY

#define FT_ARRAY_COPY ( dest,
source,
count )
Value:
FT_MEM_COPY( dest, \
source, \
(FT_Offset)(count) * sizeof ( *(dest) ) )

Definition at line 257 of file ftmemory.h.

◆ FT_ARRAY_MAX

#define FT_ARRAY_MAX ( ptr)
Value:
( FT_INT_MAX / sizeof ( *(ptr) ) )

Definition at line 272 of file ftmemory.h.

◆ FT_ARRAY_MOVE

#define FT_ARRAY_MOVE ( dest,
source,
count )
Value:
FT_MEM_MOVE( dest, \
source, \
(FT_Offset)(count) * sizeof ( *(dest) ) )

Definition at line 262 of file ftmemory.h.

◆ FT_ARRAY_ZERO

#define FT_ARRAY_ZERO ( dest,
count )
Value:
FT_MEM_ZERO( dest, \
(FT_Offset)(count) * sizeof ( *(dest) ) )

Definition at line 253 of file ftmemory.h.

◆ FT_ASSIGNP

#define FT_ASSIGNP ( p,
val )
Value:
(p) = (val)

Definition at line 95 of file ftmemory.h.

◆ FT_ASSIGNP_INNER

#define FT_ASSIGNP_INNER ( p,
exp )
Value:
FT_ASSIGNP( p, exp )

Definition at line 117 of file ftmemory.h.

◆ FT_DEBUG_INNER

#define FT_DEBUG_INNER ( exp)
Value:
(exp)

Definition at line 116 of file ftmemory.h.

◆ FT_DUP

#define FT_DUP ( dst,
address,
size )
Value:
FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )

Definition at line 384 of file ftmemory.h.

◆ FT_FREE

#define FT_FREE ( ptr)
Value:
FT_MEM_FREE( ptr )

Definition at line 341 of file ftmemory.h.

◆ FT_MEM_ALLOC

#define FT_MEM_ALLOC ( ptr,
size )
Value:
FT_ASSIGNP_INNER( ptr, ft_mem_alloc( memory, \
(FT_Long)(size), \
&error ) )

Definition at line 164 of file ftmemory.h.

◆ FT_MEM_ALLOC_MULT

#define FT_MEM_ALLOC_MULT ( ptr,
count,
item_size )
Value:
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
(FT_Long)(item_size), \
0, \
(FT_Long)(count), \
NULL, \
&error ) )

Definition at line 202 of file ftmemory.h.

◆ FT_MEM_COPY

#define FT_MEM_COPY ( dest,
source,
count )
Value:
ft_memcpy( dest, source, (FT_Offset)(count) )

Definition at line 241 of file ftmemory.h.

◆ FT_MEM_DUP

#define FT_MEM_DUP ( dst,
address,
size )
Value:
FT_ASSIGNP_INNER( dst, ft_mem_dup( memory, \
(address), \
(FT_ULong)(size), \
&error ) )

Definition at line 378 of file ftmemory.h.

◆ FT_MEM_FREE

#define FT_MEM_FREE ( ptr)
Value:
FT_BEGIN_STMNT \
FT_DEBUG_INNER( ft_mem_free( memory, (ptr) ) ); \
(ptr) = NULL; \
FT_END_STMNT

Definition at line 169 of file ftmemory.h.

◆ FT_MEM_MOVE

#define FT_MEM_MOVE ( dest,
source,
count )
Value:
ft_memmove( dest, source, (FT_Offset)(count) )

Definition at line 244 of file ftmemory.h.

◆ FT_MEM_NEW

#define FT_MEM_NEW ( ptr)
Value:
FT_MEM_ALLOC( ptr, sizeof ( *(ptr) ) )

Definition at line 175 of file ftmemory.h.

◆ FT_MEM_NEW_ARRAY

#define FT_MEM_NEW_ARRAY ( ptr,
count )
Value:
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
sizeof ( *(ptr) ), \
0, \
(FT_Long)(count), \
NULL, \
&error ) )

Definition at line 283 of file ftmemory.h.

◆ FT_MEM_QALLOC

#define FT_MEM_QALLOC ( ptr,
size )
Value:
FT_ASSIGNP_INNER( ptr, ft_mem_qalloc( memory, \
(FT_Long)(size), \
&error ) )

Definition at line 186 of file ftmemory.h.

◆ FT_MEM_QALLOC_MULT

#define FT_MEM_QALLOC_MULT ( ptr,
count,
item_size )
Value:
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
(FT_Long)(item_size), \
0, \
(FT_Long)(count), \
NULL, \
&error ) )

Definition at line 218 of file ftmemory.h.

◆ FT_MEM_QNEW

#define FT_MEM_QNEW ( ptr)
Value:
FT_MEM_QALLOC( ptr, sizeof ( *(ptr) ) )

Definition at line 191 of file ftmemory.h.

◆ FT_MEM_QNEW_ARRAY

#define FT_MEM_QNEW_ARRAY ( ptr,
count )
Value:
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
sizeof ( *(ptr) ), \
0, \
(FT_Long)(count), \
NULL, \
&error ) )

Definition at line 299 of file ftmemory.h.

◆ FT_MEM_QREALLOC

#define FT_MEM_QREALLOC ( ptr,
cursz,
newsz )
Value:
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
1, \
(FT_Long)(cursz), \
(FT_Long)(newsz), \
(ptr), \
&error ) )

Definition at line 194 of file ftmemory.h.

◆ FT_MEM_QREALLOC_MULT

#define FT_MEM_QREALLOC_MULT ( ptr,
oldcnt,
newcnt,
itmsz )
Value:
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
(FT_Long)(itmsz), \
(FT_Long)(oldcnt), \
(FT_Long)(newcnt), \
(ptr), \
&error ) )

Definition at line 226 of file ftmemory.h.

◆ FT_MEM_QRENEW_ARRAY

#define FT_MEM_QRENEW_ARRAY ( ptr,
cursz,
newsz )
Value:
FT_ASSIGNP_INNER( ptr, ft_mem_qrealloc( memory, \
sizeof ( *(ptr) ), \
(FT_Long)(cursz), \
(FT_Long)(newsz), \
(ptr), \
&error ) )

Definition at line 307 of file ftmemory.h.

◆ FT_MEM_REALLOC

#define FT_MEM_REALLOC ( ptr,
cursz,
newsz )
Value:
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
1, \
(FT_Long)(cursz), \
(FT_Long)(newsz), \
(ptr), \
&error ) )

Definition at line 178 of file ftmemory.h.

◆ FT_MEM_REALLOC_MULT

#define FT_MEM_REALLOC_MULT ( ptr,
oldcnt,
newcnt,
itmsz )
Value:
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
(FT_Long)(itmsz), \
(FT_Long)(oldcnt), \
(FT_Long)(newcnt), \
(ptr), \
&error ) )

Definition at line 210 of file ftmemory.h.

◆ FT_MEM_RENEW_ARRAY

#define FT_MEM_RENEW_ARRAY ( ptr,
cursz,
newsz )
Value:
FT_ASSIGNP_INNER( ptr, ft_mem_realloc( memory, \
sizeof ( *(ptr) ), \
(FT_Long)(cursz), \
(FT_Long)(newsz), \
(ptr), \
&error ) )

Definition at line 291 of file ftmemory.h.

◆ FT_MEM_SET

#define FT_MEM_SET ( dest,
byte,
count )
Value:
ft_memset( dest, byte, (FT_Offset)(count) )

Definition at line 238 of file ftmemory.h.

◆ FT_MEM_SET_ERROR

#define FT_MEM_SET_ERROR ( cond)
Value:
( (cond), error != 0 )

Definition at line 235 of file ftmemory.h.

◆ FT_MEM_STRDUP

#define FT_MEM_STRDUP ( dst,
str )
Value:
(dst) = (char*)ft_mem_strdup( memory, (const char*)(str), &error )

Definition at line 372 of file ftmemory.h.

◆ FT_MEM_ZERO

#define FT_MEM_ZERO ( dest,
count )
Value:
FT_MEM_SET( dest, 0, count )

Definition at line 248 of file ftmemory.h.

◆ FT_NEW

#define FT_NEW ( ptr)
Value:
FT_MEM_SET_ERROR( FT_MEM_NEW( ptr ) )

Definition at line 343 of file ftmemory.h.

◆ FT_NEW_ARRAY

#define FT_NEW_ARRAY ( ptr,
count )
Value:
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )

Definition at line 345 of file ftmemory.h.

◆ FT_OFFSET

#define FT_OFFSET ( base,
count )
Value:
( (base) ? (base) + (count) : NULL )

Definition at line 70 of file ftmemory.h.

◆ FT_QALLOC

#define FT_QALLOC ( ptr,
size )
Value:
FT_MEM_SET_ERROR( FT_MEM_QALLOC( ptr, size ) )

Definition at line 328 of file ftmemory.h.

◆ FT_QALLOC_MULT

#define FT_QALLOC_MULT ( ptr,
count,
item_size )
Value:
FT_MEM_SET_ERROR( FT_MEM_QALLOC_MULT( ptr, count, item_size ) )

Definition at line 334 of file ftmemory.h.

◆ FT_QNEW

#define FT_QNEW ( ptr)
Value:
FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )

Definition at line 351 of file ftmemory.h.

◆ FT_QNEW_ARRAY

#define FT_QNEW_ARRAY ( ptr,
count )
Value:
FT_MEM_SET_ERROR( FT_MEM_QNEW_ARRAY( ptr, count ) )

Definition at line 353 of file ftmemory.h.

◆ FT_QREALLOC

#define FT_QREALLOC ( ptr,
cursz,
newsz )
Value:
FT_MEM_SET_ERROR( FT_MEM_QREALLOC( ptr, cursz, newsz ) )

Definition at line 331 of file ftmemory.h.

◆ FT_QREALLOC_MULT

#define FT_QREALLOC_MULT ( ptr,
oldcnt,
newcnt,
itmsz )
Value:
FT_MEM_SET_ERROR( FT_MEM_QREALLOC_MULT( ptr, oldcnt, \
newcnt, itmsz ) )

Definition at line 337 of file ftmemory.h.

◆ FT_QRENEW_ARRAY

#define FT_QRENEW_ARRAY ( ptr,
curcnt,
newcnt )
Value:
FT_MEM_SET_ERROR( FT_MEM_QRENEW_ARRAY( ptr, curcnt, newcnt ) )

Definition at line 356 of file ftmemory.h.

◆ FT_REALLOC

#define FT_REALLOC ( ptr,
cursz,
newsz )
Value:
FT_MEM_SET_ERROR( FT_MEM_REALLOC( ptr, cursz, newsz ) )

Definition at line 318 of file ftmemory.h.

◆ FT_REALLOC_MULT

#define FT_REALLOC_MULT ( ptr,
oldcnt,
newcnt,
itmsz )
Value:
FT_MEM_SET_ERROR( FT_MEM_REALLOC_MULT( ptr, oldcnt, \
newcnt, itmsz ) )

Definition at line 324 of file ftmemory.h.

◆ FT_RENEW_ARRAY

#define FT_RENEW_ARRAY ( ptr,
curcnt,
newcnt )
Value:
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )

Definition at line 348 of file ftmemory.h.

◆ FT_SET_ERROR

#define FT_SET_ERROR ( expression)
Value:
( ( error = (expression) ) != 0 )

Definition at line 47 of file ftmemory.h.

◆ FT_STRCPYN

#define FT_STRCPYN ( dst,
src,
size )
Value:
ft_mem_strcpyn( (char*)dst, (const char*)(src), (FT_ULong)(size) )

Definition at line 396 of file ftmemory.h.

◆ FT_STRDUP

#define FT_STRDUP ( dst,
str )
Value:
FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )

Definition at line 375 of file ftmemory.h.

◆ FT_ZERO

#define FT_ZERO ( p)
Value:
FT_MEM_ZERO( p, sizeof ( *(p) ) )

Definition at line 250 of file ftmemory.h.

Function Documentation

◆ ft_mem_alloc()

ft_mem_alloc ( FT_Memory memory,
FT_Long size,
FT_Error * p_error )

Definition at line 49 of file ftutil.c.

◆ ft_mem_dup()

ft_mem_dup ( FT_Memory memory,
const void * address,
FT_ULong size,
FT_Error * p_error )

Definition at line 178 of file ftutil.c.

◆ ft_mem_free()

ft_mem_free ( FT_Memory memory,
const void * P )

Definition at line 169 of file ftutil.c.

◆ ft_mem_qalloc()

ft_mem_qalloc ( FT_Memory memory,
FT_Long size,
FT_Error * p_error )

Definition at line 65 of file ftutil.c.

◆ ft_mem_qrealloc()

ft_mem_qrealloc ( FT_Memory memory,
FT_Long item_size,
FT_Long cur_count,
FT_Long new_count,
void * block,
FT_Error * p_error )

Definition at line 113 of file ftutil.c.

◆ ft_mem_realloc()

ft_mem_realloc ( FT_Memory memory,
FT_Long item_size,
FT_Long cur_count,
FT_Long new_count,
void * block,
FT_Error * p_error )

Definition at line 91 of file ftutil.c.

◆ ft_mem_strcpyn()

ft_mem_strcpyn ( char * dst,
const char * src,
FT_ULong size )

Definition at line 209 of file ftutil.c.

◆ ft_mem_strdup()

ft_mem_strdup ( FT_Memory memory,
const char * str,
FT_Error * p_error )

Definition at line 196 of file ftutil.c.