AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.124
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/share/swig4.0/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /usr/share/swig4.0/cmalloc.i
/* -----------------------------------------------------------------------------
 * cmalloc.i
 *
 * SWIG library file containing macros that can be used to create objects using
 * the C malloc function.
 * ----------------------------------------------------------------------------- */

%{
#include <stdlib.h>
%}

/* %malloc(TYPE [, NAME = TYPE])
   %calloc(TYPE [, NAME = TYPE])
   %realloc(TYPE [, NAME = TYPE])
   %free(TYPE [, NAME = TYPE])
   %allocators(TYPE [,NAME = TYPE])

   Creates functions for allocating/reallocating memory.

   TYPE *malloc_NAME(int nbytes = sizeof(TYPE);
   TYPE *calloc_NAME(int nobj=1, int size=sizeof(TYPE));
   TYPE *realloc_NAME(TYPE *ptr, int nbytes);
   void free_NAME(TYPE *ptr);

*/

%define %malloc(TYPE,NAME...)
#if #NAME != ""
%rename(malloc_##NAME) ::malloc(int nbytes);
#else
%rename(malloc_##TYPE) ::malloc(int nbytes);
#endif

#if #TYPE != "void"
%typemap(default) int nbytes "$1 = (int) sizeof(TYPE);"
#endif
TYPE *malloc(int nbytes);
%typemap(default) int nbytes;
%enddef

%define %calloc(TYPE,NAME...)
#if #NAME != ""
%rename(calloc_##NAME) ::calloc(int nobj, int sz);
#else
%rename(calloc_##TYPE) ::calloc(int nobj, int sz);
#endif
#if #TYPE != "void"
%typemap(default) int sz "$1 = (int) sizeof(TYPE);"
#else
%typemap(default) int sz "$1 = 1;"
#endif
%typemap(default) int nobj "$1 = 1;"
TYPE *calloc(int nobj, int sz);
%typemap(default) int sz;
%typemap(default) int nobj;
%enddef

%define %realloc(TYPE,NAME...)
%insert("header") {
#if #NAME != ""
TYPE *realloc_##NAME(TYPE *ptr, int nitems)
#else
TYPE *realloc_##TYPE(TYPE *ptr, int nitems)
#endif
{
#if #TYPE != "void"
return (TYPE *) realloc(ptr, nitems*sizeof(TYPE));
#else
return (TYPE *) realloc(ptr, nitems);
#endif
}
}
#if #NAME != ""
TYPE *realloc_##NAME(TYPE *ptr, int nitems);
#else
TYPE *realloc_##TYPE(TYPE *ptr, int nitems);
#endif
%enddef

%define %free(TYPE,NAME...)
#if #NAME != ""
%rename(free_##NAME) ::free(TYPE *ptr);
#else
%rename(free_##TYPE) ::free(TYPE *ptr);
#endif
void free(TYPE *ptr);
%enddef

%define %sizeof(TYPE,NAME...)
#if #NAME != ""
%constant int sizeof_##NAME = sizeof(TYPE);
#else
%constant int sizeof_##TYPE = sizeof(TYPE);
#endif
%enddef

%define %allocators(TYPE,NAME...)
%malloc(TYPE,NAME)
%calloc(TYPE,NAME)
%realloc(TYPE,NAME)
%free(TYPE,NAME)
#if #TYPE != "void"
%sizeof(TYPE,NAME)
#endif
%enddef






Anon7 - 2022
AnonSec Team