FlashBASIC C Functions List

The following FlashBASIC C Functions are presented:

%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

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

Instructs the alarm clock of the calling process to send the signal SIGALRM to the calling process.

%bind() Function

Binds a socket to a named resource. In case of a network, the resource would be an access point into the system.

%calloc() Function

Allocates and frees dynamic memory.

%chdir() Function

Changes the current directory to the one in the specified string.

%chmod() Function

Changes the mode of the file specified in the string to the value specified in the specified mode.

%chown() Function

Changes the owner-ID and group-ID of the file specified in the string to the specified in owner and group, respectively.

%close() Function

Closes the UNIX file specified by the file descriptor returned by a previous call to %open(), %creat(), %dup(), %socket(), or %accept().

%close_ssl() Function

Closes the socket specified by the file descriptor, as well as the secure connection specified by the SSL file descriptor.

%closeall() Function

Closes all opened file-descriptors, including sockets.

%closesocket() Function

Closes an existing socket.

%connect() Function

Requests a connection between two sockets.

%connect_ssl() Function

Requests a secure connection between two sockets.

%creat() Function

Creates a new host OS file or prepares to rewrite an existing host OS file designated by the specified string for write only.

%decrypt() Function

Decrypts a string.

%dup() Function

Returns a new file descriptor associated to the same file as the one associated with the specified file descriptor.

%encrypt() Function

Encrypts a string.

%fclose() Function

Writes the character specified by the character on the named output stream.

%fdopen() Function

Associates a stream with the file descriptor obtained from an %open(), %dup(), or %creat().

%fgetc() Function

Returns the next character from the named input stream.

%fgets() Function

Reads characters from the named input stream into the variable until n-1 characters are read or a new line character is read and transferred to the string.

%fopen() Function

Opens the host OS file designated by the string and associates a stream with it.

%fprintf() Function

Writes formatted output on the stream under control of the format.

%fputc() Function

Writes the specified character on the named output stream.

%fputs() Function

Writes the specified string on the named output stream.

%fread() Function

Binary stream input/output.

%free() Function

Frees a block of memory allocated by a call to %malloc().

%freopen() Function

Substitutes the named file specified by the string in place of the opened stream.

%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().

%fwrite() Function

Binary stream input/output.

%getaddrinfo() Function

Front end to the socket %getaddrinfo() function.

%getenv() Function

Searches the environment for a string of the form name=value and returns a pointer to the value in the current environment if such a string is present, otherwise, a null is returned.

%gethostid() Function

Allows a FlashBASIC application to retrieve the unique 32-bit identifier for the current host.

%gethostname() Function

Retrieves the standard host name for the local computer.

%getnamedhost() Function

Front end to the socket %gethostbyname() function.

%getperfcount() Function

Returns the D3 performance counters.

%getpgrp() Function

Returns the UNIX process group ID of the calling process.

%getpid() Function

Returns the Process-ID (PID) of the calling process.

%getppid() Function

Returns the UNIX parent Process-ID of the calling process.

%getsockopt() Function

Retrieves a socket option.

%inet_addr() Function

Converts a string containing an IPv4 dotted-decimal address into a proper address for the IN_ADDR structure.

%ioctl() Function

A general purpose control function that passes the request and arg arguments to the device designated by the file descriptor.

%ioctlsocket() Function

Controls the I/O mode of a socket.

%kill() Function

Sends the specified signal to the specified process.

%listen() Function

Marks the specified socket as accepting incoming connections and limits the number of outstanding connections in the system queue.

%lseek() Function

Moves the read/write pointer.

%malloc() Function

Allocates a memory block of the specified size in bytes and returns the address of this block.

%memccpy() Function

Copies the memory area.

%memchr() Function

Scans memory for a character,

%memcopy() Function

Copies characters from the specified memory area into another, stopping after the first occurrence of the specified character has been copied, or after the number of characters specified by the length have been copied, whichever comes first.

%memcpy() Function

Copies the specified number of characters from one specified memory to another.

%memxcpy() Function

Copies a specified number of characters from a specified memory area into another, and converts each input character into two ASCII hexadecimal characters 0 through 9 and A through F.

%open() Function

Opens the specified host OS file and sets the file status flags.

%pause() Function

Suspends the calling process until it receives a signal.

%pclose() Function

Closes the specified stream opened by a %popen() and returns the exit status of the command.

%pgetpid() Function

Returns the UNIX Process-ID (PID) associated to the D3 process line.

%popen() Function

Creates a pipe between the calling process and the command to be executed.

%printf() Function

Formatted output conversion.

%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

Reads the specified number of bytes into the variable from the specified file, converting each byte into two ASCII hexadecimal characters.

%read() Function

Reads the specified number of bytes into the variable from the specified file.

%read_ssl() Function

Reads the specified number of bytes into the variable from the Secure connection specified by the SSL file descriptor.

%readregistry() Function

Retrieves string values from the registry.

%realloc() Function

Resizes the memory buffer specified to the specified size in bytes and returns a pointer to the resized buffer.

%recv() Function

Receives data from a connected socket or a bound connectionless socket.

%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

Performs semaphore control operations.

%semget() Function

Creates a semaphore set.

%semop() Function

Performs an array of semaphore operations on a set of semaphores.

%send() Function

Sends data on a connected socket.

%sendto() Function

Sends data to a specified destination.

%setflush() Function

Sets the flush periods.

%setsockopt() Function

Sets a socket option.

%shell() Function

Executes the specified MS-DOS command and returns the exit code of the command.

%shellcapture() Function

Executes the specified MS-DOS command and captures the result in the specified buffer variable, up to the maximum size.

%shmat() Function

Attaches a shared memory segment associated with the shared memory identifier 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

Detaches the shared memory segment located at the specified address.

%shmget() Function

Creates a shared memory segment and returns a shared memory identifier.

%shutdown() Function

Disables sends or receives on a socket.

%socket() Function

Creates a socket in the specified address of the specified type.

%sprintf() Function

Formatted output conversion.

%startfileio() Function

Specifies that all input comes from the input file and all output goes to the output file.

%stopfileio() Function

Stops all input and output to and from the file.

%strcat() Function

Concatenates two strings.

%strcpy() Function

Copies a string.

%strlen() Function

Calculates the length of a string.

%ttyname() Function

Returns a pointer to a static area containing the null terminated path name of the terminal device associated to the specified file descriptor.

%unlink ()Function

Removes the directory entry named by the specified path name.

%wait() Function

Returns the exit code of the child processes created by the current process.

%whex() Function

Writes to the specified file 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

Writes the specified number of bytes from the variable to the specified file descriptor returned by a previous call to %open(), %creat(), or %dup().

%write_ssl() Function

Writes the specified number of bytes from the variable to the Secure connection specified by the SSL file descriptor.