The following FlashBASIC C Functions are available.
%accept() function The %accept() function extracts the first connection on the queue of pending connections, creates a new socket, and allocates a new file descriptor.
%accept_ssl() function The %accept_ssl() function first calls the %accept() function to extract the first connection on the queue of pending connections, and then it creates a new socket. Thereafter, the function will wait for a TLS/SSL client to initiate the TLS/SSL handshake, and then create a secure SSL connection.
%alarm() function The %alarm() function instructs the alarm clock of the calling process to send the signal SIGALRM to the calling process.
%bind() function The %bind() function binds a socket to a named resource. In case of a network, the resource would be an access point into the system (see the example below).
%chdir() function The %chdir() function changes the current directory to the one specified in str.
%chmod() function The %chmod() function changes the mode of the file str to the value specified in mode.
%chown() function The %chown() function changes the owner-ID and group-ID of the file str to the values specified in owner and group respectively.
%close() function The %close() function closes the UNIX file specified by file.descriptor returned by a previous call to %open(), %creat(), %dup(), %socket(), or %accept().
%close_ssl() function The %close_ssl function closes the socket specified by the fd file descriptor, as well as the secure connection specified by the ssl_fd descriptor. The fd file descriptor is returned by a previous call to %socket whereas the ssl_fd descriptor is returned buy a previous call to %accept_ssl() or %connect_ssl.
%closeall() function The %closeall() function closes all opened file-descriptors, including sockets.
%fclose() function The %fclose() function closes the stream specified by stream returned by a previous call to %fopen().
%fdopen() function The %fdopen() function associates a stream with the file.descriptor obtained from an %open(), %dup(), or %creat().
%fgetc() function The %fgetc() function returns the next character from the named input stream.
%fgets() function The %fgets() function reads characters from the named input stream into var until n-1 characters are read or a new line character is read and transferred to the string.
%fopen() function The %fopen() function opens the host OS file designated by str and associates a stream with it.
%fprintf() function The %fprintf() function writes formatted output on stream under control of format.
%fputc() function The %fputc() function writes the character specified by character on the named output stream.
%fputs() function The %fputs() function writes the string designated by str on the named output stream.
%free() function The %free() function frees a block of memory allocated by a call to %malloc().
%freopen() function The %freopen() function substitutes the named file specified by str in place of the opened stream stream1.
%fsize() function The %fsize() function returns the size in bytes of the file associated to the opened file.descriptor returned by a previous call to %open() or %creat().
%getenv() function The %getenv() function searches the environment for a string of the form name=value and returns a pointer to value in the current environment if such a string is present, otherwise, a null is returned.
%gethostid() function The %gethostid() function allows a FlashBASIC application to retrieve the unique 32-bit identifier for the current host. The ID is returned as a decimal number.
%gethostname() function The %gethostname() function retrieves the standard host name for the local computer.
%inet_addr() function The %inet_addr() function converts a string containing an IPv4 dotted-decimal address into a proper address for the IN_ADDR structure.
%ioctl() function The %ioctl() function is a general purpose control function that passes the arguments request and arg to the device designated by file.descriptor.
%kill() function The %kill() function sends the signal specified in signal to the process pid.
%listen() function The %listen() function marks the specified socket as accepting incoming connections and limits the number of outstanding connections in the system queue.
%lseek() function The %lseek() function moves the read/write pointer. See your host OS system documentation.
%malloc() function The %malloc() function allocates a memory block of size bytes and returns the address of this block.
%memcopy() function The %memcopy() function copies characters from the memory area specified by s2 into s1, stopping after the first occurrence of the character designated by character has been copied, or after the number of characters specified by length have been copied, whichever comes first.
%memcpy() function The %memcpy() function copies the number of characters specified by number from memory area s2 into s1.
%memxcpy() function The %memxcpy() function copies a specified number of characters from memory area s2 into s1, and converts each input character into two ASCII hexadecimal characters 0 through 9 and A through F.
%open() function The %open() function opens the host OS file specified by str and sets the file status flags according to the value of oflag.
%pause() function The %pause() function suspends the calling process until it receives a signal.
%pclose() function The %pclose() function closes the stream designated by stream opened by a %popen() and returns the exit status of the command.
%pgetpid() function The %pgetpid() function returns the UNIX Process-ID (PID) associated to the D3 process line.
%popen() function The %popen() function creates a pipe between the calling process and the command to be executed.
%putenv() function The %putenv() function makes the value of the environment variable name equal to the value designated by str, by altering an existing variable or by creating a new one.
%rdhex() function The %rdhex() function reads the number of bytes designated by (size * 2) into var from the file specified in file.descriptor, converting each byte into two ASCII hexadecimal characters.
%read() function The %read() function reads the number of bytes designated in size into var, from the file specified by file.descriptor. This file is returned by a previous call to %open(), %creat(), or %dup().
%read_ssl() function The %read_ssl() function reads the number of bytes designated in size into var, from the Secure connection specified by ssl_fd descriptor. This descriptor is returned by a previous call to %accept_ssl() or %connect_ssl.
%readregistry() function The %readregistry() function retrieves string values from the registry.
%realloc() function The %realloc() function resizes the memory buffer specified to the specified size in bytes and returns a pointer to the resized buffer. The contents of the buffer are not changed. If buffer is null, this function behaves like the %malloc() function for the specified size. If the specified size is zero and the specified buffer is not null, the buffer memory is freed.
%recv() function The %recv() function receives data from a connected socket or a bound connectionless socket.
%recvfrom() function The %recvfrom() function receives a datagram from a bound socket and stores the information on the sender. If no errors occur, the number of bytes received is returned.
%semctl() function The %semctl() function performs semaphore control operations.
%shell() function The %shell() function executes the MS-DOS command, command, and returns the exit code of the command.
%shellcapture() function The %shellcapture() function executes the MS-DOS command, command, and captures the result in the buffer variable, up to the maximum size. If the buffer is not large enough, the exceeding output is discarded.
%shmat() function The %shmat() function attaches a shared memory segment associated with the shared memory identifier shmid and returns the address of the segment.
%shmctl() function Allows the user to receive information on a shared memory segment, set the owner, group, and permissions of a shared memory segment, or destroy a segment.
%shmdt() function The %shmdt() function detaches the shared memory segment located at the address specified by shmaddr.
%shmget() function The %shmget() function creates a shared memory segment and returns a shared memory identifier.
%shutdown() function The %shutdown() function disables sends or receives on a socket.
%socket() function The %socket() function creates a socket in the specified addr.family and of the specified type. A protocol can be specified or assigned by the system. If the protocol is left unspecified (with a value of 0), the system selects an appropriate protocol in the specified addr.family.
%startfileio() function Specifies that all input comes from the input file and all output goes to the output file. The FlashBASIC tab of the D3 Device Manager contains the default path of the input and output files (see the D3 System Administration Guide for more information).
%stopfileio() function Stops all input and output to and from the file. The FlashBASIC tab of the D3 Device Manager contains the default path of the input and output files (see the D3 System Administration Guide for more information).
%ttyname() function The %ttyname() function returns a pointer to a static area containing the null terminated path name of the terminal device associated to the file descriptor fd.
%unlink ()function The %unlink() function removes the directory entry named by the path name pointed to by path. The named file is unlinked, and when all the links have been removed, and the file is no longer open, the file is removed.
%wait() function The %wait() function returns the exit code of the child processes created by the current process.
%whex() function The %whex() function writes to the file specified by file.descriptor returned by a previous call to %open(), %creat(), or %dup() a string of bytes resulting from converting the ASCII string variable into binary.
%write() function The %write() function writes the number of bytes designated by size from var to the file specified by file.descriptor returned by a previous call to %open(), %creat(), or %dup().
%write_ssl() function The %write_ssl() function writes the number of bytes designated by size from var to the Secure connection specified by ssl_fd descriptor. This descriptor is returned by a previous call to %accept_ssl() or %connect_ssl.