FramerD Kernel APIs

Automatically Generated by etc/build-api-doc.fdx at 2002-06-26T14:58:37.044382-4:00

Summary

src/cons/hash.c_fd_hashset_add_nc | _fd_hashtable_set_nolock | _fd_set_symbol_value_noref | _fd_symbol_value_noref | fd_choice_to_hashset | fd_cleanup_locked_hashtable | fd_final_hashset_elts | fd_for_all_symbols | fd_free_hashset | fd_free_hashtable | fd_grow_hashset | fd_grow_hashtable | fd_hash_lisp | fd_hashset_add | fd_hashset_drop | fd_hashset_elts | fd_hashset_get | fd_hashset_intern | fd_hashset_probe | fd_hashset_strget | fd_hashtable_add | fd_hashtable_drop | fd_hashtable_get | fd_hashtable_increment | fd_hashtable_increment_existing | fd_hashtable_max | fd_hashtable_probe | fd_hashtable_set | fd_hashtable_skim | fd_hashtable_test | fd_hashtable_zap | fd_init_hashset | fd_init_hashtable | fd_intern | fd_make_hashset | fd_make_hashtable | fd_make_qstring | fd_make_symbol | fd_probe_symbol | fd_reinit_hashset | fd_reinit_hashtable | fd_select_table_size | fd_set_symbol_value | fd_symbol_value |
src/index/file-index.cfd_dtype_compare | fd_file_index_collect_values | fd_index_report_stats | fd_preload_file_index | fd_register_file_index_opener | fd_unpreload_file_index | object |
src/cons/data.cFD_MAKE_LIST | _FD_MAKE_LIST1 | _FD_MAKE_PAIR | _fd_copy_lisp_proc | _fd_decref_cons | _fd_incref_cons | fd_copy_string | fd_for_elts | fd_free_proc | fd_get_big_buffer | fd_init_string | fd_init_vector | fd_lisp_equal | fd_list_length | fd_lookup_compound | fd_lookup_package_code | fd_lookup_record | fd_lower_string | fd_make_character | fd_make_cptr | fd_make_lrecord | fd_make_pair | fd_make_record | fd_make_string | fd_make_substring | fd_make_vector | fd_memberp | fd_register_record | fd_register_source_file | fd_register_typecode | fd_stream_string | fd_utf8_string_ref | fd_utf8_strlen | fd_utf8_substring |
src/index/index.cfd_close_index | fd_commit_index | fd_find_index | fd_for_indices | fd_index_add | fd_index_drop | fd_index_get | fd_index_get_size | fd_index_keys | fd_index_prefetch | fd_index_set | fd_index_set_sizes | fd_intern_index_values | fd_interpret_index | fd_revert_index | fd_set_index_zipf_threshold | fd_swap_out_index | fd_use_index |
src/os/fdprintf.c_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 |
src/index/network-index.cfd_use_network_index |
src/eval/sandbox.cfd_add_restricted_cproc | fd_add_restricted_lexpr | fd_add_restricted_special_form |
src/text/mime.cfd_parse_mime |
src/text/text.cfd_text_subst |
src/text/htmlgen.cfd_http_puts | fd_http_write_bytes | fd_set_http_output_methods | fd_start_http | fd_start_http_output | fd_unparse_xml |
src/odb/network-pool.cfd_use_network_pool |
src/odb/pools.cfd_commit_pool | fd_find_pool_named | fd_for_pools | fd_get_pool | fd_interpret_pool | fd_locate_pool | fd_pool_load | fd_random_oid | fd_register_pool | fd_set_oid_locator | fd_use_pool |
src/text/stem.cfd_stem_english_word |
src/cons/xdata.cfd_alist_to_hashtable | fd_compare_cptrs | fd_cons | fd_copy_cptr | fd_hashtable_to_alist | fd_lisp_hashset_elts | fd_make_complex | fd_make_double_vector | fd_make_error | fd_make_exception | fd_make_float_vector | fd_make_flonum | fd_make_hashset_for_lisp | fd_make_hashtable_for_lisp | fd_make_int_vector | fd_make_packet | fd_make_rational | fd_make_short_vector | fd_make_timestamp | fd_make_xtimestamp | fd_parse_packet | fd_quote_lisp |
src/os/timefns.cfd_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 |
src/cons/consed-oids.c_fd_not_an_oid | fd_grow_oid_table | fd_make_oid | fd_probe_oid |
src/eval/load.cfd_get_module | fd_load_file | fd_load_library |
src/os/envfns.cfd_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 |
src/os/filefns.cfd_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 |
src/odb/odb.cfd_close_pool | fd_commit_oid | fd_control_frame_printing | fd_get_modified | fd_get_oid_value | fd_mark_modified | fd_new_oid | fd_oid_modifiedp | fd_print_oid | fd_revert_oid | fd_revert_pool | fd_set_oid_value | fd_show_poolids | fd_swap_out | fd_swap_out_pool | fd_try_oid_value |
src/fdscript/osprims.cfd_register_url_protocol | fd_urlget |
src/scheme/strings.cfd_string_length | fd_string_ref | fd_string_set |
src/odb/super-pool.cfd_allocate_pool | fd_recovered_pool | fd_super_pool_base | fd_super_pool_loading | fd_super_pool_top |
src/eval/threads.cfd_thread_symbind | fd_thread_symeval |
src/cons/choices.c_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 |
src/odb/frames.cfd_already_doing_p | fd_clear_slot_cache | fd_copy_frame | fd_describe_slot | fd_disable_slot_cache | fd_enable_slot_cache | fd_for_slots | fd_frame_add | fd_frame_create | fd_frame_get | fd_frame_get_star | fd_frame_remove | fd_frame_set | fd_frame_slots | fd_frame_test | fd_get_slotmap | fd_inherit_values | fd_inherits_valuep | fd_overlay_create | fd_overlay_get | fd_overlay_test | fd_pathp | fd_prim_add | fd_prim_add_consed | fd_prim_drop | fd_prim_get | fd_prim_set | fd_prim_set_consed | fd_prim_test | fd_use_autoindex |
src/odb/libframerd.cfd_report_framerd_stats |
src/text/xml.cfd_make_xmltag | fd_parse_html | fd_parse_xml | fd_xml_attributes | fd_xml_content | fd_xml_tag | fd_xmltag_name | fd_xmltag_namespace |
src/cons/slotmaps.c_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 |
src/eval/lambda.cfd_bind_value | fd_free_env | fd_make_env | fd_make_gproc | fd_make_sproc | fd_make_ssproc | fd_mallocd_env | fd_module_export | fd_module_uses | fd_register_module | fd_register_restricted_module | fd_registered_module | fd_required_symeval | fd_safe_set_value | fd_set_value | fd_symeval |
src/eval/eval.c_fd_finalize_static_tail_call | fd_add_alias | fd_add_cproc | fd_add_lexpr | fd_add_special_form | fd_do_application | fd_eval | fd_eval_elts | fd_eval_in_env | fd_evalstring | fd_finish_value | fd_make_rproc | fd_mv_arity | fd_mv_ref | fd_mv_return | fd_record_typep | fd_set_supertype | fd_start_eval | fd_streval |
src/os/network.cfd_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 |
src/os/i18n.cfd_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 |
src/os/fdmalloc.c_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 |
src/os/except.c_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 |
src/cons/io.c_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 |
src/odb/file-pool.cfd_cache_file_pool | fd_file_pool_capacity | fd_file_pool_freespace | fd_file_pool_load | fd_label_file_pool | fd_lock_file_pool | fd_make_file_pool | fd_make_new_super_pool | fd_make_pool_snapshot | fd_make_super_pool | fd_new_file_pool | fd_read_file_pool_metadata | fd_register_file_pool_opener | fd_use_file_pool |
src/index/search.cfd_find_frames | fd_find_similar | fd_get_frame_features | fd_get_slot_features | fd_index_frame | fd_index_notice_slot_values | fd_index_slot_values | fd_index_slots | fd_score_from_samples | fd_score_from_spec | fd_strict_search |

Functions defined in src/os/envfns.c

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 |

FunctionArgumentsReturns
fd_get_unameuid_t idchar *
a uida string
Gets the user name for a particular id
fd_set_gidchar *gnameint
a gidchanges the current group to be name, return 1 if successful
fd_inhibit_heraldint inhibitvoid
nonevoid
Keeps the startup and shutdown heralds from being shown
fd_get_uidchar *unameuid_t
a stringgets the user ID for a named user
fd_set_build_datechar *datevoid
a stringnothing
Sets the build date to be returned by fd_get_build_date
fd_int_getenvchar *var,int dfltint
a string naming a variable and an int defaultan 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_gidchar *unamegid_t
a stringgets the group ID for a named group
fd_get_gnamegid_t idchar *
a gida string
Gets the group name for a particular gid
fd_exitint statusvoid
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_configchar *config_fileint
a filename (a string)nothing
Loads the variable bindings defined in the specified configuration file, setting the corresponding symbol values
fd_inhibit_anti_warrantyint inhibitvoid
nonevoid
Keeps the startup and shutdown heralds from being shown
fd_getenvchar *varlisp
a string naming a variablea 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_getrusagestruct rusage *rvoid
a pointer to an rusage structurevoid
Gets rusage information, covering for holes in various implementations (currently just Linux)
fd_string_getenvchar *varfd_u8char *
a string naming a variablea 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_randomunsigned int seedvoid
an unsigned intvoid
This sets the random seed.
fd_set_uidchar *unameint
a uidchanges the current user to be name, return 1 if successful
fd_set_session_mnemonicchar *mnemonicvoid
a stringnothing
Sets the string used to identify this kind of session (e.g. 'fdscript' or more usefully, 'mailreader')
fd_get_user_datauid_t idlisp
a uida lisp structure
Gets the user password data for a particular id

Functions defined in src/os/fdprintf.c

_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 |

FunctionArgumentsReturns
fd_default_notifierfd_u8char *messagevoid
a stringvoid
This is the default notification function, which outputs a bracketed time and report.
_fd_sputcfd_string_stream ss,int chvoid
a pointer to a string stream and a unicode charactervoid
Writes the utf8 representation of the character to the string stream.
fd_xprintfchar *format_string,...void
a format string, and other argsvoid
Outputs a string as exceptional I/O generated from the format string and using the provided arguments. Much like printf (surprise).
fd_fprintfFILE *f,char *fstring,...void
a FILE * stream, a format string, and other argsvoid
Outputs a string to a file stream generated from the format string and using the provided arguments. Much like printf (surprise).
_fd_sputnfd_string_stream ss,fd_u8char *string,int nvoid
a pointer to a string stream, a utf8 string, and an intvoid
Internal string stream string putn function, used in macro ssputn
fd_notifychar *format_string,...void
a FILE * stream, a format string, and other argsvoid
Outputs a string as a notification, which is generated from the format string and using the provided arguments. Much like printf (surprise).
_fd_sputsfd_string_stream ss,fd_u8char *stringvoid
a pointer to a string stream and a utf8 stringvoid
Internal string stream string put function, used in macro ssputs
fd_printffd_string_stream s,char *format_string,...void
a string stream, a format string, and other argsvoid
Outputs a string to string stream generated from the format string and using the provided arguments. Much like printf (surprise).
fd_set_notify_handlervoid (*nfvoid
a function taking a string argvoid
Sets the function which is called on notification messages
fd_warnchar *format_string,...void
a FILE * stream, a format string, and other argsvoid
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_streamfd_string_stream ss,int deltavoid
a pointer to a string stream and a number of bytesvoid
Grows the data structures for the string stream to include delta more bytes
fd_set_warn_handlervoid (*wfvoid
a function taking a string argvoid
Sets the function which is called on warning messages

Functions defined in src/os/timefns.c

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 |

FunctionArgumentsReturns
fd_init_xtimestruct FD_XTIME *xtpvoid
a pointer to an extended timestamp structurevoid
This takes a timestamp object and fills out an extended time pointer structure which includes timezone and precision information.
fd_parse_tzspecchar *s,int dfltint
a string and a default offsetan offset from UTC
This uses a built in table but should really use operating system facilities if they were even remotely standardized.
fd_sleepdouble secsvoid
an interval in seconds (a double)nothing
This is a platform abstraction for sleeping that *may* allow sub-second sleeps.
fd_mktimestruct tm *tptr,int tzofftime_t
a pointer to a tm struct and a time offset (from UTC) in secondsa 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_timestruct tm *tptr,time_t tick,int tzoffint
a pointer to a tm struct, a time_t value, and an offsetan 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_timelisp timestamptime_t
a lisp pointer to a timestampa time_t value
fd_xtime_to_timestampstruct FD_XTIME *xtpfd_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_xtimechar *s,struct FD_XTIME *xtptime_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_iso8601char *stringtime_t
a stringa time_t
Parses an iso8601 format date/time string into a time_t value.
fd_timestamp_to_xtimefd_lisp timestamp,struct FD_XTIME *xtptime_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_iso8601struct FD_XTIME *xtp,fd_string_stream ssint
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_nowstruct FD_XTIME *xtptime_t
a pointer to an extended time pointera time_t or -1 if it fails for some reason
This will try and get the finest precision time it can.
fd_localtimestruct tm *tptr,time_t tickint
a pointer to a tm struct and a time_t valuethe 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.

Functions defined in src/os/except.c

_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 |

FunctionArgumentsReturns
fd_raise_detailed_exceptionfd_exception ex,char *detailsvoid
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_exceptionfd_exception ex,char *details,lisp objvoid
an exception (a string), details (another string), and a lisp objectno.
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_exceptionfd_exception exvoid
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_exceptionfd_exception ex,fd_u8char *details,lisp objectvoid
an exception (a string), a details string, and a lisp objectnothing
Set's the current threads exception information.
fd_exception_contextint forcestruct FD_EXCEPTION_CONTEXT *
nonea pointer to a FD_EXCEPTION_CONTEXT struct
fd_ctype_errorchar *c_context,fd_u8char *details,lisp objvoid
details text (a string), and a lisp objectno.
Raises a type error with particular details and an object.
fd_record_type_errorlisp obj,lisp tagvoid
details text (a string), and a lisp objectno.
Raises a type error with particular details and an object.
fd_pigs_flyfd_u8char *detailsvoid
details text (a string)no.
This is used to signal errors which should never happen.
_fd_push_jbrfd_setjmp_rec *jbrvoid
a setjmp recordvoid
Adds an entry to the exception handling stack for a particular setmp location
fd_type_errorfd_u8char *details,lisp objvoid
details text (a string), and a lisp objectno.
Raises a type error with particular details and an object.
fd_exception_context_pushlisp symvoid
a lisp pointervoid
Adds a value to the current exception context
fd_throwfd_exception ex,char *details,lisp objvoid
an exception (a string), details (another string), and a lisp objectno.
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.

Functions defined in src/os/network.c

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 |

FunctionArgumentsReturns
fd_dtype_evallisp expr,fd_server slisp
a lisp object and a servera lisp object
Asks the server to evaluate the lisp object, returning the result and trying to restart the connection once if neccessary.
fd_sendallint socket,char *buf,int size,int flagsint
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_connectionfd_server server,char *dest,int port,char *idvoid
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_dtcallfd_server s,char *fcn,...lisp
a server, a function name (a string), and a number of args ending with FD_VOIDa 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_connectchar *specfd_server
a string identifying a servera 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_mailchar *dest,char *text,lisp fieldsvoid
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 **fullnameint
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_connectionfd_server svoid
a servernothing
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_dtcallfd_server s,char *fcn,...lisp
a server, a function name (a string), and a number of args ending with FD_VOIDa lisp object
Like fd_dtcall, but signals an error when the remote server returns an error object.
fd_timed_recvint secs,int socket_id,char *data,int len,int flagsint
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_connectchar *specfd_server
a string identifying a servera 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_getchar *url,int *sizepchar *
a string and a pointer to an inta 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_socketchar *filename,char *id,int signal_errorint
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_headchar *url,int *sizepchar *
a string and a pointer to an inta string (actually a pointer to a byte array)
Gets the head of a remote URL as a character string
fd_open_connectionchar *name,int port,char *idfd_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_socketstruct FD_DBUF *buf,int socketvoid
a pointer to an FD_DBUF struct and a socketnothing (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_evallisp expr,fd_server slisp
a lisp object and a servera lisp object
Like fd_dtype_eval but signals an error if the remote server returns an error or exception object.
fd_get_portnochar *stringint
a stringan 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_dtevalint flagint
1 or 01 or 0
Turns on tracing of all remote DTYPE evaluation activity.
fd_http_stringchar *urlchar *
a stringa 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

Functions defined in src/os/filefns.c

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 |

FunctionArgumentsReturns
fd_file_sizefd_u8char *pathoff_t
a stringa long
Returns the size of a file
fd_fcloseFILE *streamvoid
a filenamea FILE * pointer
Closes the stream and cleans up XFILEs associated with it
fd_getpathfd_u8char *namelisp
a string naming an extended environment variablea lisp pointer to a list of directories
Interprets a path variable
fd_symbolic_linkpfd_u8char *pathint
a string1 or 0
Returns 1 if the file is a symbolic link to another file (currently always zero under WIN32).
fd_get_exec_filenamechar *argv0char *
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_lockedfd_u8char *filename,char *mode,int allow_readersFILE *
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_filefd_u8char *filename,lisp search_pathfd_u8char *
a string and a lisp pointeranother 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_directorypfd_u8char *pathint
a string1 or 0
Returns 1 if the file is actually a directory.
fd_file_writablepfd_u8char *filenameint
a string1 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_filepfd_u8char *pathint
a string1 or 0
Returns 1 if the file is a regular file.
fd_file_existspfd_u8char *fnameint
a string1 or 0
Returns 1 if the file exists, 0 otherwise. Uses stat.
fd_fopenfd_u8char *filename,char *modeFILE *
a filename and a mode specifiera FILE * pointer
Normalizes the filename for the OS

Functions defined in src/os/i18n.c

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 |

FunctionArgumentsReturns
fd_foreign_filestringchar *filename,struct FD_TEXT_ENCODING *elisp
a filename (a localized string) and a text encodinga utf-8 string
Interprets the contents of the file according to the encoding and returns a UTF-8 encoded unicode string.
fd_upcase_stringfd_u8char *string,int lenfd_u8char *
a utf8 stringa copy of the argument converted to upper case
fd_get_file_encodingFILE *fstruct FD_TEXT_ENCODING *
a FILE pointera pointer to an encoding struct or NULL
Returns the encoding associated with a particular file stream.
fd_valid_utf8pfd_u8char *sint
a possible utf8 string1 if the string is valid, 0 otherwise.
fd_fputs_encodedfd_u8char *s,int len,FILE *fvoid
a utf8 string and a FILE pointernothing
Writes the contents of the string to the XFILE, writing unhandled characters with unicode (\u and \U escapes).
fd_fputcxchar c,FILE *fvoid
a wide char and a FILE pointervoid
Writes the character to the FILE stream
fd_set_system_encodingchar *namevoid
an encoding namevoid
Sets the encoding used by the operating system (e.g. for system calls, filenames, etc)
fd_ungetcint c,FILE *fvoid
a wide character and a FILE pointernothing
Ungets the character on the stream, using its XFILE structure if possible.
fd_set_default_encodingchar *namevoid
an encoding namevoid
Sets the default encoding used for XFILES
fd_set_file_encodingFILE *f,char *namevoid
a FILE pointer and an ASCII string naming an encodingvoid
Sets the encoding for a particular FILE pointer to the encoding with the specified name.
fd_fgetcFILE *fint
a FILE pointera wide character
Returns a wide character from a stream according to its encoding.
fd_get_xfileFILE *fstruct FD_XFILE *
a FILE pointeran XFILE pointer (or NULL)
Gets the XFILE struct associated with a particular file pointer.
fd_fputs_rawfd_u8char *s,int len,FILE *fvoid
a utf8 string and an XFILE pointernothing
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_utf8fd_u8char *string,struct FD_TEXT_ENCODING *eunsigned char *
a utf8 encoded string and a text encodinga regular string
Returns an 8BIT string encoded using the text encoding.
fd_xgetc_encodedstruct FD_XFILE *fint
an XFILE pointera 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_utf8fd_u8char *string,int slen,struct FD_TEXT_ENCODING *e,int *size_locunsigned char *
a utf8 encoded string and a text encodinga regular string
Returns an 8BIT string encoded using the text encoding.
fd_interpret_unicode_escapesfd_u8char *stringfd_u8char *
a utf8 string with (potentially) embedded unicode escapesa utf8 string where those escapes have been expanded
fd_free_xfileFILE *fvoid
an FILE pointernothing
Frees the XFILE entry from the linked list of FILE association pointers.
fd_load_encodingchar *name,char *filevoid
a name and a filenamevoid
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_encodingchar *namestruct FD_TEXT_ENCODING *
an ASCII stringa pointer to an FD_TEXT_ENCODING struct
This gets the structure describing a particular encoding given its ASCII name.
fd_xputcxchar c,struct FD_XFILE *fvoid
a wide char and an XFILE pointervoid
Writes the character to XFILE stream, signalling an error if the stream cannot handle the character.
fd_make_utf8uchar *start,uchar *end,struct FD_TEXT_ENCODING *efd_u8char *
a 8BIT string representation and a text encodinga utf8 encoded string
fd_xputc_encodedxchar c,struct FD_XFILE *fvoid
a wide char and an XFILE pointervoid
Writes the character to XFILE stream, using unicode escapes if the stream cannot handle the character.
fd_downcase_stringfd_u8char *string,int lenfd_u8char *
a utf8 stringa copy of the argument converted to lower case
fd_xungetcint c,struct FD_XFILE *evoid
a wide character and an XFILE pointernothing
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 flagsint
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_xgetcstruct FD_XFILE *fint
an XFILE pointera wide character
Returns a wide character from a stream according to its encoding. This will *not* interpret \u and \U escapes in the file.

Functions defined in src/os/fdmalloc.c

_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 |

FunctionArgumentsReturns
_fd_qmalloc_conssize_t bytesvoid *
number of bytesallocated memory
This also initializes the reference count, assuming that the result will be a struct whose first int field is the reference count.
fd_xreallocvoid *oldptr,size_t bytesvoid *
a pointer and a sizereturns 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_qmallocsize_t bytesvoid *
number of bytesallocated memory
This maintains a free list for certain memory sizes and allocates them blocks at a time.
fd_mallocsize_t bytesvoid *
number of bytesallocated memory to at least that many bytes
This signals an exception if malloc fails.
fd_memdupconst char *data,size_t szchar *
a pointer to a chunk of memory and a sizea 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_initsize_t sz,int chunk_sizevoid
two size_t pointers, struct_size and block_sizevoid
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_xmallocsize_t bytesvoid *
number of bytesallocated memory to at least that many bytes
This signals an exception if malloc fails. It doesn't count the malloc'd bytes, though...
fd_xfreevoid *ptrvoid
a pointervoid
Doesn't signal an error of pointer is NULL
fd_free_int_arrayunsigned int *ptr,size_t sizevoid
a pointer and number of bytesvoid
This frees the pointer and bumps the malloc pointer down by a number rounded up to the size to FD_STRING_CHUNK.
fd_mallocizechar *data,size_t szchar *
a pointer to a chunk of memory and a sizea 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_xmemdupconst char *data,size_t szchar *
a pointer to a chunk of data and a sizea 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_reallocvoid *ptr,size_t new_size,size_t old_sizevoid *
a pointer and a number of bytesvoid
Frees the pointer and updates the memory usage count
fd_strdupconst char *stringchar *
a null terminated stringa 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_adjustint deltavoid
an intvoid
Bumps up the malloc count but doesn't really malloc anything
_fd_qfreevoid *p,size_t bytesvoid
a pointer and a number of bytesvoid
This frees a cons allocated by fd_qmalloc which tries to do free list maintainance.
fd_freevoid *ptr,size_t bytesvoid
a pointer and a number of bytesvoid
Frees the pointer and updates the memory usage count
{}

Functions defined in src/cons/oids.c

FunctionArgumentsReturns

Functions defined in src/cons/slotmaps.c

_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 |

FunctionArgumentsReturns
fd_slotmap_addfd_slotmap sm,lisp key,lisp valuevoid
a slotmap, a lisp key, and a lisp valuemakes 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_datalisp x,void **veltsint
a lisp pointer (to a slotmap) and a pointer to a pointer to a vector of lisp pointersan 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_testfd_slotmap sm,lisp key,lisp valueint
a slotmap, a lisp key, and a lisp value1 or 0
Returns 1 if the value can be found on the *key* slot of the slotmap.
fd_slotmap_getfd_slotmap sm,lisp key,lisp dfltlisp
a slotmap, a lisp key, and a default valuethe value associated with the key in the slotmap
or the default value otherwise.
fd_make_slotmapint sizelisp
a size (int)a slotmap with capacity for slots
_fd_done_with_slotmap_datafd_lisp *elts,int sizevoid
a pointer to a vector of LISP pointers and a sizenothing
Frees a slotmap data vector.
fd_slotmap_setfd_slotmap sm,lisp key,lisp valuevoid
a slotmap, a lisp key, and a lisp valuemakes 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_removefd_slotmap sm,lisp key,lisp valuevoid
a slotmap, a lisp key, and a lisp valueremoves the value from the values associated with
a particular key in the slotmap The value on the slotmap is freed.
fd_slotmap_zapfd_slotmap sm,lisp keyvoid
a pointer to a slotmap and a keynothing
Removes all values associated with the key in the slotmap.

Functions defined in src/cons/io.c

_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 |

FunctionArgumentsReturns
fd_parse_argchar *xstringlisp
a localized stringa lisp object
Returns the lisp object described by the printed representation in its argument.
fd_print_lisplisp x, FILE * streamvoid
a lisp object and a standard output streamnothing
Outputs an ascii representation of the object to the output stream
fd_configure_oid_io void ((*print_fcnvoid
a pointer to two C functions; the first outputs OIDs to string streams and the second parses utf8 strings into OIDsnothing
Changes the default printer and parser for OIDs.
fd_write_dtype_to_filelisp v,char *filenamevoid
a lisp object, a filename (a string)nothing
Outputs a dtype representation of the object to the specified file.
fd_default_parse_oidfd_u8char *stringlisp
a pointer to a UTF-8 stringa lisp pointer to an FD_OID
Outputs the most primitive ASCII representation of the object to the string stream.
_fd_sgetcfd_u8char **ssint
a pointer to a pointer to a UTF-8 stringan 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_filechar *filenamelisp
a localized string (a filename)a lisp object
Returns the lisp object described by the first DTYPE in filename.
fd_parse_numberfd_u8char *string,int baselisp
a utf8 string and an integral basea lisp object
Parses the number assuming the specified base.
fd_default_print_oidlisp obj,fd_string_stream ssvoid
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_filechar *filenamelisp
a localized string (a filename)a lisp object
Returns the lisp objects described by the DTYPES in filename.
fd_validate_dtypeunsigned char *buf,unsigned char *endint
two pointers into an array of bytes1 if the range contains a valid dtype representation
fd_set_bignum_parserlisp (*fcnvoid
a function for parsing bignums from strings and returning lisp objectsvoid
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_sizelisp xunsigned int
a lis pointeran integer
Returns the number of bytes which will be used by the DType representation of its argument.
fd_parse_lisp_from_streamFILE *flisp
a FILE pointera lisp object
Parses the printed representation of an object from a stdio file stream
fd_object_to_stringlisp objectfd_u8char *
a lisp objecta string
Returns a string containing a UTF-8 representation of the object.
fd_parse_stringfd_u8char *stringlisp
a utf8 stringa lisp object
Returns the lisp object described by the printed representation in its argument.
fd_set_super_pool_aliasingFD_OID from,FD_OID tovoid
two OIDsnothing
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_filelisp v,char *filenamevoid
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_stdoutlisp dtypevoid
a lisp objectnothing
Outputs an ascii representation of the object to the standard output
fd_print_lisp_to_stringlisp x,fd_string_stream svoid
a lisp object and a pointer to a "string stream"nothing
Outputs an ASCII representation of the object to the string stream.

Functions defined in src/cons/choices.c

_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 |

FunctionArgumentsReturns
fd_init_oid_choiceint nlisp
a sizeAn 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_heterogenousfd_choice chvoid
a pointer to a choicenothing
Makes a homogenous choice into a heterogenous one
_fd_binary_choicelisp x,lisp ylisp
two lisp objectsa 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_choicefd_lisp argint
a pointer to a choice1/0
Sorts the elements of a heterogenous choice, returns 1 if the choice was successfully sorted, 0 otherwise
fd_list_to_choicelisp lstlisp
a lisp listan 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_choiceint nlisp
a sizeAn empty non-deterministic set
This returns an empty set with reserved space for a certain number of elements.
fd_remove_from_choicelisp x,lisp choicelisp
a lisp object and a lisp non-deterministic seta non-deterministic set without any occurences of the object
_fd_make_choice_homogenousfd_choice chvoid
a pointer to a choicenothing
Makes a heterogenous choice into a homogenous one
fd_choice_containsplisp sub,lisp superint
two lisp objects1 or 0
Returns 1 if the first argument is a subset of the second. of the choice which is the second argument.
_fd_unquote_choicefd_lisp xfd_lisp
a lisp object (possibly a choice)a lisp object
Returns a lisp object will be a quoted choice if appropriate
_fd_merge_choiceslisp x,lisp ylisp
two objectsa non-deterministic set which contains the elements of both
This implicitly frees y (its second argument), while adding its elements to x.
fd_merge_choiceslisp x,lisp ylisp
two objectsa 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_choiceplisp valueint
a lisp pointer1 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_choicelisp valueslisp
a lisp pointeranother lisp pointer
If the argument is a non-deterministic set, this returns a "proper set" which contains no duplicate elements.
fd_choice_overlapsplisp ch1,lisp ch2int
two lisp objects1 or 0
Returns 1 if any elements of the first argument overlap elements of the second.
fd_intersect_choiceslisp *choices,int sizelisp
a C array of LISP pointers and a sizea lisp object
Returns the intersection of all the choices in the array. This is optimized to take advantage of sorted choices.
_fd_add_to_choicelisp x,lisp setvoid
a lisp object and a lisp non-deterministic setnothing
Adds the object (not a copy!) to the non-deterministic set.
_fd_quote_choicefd_lisp xfd_lisp
a lisp object (possibly a choice)a lis