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/guile/ |
Upload File : |
/* ----------------------------------------------------------------------------- * ports.i * * Guile typemaps for handling ports * ----------------------------------------------------------------------------- */ %{ #ifndef _POSIX_SOURCE /* This is needed on Solaris for fdopen(). */ # define _POSIX_SOURCE 199506L #endif #include <stdio.h> #include <errno.h> #include <unistd.h> %} /* This typemap for FILE * accepts (1) FILE * pointer objects, (2) Scheme file ports. In this case, it creates a temporary C stream which reads or writes from a dup'ed file descriptor. */ %typemap(in, doc="$NAME is a file port or a FILE * pointer") FILE * { if (SWIG_ConvertPtr($input, (void**) &($1), $1_descriptor, 0) != 0) { if (!(SCM_FPORTP($input))) { scm_wrong_type_arg("$symname", $argnum, $input); } else { int fd; if (SCM_OUTPUT_PORT_P($input)) { scm_force_output($input); } fd=dup(SCM_FPORT_FDES($input)); if (fd==-1) { scm_misc_error("$symname", strerror(errno), SCM_EOL); } $1=fdopen(fd, SCM_OUTPUT_PORT_P($input) ? (SCM_INPUT_PORT_P($input) ? "r+" : "w") : "r"); if ($1==NULL) { scm_misc_error("$symname", strerror(errno), SCM_EOL); } } } } %typemap(freearg) FILE* { if ($1) { fclose($1); } }