1 /* 2 * GPAC - Multimedia Framework C SDK 3 * 4 * Authors: Jean Le Feuvre 5 * Copyright (c) Telecom ParisTech 2000-2019 6 * All rights reserved 7 * 8 * This file is part of GPAC / general OS configuration file 9 * 10 * GPAC is free software; you can redistribute it and/or modify 11 * it under the terms of the GNU Lesser General Public License as published by 12 * the Free Software Foundation; either version 2, or (at your option) 13 * any later version. 14 * 15 * GPAC is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License for more details. 19 * 20 * You should have received a copy of the GNU Lesser General Public 21 * License along with this library; see the file COPYING. If not, write to 22 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 23 * 24 */ 25 26 #ifndef _GF_SETUP_H_ 27 #define _GF_SETUP_H_ 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 33 34 /*! 35 \file "gpac/setup.h" 36 \brief Base data types of GPAC. 37 38 This file contains the base data types of GPAC, depending on the platform. 39 40 41 */ 42 43 44 /*! 45 \addtogroup setup_grp 46 \brief Base data types of GPAC. 47 48 This section documents the base data types of GPAC, as well as some macros wrapping platform-specific functionalities. 49 For better portability, only use the base data types defined here. 50 51 @{ 52 */ 53 54 /*This is to handle cases where config.h is generated at the root of the gpac build tree (./configure) 55 This is only needed when building libgpac and modules when libgpac is not installed*/ 56 #ifdef GPAC_HAVE_CONFIG_H 57 # include "config.h" 58 #else 59 # include <gpac/configuration.h> 60 #endif 61 62 63 /*WIN32 and WinCE config*/ 64 #if defined(WIN32) || defined(_WIN32_WCE) 65 66 /*common win32 parts*/ 67 #include <stdio.h> 68 #include <stdlib.h> 69 #include <stddef.h> 70 71 #if defined(_WIN64) && !defined(GPAC_64_BITS) 72 /*! macro defined for 64-bits platforms*/ 73 #define GPAC_64_BITS 74 #endif 75 76 /*! 64 bit unsigned integer*/ 77 typedef unsigned __int64 u64; 78 /*! 64 bit signed integer*/ 79 typedef __int64 s64; 80 /*! 32 bit unsigned integer*/ 81 typedef unsigned int u32; 82 /*! 32 bit signed integer*/ 83 typedef int s32; 84 /*! 16 bit unsigned integer*/ 85 typedef unsigned short u16; 86 /*! 16 bit signed integer*/ 87 typedef short s16; 88 /*! 8 bit unsigned integer*/ 89 typedef unsigned char u8; 90 /*! 8 bit signed integer*/ 91 typedef char s8; 92 93 #if defined(__GNUC__) 94 /*! macro for cross-platform inlining of functions*/ 95 #define GFINLINE inline 96 #else 97 /*! macro for cross-platform inlining of functions*/ 98 #define GFINLINE __inline 99 #endif 100 101 /*! default path separator of the current platform*/ 102 #define GF_PATH_SEPARATOR '\\' 103 /*! default max filesystem path size of the current platform*/ 104 #define GF_MAX_PATH 1024 105 106 /*WINCE config*/ 107 #if defined(_WIN32_WCE) 108 109 /*win32 assert*/ 110 #ifndef assert 111 void CE_Assert(u32 valid, char *file, u32 line); 112 #ifndef NDEBUG 113 #define assert( t ) CE_Assert((unsigned int) (t), __FILE__, __LINE__ ) 114 #else 115 #define assert(t) 116 #endif 117 118 #endif 119 120 121 /*performs wide->char and char->wide conversion on a buffer GF_MAX_PATH long*/ 122 void CE_WideToChar(unsigned short *w_str, char *str); 123 void CE_CharToWide(char *str, unsigned short *w_str); 124 125 126 #define strdup _strdup 127 #define stricmp _stricmp 128 #define strnicmp _strnicmp 129 #define strupr _strupr 130 #define mkdir _mkdir 131 #define snprintf _snprintf 132 #define memccpy _memccpy 133 134 135 #ifndef _PTRDIFF_T_DEFINED 136 typedef int ptrdiff_t; 137 #define PTRDIFF(p1, p2, type) ((p1) - (p2)) 138 #define _PTRDIFF_T_DEFINED 139 #endif 140 141 #ifndef _SIZE_T_DEFINED 142 typedef unsigned int size_t; 143 #define _SIZE_T_DEFINED 144 #endif 145 146 #ifndef offsetof 147 #define offsetof(s,m) ((size_t)&(((s*)0)->m)) 148 #endif 149 150 #ifndef getenv 151 #define getenv(a) 0L 152 #endif 153 154 #define strupr _strupr 155 #define strlwr _strlwr 156 157 /* 158 #define GPAC_DISABLE_LOG 159 */ 160 #else /*END WINCE*/ 161 162 /*WIN32 not-WinCE*/ 163 #include <ctype.h> 164 #include <string.h> 165 #include <float.h> 166 #include <limits.h> 167 #include <stdarg.h> 168 #include <assert.h> 169 170 #define snprintf _snprintf 171 172 #endif /*END WIN32 non win-ce*/ 173 /*end WIN32 config*/ 174 175 /*start SYMBIAN config*/ 176 #elif defined(__SYMBIAN32__) 177 178 /*! macro for cross-platform inlining of functions*/ 179 #define GFINLINE inline 180 /*! default path separator of the current platform*/ 181 #define GF_PATH_SEPARATOR '\\' 182 183 /*we must explicitely export our functions...*/ 184 185 /*! macro for cross-platform signaling of exported function of libgpac*/ 186 #define GF_EXPORT EXPORT_C 187 188 #include <stdio.h> 189 #include <stdlib.h> 190 #include <stddef.h> 191 #include <stdarg.h> 192 #include <limits.h> 193 #include <ctype.h> 194 #include <string.h> 195 #include <assert.h> 196 197 #ifdef __SERIES60_3X__ 198 199 /*! 64 bit unsigned integer*/ 200 typedef unsigned __int64 u64; 201 /*! 64 bit signed integer*/ 202 typedef __int64 s64; 203 204 #else 205 206 /*FIXME - we don't have 64bit support here we should get rid of all 64bits divisions*/ 207 /* 208 typedef unsigned long long u64; 209 typedef long long s64; 210 */ 211 212 /*! 64 bit unsigned integer*/ 213 typedef unsigned int u64; 214 /*! 64 bit signed integer*/ 215 typedef signed int s64; 216 217 #endif /*symbian 8*/ 218 219 220 /*! 32 bit unsigned integer*/ 221 typedef unsigned int u32; 222 /*! 32 bit signed integer*/ 223 typedef int s32; 224 /*! 16 bit unsigned integer*/ 225 typedef unsigned short u16; 226 /*! 16 bit signed integer*/ 227 typedef short s16; 228 /*! 8 bit unsigned integer*/ 229 typedef unsigned char u8; 230 /*! 8 bit signed integer*/ 231 typedef signed char s8; 232 233 #pragma mpwc_relax on 234 235 /*! default max filesystem path size of the current platform*/ 236 #define GF_MAX_PATH 260 237 238 /*sorry this was developed under w32 :)*/ 239 #define stricmp strcasecmp 240 #define strnicmp strncasecmp 241 242 #ifndef strupr 243 char * my_str_upr(char *str); 244 #define strupr my_str_upr 245 #endif 246 247 #ifndef strlwr 248 char * my_str_lwr(char *str); 249 #define strlwr my_str_lwr 250 #endif 251 252 #ifndef DBL_MAX 253 #include <libc/ieeefp.h> 254 #define DBL_MAX (__IEEE_DBL_MAXPOWTWO) 255 #endif 256 257 #ifndef FLT_MAX 258 #include <libc/ieeefp.h> 259 #define FLT_MAX (__IEEE_FLT_MAXPOWTWO) 260 #endif 261 262 #ifndef FLT_EPSILON 263 #define FLT_EPSILON 1 264 #endif 265 266 /*end SYMBIAN config*/ 267 268 #else 269 270 /*UNIX likes*/ 271 272 /*! max file offset bits*/ 273 #ifndef _FILE_OFFSET_BITS 274 #define _FILE_OFFSET_BITS 64 275 #endif 276 /*! largefile*/ 277 #ifndef _LARGEFILE_SOURCE 278 #define _LARGEFILE_SOURCE 279 #endif 280 /*! largefile64*/ 281 #ifndef _LARGEFILE64_SOURCE 282 #define _LARGEFILE64_SOURCE 283 #endif 284 285 #include <stdio.h> 286 #include <stdint.h> 287 #include <stdlib.h> 288 #include <stddef.h> 289 #include <stdarg.h> 290 #include <limits.h> 291 #include <float.h> 292 #include <ctype.h> 293 #include <string.h> 294 #include <assert.h> 295 296 #if __APPLE__ && defined GPAC_CONFIG_IOS 297 #include <TargetConditionals.h> 298 #endif 299 300 /*! 64 bit unsigned integer*/ 301 typedef uint64_t u64; 302 /*! 64 bit signed integer*/ 303 typedef int64_t s64; 304 /*! 32 bit unsigned integer*/ 305 typedef uint32_t u32; 306 /*! 32 bit signed integer*/ 307 typedef int32_t s32; 308 /*! 16 bit unsigned integer*/ 309 typedef uint16_t u16; 310 /*! 16 bit signed integer*/ 311 typedef int16_t s16; 312 /*! 8 bit unsigned integer*/ 313 typedef uint8_t u8; 314 /*! 8 bit signed integer*/ 315 typedef int8_t s8; 316 317 /*! macro for cross-platform inlining of functions*/ 318 #define GFINLINE inline 319 320 /*! use stricmp */ 321 #define stricmp strcasecmp 322 /*! use strnicmp */ 323 #define strnicmp strncasecmp 324 325 #ifndef strupr 326 /*! gets upper case 327 \param str input string 328 \return uper case to free*/ 329 char *my_str_upr(char *str); 330 /*! use strupr */ 331 #define strupr my_str_upr 332 #endif 333 334 #ifndef strlwr 335 /*! gets lower case 336 \param str input string 337 \return lower case to free*/ 338 char * my_str_lwr(char *str); 339 /*! use strulwr */ 340 #define strlwr my_str_lwr 341 #endif 342 343 /*! default path separator of the current platform*/ 344 #define GF_PATH_SEPARATOR '/' 345 346 #ifdef PATH_MAX 347 /*! default max filesystem path size of the current platform*/ 348 #define GF_MAX_PATH PATH_MAX 349 #else 350 /*! default max filesystem path size of the current platform*/ 351 #define GF_MAX_PATH 1023 352 #endif 353 354 355 #endif /* end platform specific Win32/WinCE/UNIX*/ 356 357 358 //! @cond Doxygen_Suppress 359 360 /*define what's missing*/ 361 362 #ifndef NULL 363 #define NULL 0 364 #endif 365 366 //! @endcond 367 368 369 /*! Double-precision floating point number*/ 370 typedef double Double; 371 /*! Single-precision floating point number*/ 372 typedef float Float; 373 /*! 128 bit IDs */ 374 typedef u8 bin128[16]; 375 /*! max positive possible value for Double*/ 376 #define GF_MAX_DOUBLE DBL_MAX 377 /*! max negative possible value for Double*/ 378 #define GF_MIN_DOUBLE -GF_MAX_DOUBLE 379 /*! max positive possible value for Float*/ 380 #define GF_MAX_FLOAT FLT_MAX 381 /*! max negative possible value for Float*/ 382 #define GF_MIN_FLOAT -GF_MAX_FLOAT 383 /*! smallest possible value for float*/ 384 #define GF_EPSILON_FLOAT FLT_EPSILON 385 /*! max possible value for s16*/ 386 #define GF_SHORT_MAX SHRT_MAX 387 /*! min possible value for s16*/ 388 #define GF_SHORT_MIN SHRT_MIN 389 /*! max possible value for u32*/ 390 #define GF_UINT_MAX UINT_MAX 391 /*! max possible value for s32*/ 392 #define GF_INT_MAX INT_MAX 393 /*! min possible value for s32*/ 394 #define GF_INT_MIN INT_MIN 395 396 #ifndef MIN 397 /*! get the smallest of two numbers*/ 398 #define MIN(X, Y) ((X)<(Y)?(X):(Y)) 399 #endif 400 #ifndef MAX 401 /*! get the biggest of two numbers*/ 402 #define MAX(X, Y) ((X)>(Y)?(X):(Y)) 403 #endif 404 405 /*! get the absolute difference betwee two numbers*/ 406 #define ABSDIFF(a, b) ( ( (a) > (b) ) ? ((a) - (b)) : ((b) - (a)) ) 407 408 #ifndef ABS 409 /*! get the absolute value of a number*/ 410 #define ABS(a) ( ( (a) > 0 ) ? (a) : - (a) ) 411 #endif 412 413 #ifndef Bool 414 /*! boolean value*/ 415 typedef enum { 416 GF_FALSE = 0, 417 GF_TRUE 418 } Bool; 419 #endif 420 421 /*! 32 bit fraction*/ 422 typedef struct { 423 s32 num; 424 u32 den; 425 } GF_Fraction; 426 427 /*! 64 bit fraction*/ 428 typedef struct { 429 s64 num; 430 u64 den; 431 } GF_Fraction64; 432 433 #if (defined (WIN32) || defined (_WIN32_WCE)) && (defined(__MINGW32__) || !defined(__GNUC__)) 434 435 /*! macro for cross-platform suffix used for formating s64 integers in logs and printf routines*/ 436 #define LLD_SUF "I64d" 437 /*! macro for cross-platform suffix used for formating u64 integers in logs and printf routines*/ 438 #define LLU_SUF "I64u" 439 /*! macro for cross-platform suffix used for formating u64 integers as hex in logs and printf routines*/ 440 #define LLX_SUF "I64x" 441 442 #ifdef _WIN64 443 /*! macro for cross-platform casting a pointer to an integer*/ 444 #define PTR_TO_U_CAST (u64) 445 #else 446 /*! macro for cross-platform casting a pointer to an integer*/ 447 #define PTR_TO_U_CAST (u32) 448 #endif 449 450 #elif defined (__SYMBIAN32__) 451 452 /*! macro for cross-platform suffix used for formating s64 integers in logs and printf routines*/ 453 #define LLD_SUF "d" 454 /*! macro for cross-platform suffix used for formating u64 integers in logs and printf routines*/ 455 #define LLU_SUF "u" 456 /*! macro for cross-platform suffix used for formating u64 integers as hex in logs and printf routines*/ 457 #define LLX_SUF "x" 458 459 /*! macro for cross-platform casting a pointer to an integer*/ 460 #define PTR_TO_U_CAST (u32) 461 462 /*seems that even though _LP64 is defined in OSX, %ll modifiers are still needed*/ 463 #elif defined(__DARWIN__) || defined(__APPLE__) 464 465 /*! macro for cross-platform suffix used for formating s64 integers in logs and printf routines*/ 466 #define LLD_SUF "lld" 467 /*! macro for cross-platform suffix used for formating u64 integers in logs and printf routines*/ 468 #define LLU_SUF "llu" 469 /*! macro for cross-platform suffix used for formating u64 integers as hex in logs and printf routines*/ 470 #define LLX_SUF "llx" 471 472 #ifdef __LP64__ /* Mac OS 64 bits */ 473 /*! macro for cross-platform casting a pointer to an integer*/ 474 #define PTR_TO_U_CAST (u64) 475 #else 476 /*! macro for cross-platform casting a pointer to an integer*/ 477 #define PTR_TO_U_CAST (u32) 478 #endif 479 480 #elif defined(_LP64) /*Unix 64 bits*/ 481 482 /*! macro for cross-platform suffix used for formating s64 integers in logs and printf routines*/ 483 #define LLD_SUF "ld" 484 /*! macro for cross-platform suffix used for formating u64 integers in logs and printf routines*/ 485 #define LLU_SUF "lu" 486 /*! macro for cross-platform suffix used for formating u64 integers as hex in logs and printf routines*/ 487 #define LLX_SUF "lx" 488 489 /*! macro for cross-platform casting a pointer to an integer*/ 490 #define PTR_TO_U_CAST (u64) 491 492 #else /*Unix 32 bits*/ 493 494 /*! macro for cross-platform suffix used for formating s64 integers in logs and printf routines*/ 495 #define LLD_SUF "lld" 496 /*! macro for cross-platform suffix used for formating u64 integers in logs and printf routines*/ 497 #define LLU_SUF "llu" 498 /*! macro for cross-platform suffix used for formating u64 integers as hex in logs and printf routines*/ 499 #define LLX_SUF "llx" 500 501 /*! macro for cross-platform casting a pointer to an integer*/ 502 #define PTR_TO_U_CAST (u32) 503 504 #endif 505 506 #ifndef PTR_TO_U_CAST 507 /*! macro for cross-platform casting a pointer to an integer*/ 508 #define PTR_TO_U_CAST 509 #endif 510 511 /*! macro for cross-platform formatting of s64 integers in logs and printf routines*/ 512 #define LLD "%"LLD_SUF 513 /*! macro for cross-platform formatting of u64 integers in logs and printf routines*/ 514 #define LLU "%"LLU_SUF 515 /*! macro for cross-platform formatting of u64 integers as hexadecimal in logs and printf routines*/ 516 #define LLX "%"LLX_SUF 517 518 519 #if !defined(GF_EXPORT) 520 #if defined(__GNUC__) && __GNUC__ >= 4 && !defined(GPAC_CONFIG_IOS) 521 /*! macro for cross-platform signaling of exported function of libgpac*/ 522 #define GF_EXPORT __attribute__((visibility("default"))) 523 #else 524 /*use def files for windows or let compiler decide*/ 525 526 /*! macro for cross-platform signaling of exported function of libgpac*/ 527 #define GF_EXPORT 528 #endif 529 #endif 530 531 532 //! @cond Doxygen_Suppress 533 534 #if defined(GPAC_CONFIG_IOS) 535 #define GPAC_STATIC_MODULES 536 #endif 537 538 /*safety checks on macros*/ 539 540 #ifdef GPAC_DISABLE_ZLIB 541 # define GPAC_DISABLE_LOADER_BT 542 # define GPAC_DISABLE_SWF_IMPORT 543 #endif 544 545 #ifdef GPAC_DISABLE_VRML 546 # ifndef GPAC_DISABLE_BIFS 547 # define GPAC_DISABLE_BIFS 548 # endif 549 # ifndef GPAC_DISABLE_QTVR 550 # define GPAC_DISABLE_QTVR 551 # endif 552 # ifndef GPAC_DISABLE_X3D 553 # define GPAC_DISABLE_X3D 554 # endif 555 # ifndef GPAC_DISABLE_LOADER_BT 556 # define GPAC_DISABLE_LOADER_BT 557 # endif 558 # ifndef GPAC_DISABLE_LOADER_XMT 559 # define GPAC_DISABLE_LOADER_XMT 560 # endif 561 #endif 562 563 #ifdef GPAC_DISABLE_SVG 564 # ifndef GPAC_DISABLE_LASER 565 # define GPAC_DISABLE_LASER 566 # endif 567 #endif 568 569 570 #ifdef GPAC_DISABLE_AV_PARSERS 571 # ifndef GPAC_DISABLE_MPEG2PS 572 # define GPAC_DISABLE_MPEG2PS 573 # endif 574 # ifndef GPAC_DISABLE_ISOM_HINTING 575 # define GPAC_DISABLE_ISOM_HINTING 576 # endif 577 #endif 578 579 #ifdef GPAC_DISABLE_ISOM 580 # ifndef GPAC_DISABLE_ISOM_WRITE 581 # define GPAC_DISABLE_ISOM_WRITE 582 # endif 583 # ifndef GPAC_DISABLE_ISOM_HINTING 584 # define GPAC_DISABLE_ISOM_HINTING 585 # endif 586 # ifndef GPAC_DISABLE_ISOM_FRAGMENTS 587 # define GPAC_DISABLE_ISOM_FRAGMENTS 588 # endif 589 # ifndef GPAC_DISABLE_SCENE_ENCODER 590 # define GPAC_DISABLE_SCENE_ENCODER 591 # endif 592 # ifndef GPAC_DISABLE_ISOM_DUMP 593 # define GPAC_DISABLE_ISOM_DUMP 594 # endif 595 # ifndef GPAC_DISABLE_LOADER_ISOM 596 # define GPAC_DISABLE_LOADER_ISOM 597 # endif 598 # ifndef GPAC_DISABLE_MEDIA_EXPORT 599 # define GPAC_DISABLE_MEDIA_EXPORT 600 # endif 601 #endif 602 603 #ifdef GPAC_DISABLE_ISOM_WRITE 604 # ifndef GPAC_DISABLE_MEDIA_IMPORT 605 # define GPAC_DISABLE_MEDIA_IMPORT 606 # endif 607 # ifndef GPAC_DISABLE_QTVR 608 # define GPAC_DISABLE_QTVR 609 # endif 610 # ifndef GPAC_DISABLE_ISOM_HINTING 611 # define GPAC_DISABLE_ISOM_HINTING 612 # endif 613 # ifndef GPAC_DISABLE_SCENE_ENCODER 614 # define GPAC_DISABLE_SCENE_ENCODER 615 # endif 616 #endif 617 618 #ifdef GPAC_DISABLE_STREAMING 619 # ifndef GPAC_DISABLE_ISOM_HINTING 620 # define GPAC_DISABLE_ISOM_HINTING 621 # endif 622 #endif 623 624 #ifdef GPAC_DISABLE_BIFS 625 # ifndef GPAC_DISABLE_BIFS_ENC 626 # define GPAC_DISABLE_BIFS_ENC 627 # endif 628 #endif 629 630 #if defined(GPAC_DISABLE_BIFS_ENC) && defined(GPAC_DISABLE_LASER) 631 # ifndef GPAC_DISABLE_LOADER_ISOM 632 # define GPAC_DISABLE_LOADER_ISOM 633 # endif 634 # ifndef GPAC_DISABLE_SENG 635 # define GPAC_DISABLE_SENG 636 # endif 637 #endif 638 639 //we currently disable all extra IPMP/IPMPX/OCI/extra MPEG-4 descriptors parsing 640 #ifndef GPAC_MINIMAL_ODF 641 #define GPAC_MINIMAL_ODF 642 #endif 643 644 //define this to remove most of built-in doc of libgpac - for now filter description and help is removed, but argument help is not 645 //#define GPAC_DISABLE_DOC 646 647 648 //! @endcond 649 650 /*! @} */ 651 652 /*! 653 \addtogroup mem_grp 654 \brief Memory management 655 656 GPAC can use its own memory tracker, depending on compilation option. It is recommended to use only the functions 657 defined in this section to allocate and free memory whenever developping within the GPAC library. 658 659 \warning these functions shall only be used after initializing the library using \ref gf_sys_init 660 @{ 661 */ 662 /*GPAC memory tracking*/ 663 #if defined(GPAC_MEMORY_TRACKING) 664 665 666 void *gf_mem_malloc(size_t size, const char *filename, int line); 667 void *gf_mem_calloc(size_t num, size_t size_of, const char *filename, int line); 668 void *gf_mem_realloc(void *ptr, size_t size, const char *filename, int line); 669 void gf_mem_free(void *ptr, const char *filename, int line); 670 char *gf_mem_strdup(const char *str, const char *filename, int line); 671 void gf_memory_print(void); /*prints the state of current allocations*/ 672 u64 gf_memory_size(); /*gets memory allocated in bytes*/ 673 674 /*! free memory allocated with gpac*/ 675 #define gf_free(ptr) gf_mem_free(ptr, __FILE__, __LINE__) 676 /*! allocates memory, shall be freed using \ref gf_free*/ 677 #define gf_malloc(size) gf_mem_malloc(size, __FILE__, __LINE__) 678 /*! allocates memory array, shall be freed using \ref gf_free*/ 679 #define gf_calloc(num, size_of) gf_mem_calloc(num, size_of, __FILE__, __LINE__) 680 /*! duplicates string, shall be freed using \ref gf_free*/ 681 #define gf_strdup(s) gf_mem_strdup(s, __FILE__, __LINE__) 682 /*! reallocates memory, shall be freed using \ref gf_free*/ 683 #define gf_realloc(ptr1, size) gf_mem_realloc(ptr1, size, __FILE__, __LINE__) 684 685 #else 686 687 /*! free memory allocated with gpac 688 \param ptr same as free() 689 */ 690 void gf_free(void *ptr); 691 692 /*! allocates memory, shall be freed using \ref gf_free 693 \param size same as malloc() 694 \return adress of allocated block 695 */ 696 void* gf_malloc(size_t size); 697 698 /*! allocates memory array, shall be freed using \ref gf_free 699 \param num same as calloc() 700 \param size_of same as calloc() 701 \return adress of allocated block 702 */ 703 void* gf_calloc(size_t num, size_t size_of); 704 705 /*! duplicates string, shall be freed using \ref gf_free 706 \param str same as strdup() 707 \return duplicated string 708 */ 709 char* gf_strdup(const char *str); 710 711 /*! reallocates memory, shall be freed using \ref gf_free 712 \param ptr same as realloc() 713 \param size same as realloc() 714 \return adress of reallocated block 715 */ 716 void* gf_realloc(void *ptr, size_t size); 717 718 #endif 719 /*! @} */ 720 721 722 /*end GPAC memory tracking*/ 723 724 725 #ifdef __cplusplus 726 } 727 #endif 728 729 #endif /*_GF_SETUP_H_*/ 730