PickBASIC / FlashBASIC
FlashBASIC C functions list
.mdThe following FlashBASIC C Functions are available.
In this section
%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 creates a new socket.%accept_starttls() function→The %accept_starttls function provides the ability to elevate an unsecured connection to a secured 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.%calloc() function→Allocates and frees dynamic memory.%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.%closesocket() function→The %closesocket() function closes an existing socket.%connect() function→The %connect() function requests a connection between two sockets.%connect_ssl() function→The %connect_ssl() function requests a secure connection between two sockets.%connect_starttls() function→The %connect_starttls function provides the ability to elevate an unsecured connection to a secured connection.%creat() function→The %creat() function creates a new host OS file or prepares to rewrite an existing host OS file designated by str for write only.%decrypt() function→The %decrypt() function decrypts a string. The appropriate OpenSSL libraries must be present to use this function. See your platform-specific System Administration Guide for details.%dup() function→The %dup() function returns a new file descriptor associated to the same file as the one associated with file.descriptor.%encrypt() function→The %encrypt() function encrypts a string. The appropriate OpenSSL libraries must be present to use this function. See your platform-specific System Administration Guide for details.%endlistilocks() function→The %endlistilocks() function is used to release the handle allocated by the %startlistilocks() function.%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.%filecheck() function→The %filecheck() function can be run from the TCL to call the system fsck (file system check) command.%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.%fread() function→Binary stream input/output.%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().%fwrite() function→Binary stream input/output.%getaddrinfo() function→Front end to the socket %getaddrinfo() function.%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.%getnamedhost() function→Front end to the socket %gethostbyname() function.%getperfcount() function→The %getperfcount() function returns the D3 performance counters.%getpgrp() function→The %getpgrp() function returns the UNIX process group ID of the calling process.%getpid() function→The %getpid() function returns the Process-ID (PID) of the calling process.%getppid() function→The %getppid() function returns the UNIX parent Process-ID of the calling process.%getsockopt() function→The %getsockopt() function retrieves a socket option.%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.%ioctlsocket() function→The %ioctlsocket() function controls the I/O mode of a socket.%kill() function→The %kill() function sends the signal specified in signal to the process pid.%listitemlocksfilter() function→The listitemlocksfilter() function is used to get a list of the FSI item locks in a dynamic array format.%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.%memccpy() function→Copies the memory area.%memchr() function→Scans memory for a character.%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.%printf() function→Formatted output conversion.%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.%semget() function→The %semget() function creates a semaphore set.%semop() function→The %semop() function performs an array of semaphore operations on a set of semaphores.%send() function→The %send() function sends data on a connected socket.%sendto() function→The %sendto() sends data to a specified destination. If no errors occur, the total number of bytes sent is returned.%setflush() function→The %setflush() function sets the flush periods.%setsockopt() function→The %setsockopt() function sets a socket option.%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.%sprintf() function→Formatted output conversion.%startfileio() function→Specifies that all input comes from the input file and all output goes to the output file.%startlistilocks() function→The %startlistilocks() function prepares for calls to the %listitemlocksfilter() function and the %endlistilocks() function.%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).%strcat() function→Concatenates two strings.%strcpy() function→Copies a string.%strlen() function→Calculates the length of a string.%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.