Automatically Generated by etc/build-api-doc.fdx at 2002-06-26T14:58:37.044382-4:00
fd_exit | fd_get_gid | fd_get_gname | fd_get_uid | fd_get_uname | fd_get_user_data | fd_getenv | fd_getrusage | fd_inhibit_anti_warranty | fd_inhibit_herald | fd_int_getenv | fd_load_config | fd_set_build_date | fd_set_gid | fd_set_random | fd_set_session_mnemonic | fd_set_uid | fd_string_getenv |
| Function | Arguments | Returns |
|---|---|---|
| fd_get_uname | uid_t id | char * |
| a uid | a string | |
| Gets the user name for a particular id | ||
| fd_set_gid | char *gname | int |
| a gid | changes the current group to be name, return 1 if successful | |
| fd_inhibit_herald | int inhibit | void |
| none | void | |
| Keeps the startup and shutdown heralds from being shown | ||
| fd_get_uid | char *uname | uid_t |
| a string | gets the user ID for a named user | |
| fd_set_build_date | char *date | void |
| a string | nothing | |
| Sets the build date to be returned by fd_get_build_date | ||
| fd_int_getenv | char *var,int dflt | int |
| a string naming a variable and an int default | an int | |
| Gets a variable from the environment. It first tries the top level LISP environment, then the Windows registry (under WIN32), and finally the "POSIX" environment. Unlike fd_getenv, this doesn't parse the string. | ||
| fd_get_gid | char *uname | gid_t |
| a string | gets the group ID for a named group | |
| fd_get_gname | gid_t id | char * |
| a gid | a string | |
| Gets the group name for a particular gid | ||
| fd_exit | int status | void |
| a status code (an int) | no. | |
| This sets the variable fd_normal_exit to 1 if the status code is zero, which can be read by atexit handlers. | ||
| fd_load_config | char *config_file | int |
| a filename (a string) | nothing | |
| Loads the variable bindings defined in the specified configuration file, setting the corresponding symbol values | ||
| fd_inhibit_anti_warranty | int inhibit | void |
| none | void | |
| Keeps the startup and shutdown heralds from being shown | ||
| fd_getenv | char *var | lisp |
| a string naming a variable | a lisp object | |
| Gets a variable from the environment. It first tries the top level LISP environment, then the Windows registry (under WIN32), and finally the "POSIX" environment used by getenv. When the value comes from anywhere besides the lisp environment, it is parsed as a LISP argument, so that numbers turn into numbers. | ||
| fd_getrusage | struct rusage *r | void |
| a pointer to an rusage structure | void | |
| Gets rusage information, covering for holes in various implementations (currently just Linux) | ||
| fd_string_getenv | char *var | fd_u8char * |
| a string naming a variable | a lisp string | |
| Gets a variable from the environment. It first tries the top level LISP environment, then the Windows registry (under WIN32), and finally the "POSIX" environment. Unlike fd_getenv, this doesn't parse the string. | ||
| fd_set_random | unsigned int seed | void |
| an unsigned int | void | |
| This sets the random seed. | ||
| fd_set_uid | char *uname | int |
| a uid | changes the current user to be name, return 1 if successful | |
| fd_set_session_mnemonic | char *mnemonic | void |
| a string | nothing | |
| Sets the string used to identify this kind of session (e.g. 'fdscript' or more usefully, 'mailreader') | ||
| fd_get_user_data | uid_t id | lisp |
| a uid | a lisp structure | |
| Gets the user password data for a particular id |
_fd_grow_string_stream | _fd_sputc | _fd_sputn | _fd_sputs | fd_default_notifier | fd_fprintf | fd_notify | fd_printf | fd_set_notify_handler | fd_set_warn_handler | fd_warn | fd_xprintf |
| Function | Arguments | Returns |
|---|---|---|
| fd_default_notifier | fd_u8char *message | void |
| a string | void | |
| This is the default notification function, which outputs a bracketed time and report. | ||
| _fd_sputc | fd_string_stream ss,int ch | void |
| a pointer to a string stream and a unicode character | void | |
| Writes the utf8 representation of the character to the string stream. | ||
| fd_xprintf | char *format_string,... | void |
| a format string, and other args | void | |
| Outputs a string as exceptional I/O generated from the format string and using the provided arguments. Much like printf (surprise). | ||
| fd_fprintf | FILE *f,char *fstring,... | void |
| a FILE * stream, a format string, and other args | void | |
| Outputs a string to a file stream generated from the format string and using the provided arguments. Much like printf (surprise). | ||
| _fd_sputn | fd_string_stream ss,fd_u8char *string,int n | void |
| a pointer to a string stream, a utf8 string, and an int | void | |
| Internal string stream string putn function, used in macro ssputn | ||
| fd_notify | char *format_string,... | void |
| a FILE * stream, a format string, and other args | void | |
| Outputs a string as a notification, which is generated from the format string and using the provided arguments. Much like printf (surprise). | ||
| _fd_sputs | fd_string_stream ss,fd_u8char *string | void |
| a pointer to a string stream and a utf8 string | void | |
| Internal string stream string put function, used in macro ssputs | ||
| fd_printf | fd_string_stream s,char *format_string,... | void |
| a string stream, a format string, and other args | void | |
| Outputs a string to string stream generated from the format string and using the provided arguments. Much like printf (surprise). | ||
| fd_set_notify_handler | void (*nf | void |
| a function taking a string arg | void | |
| Sets the function which is called on notification messages | ||
| fd_warn | char *format_string,... | void |
| a FILE * stream, a format string, and other args | void | |
| Outputs a string as a warning, which is generated from the format string and using the provided arguments. Much like printf (surprise). Note that notifications can be turned off but warnings cannot. | ||
| _fd_grow_string_stream | fd_string_stream ss,int delta | void |
| a pointer to a string stream and a number of bytes | void | |
| Grows the data structures for the string stream to include delta more bytes | ||
| fd_set_warn_handler | void (*wf | void |
| a function taking a string arg | void | |
| Sets the function which is called on warning messages |
fd_breakup_time | fd_get_now | fd_init_xtime | fd_iso8601_to_xtime | fd_localtime | fd_mktime | fd_parse_iso8601 | fd_parse_tzspec | fd_sleep | fd_timestamp_time | fd_timestamp_to_xtime | fd_xtime_to_iso8601 | fd_xtime_to_timestamp |
| Function | Arguments | Returns |
|---|---|---|
| fd_init_xtime | struct FD_XTIME *xtp | void |
| a pointer to an extended timestamp structure | void | |
| This takes a timestamp object and fills out an extended time pointer structure which includes timezone and precision information. | ||
| fd_parse_tzspec | char *s,int dflt | int |
| a string and a default offset | an offset from UTC | |
| This uses a built in table but should really use operating system facilities if they were even remotely standardized. | ||
| fd_sleep | double secs | void |
| an interval in seconds (a double) | nothing | |
| This is a platform abstraction for sleeping that *may* allow sub-second sleeps. | ||
| fd_mktime | struct tm *tptr,int tzoff | time_t |
| a pointer to a tm struct and a time offset (from UTC) in seconds | a time_t pointer | |
| Returns the UTC time given a filled out tm structure and the offset of the zone it was filled out in from UTC. | ||
| fd_breakup_time | struct tm *tptr,time_t tick,int tzoff | int |
| a pointer to a tm struct, a time_t value, and an offset | an integral timezone offset | |
| Fills the tm struct with the broken down UTC time based on the time_t value. This is threadsafe, locking the possible shared tptr. | ||
| fd_timestamp_time | lisp timestamp | time_t |
| a lisp pointer to a timestamp | a time_t value | |
| fd_xtime_to_timestamp | struct FD_XTIME *xtp | fd_lisp |
| a string and a pointer to a timestamp structure | -1 on error, the time as a time_t otherwise | |
| This takes an iso8601 string and fills out an extended time pointer which includes possible timezone and precision information. | ||
| fd_iso8601_to_xtime | char *s,struct FD_XTIME *xtp | time_t |
| a string and a pointer to a timestamp structure | -1 on error, the time as a time_t otherwise | |
| This takes an iso8601 string and fills out an extended time pointer which includes possible timezone and precision information. | ||
| fd_parse_iso8601 | char *string | time_t |
| a string | a time_t | |
| Parses an iso8601 format date/time string into a time_t value. | ||
| fd_timestamp_to_xtime | fd_lisp timestamp,struct FD_XTIME *xtp | time_t |
| a lisp pointer to a timestamp and a pointer to a timestamp structure | -1 on error, the time as a time_t otherwise | |
| This takes a timestamp object and fills out an extended time pointer structure which includes timezone and precision information. | ||
| fd_xtime_to_iso8601 | struct FD_XTIME *xtp,fd_string_stream ss | int |
| a timestamp and a pointer to a string stream | -1 on error, the time as a time_t otherwise | |
| This takes an iso8601 string and fills out an extended time pointer which includes possible timezone and precision information. | ||
| fd_get_now | struct FD_XTIME *xtp | time_t |
| a pointer to an extended time pointer | a time_t or -1 if it fails for some reason | |
| This will try and get the finest precision time it can. | ||
| fd_localtime | struct tm *tptr,time_t tick | int |
| a pointer to a tm struct and a time_t value | the time_t value or -1 if it failed | |
| Fills the tm struct with the local time based on the time_t value. This is threadsafe, since localtime is not. |
_fd_push_jbr | fd_ctype_error | fd_exception_context | fd_exception_context_push | fd_pigs_fly | fd_raise_detailed_exception | fd_raise_exception | fd_raise_lisp_exception | fd_record_type_error | fd_set_exception | fd_throw | fd_type_error |
| Function | Arguments | Returns |
|---|---|---|
| fd_raise_detailed_exception | fd_exception ex,char *details | void |
| an exception (a string) and details (another string) | no. | |
| Raises an exception of a particular kind with particular details used in generating exception reports Unhandled crises cause an exit by calling unhandled_exception. | ||
| fd_raise_lisp_exception | fd_exception ex,char *details,lisp obj | void |
| an exception (a string), details (another string), and a lisp object | no. | |
| Raises an exception of a particular kind with particular details used in generating exception reports and an associated lisp object (the irritant) Unhandled crises cause an exit by calling unhandled_exception. | ||
| fd_raise_exception | fd_exception ex | void |
| an exception (a string) | no. | |
| Raises an exception of a particular kind without providing any other information. Unhandled crises cause an exit by calling unhandled_exception. | ||
| fd_set_exception | fd_exception ex,fd_u8char *details,lisp object | void |
| an exception (a string), a details string, and a lisp object | nothing | |
| Set's the current threads exception information. | ||
| fd_exception_context | int force | struct FD_EXCEPTION_CONTEXT * |
| none | a pointer to a FD_EXCEPTION_CONTEXT struct | |
| fd_ctype_error | char *c_context,fd_u8char *details,lisp obj | void |
| details text (a string), and a lisp object | no. | |
| Raises a type error with particular details and an object. | ||
| fd_record_type_error | lisp obj,lisp tag | void |
| details text (a string), and a lisp object | no. | |
| Raises a type error with particular details and an object. | ||
| fd_pigs_fly | fd_u8char *details | void |
| details text (a string) | no. | |
| This is used to signal errors which should never happen. | ||
| _fd_push_jbr | fd_setjmp_rec *jbr | void |
| a setjmp record | void | |
| Adds an entry to the exception handling stack for a particular setmp location | ||
| fd_type_error | fd_u8char *details,lisp obj | void |
| details text (a string), and a lisp object | no. | |
| Raises a type error with particular details and an object. | ||
| fd_exception_context_push | lisp sym | void |
| a lisp pointer | void | |
| Adds a value to the current exception context | ||
| fd_throw | fd_exception ex,char *details,lisp obj | void |
| an exception (a string), details (another string), and a lisp object | no. | |
| Throws an exception, with particular details and irritant. This is used when the exception is expected to be caught, as in the use of exceptions to implement continuation. This is identical to fd_raise_lisp_exception but that debuggers may often break on fd_raise_lisp_exception and not on fd_throw. |
fd_careful_dtcall | fd_careful_dtype_eval | fd_close_connection | fd_connect | fd_dtcall | fd_dtype_eval | fd_get_portno | fd_http_get | fd_http_head | fd_http_string | fd_init_connection | fd_open_connection | fd_open_local_socket | fd_open_tcp_socket | fd_read_from_socket | fd_send_smtp_mail | fd_sendall | fd_timed_recv | fd_trace_dteval | fd_try_to_connect |
| Function | Arguments | Returns |
|---|---|---|
| fd_dtype_eval | lisp expr,fd_server s | lisp |
| a lisp object and a server | a lisp object | |
| Asks the server to evaluate the lisp object, returning the result and trying to restart the connection once if neccessary. | ||
| fd_sendall | int socket,char *buf,int size,int flags | int |
| a socket, a pointer to a block of data, the length of the block of data, and flags to pass to send() | either zero or -1 (indictating an error) | |
| This sends all of the bytes in a block of data, repeatedly calling send(). This will return -1, indicating a failure, if the attempt to write times out. | ||
| fd_init_connection | fd_server server,char *dest,int port,char *id | void |
| a pointer to an FD_SERVER struct, a host (a string), a port (an int), and an id (a string or NULL) | nothing | |
| Initializations a TCP/IP connection structure. | ||
| fd_dtcall | fd_server s,char *fcn,... | lisp |
| a server, a function name (a string), and a number of args ending with FD_VOID | a lisp object | |
| Asks the server to apply the named function to the args, returning the result. It calls fd_dtype_eval. The arguments are quoted before being passed. | ||
| fd_try_to_connect | char *spec | fd_server |
| a string identifying a server | a server | |
| Tries to make a connection to a particular server, returning NULL if it fails. The server identification has the form port@host, where port is either a registered service or is 'touch-tone' encoded to a port number | ||
| fd_send_smtp_mail | char *dest,char *text,lisp fields | void |
| a destination (a string), a contents (a string), and a set of fields (a lisp object) | nothing | |
| Uses a local SMTP connection to send mail to a particular individual with a particular set of fields and a particular contents. | ||
| fd_open_tcp_socket | char *hostname,int port,char *id,int signal_error,char **fullname | int |
| a hostname (a string) and a port (an int) and an id (a string) and an error flag (an int) | an open socket | |
| This utility function gets an open TCP socket for a host and port. | ||
| fd_close_connection | fd_server s | void |
| a server | nothing | |
| Closes the connection to server. This just does a close on the socket and nothing clever to ensure that pending transactions are completed (though they should throw out and restart). | ||
| fd_careful_dtcall | fd_server s,char *fcn,... | lisp |
| a server, a function name (a string), and a number of args ending with FD_VOID | a lisp object | |
| Like fd_dtcall, but signals an error when the remote server returns an error object. | ||
| fd_timed_recv | int secs,int socket_id,char *data,int len,int flags | int |
| an interval in seconds (an int), an open socket, a pointer to a block of data, a number of bytes, and some flags (an int) for recv() | the number of bytes read or -1 on error | |
| Tries to read bytes from a connection, returning -1 if the connection times out. | ||
| fd_connect | char *spec | fd_server |
| a string identifying a server | a server | |
| Makes a connection to a particular server, signalling an error if a connection cannot be made. The server identification has the form port@host, where port is either a registered service or is 'touch-tone' encoded to a port number | ||
| fd_http_get | char *url,int *sizep | char * |
| a string and a pointer to an int | a string (actually a pointer to a byte array) | |
| Gets the contents of a remote URL as a character string, storing the size in the second argument (if non-NULL) | ||
| fd_open_local_socket | char *filename,char *id,int signal_error | int |
| a filename (a string) and a server id (a string) and an error flag (an int) | an open socket | |
| This utility function gets an open socket for a local filenname. | ||
| fd_http_head | char *url,int *sizep | char * |
| a string and a pointer to an int | a string (actually a pointer to a byte array) | |
| Gets the head of a remote URL as a character string | ||
| fd_open_connection | char *name,int port,char *id | fd_server |
| a name (a string), a port (an int) and an id (a string) | a server (a pointer to a FD_SERVER struct) | |
| Looks for a current connection to port@hostname and creates one if it doesn't exist. | ||
| fd_read_from_socket | struct FD_DBUF *buf,int socket | void |
| a pointer to an FD_DBUF struct and a socket | nothing (void) | |
| This fills the expandable FD_DBUF struct with bytes read from socket, stopping when recv() return 0 or the call to recv times out. | ||
| fd_careful_dtype_eval | lisp expr,fd_server s | lisp |
| a lisp object and a server | a lisp object | |
| Like fd_dtype_eval but signals an error if the remote server returns an error or exception object. | ||
| fd_get_portno | char *string | int |
| a string | an integer | |
| Returns the port number identified by a particular string, starting with the service database and doing touch-tone encoding if that fails. | ||
| fd_trace_dteval | int flag | int |
| 1 or 0 | 1 or 0 | |
| Turns on tracing of all remote DTYPE evaluation activity. | ||
| fd_http_string | char *url | char * |
| a string | a string (actually a pointer to a byte array) | |
| Gets the contents of a remote URL as a character string, storing the size in the second argument |
fd_directoryp | fd_fclose | fd_file_existsp | fd_file_size | fd_file_writablep | fd_find_file | fd_fopen | fd_fopen_locked | fd_get_exec_filename | fd_getpath | fd_regular_filep | fd_symbolic_linkp |
| Function | Arguments | Returns |
|---|---|---|
| fd_file_size | fd_u8char *path | off_t |
| a string | a long | |
| Returns the size of a file | ||
| fd_fclose | FILE *stream | void |
| a filename | a FILE * pointer | |
| Closes the stream and cleans up XFILEs associated with it | ||
| fd_getpath | fd_u8char *name | lisp |
| a string naming an extended environment variable | a lisp pointer to a list of directories | |
| Interprets a path variable | ||
| fd_symbolic_linkp | fd_u8char *path | int |
| a string | 1 or 0 | |
| Returns 1 if the file is a symbolic link to another file (currently always zero under WIN32). | ||
| fd_get_exec_filename | char *argv0 | char * |
| a string, typicallying argv[0] | a malloc'd absolute filename or NULL | |
| Attempts to figure out the absolute pathname of an executable from the argv[0] parameter. Used to find the FramerD configuration file. | ||
| fd_fopen_locked | fd_u8char *filename,char *mode,int allow_readers | FILE * |
| a filename, a mode specifier, and a flag (1 or 0) | a FILE * pointer | |
| Normalizes the filename for the OS and locks the returned stream (using fcntl). If the integer flag is 1, the lock is only a write lock. If it is 0, neither reads nor writes are permitted. | ||
| fd_find_file | fd_u8char *filename,lisp search_path | fd_u8char * |
| a string and a lisp pointer | another string | |
| The lisp pointer is used as a search path to look for files. It first checks to see if the string exists as a file as given. It then searches along the directories in the search path. The search path can be a string (taken as a directory name) or a list of strings take as directory names. It allocates a string for a result (but doesn't count it as fd_mallocd). | ||
| fd_directoryp | fd_u8char *path | int |
| a string | 1 or 0 | |
| Returns 1 if the file is actually a directory. | ||
| fd_file_writablep | fd_u8char *filename | int |
| a string | 1 or 0 | |
| Returns 1 if the file can be written (whether it exists or not), 0 otherwise. Actually opens it to try, rather than doing something clever with stat. | ||
| fd_regular_filep | fd_u8char *path | int |
| a string | 1 or 0 | |
| Returns 1 if the file is a regular file. | ||
| fd_file_existsp | fd_u8char *fname | int |
| a string | 1 or 0 | |
| Returns 1 if the file exists, 0 otherwise. Uses stat. | ||
| fd_fopen | fd_u8char *filename,char *mode | FILE * |
| a filename and a mode specifier | a FILE * pointer | |
| Normalizes the filename for the OS |
fd_convert_utf8 | fd_define_encoding | fd_downcase_string | fd_fgetc | fd_foreign_filestring | fd_fputc | fd_fputs_encoded | fd_fputs_raw | fd_free_xfile | fd_get_encoding | fd_get_file_encoding | fd_get_xfile | fd_interpret_unicode_escapes | fd_load_encoding | fd_localize_utf8 | fd_make_utf8 | fd_set_default_encoding | fd_set_file_encoding | fd_set_system_encoding | fd_ungetc | fd_upcase_string | fd_valid_utf8p | fd_xgetc | fd_xgetc_encoded | fd_xputc | fd_xputc_encoded | fd_xungetc |
| Function | Arguments | Returns |
|---|---|---|
| fd_foreign_filestring | char *filename,struct FD_TEXT_ENCODING *e | lisp |
| a filename (a localized string) and a text encoding | a utf-8 string | |
| Interprets the contents of the file according to the encoding and returns a UTF-8 encoded unicode string. | ||
| fd_upcase_string | fd_u8char *string,int len | fd_u8char * |
| a utf8 string | a copy of the argument converted to upper case | |
| fd_get_file_encoding | FILE *f | struct FD_TEXT_ENCODING * |
| a FILE pointer | a pointer to an encoding struct or NULL | |
| Returns the encoding associated with a particular file stream. | ||
| fd_valid_utf8p | fd_u8char *s | int |
| a possible utf8 string | 1 if the string is valid, 0 otherwise. | |
| fd_fputs_encoded | fd_u8char *s,int len,FILE *f | void |
| a utf8 string and a FILE pointer | nothing | |
| Writes the contents of the string to the XFILE, writing unhandled characters with unicode (\u and \U escapes). | ||
| fd_fputc | xchar c,FILE *f | void |
| a wide char and a FILE pointer | void | |
| Writes the character to the FILE stream | ||
| fd_set_system_encoding | char *name | void |
| an encoding name | void | |
| Sets the encoding used by the operating system (e.g. for system calls, filenames, etc) | ||
| fd_ungetc | int c,FILE *f | void |
| a wide character and a FILE pointer | nothing | |
| Ungets the character on the stream, using its XFILE structure if possible. | ||
| fd_set_default_encoding | char *name | void |
| an encoding name | void | |
| Sets the default encoding used for XFILES | ||
| fd_set_file_encoding | FILE *f,char *name | void |
| a FILE pointer and an ASCII string naming an encoding | void | |
| Sets the encoding for a particular FILE pointer to the encoding with the specified name. | ||
| fd_fgetc | FILE *f | int |
| a FILE pointer | a wide character | |
| Returns a wide character from a stream according to its encoding. | ||
| fd_get_xfile | FILE *f | struct FD_XFILE * |
| a FILE pointer | an XFILE pointer (or NULL) | |
| Gets the XFILE struct associated with a particular file pointer. | ||
| fd_fputs_raw | fd_u8char *s,int len,FILE *f | void |
| a utf8 string and an XFILE pointer | nothing | |
| Writes the contents of the string to the XFILE, signalling an error if the stream does not accept any of the characters in the XFILE. | ||
| fd_localize_utf8 | fd_u8char *string,struct FD_TEXT_ENCODING *e | unsigned char * |
| a utf8 encoded string and a text encoding | a regular string | |
| Returns an 8BIT string encoded using the text encoding. | ||
| fd_xgetc_encoded | struct FD_XFILE *f | int |
| an XFILE pointer | a wide character | |
| Returns a wide character from a stream according to its encoding. This will interpret \u and \U escapes in the file. | ||
| fd_convert_utf8 | fd_u8char *string,int slen,struct FD_TEXT_ENCODING *e,int *size_loc | unsigned char * |
| a utf8 encoded string and a text encoding | a regular string | |
| Returns an 8BIT string encoded using the text encoding. | ||
| fd_interpret_unicode_escapes | fd_u8char *string | fd_u8char * |
| a utf8 string with (potentially) embedded unicode escapes | a utf8 string where those escapes have been expanded | |
| fd_free_xfile | FILE *f | void |
| an FILE pointer | nothing | |
| Frees the XFILE entry from the linked list of FILE association pointers. | ||
| fd_load_encoding | char *name,char *file | void |
| a name and a filename | void | |
| Defines a text encoding based on a text file of byte sequence to unicode mappings. This interprets the standard mappings files provided by the Unicode consortium at ftp://ftp.unicode.org/Public/MAPPINGS/. | ||
| fd_get_encoding | char *name | struct FD_TEXT_ENCODING * |
| an ASCII string | a pointer to an FD_TEXT_ENCODING struct | |
| This gets the structure describing a particular encoding given its ASCII name. | ||
| fd_xputc | xchar c,struct FD_XFILE *f | void |
| a wide char and an XFILE pointer | void | |
| Writes the character to XFILE stream, signalling an error if the stream cannot handle the character. | ||
| fd_make_utf8 | uchar *start,uchar *end,struct FD_TEXT_ENCODING *e | fd_u8char * |
| a 8BIT string representation and a text encoding | a utf8 encoded string | |
| fd_xputc_encoded | xchar c,struct FD_XFILE *f | void |
| a wide char and an XFILE pointer | void | |
| Writes the character to XFILE stream, using unicode escapes if the stream cannot handle the character. | ||
| fd_downcase_string | fd_u8char *string,int len | fd_u8char * |
| a utf8 string | a copy of the argument converted to lower case | |
| fd_xungetc | int c,struct FD_XFILE *e | void |
| a wide character and an XFILE pointer | nothing | |
| Ungets the character on an XFILE stream. | ||
| fd_define_encoding | char *name,struct FD_MB_MAP *charset,int size, wc2mb_fn wc2mb,mb2wc_fn mb2wc,int flags | int |
| a name, a pointer to a charset, a wide-char to multi-byte conversion function, a multi-byte to wide-char conversion function, and a set of flags. | 1 if the map was used, zero if it wasn't (mapping was already defined) | |
| Defines an encoding with a name and the associated properties. If an encoding with the give properties already exists, the name is added to that encoding structure. | ||
| fd_xgetc | struct FD_XFILE *f | int |
| an XFILE pointer | a wide character | |
| Returns a wide character from a stream according to its encoding. This will *not* interpret \u and \U escapes in the file. |
_fd_qfree | _fd_qmalloc | _fd_qmalloc_cons | fd_free | fd_free_int_array | fd_malloc | fd_malloc_adjust | fd_malloc_init | fd_mallocize | fd_memdup | fd_realloc | fd_strdup | fd_xfree | fd_xmalloc | fd_xmemdup | fd_xrealloc |
| Function | Arguments | Returns |
|---|---|---|
| _fd_qmalloc_cons | size_t bytes | void * |
| number of bytes | allocated memory | |
| This also initializes the reference count, assuming that the result will be a struct whose first int field is the reference count. | ||
| fd_xrealloc | void *oldptr,size_t bytes | void * |
| a pointer and a size | returns a pointer to a memory chunk with at least size bytes | |
| which includes the data of the argument passed in This signals an exception if malloc fails. It doesn't count the malloc'd bytes | ||
| _fd_qmalloc | size_t bytes | void * |
| number of bytes | allocated memory | |
| This maintains a free list for certain memory sizes and allocates them blocks at a time. | ||
| fd_malloc | size_t bytes | void * |
| number of bytes | allocated memory to at least that many bytes | |
| This signals an exception if malloc fails. | ||
| fd_memdup | const char *data,size_t sz | char * |
| a pointer to a chunk of memory and a size | a string | |
| Allocates a new string which is a copy of its argument and has the corresponding size. This will work with strings that contain NULLs. This will count towards global memory counts and use huge_malloc if neccessary. | ||
| fd_malloc_init | size_t sz,int chunk_size | void |
| two size_t pointers, struct_size and block_size | void | |
| Arranges for malloc tables to keep a free list of structs with *struct_size* bytes and to allocate these structs in blocks of *block_size* to reduce malloc overhead. This will signal an error if any thread has already copied the malloc data table. This isn't neccessary, but just easy to code right now. | ||
| fd_xmalloc | size_t bytes | void * |
| number of bytes | allocated memory to at least that many bytes | |
| This signals an exception if malloc fails. It doesn't count the malloc'd bytes, though... | ||
| fd_xfree | void *ptr | void |
| a pointer | void | |
| Doesn't signal an error of pointer is NULL | ||
| fd_free_int_array | unsigned int *ptr,size_t size | void |
| a pointer and number of bytes | void | |
| This frees the pointer and bumps the malloc pointer down by a number rounded up to the size to FD_STRING_CHUNK. | ||
| fd_mallocize | char *data,size_t sz | char * |
| a pointer to a chunk of memory and a size | a pointer | |
| Returns a pointer which can be used with the fd_malloc/realloc/free functions. This does two things: if the size is large enough to for calling huge_malloc, it is called, the strings contents is copied, and the original chunk is freed; in addition, in either the case of a copy or a pass-through fd_malloc_adjust is called to record the memory take up by the chunk of memory. | ||
| fd_xmemdup | const char *data,size_t sz | char * |
| a pointer to a chunk of data and a size | a string | |
| Allocates a new string which is a copy of its argument and has the corresponding size. This will work with strings that contain NULLs. This does not count towards the global memory counts. | ||
| fd_realloc | void *ptr,size_t new_size,size_t old_size | void * |
| a pointer and a number of bytes | void | |
| Frees the pointer and updates the memory usage count | ||
| fd_strdup | const char *string | char * |
| a null terminated string | a null terminated string | |
| Allocates a new string which is a copy of its argument. This does not count towards the global memory counts. | ||
| fd_malloc_adjust | int delta | void |
| an int | void | |
| Bumps up the malloc count but doesn't really malloc anything | ||
| _fd_qfree | void *p,size_t bytes | void |
| a pointer and a number of bytes | void | |
| This frees a cons allocated by fd_qmalloc which tries to do free list maintainance. | ||
| fd_free | void *ptr,size_t bytes | void |
| a pointer and a number of bytes | void | |
| Frees the pointer and updates the memory usage count |
| Function | Arguments | Returns |
|---|
_fd_done_with_slotmap_data | _fd_slotmap_data | fd_make_slotmap | fd_slotmap_add | fd_slotmap_get | fd_slotmap_remove | fd_slotmap_set | fd_slotmap_test | fd_slotmap_zap |
| Function | Arguments | Returns |
|---|---|---|
| fd_slotmap_add | fd_slotmap sm,lisp key,lisp value | void |
| a slotmap, a lisp key, and a lisp value | makes the value be associated with the key | |
| in the slotmap, making the value non deterministic if neccessary. Refcounts (if it's not a set) or copies (if it is) the value given it. | ||
| _fd_slotmap_data | lisp x,void **velts | int |
| a lisp pointer (to a slotmap) and a pointer to a pointer to a vector of lisp pointers | an int (the number of lisp pointers in the vector assigned | |
| Returns the data of the slotmap to use in producing a packaged DTYPE from it. | ||
| fd_slotmap_test | fd_slotmap sm,lisp key,lisp value | int |
| a slotmap, a lisp key, and a lisp value | 1 or 0 | |
| Returns 1 if the value can be found on the *key* slot of the slotmap. | ||
| fd_slotmap_get | fd_slotmap sm,lisp key,lisp dflt | lisp |
| a slotmap, a lisp key, and a default value | the value associated with the key in the slotmap | |
| or the default value otherwise. | ||
| fd_make_slotmap | int size | lisp |
| a size (int) | a slotmap with capacity for |
|
| _fd_done_with_slotmap_data | fd_lisp *elts,int size | void |
| a pointer to a vector of LISP pointers and a size | nothing | |
| Frees a slotmap data vector. | ||
| fd_slotmap_set | fd_slotmap sm,lisp key,lisp value | void |
| a slotmap, a lisp key, and a lisp value | makes the value be associated with the key | |
| in the slotmap Refcounts (if it's not a set) or copies (if it is) the value given it. | ||
| fd_slotmap_remove | fd_slotmap sm,lisp key,lisp value | void |
| a slotmap, a lisp key, and a lisp value | removes the value from the values associated with | |
| a particular key in the slotmap The value on the slotmap is freed. | ||
| fd_slotmap_zap | fd_slotmap sm,lisp key | void |
| a pointer to a slotmap and a key | nothing | |
| Removes all values associated with the key in the slotmap. |
_fd_sgetc | fd_add_dtype_to_file | fd_configure_oid_io | fd_default_parse_oid | fd_default_print_oid | fd_dtype_size | fd_object_to_string | fd_parse_arg | fd_parse_lisp_from_stream | fd_parse_number | fd_parse_string | fd_print_lisp | fd_print_lisp_to_stdout | fd_print_lisp_to_string | fd_read_dtype_from_file | fd_read_dtypes_from_file | fd_set_bignum_parser | fd_set_super_pool_aliasing | fd_validate_dtype | fd_write_dtype_to_file |
| Function | Arguments | Returns |
|---|---|---|
| fd_parse_arg | char *xstring | lisp |
| a localized string | a lisp object | |
| Returns the lisp object described by the printed representation in its argument. | ||
| fd_print_lisp | lisp x, FILE * stream | void |
| a lisp object and a standard output stream | nothing | |
| Outputs an ascii representation of the object to the output stream | ||
| fd_configure_oid_io | void ((*print_fcn | void |
| a pointer to two C functions; the first outputs OIDs to string streams and the second parses utf8 strings into OIDs | nothing | |
| Changes the default printer and parser for OIDs. | ||
| fd_write_dtype_to_file | lisp v,char *filename | void |
| a lisp object, a filename (a string) | nothing | |
| Outputs a dtype representation of the object to the specified file. | ||
| fd_default_parse_oid | fd_u8char *string | lisp |
| a pointer to a UTF-8 string | a lisp pointer to an FD_OID | |
| Outputs the most primitive ASCII representation of the object to the string stream. | ||
| _fd_sgetc | fd_u8char **ss | int |
| a pointer to a pointer to a UTF-8 string | an int (representing a unicode character) | |
| Reads a single unicode character from a utf-8 string, advancing the string past the character. | ||
| fd_read_dtype_from_file | char *filename | lisp |
| a localized string (a filename) | a lisp object | |
| Returns the lisp object described by the first DTYPE in filename. | ||
| fd_parse_number | fd_u8char *string,int base | lisp |
| a utf8 string and an integral base | a lisp object | |
| Parses the number assuming the specified base. | ||
| fd_default_print_oid | lisp obj,fd_string_stream ss | void |
| a pointer to a LISP OID pointer and a pointer to a "string stream" | nothing | |
| Outputs the most primitive ASCII representation of the object to the string stream. | ||
| fd_read_dtypes_from_file | char *filename | lisp |
| a localized string (a filename) | a lisp object | |
| Returns the lisp objects described by the DTYPES in filename. | ||
| fd_validate_dtype | unsigned char *buf,unsigned char *end | int |
| two pointers into an array of bytes | 1 if the range contains a valid dtype representation | |
| fd_set_bignum_parser | lisp (*fcn | void |
| a function for parsing bignums from strings and returning lisp objects | void | |
| Defines the function used for parsing large integers into lisp objects. The function takes a string and an integral radix and returns a lisp object representing the number described by the string. | ||
| fd_dtype_size | lisp x | unsigned int |
| a lis pointer | an integer | |
| Returns the number of bytes which will be used by the DType representation of its argument. | ||
| fd_parse_lisp_from_stream | FILE *f | lisp |
| a FILE pointer | a lisp object | |
| Parses the printed representation of an object from a stdio file stream | ||
| fd_object_to_string | lisp object | fd_u8char * |
| a lisp object | a string | |
| Returns a string containing a UTF-8 representation of the object. | ||
| fd_parse_string | fd_u8char *string | lisp |
| a utf8 string | a lisp object | |
| Returns the lisp object described by the printed representation in its argument. | ||
| fd_set_super_pool_aliasing | FD_OID from,FD_OID to | void |
| two OIDs | nothing | |
| Sets up the DType reader to translate OIDs in the super pool of *from* into OIDs in the super pool for *to*. | ||
| fd_add_dtype_to_file | lisp v,char *filename | void |
| a lisp object, a filename (a string) | nothing | |
| Outputs a dtype representation of the object to the end of the specified file (creating it if neccessary). | ||
| fd_print_lisp_to_stdout | lisp dtype | void |
| a lisp object | nothing | |
| Outputs an ascii representation of the object to the standard output | ||
| fd_print_lisp_to_string | lisp x,fd_string_stream s | void |
| a lisp object and a pointer to a "string stream" | nothing | |
| Outputs an ASCII representation of the object to the string stream. |
_fd_add_to_choice | _fd_binary_choice | _fd_make_choice_heterogenous | _fd_make_choice_homogenous | _fd_merge_choices | _fd_quote_choice | _fd_unquote_choice | fd_choice_containsp | fd_choice_overlapsp | fd_init_choice | fd_init_oid_choice | fd_intersect_choices | fd_list_to_choice | fd_merge_choices | fd_proper_choicep | fd_remove_from_choice | fd_return_proper_choice | fd_sort_choice |
| Function | Arguments | Returns |
|---|---|---|
| fd_init_oid_choice | int n | lisp |
| a size | An empty non-deterministic set with a homogenous type of OID | |
| This returns an empty set with reserved space for a certain number of elements. The set is initialized as a homogenous choice of OIDS. | ||
| _fd_make_choice_heterogenous | fd_choice ch | void |
| a pointer to a choice | nothing | |
| Makes a homogenous choice into a heterogenous one | ||
| _fd_binary_choice | lisp x,lisp y | lisp |
| two lisp objects | a non-deterministic set containing copies of them | |
| This is useful because the transition from simple value to nd-value usually starts with a set of two elements. | ||
| fd_sort_choice | fd_lisp arg | int |
| a pointer to a choice | 1/0 | |
| Sorts the elements of a heterogenous choice, returns 1 if the choice was successfully sorted, 0 otherwise | ||
| fd_list_to_choice | lisp lst | lisp |
| a lisp list | an non-deterministic set whose elements are the elements of | |
| the list it is given This copies (rather than just crefs) the elements it is given | ||
| fd_init_choice | int n | lisp |
| a size | An empty non-deterministic set | |
| This returns an empty set with reserved space for a certain number of elements. | ||
| fd_remove_from_choice | lisp x,lisp choice | lisp |
| a lisp object and a lisp non-deterministic set | a non-deterministic set without any occurences of the object | |
| _fd_make_choice_homogenous | fd_choice ch | void |
| a pointer to a choice | nothing | |
| Makes a heterogenous choice into a homogenous one | ||
| fd_choice_containsp | lisp sub,lisp super | int |
| two lisp objects | 1 or 0 | |
| Returns 1 if the first argument is a subset of the second. of the choice which is the second argument. | ||
| _fd_unquote_choice | fd_lisp x | fd_lisp |
| a lisp object (possibly a choice) | a lisp object | |
| Returns a lisp object will be a quoted choice if appropriate | ||
| _fd_merge_choices | lisp x,lisp y | lisp |
| two objects | a non-deterministic set which contains the elements of both | |
| This implicitly frees y (its second argument), while adding its elements to x. | ||
| fd_merge_choices | lisp x,lisp y | lisp |
| two objects | a non-deterministic set which contains the elements of both | |
| Merges two choices, being smart about sorted choices. This may side effect the first argument. | ||
| fd_proper_choicep | lisp value | int |
| a lisp pointer | 1 if the argument is a proper choice, 0 otherwise | |
| A proper choice has no duplicated elements. Note that a non-choice lisp pointer is always "proper" since it has only one element. | ||
| fd_return_proper_choice | lisp values | lisp |
| a lisp pointer | another lisp pointer | |
| If the argument is a non-deterministic set, this returns a "proper set" which contains no duplicate elements. | ||
| fd_choice_overlapsp | lisp ch1,lisp ch2 | int |
| two lisp objects | 1 or 0 | |
| Returns 1 if any elements of the first argument overlap elements of the second. | ||
| fd_intersect_choices | lisp *choices,int size | lisp |
| a C array of LISP pointers and a size | a lisp object | |
| Returns the intersection of all the choices in the array. This is optimized to take advantage of sorted choices. | ||
| _fd_add_to_choice | lisp x,lisp set | void |
| a lisp object and a lisp non-deterministic set | nothing | |
| Adds the object (not a copy!) to the non-deterministic set. | ||
| _fd_quote_choice | fd_lisp x | fd_lisp |
| a lisp object (possibly a choice) | a lis |