Synchronet JavaScript Object Model Reference

Generated for Synchronet v3.21f, master/23330fc0d2 (Mar 25 2026 13:27) compiled Mar 25 2026 15:44
  1. [+]  global object
  2. [+]  js object
  3. [+]  system object
  4. [+]  File class
  5. [+]  Archive class
  6. [+]  Queue class
  7. [+]  Socket class
  8. [+]  ConnectedSocket class
  9. [+]  ListeningSocket class
  10. [+]  COM class
  11. [+]  conio object
  12. [+]  CryptContext class
  13. [+]  CryptKeyset class
  14. [+]  CryptCert class
  15. [+]  uifc object

global object
Top-level functions and properties (common to all servers, services, and JSexec) - introduced in v3.10

global methods
Name Returns Usage Ver Description
logstringlog([number level=LOG_INFO,] value [,value]) 3.11 Add a line of text to the server and/or system log.
values are typically string constants or variables (each logged as a separate log message),
level is the severity of the message to be logged, one of the globally-defined values, in decreasing severity:
LOG_EMERG, LOG_ALERT, LOG_CRIT, LOG_ERR, LOG_WARNING, LOG_NOTICE, LOG_INFO, and LOG_DEBUG (default: LOG_INFO)
readstringread([count=128]) 3.11 Read up to count characters from input stream and return as a string or undefined upon error
readlnstringreadln([count=128]) 3.11 Read a single line, up to count characters, from input stream and return as a string or undefined upon error
writevoidwrite(value [,value]) 3.11 Send one or more values (typically strings) to the output stream
writelnvoidwriteln(value [,value]) 3.11 Send a line of text to the output stream with automatic line termination (CRLF), values are typically string constants or variables (AKA print)
printfstringprintf(string format [,value][,value]) 3.10 Send a C-style formatted string of text to the output stream. See also the format() function.
alertvoidalert(value) 3.10 Send an alert message (ala client-side JS) to the output stream
promptstringprompt([string text] [,string value] [,number k_mode=K_EDIT]) 3.10 Display a prompt (text) and return a string of user input (ala client-side JS) or null upon no-input
value is an optional default string to be edited (used with the k_mode K_EDIT flag)
See sbbsdefs.js for all valid K_ (keyboard-input) mode flags.
confirmbooleanconfirm(value) 3.10 Display a Yes/No prompt and return true or false based on user's confirmation (ala client-side JS, true = yes)
see also console.yesno()
denybooleandeny(value) 3.15b Display a No/Yes prompt and returns true or false based on user's denial (true = no)
see also console.noyes()
chdirvoidchdir(undefined) undefined
putenvvoidputenv(undefined) undefined
assertEqvoidassertEq(undefined) undefined
exitvoidexit([number exit_code=0]) 3.11 Stop script execution, optionally setting the global property exit_code to the specified numeric value
loadundefinedload([bool background or object scope,] string filename [,args]) 3.12 Load and execute a JavaScript module (filename), optionally specifying a target scope object (default: this) and a list of arguments to pass to the module (as argv).
Returns the result (last executed statement) of the executed script or a newly created Queue object if background is true).

Background:
When the background parameter is true, the loaded script runs in the background (in a child thread) but may communicate with the parent script/thread by reading from and/or writing to the parent_queue (an automatically created Queue object). The result (last executed statement) of the executed script (or the optional exit_code passed to the exit() function) will be automatically written to the parent_queue which may be read later by the parent script (using load_result.read(), for example).
requireundefinedrequire([object scope,] string filename, propname [,args]) 3.17 Load and execute a JavaScript module (filename), optionally specifying a target scope object (default: this) and a list of arguments to pass to the module (as argv) IF AND ONLY IF the property named propname is not defined in the target scope (a defined symbol with a value of undefined will not cause the script to be loaded).
Returns the result (last executed statement) of the executed script or null if the script is not executed.
mswaitnumbermswait([milliseconds=1]) 3.13 Pause execution for the specified number of milliseconds (AKA sleep), returns elapsed duration, in seconds
yieldvoidyield([forced=true]) 3.11 Release current thread time-slice, a forced yield will yield to all other pending tasks (lowering CPU utilization), a non-forced yield will yield only to pending tasks of equal or higher priority. forced defaults to true
randomnumberrandom([max_number=100]) 3.10 Return random integer between 0 and max_number-1
timenumbertime() 3.10 Return current time and date in Unix (time_t) format (number of seconds since January 1st, 1970 UTC)
beepvoidbeep([frequency=500] [,duration=500]) 3.10 Produce a tone on the local speaker at specified frequency for specified duration (in milliseconds)
soundbooleansound([filename]) 3.10 Play a waveform (.wav) sound file (currently, on Windows platforms only)
ctrlstringctrl(number or string value) 3.11 Return ASCII control character representing character value passed - Example: ctrl('C') returns string containing the single character string: '\3'
asciiundefinedascii([string text] or [number value]) 3.10 Convert single character to numeric ASCII value or vice-versa, returns number OR string, or null or undefined if passed those values
ascii_strstringascii_str(text) 3.10 Convert extended-ASCII (CP437) characters in text string to plain US-ASCII equivalent, returns modified string or null or undefined if passed those values
strip_ctrlstringstrip_ctrl(text) 3.10 Strip all control characters and Ctrl-A (attribute) sequences from string, returns modified string or null or undefined if passed those values
strip_ctrl_astringstrip_ctrl_a(text) 3.20 Strip all Ctrl-A (attribute) sequences from string, returns modified string or null or undefined if passed those values
strip_ansistringstrip_ansi(text) 3.18c Strip all ANSI terminal control sequences from string, returns modified string or null or undefined if passed those values
strip_exasciistringstrip_exascii(text) 3.10 Strip all extended-ASCII characters from string, returns modified string or null or undefined if passed those values
skipspstringskipsp(text) 3.15 Skip (trim) white-space characters off beginning of string, returns modified string or null or undefined if passed those values
truncspstringtruncsp(text) 3.10 Truncate (trim) white-space characters off end of string, returns modified string or null or undefined if passed those values
truncstrstringtruncstr(text, charset) 3.10 Truncate (trim) string at first char in charset, returns modified string or null or undefined if passed those values
lfexpandstringlfexpand(text) 3.10 Expand sole line-feeds (LF) to carriage-return/line-feed sequences (CRLF), returns modified string or null or undefined if passed those values
wildmatchbooleanwildmatch([bool case_sensitive=false,] filename [,pattern='*'] [,path=false]) 3.14 Return true if the filename matches the wildcard pattern (wildcard characters supported are '*' and '?'), if path is true, '*' will not match path delimiter characters (e.g. '/')
backslashstringbackslash(path) 3.12 Return directory path with trailing (platform-specific) path delimiter (i.e. "slash" or "backslash")
fullpathstringfullpath(path) 3.15 Create and return an absolute or full path name for the specified relative path name.
file_getnamestringfile_getname(path/filename) 3.11 Return filename portion of passed path string
file_getextstringfile_getext(path/filename) 3.11 Return file extension portion of passed path/filename string (including '.') or undefined if no extension is found
file_getcasestringfile_getcase(path/filename) 3.11 Return correct case of filename (long version of filename on Windows) or undefined if the file doesn't exist
file_cfgnamestringfile_cfgname(path, filename) 3.12 Return completed configuration filename from supplied path and filename, optionally including the local hostname (e.g. path/file.host.domain.ext or path/file.host.ext) if such a variation of the filename exists
file_getdosnamestringfile_getdosname(path/filename) 3.15 Return DOS-compatible (Micros~1 shortened) version of specified path/filename(on Windows only)
return unmodified path/filename on other platforms
file_existsbooleanfile_exists(path/filename) 3.10 Verify a file's existence
file_removebooleanfile_remove(path/filename) 3.10 Delete a file
file_removecasebooleanfile_removecase(path/filename) 3.14 Delete files case insensitively
file_renamebooleanfile_rename(path/oldname, path/newname) 3.11 Rename a file, possibly moving it to another directory in the process
file_copybooleanfile_copy(path/source, path/destination) 3.11 Copy a file from one directory or filename to another
file_backupbooleanfile_backup(path/filename [,level=5] [,rename=false]) 3.11 Back up the specified filename as filename.number.extension where number is the backup number 0 through level-1 (default backup level is 5), if rename is true, the original file is renamed instead of copied (default is false)
file_isdirbooleanfile_isdir(path/filename) 3.10 Check if specified filename is a directory
file_attribnumberfile_attrib(path/filename) 3.10 Get a file's attributes (same as file_mode() on *nix). On Windows, the return value corresponds with _finddata_t.attrib (includes DOS/Windows file system-specific attributes, like hidden, and archive). Returns -1 if the path/filename does not exist.
file_modenumberfile_mode(path/filename) 3.17c Get a file's type and mode flags (e.g. read/write/execute permissions). The return value corresponds with struct stat.st_mode. Returns -1 if the path/filename does not exist.
file_chmodbooleanfile_chmod(path/filename, number mode) 3.17c Set a file's permissions flags. The supported mode bit values are system-dependent (e.g. Windows only supports setting or clearing the user-write/0x80 mode flag). Returns true if the requested change was successful.
file_datenumberfile_date(path/filename) 3.10 Get a file's last modified date/time (in time_t format). Returns -1 if the path/filename does not exist.
file_cdatenumberfile_cdate(path/filename) 3.17 Get a file's creation date/time (in time_t format). Returns -1 if the path/filename does not exist.
file_sizenumberfile_size(path/filename) 3.10 Get a file's length (in bytes). Returns -1 if the path/filename does not exist.
file_utimebooleanfile_utime(path/filename [,access_time=current] [,mod_time=current]) 3.11 Change a file's last accessed and modification date/time (in time_t format), or change to current time
file_touchbooleanfile_touch(path/filename) 3.11 Update a file's last modification date/time to current time, creating an empty file if it doesn't already exist
file_mutexbooleanfile_mutex(path/filename [,string text=local_hostname] [,number max_age=0]) 3.12 Attempt to create an mutual-exclusion (e.g. lock) file, optionally with the contents of text. If a non-zero max_age is specified and the lock file exists, but is older than this value (in seconds), it is presumed stale and removed/over-written
file_comparebooleanfile_compare(path/file1, path/file2) 3.14 Compare 2 files, returning true if they are identical, false otherwise
directoryarraydirectory(path/pattern [,flags=GLOB_MARK]) 3.10 Return an array of directory entries, pattern is the path and filename or wildcards to search for (e.g. '/subdir/*.txt'), flags is a set of optional glob bit-flags (default is GLOB_MARK)
dir_freespacenumberdir_freespace(directory [,unit_size=1]) 3.11 Return the amount of available disk space in the specified directory using the specified unit_size in bytes (default: 1), specify a unit_size of 1000 to return the available space in kilobytes or 1024 for kibibytes.
disk_sizenumberdisk_size(directory [,unit_size=1]) 3.14 Return the total disk size of the specified directory using the specified unit_size in bytes (default: 1), specify a unit_size of 1000 to return the total disk size in kilobytes or 1024 for kibibytes.
socket_selectarraysocket_select([array of socket objects or descriptors] [,number timeout=0] [,bool write=false]) 3.11 Check an array of socket objects or descriptors for read or write ability (default is read), default timeout value is 0.0 seconds (immediate timeout), returns an array of 0-based index values into the socket array, representing the sockets that were ready for reading or writing, or null on error. If multiple arrays of sockets are passed, they are presumed to be in the order of read, write, and except. In this case, the write parameter is ignored and an object is returned instead with up to three properties "read", "write", and "except", corresponding to the passed arrays. Empty passed arrays will not have a corresponding property in the returned object.
socket_strerrorstringsocket_strerror(error) 3.18c Get the description(string representation) of a numeric socket error value (e.g. socket_errno)
strerrorstringstrerror(error) 3.18c Get the description(string representation) of a numeric system error value (e.g. errno)
mkdirbooleanmkdir(path/directory) 3.10 Make a directory on a local file system
mkpathbooleanmkpath(path/directory) 3.15 Make a path to a directory (creating all necessary sub-directories). Returns true if the directory already exists.
rmdirbooleanrmdir(path/directory) 3.10 Remove a directory
rmfilesbooleanrmfiles(path/directory [,file-spec='*'] [,files-to-keep=0]) 3.20 Remove all files and sub-directories in the specified directory, recursively - use with caution!
strftimestringstrftime(format [,time=current]) 3.10 Return a formatted time string (ala the standard C strftime function)
formatstringformat(format [,args]) 3.10 Return a C-style formatted string (ala the standard C sprintf function)
html_encodestringhtml_encode(text [,bool ex_ascii=true] [,bool white_space=true] [,bool ansi=true] [,bool ctrl_a=true] [, state (object)]) 3.11 Return an HTML-encoded text string (using standard HTML character entities), escaping IBM extended-ASCII (CP437), white-space characters, ANSI codes, and CTRL-A codes by default.Optionally storing the current ANSI state in state object
html_decodestringhtml_decode(html) 3.11 Return a decoded HTML-encoded text string, translating HTML character entities into CP437 character equivalents
word_wrapstringword_wrap(text [,line_length=79 [,orig_line_length=79 [,bool handle_quotes=true [,number pmode=0]]]]) 3.11 Return a word-wrapped version of the text string argument optionally handing quotes magically, line_length defaults to 79, orig_line_length defaults to 79, handle_quotes defaults to true, pmode defaults to 0, P_UTF8 and P_RENEGADE pmode bit-flags are supported and may be optionally specified as a set of bool values.

Note: if the original text does not contain any carriage-return (CR) characters, lines are wrapped with sole line-feed (LF) characters.

quote_msgstringquote_msg(text [,line_length=79] [,prefix=" > "]) 3.11 Return a quoted version of the message text string argument, line_length defaults to 79, prefix defaults to " > "
rot13_translatestringrot13_translate(text) 3.11 Return ROT13-translated version of text string (will encode or decode text)
base64_encodestringbase64_encode(text) 3.11 Return base64-encoded version of text string or null on error
base64_decodestringbase64_decode(text) 3.11 Return base64-decoded text string or null on error
crc16_calcnumbercrc16_calc(text) 3.11 Calculate and return 16-bit CRC of text string
crc32_calcnumbercrc32_calc(text) 3.11 Calculate and return 32-bit CRC of text string
chksum_calcnumberchksum_calc(text) 3.11 Calculate and return 32-bit checksum of text string
md5_calcstringmd5_calc(text [,bool hex=false]) 3.11 Calculate and return 128-bit MD5 digest of text string, result encoded in base64 (default) or hexadecimal (32 hex digits)
sha1_calcstringsha1_calc(text [,bool hex=false]) 3.19 Calculate and return 160-bit SHA-1 digest of text string, result encoded in base64 (default) or hexadecimal (40 hex digits)
resolve_ipstringresolve_ip(string hostname [,bool array=false]) 3.11 Resolve IP address of specified hostname (AKA gethostbyname). If array is true, will return an array of all addresses rather than just the first one (upon success). Returns null if unable to resolve address.
resolve_hoststringresolve_host(ip_address) 3.11 Resolve hostname of specified IP address (AKA gethostbyaddr). Returns null if unable to resolve address.
netaddr_typenumbernetaddr_type(email_address) 3.12 Return the proper message net_type for the specified email_address, (e.g. NET_INTERNET for Internet e-mail or NET_NONE for local e-mail)
list_named_queuesarraylist_named_queues() 3.12 Return an array of named queues (created with the Queue constructor)
flags_strundefinedflags_str(string or number) 3.13 Convert a string of security flags (letters) into their numeric value or vice-versa, returns number OR string
utf8_encodestringutf8_encode([string CP437] or [string UTF16] or [number codepoint]) 3.17c Return UTF-8 encoded version of the specified CP437 text string, UTF-16 encoded text string, or a single Unicode codepoint
utf8_decodestringutf8_decode(text) 3.17c Return CP437 representation of UTF-8 encoded text string or null on error (invalid UTF-8)
utf8_get_widthnumberutf8_get_width(text) 3.17c Return the fixed printed-width of the specified string of UTF-8 encoded characters
str_is_utf8booleanstr_is_utf8(text) 3.17c Return true if the specified string contains only valid UTF-8 encoded and US-ASCII characters
str_is_utf16booleanstr_is_utf16(text) 3.17c Return true if the specified string contains one or more UTF-16 encoded characters
str_is_asciibooleanstr_is_ascii(text) 3.17c Return true if the specified string contains only US-ASCII (no CP437 or UTF-8) characters
str_has_ctrlbooleanstr_has_ctrl(text) 3.17c Return true if the specified string contains any control characters (ASCII 0x01 - 0x1F)

global properties
Name Type Ver Description
userUserN/AInstance of the User class representing the current user 'online'
argcnumberN/ACount of arguments passed to the script
argvarrayN/AArray of argument strings (argv.length == argc)
errnonumber3.10hLast system error number
errno_strstring3.10hDescription of last system error
socket_errnonumber3.13aLast socket-related error number (same as errno on Unix platforms)
socket_errno_strstring3.18aDescription of last socket-related error (same as errno_str on Unix platforms)

js object
JavaScript engine internal control object - introduced in v3.11

js methods
Name Returns Usage Ver Description
evalundefinedjs.eval(script) 3.11 Evaluate a JavaScript string in its own (secure) context, returning the result
gcvoidjs.gc(forced=true) 3.11 Perform a garbage collection operation (freeing memory for unused allocated objects), if forced is true (the default) a garbage collection is always performed, otherwise it is only performed if deemed appropriate by the JavaScript engine
on_exitvoidjs.on_exit(to_eval) 3.13 Add a string to evaluate/execute (LIFO stack) upon script's termination (e.g. call of exit())
report_errorvoidjs.report_error(error [,fatal=false]) 3.13 Report an error using the standard JavaScript error reporting mechanism (including script filename and line number), if fatal is true, immediately terminates script
flatten_stringvoidjs.flatten_string(string value) 3.16 Flatten a string, optimizing allocated memory used for concatenated strings
execnumberjs.exec(string filename [,string startup_dir], object scope [,...]) 3.17c Execute a script within the specified scope. The main difference between this method and load() is that scripts invoked in this way can call exit() without terminating the caller. If it does, any on_exit() handlers will be evaluated in the script's scope when the script exits.
NOTE: to get a child of the current scope, you need to create an object in the current scope. An anonymous object can be created using 'new function(){}'.
TIP: Use js.exec.apply() if you need to pass a variable number of arguments to the executed script.
setTimeoutnumberjs.setTimeout(callback, time [,thisObj]) 3.19 Install a timeout timer. callback() will be called time (milliseconds) after this function is called. Returns an id which can be passed to clearTimeout()
setIntervalnumberjs.setInterval(callback, period [,thisObj]) 3.19 Install an interval timer. callback() will be called every period (milliseconds) after setInterval() is called. Returns an id which can be passed to clearInterval()
clearTimeoutvoidjs.clearTimeout(id) 3.19 Remove a timeout timer
clearIntervalvoidjs.clearInterval(id) 3.19 Remove an interval timer
addEventListenernumberjs.addEventListener(eventName, callback) 3.19 Add a listener that is ran after js.dispatchEvent(eventName) is called. Returns an id to be passed to js.removeEventListener()
removeEventListenervoidjs.removeEventListener(id) 3.19 Remove listeners added with js.addEventListener(). id can be a string or an id returned by addEventListener(). This does not remove already triggered callbacks from the run queue.
dispatchEventvoidjs.dispatchEvent(eventName [,object thisObj]) 3.19 Add all listeners of eventName to the end of the run queue. If thisObj is passed, specifies this in the callback (the js object is used otherwise).
setImmediatevoidjs.setImmediate(callback [,thisObj]) 3.19 Add callback to the end of the run queue, where it will be called after all pending events are processed

js properties
Name Type Ver Description
versionstring 3.11 JavaScript engine version information (AKA system.js_version) - READ ONLY
auto_terminateboolean 3.11 Set to false to disable the automatic termination of the script upon external request or user disconnection
terminatedboolean 3.11 Termination has been requested (stop execution as soon as possible)
counternumber 3.16 Number of operation callbacks performed in this runtime
time_limitnumber 3.16 Maximum number of operation callbacks, used for infinite-loop detection (0=disabled)
yield_intervalnumber 3.11 Interval of periodic time-slice yields (lower number=higher frequency, 0=disabled)
gc_intervalnumber 3.11 Interval of periodic garbage collection attempts (lower number=higher frequency, 0=disabled)
gc_attemptsnumber 3.11 Number of garbage collections attempted in this runtime - READ ONLY
globalobject 3.14 Global (top level) object - READ ONLY
optionsnumber 3.18c Option flags - READ ONLY
do_callbacksboolean 3.19 Do callbacks after script finishes running
load_path_listobject N/A load() search path array.
For relative load paths (e.g. not beginning with '/' or '\'), the path is assumed to be a sub-directory of the (configurable) mods or exec directories and is searched accordingly.
So, by default, load("somefile.js") will search in this order:
  1. mods/load/somefile.js
  2. exec/load/somefile.js
  3. mods/somefile.js
  4. exec/somefile.js
exec_pathstring N/A Full path and filename of JS file executed
exec_filestring N/A JS filename executed (with no path)
exec_dirstring N/A Directory of executed JS file
startup_dirstring N/A Either the configured startup directory in SCFG (for externals) or the CWD when jsexec was started
scopeobject N/A Global scope for this script

system object
Global system-related properties and methods - introduced in v3.10

system methods
Name Returns Usage Ver Description
trashcanbooleansystem.trashcan(basename, find_string) 3.10 Search text/basename.can for pseudo-regexp
findstrbooleansystem.findstr(path/filename or array of strings, find_string) 3.10 Search any trashcan/filter file or array of pattern strings (in *.can format) for find_string
zonestrstringsystem.zonestr([timezone=local]) 3.10 Convert time zone integer to string, defaults to system timezone if timezone not specified
timestrstringsystem.timestr([time=current]) 3.10 Convert time_t integer into a time string, defaults to current time if time not specified
datestrstringsystem.datestr([time=current]) 3.10 Convert time_t integer into a short (8 character) date string, in either numeric or verbal format (depending on system preference), defaults to current date if time not specified. If time is a string in numeric date format, returns the parsed time_t value as a number.
secondstrstringsystem.secondstr(seconds [,bool verbose=true]) 3.10 Convert a duration in seconds into a string in hh:mm:ss format
minutestrstringsystem.minutestr(minutes [,bool estimate=false] [,bool words=false]) 3.21 Convert a duration in minutes into a string in 'DDd HHh MMm', 'X.Yh' or 'X.h hours' format
execnumbersystem.exec(command-line) 3.11 Execute a native system/shell command-line, returns 0 on success
popenarraysystem.popen(command-line) 3.11 Execute a native system/shell command-line, returns array of captured output lines on success (only functional on UNIX systems)
check_pidbooleansystem.check_pid(process-ID) 3.15 Check that the provided process ID is a valid executing process on the system, returns true if it is valid
terminate_pidbooleansystem.terminate_pid(process-ID) 3.15 Terminate executing process on the system with the specified process ID, returns true on success
textstringsystem.text(number index or string id) 3.18c Return specified text string (see bbs.text() for details) or null if invalid index or id specified.
The string id support was added in v3.20.

system properties
Name Type Ver Description
freediskspacenumber 3.10 Amount of free disk space (in bytes)
freediskspaceknumber 3.10 Amount of free disk space (in kibibytes)
ctrl_dirstring 3.10 Control file directory
data_dirstring 3.10 Data file directory
text_dirstring 3.10 Text file directory
temp_dirstring 3.10 Temporary file directory
exec_dirstring 3.10 Executable file directory
mods_dirstring 3.10 Modified modules directory (optional)
logs_dirstring 3.10 Log file directory
devnullstring 3.11 Platform-specific "null" device filename
temp_pathstring 3.12 Platform-specific temporary file directory
cmd_shellstring 3.14 Platform-specific command processor/shell
clock_ticksnumber 3.11 Amount of elapsed time in clock 'ticks'
clock_ticks_per_secondnumber 3.11 Number of clock ticks per second
timernumber 3.14 High-resolution timer, in seconds (fractional seconds supported)
stats_intervalnumber 3.21 System statistics interval (cache duration) in seconds
local_host_namestring 3.11 Private host name that uniquely identifies this system on the local network
name_serversobject 3.18c Array of nameservers in use by the system
socket_libstring N/A Public host name that uniquely identifies this system on the Internet (usually the same as system.inet_addr)
uptimenumber N/A Socket library version information
full_versionstring N/A Time/date system was brought online (in time_t format)
git_branchstring N/A Synchronet full version information (e.g. '3.10k Beta Debug')
git_hashstring N/A Synchronet Git repository branch name
git_datestring N/A Synchronet Git repository commit hash
compiled_whenstring N/A Synchronet Git repository commit date/time
versionstring N/A Date and time compiled
revisionstring N/A Synchronet version number (e.g. '3.10')
beta_versionstring N/A Synchronet revision letter (e.g. 'k')
version_noticestring N/A Synchronet alpha/beta designation (e.g. ' beta')
version_numnumber N/A Synchronet version notice (includes version and platform)
version_hexnumber N/A Synchronet version number in decimal (e.g. 31301 for v3.13b)
git_timenumber N/A Synchronet version number in hexadecimal (e.g. 0x31301 for v3.13b)
platformstring N/A Synchronet Git repository commit date/time (seconds since Unix epoch)
architecturestring N/A Platform description (e.g. 'Win32', 'Linux', 'FreeBSD')
msgbase_libstring N/A Architecture description (e.g. 'i386', 'i686', 'x86_64')
compiled_withstring N/A Message base library version information
copyrightstring N/A Compiler used to build Synchronet
js_versionstring N/A Synchronet copyright display
os_versionstring N/A JavaScript engine version information

File class
Class used for opening, creating, reading, or writing files on the local file system

Special features include:

  1. Exclusive-access files (default) or shared files
    1. optional record-locking
    2. buffered or non-buffered I/O
  2. Support for binary files
    1. native or network byte order (endian)
    2. automatic Unix-to-Unix (UUE), yEncode (yEnc) or Base64 encoding/decoding
  3. Support for ASCII text files
    1. supports line-based I/O
      1. entire file may be read or written as an array of strings
      2. individual lines may be read or written one line at a time
    2. supports fixed-length records
      1. optional end-of-text (etx) character for automatic record padding/termination
      2. Synchronet .dat files use an etx value of 3 (Ctrl-C)
    3. supports .ini formatted configuration files
  4. Dynamically-calculated industry standard checksums (e.g. CRC-16, CRC-32, MD5)
- introduced in v3.10

To create a new File object: var f = new File(filename)

File methods
Name Returns Usage Ver Description
openbooleanFile.open([string mode="w+"] [,bool shareable=false] [,number buffer_length]) 3.10 Open file, shareable defaults to false, buffer_length defaults to 2048 bytes, mode (default: 'w+') specifies the type of access requested for the file, as follows:
open for reading; if the file does not exist or cannot be found, the open call fails
open an empty file for writing; if the given file exists, its contents are destroyed
open for writing at the end of the file (appending); creates the file first if it doesn't exist
r+ open for both reading and writing (the file must exist)
w+ open an empty file for both reading and writing; if the given file exists, its contents are destroyed
a+ open for reading and appending
open in binary (untranslated) mode; translations involving carriage-return and linefeed characters are suppressed (e.g. r+b)
open a non-shareable file (that must not already exist) for exclusive access

Note: When using the iniSet methods to modify a .ini file, the file must be opened for both reading and writing.

Note: To open an existing or create a new file for both reading and writing (e.g. updating an .ini file) use the exists property like so:
file.open(file.exists ? 'r+':'w+');

Note: When shareable is false, uses the Synchronet nopen() function which will lock the file and perform automatic retries. The lock mode is as follows:
DENYWRITE - Allows other scripts to open the file for reading, but not for writing.
DENYALL - Does not allow other scripts to open the file when shareable is set to true
DENYALL - Does not allow other scripts to open the file when shareable is set to true
r+ DENYALL - Does not allow other scripts to open the file when shareable is set to true
w+ DENYALL - Does not allow other scripts to open the file when shareable is set to true
a+ DENYALL - Does not allow other scripts to open the file when shareable is set to true

When shareable is true uses the standard C fopen() function, and will only attempt to open the file once and will perform no locking.
The behavior when one script has a file opened with shareable set to a different value than is used with a new call is OS specific. On Windows, the second open will always fail and on *nix, the second open will always succeed.
popenbooleanFile.popen([string mode="r+"] [,number buffer_length]) 3.15 Open pipe to command, buffer_length defaults to 2048 bytes, mode (default: 'r+') specifies the type of access requested for the file, as follows:
read the programs stdout;
write to the programs stdin
r+ open for both reading stdout and writing stdin
(only functional on UNIX systems)
closevoidFile.close() 3.10 Close file
removebooleanFile.remove() 3.10 Remove the file from the disk
clear_errorbooleanFile.clear_error() 3.10 Clears the current error value (AKA clearError)
flushbooleanFile.flush() 3.10 Flush/commit buffers to disk
rewindbooleanFile.rewind() 3.11 Repositions the file pointer (position) to the beginning of a file and clears error and end-of-file indicators
truncatebooleanFile.truncate([length=0]) 3.14 Changes the file length (default: 0) and repositions the file pointer (position) to the new end-of-file
lockbooleanFile.lock([offset=0] [,length=file_length-offset]) 3.10 Lock file record for exclusive access (file must be opened shareable)
unlockbooleanFile.unlock([offset=0] [,length=file_length-offset]) 3.10 Unlock file record for exclusive access
readstringFile.read([maxlen=file_length-file_position]) 3.10 Read a string from file (optionally unix-to-unix or base64 encoding in the process), maxlen defaults to the current length of the file minus the current file position
readlnstringFile.readln([maxlen=512]) 3.10 Read a line-feed terminated string, maxlen defaults to 512 characters. Returns null upon end of file.
readBinnumberFile.readBin([bytes=4 [,count=1]]) 3.10 Read one or more binary integers from the file, default number of bytes is 4 (32-bits). if count is not equal to 1, an array is returned (even if no integers were read)
readAllarrayFile.readAll([maxlen=512]) 3.10 Read all lines into an array of strings, maxlen defaults to 512 characters
raw_readstringFile.raw_read([maxlen=1]) 3.17 Read a string from underlying file descriptor. Undefined results when mixed with any other read/write methods except raw_write, including indirect ones. maxlen defaults to one
raw_pollinbooleanFile.raw_pollin([timeout]) 3.17 Waits up to timeout milliseconds (or forever if timeout is not specified) for data to be available via raw_read().
writebooleanFile.write(text [,length=text_length]) 3.10 Write a string to the file (optionally unix-to-unix or base64 decoding in the process). If the specified length is longer than the text, the remaining length will be written as NUL bytes.
writelnbooleanFile.writeln([text]) 3.10 Write a new-line terminated string (a line of text) to the file
writeBinbooleanFile.writeBin(value(s) [,bytes=4]) 3.10 Write one or more binary integers to the file, default number of bytes is 4 (32-bits). If value is an array, writes the entire array to the file.
writeAllbooleanFile.writeAll(array lines) 3.10 Write an array of new-line terminated strings (lines of text) to the file
raw_writebooleanFile.raw_write(text) 3.17 Write a string to the underlying file descriptor. Undefined results when mixed with any other read/write methods except raw_read, including indirect ones.
printfnumberFile.printf(format [,args]) 3.10 Write a C-style formatted string to the file (ala the standard C fprintf function)
iniGetSectionsarrayFile.iniGetSections([prefix=none]) 3.11 Parse all section names from a .ini file (format = '[section]') and return the section names as an array of strings, optionally, only those section names that begin with the specified prefix
iniGetKeysarrayFile.iniGetKeys([section=root]) 3.11 Parse all key names from the specified section in a .ini file and return the key names as an array of strings. if section is undefined, returns key names from the root section
iniGetValueundefinedFile.iniGetValue(section, key [,default=none]) 3.11 Parse a key from a .ini file and return its value (format = 'key = value'). To parse a key from the root section, pass null for section. Returns the specified default value if the key or value is missing or invalid.
Returns a bool, number, string, date, or an array of strings determined by the type of default value specified.
Note: To insure that any/all values are returned as a string (e.g. numeric passwords are not returned as a number), pass an empty string ('') for the default value.
iniSetValuebooleanFile.iniSetValue(section, key, [value=none]) 3.12 Set the specified key to the specified value in the specified section of a .ini file. to set a key in the root section, pass null for section.
iniGetObjectobjectFile.iniGetObject([section=root] [,bool lowercase=false] [,bool blanks=false]) 3.11 Parse an entire section from a .ini file and return all of its keys (optionally lowercased) and values as properties of an object.
If section is null or undefined, returns keys and values from the root section.
If blanks is true then empty string (instead of undefined) values may included in the returned object.
Returns null if the specified section does not exist in the file or the file has not been opened.
iniSetObjectbooleanFile.iniSetObject(section, object object) 3.12 Write all the properties of the specified object as separate key=value pairs in the specified section of a .ini file.
To write an object in the root section, pass null for section.
Note: this method does not remove unreferenced keys from an existing section. If your intention is to replace an existing section, use the iniRemoveSection function first.
iniGetAllObjectsarrayFile.iniGetAllObjects([string name_property] [,string prefix=none] [,bool lowercase=false] [,blanks=false]) 3.11 Parse all sections from a .ini file and return all (non-root) sections in an array of objects with each section's keys (optionally lowercased) as properties of each object.
name_property is the name of the property to create to contain the section's name (optionally lowercased, default is "name"), the optional prefix has the same use as in the iniGetSections method.
If a (String) prefix is specified, it is removed from each section's name.
If blanks is true then empty string (instead of undefined) values may be included in the returned objects.
iniSetAllObjectsbooleanFile.iniSetAllObjects(object array [,name_property="name"]) 3.12 Write an array of objects to a .ini file, each object in its own section named after the object's name_property (default: name)
iniRemoveKeybooleanFile.iniRemoveKey(section, key) 3.14 Remove specified key from specified section in .ini file.
iniRemoveSectionbooleanFile.iniRemoveSection(section) 3.14 Remove specified section from .ini file.
iniRemoveSectionsbooleanFile.iniRemoveSections([prefix]) 3.20 Remove all sections from .ini file, optionally only sections with the specified section name prefix.
iniReadAllarrayFile.iniReadAll() 3.18c Read entire .ini file into an array of strings (with !includeed files).

File properties
Name Type Ver Description
namestring 3.10 Filename specified in constructor - READ ONLY
modestring 3.10 Mode string specified in open call - READ ONLY
existsboolean 3.10 true if the file is open or exists (case-insensitive) - READ ONLY
is_openboolean 3.10 true if the file has been opened successfully - READ ONLY
eofboolean 3.10 true if the current file position is at the end of file - READ ONLY
errornumber 3.10 The last occurred error value (use clear_error to clear) - READ ONLY
descriptornumber 3.10 The open file descriptor (advanced use only) - READ ONLY
etxnumber 3.10 End-of-text character (advanced use only), if non-zero used by read, readln, and write
debugboolean 3.10 Set to true to enable debug log output
positionnumber 3.10 The current file position (offset in bytes), change value to seek within file
datenumber 3.11 Last modified date/time (in time_t format)
lengthnumber 3.10 The current length of the file (in bytes)
attributesnumber 3.10 File type/mode flags (i.e. struct stat.st_mode value, compatible with file_chmod())
network_byte_orderboolean 3.11 Set to true if binary data is to be written and read in Network Byte Order (big end first)
rot13boolean 3.11 Set to true to enable automatic ROT13 translation of text
uueboolean 3.11 Set to true to enable automatic Unix-to-Unix encode and decode on read and write calls
yencboolean 3.11 Set to true to enable automatic yEnc encode and decode on read and write calls
base64boolean 3.11 Set to true to enable automatic Base64 encode and decode on read and write calls
crc16number 3.11 Calculated 16-bit CRC of file contents - READ ONLY
crc32number 3.11 Calculated 32-bit CRC of file contents - READ ONLY
chksumnumber 3.11 Calculated 32-bit checksum of file contents - READ ONLY
md5_hexundefined 3.11 Calculated 128-bit MD5 digest of file contents as hexadecimal string - READ ONLY
md5_base64undefined 3.11 Calculated 128-bit MD5 digest of file contents as base64-encoded string - READ ONLY
sha1_hexundefined 3.19 Calculated 160-bit SHA1 digest of file contents as hexadecimal string - READ ONLY
sha1_base64undefined 3.19 Calculated 160-bit SHA1 digest of file contents as base64-encoded string - READ ONLY
ini_key_lennumber 3.17 Ini style: minimum key length (for left-justified white-space padded keys)
ini_key_prefixobject 3.17 Ini style: key prefix (e.g. '\t', null = default prefix)
ini_section_separatorobject 3.17 Ini style: section separator (e.g. '\n', null = default separator)
ini_value_separatorobject 3.17 Ini style: value separator (e.g. ' = ', null = default separator)
ini_bit_separatorobject 3.17 Ini style: bit separator (e.g. ' | ', null = default separator)
ini_literal_separatorobject 3.17 Ini style: literal separator (null = default separator)

Archive class
Class used for creating, reading, or extracting archive files on the local file system
Note: cannot be used to update (e.g. add/remove/replace files in) an existing archive.
- introduced in v3.19

To create a new Archive object: var a = new Archive(filename)

Archive methods
Name Returns Usage Ver Description
createnumberArchive.create([string format] [,bool with_path=false] [,array file_list]) 3.19 Create an archive of the specified format (e.g. 'zip', '7z', 'tgz').
Returns the number of files archived.
Will throw exception upon error.
readstringArchive.read(string path/filename) 3.19 Read and return the contents of the specified archived text file.
extractnumberArchive.extract(output_directory [,bool with_path=false] [,bool overwrite=true] [,number max_files=0] [,string file/pattern [...]] [,bool recurse=false]) 3.19 Extract files from an archive to specified output directory.
Returns the number of files extracted.
Will throw exception upon error.
listarrayArchive.list([,bool hash=false] [,string file/pattern]) 3.19 Get list of archive contents as an array of objects, optionally filtered by a specified path/filename pattern.

Archived object properties:
NameTypeDescription
typestringItem type: 'file', 'link', or 'directory'
namestringItem path/name
pathstringSource path
symlinkstring
hardlinkstring
sizenumberItem size in bytes
timenumberModification date/time in time_t format
modenumberPermissions/mode flags
userstringOwner name
groupstringOwner group
formatstringArchive format
compressionstringCompression method
fflagsstring
crc16number16-bit CRC, when hash is true and type is 'file'
crc32number32-bit CRC, when hash is true and type is 'file'
md5stringHexadecimal MD-5 sum, when hash is true and type is 'file'
sha1stringHexadecimal SHA-1 sum, when hash is true and type is 'file'

When the hash parameter is true, calculates and returns hash/digest values of files in stored archive.


Archive properties
Name Type Description
typestring Format/compression type of archive file - READ ONLY
namestring Filename specified in constructor - READ ONLY

Queue class
Class for bi-directional message queues. Used for inter-thread/module communications. - introduced in v3.12

To create a new (named) Queue object: var q = new Queue(name)

Queue methods
Name Returns Usage Ver Description
pollundefinedQueue.poll([number timeout=0]) 3.12 Wait for any value to be written to the queue for up to timeout milliseconds (default: 0), returns true or the name (string) of the value waiting (if it has one), or false if no values are waiting
readundefinedQueue.read([string name] or [numbertimeout=0]) 3.13 Read a value from the queue, if name not specified, reads next value from the bottom of the queue (waiting up to timeout milliseconds)
peekundefinedQueue.peek([number timeout=0]) 3.13 Peek at the value at the bottom of the queue, wait up to timeout milliseconds for any value to be written (default: 0)
writebooleanQueue.write(value [,name=none]) 3.12 Write a value (optionally named) to the queue

Queue properties
Name Type Ver Description
nameundefined 3.12 Name of the queue (if it has one)
data_waitingboolean 3.12 true if data is waiting to be read from queue
read_levelnumber 3.12 Number of values in the read queue
write_levelnumber 3.12 Number of values in the write queue
ownerboolean 3.16 true if current thread is the owner/creator of the queue
orphanboolean 3.17c true if the owner of the queue has detached from the queue

Socket class
Class used for TCP/IP socket communications - introduced in v3.10

To create a new Socket object: load('sockdefs.js'); var s = new Socket(type, protocol ,ipv6=false)
where type = SOCK_STREAM for TCP (default) or SOCK_DGRAM for UDP
and protocol (optional) = the name of the protocol or service the socket is to be used for
To create a socket from an existing socket descriptor: var s = new Socket(true, descriptor)
where descriptor is the numerical value of an existing valid socket descriptor

Socket methods
Name Returns Usage Ver Description
closevoidSocket.close() 3.10 Close (shutdown) the socket immediately
bindbooleanSocket.bind([port] [,ip_address]) 3.11 Bind socket to a TCP or UDP port (number or service name), optionally specifying a network interface (via ip_address)
connectbooleanSocket.connect(host, port [,timeout=10] [,callback]) 3.11 Connect to a remote port (number or service name) on the specified host (IP address or host name), default timeout value is 10 (seconds). Instead of a timeout, you can pass a callback which is called when the connection completes with the Socket object as the only parameter.
listenbooleanSocket.listen() 3.10 Place socket in a state to listen for incoming connections (use before an accept)
acceptobjectSocket.accept() 3.10 Accept an incoming connection, returns a new Socket object representing the new connection
sendnumberSocket.send(data) 3.10 Send a string (AKA write). Returns the number of bytes sent or undefined if an error occured. Versions before 3.17 returned a bool true if all bytes were sent and false otherwise.
sendlinebooleanSocket.sendline(data) 3.17 Send a string (AKA write) with a carriage return line feed appended
sendtobooleanSocket.sendto(data, address, port) 3.10 Send data to a specific host (IP address or host name) and port (number or service name), for UDP sockets
sendfilebooleanSocket.sendfile(path/filename) 3.10 Send an entire file over the socket
sendBinbooleanSocket.sendBin(value [,bytes=4]) 3.11 Send a binary integer over the socket, default number of bytes is 4 (32-bits)
recvstringSocket.recv([maxlen=512, [timeout_sec=120]]) 3.10 Receive a string, default maxlen is 512 characters (AKA read)
peekstringSocket.peek([maxlen=512]) 3.10 Receive a string, default maxlen is 512 characters, leaves string in receive buffer (TLS sockets will never return more than one byte)
recvlinestringSocket.recvline([maxlen=512] [,timeout=30]) 3.10 Receive a line-feed terminated string, default maxlen is 512 characters, default timeout is 30 seconds (AKA readline and readln)
recvfromobjectSocket.recvfrom([binary=false] [,maxlen=512 or int_size=4]) 3.11 Receive data (string or integer) from a socket (typically UDP)

returns object with ip_address and port of sender along with data properties

binary defaults to false, maxlen defaults to 512 chars, int_size defaults to 4 bytes (32-bits)

recvBinnumberSocket.recvBin([bytes=4]) 3.11 Receive a binary integer from the socket, default number of bytes is 4 (32-bits)
getoptionnumberSocket.getoption(option) 3.10 Get socket option value, option may be socket option name (see sockopts in sockdefs.js) or number
setoptionbooleanSocket.setoption(option, value) 3.10 Set socket option value, option may be socket option name (see sockopts in sockdefs.js) or number
ioctlnumberSocket.ioctl(command [,argument=0]) 3.10 Send socket IOCTL (advanced)
pollnumberSocket.poll([timeout=0] [,write=false]) 3.10 Poll socket for read or write ability (default is read), default timeout value is 0.0 seconds (immediate timeout) returns -1 on error, 0 if the timeout passes without the event triggering, and 1 if the socket is ready
onnumberSocket.on(('read' | 'write'), callback) 3.19 Execute callback whenever socket is readable/writable. Returns an id to be passed to js.clearOn()
oncenumberSocket.once(('read' | 'write'), callback) 3.19 Execute callback next time socket is readable/writable Returns and id to be passed to js.clearOnce()
clearOnnumberSocket.clearOn(('read' | 'write'), id) 3.19 Remove callback installed by Socket.on()
clearOncenumberSocket.clearOnce(('read' | 'write'), id) 3.19 Remove callback installed by Socket.once()

Socket properties
Name Type Ver Description
errornumber 3.11 Error status for the last socket operation that failed - READ ONLY
error_strstring 3.18 Error description for the last socket operation that failed - READ ONLY
is_connectedboolean 3.10 true if socket is in a connected state - READ ONLY
is_writeableboolean 3.11 true if socket can accept written data - Setting to false will shutdown the write end of the socket.
is_writableboolean 3.12 Alias for is_writeable
data_waitingboolean 3.10 true if data is waiting to be read from socket - READ ONLY
nreadnumber 3.10 Number of bytes waiting to be read - TLS sockets will never return more than 1 - READ ONLY
debugnumber 3.10 Enable debug logging
descriptornumber 3.10 Socket descriptor (advanced uses only)
nonblockingboolean 3.10 Use non-blocking operation (default is false)
local_ip_addressundefined 3.10 Local IP address (string in dotted-decimal format)
local_portundefined 3.10 Local TCP or UDP port number
remote_ip_addressundefined 3.10 Remote IP address (string in dotted-decimal format)
remote_portundefined 3.10 Remote TCP or UDP port number
typenumber 3.10 Socket type, SOCK_STREAM (TCP) or SOCK_DGRAM (UDP)
familyundefined 3.18 Socket protocol family, PF_INET (IPv4) or PF_INET6 (IPv6)
network_byte_orderboolean 3.11 true if binary data is to be sent in Network Byte Order (big end first), default is true
ssl_sessionboolean 3.16 Set to true to enable SSL as a client on the socket
ssl_serverboolean 3.16 Set to true to enable SSL as a server on the socket
tls_minvernumber 3.20 Set to 100 to support TLS 1.0, 101 to support TLS 1.1 and 102 (default) for TLS 1.2, must be set before enabling TLS
tls_pskundefined 3.20c Set to an object with id: key pairs for TLS PSK auth, must be set before enabling TLS
tls_psk_idundefined 3.20c If TLS PSK is used, indicates which entry in tls_psk was used by the remote
tls_nameverifyboolean 3.21b Enables/Disables TLS server name verification, must be set before enabling TLS
tls_certverifyboolean 3.21b Enables/Disables TLS certificate verification, must be set before enabling TLS
tls_client_authboolean 3.21b Enables/Disables TLS client authentication, must be set before enabling TLS
tls_enhanced_certcheckboolean 3.21b Enables/Disables Enhanced check of TLS certificates
option_listobject N/A Array of socket option names supported by the current platform

Socket class object

Socket properties
Name Type Description
AF_INETnumber
AF_INET6number
IPPROTO_IPnumber
PF_INETnumber
PF_INET6number
PF_UNSPECnumber
SOCK_DGRAMnumber
SOCK_STREAMnumber

ConnectedSocket class
Class used for outgoing TCP/IP socket communications - introduced in v3.17

To create a new ConnectedSocket object: load('sockdefs.js'); var s = new ConnectedSocket(hostname, port, {domain:domain, proto:proto ,type:type, protocol:protocol, timeout:timeout, bindport:port, bindaddrs:bindaddrs})
where domain (optional) = PF_UNSPEC (default) for IPv4 or IPv6, PF_INET for IPv4, or PF_INET6 for IPv6
proto (optional) = IPPROTO_IP (default)
type (optional) = SOCK_STREAM for TCP (default) or SOCK_DGRAM for UDP
protocol (optional) = the name of the protocol or service the socket is to be used for
timeout (optional) = 10 (default) the number of seconds to wait for each connect() call to complete.
bindport (optional) = the name or number of the source port to bind to
bindaddrs (optional) = the name or number of the source addresses to bind to. The first of each IPv4 or IPv6 type is used for that family.

ListeningSocket class
Class used for incoming TCP/IP socket communications - introduced in v3.17

To create a new ListeningSocket object: load('sockdefs.js'); var s = new ListeningSocket(interface, port ,protocol, {domain:domain, type:type, proto:proto, retry_count:retry_count, retry_delay:retry_delay})
where interface = A array or strings or a single string of hostnames or address optionally including a :port suffix
port = a port to use when the interface doesn't specify one
protocol = protocol name, used for socket options and logging.
domain (optional) = PF_UNSPEC (default) for IPv4 or IPv6, AF_INET for IPv4, or AF_INET6 for IPv6
proto (optional) = IPPROTO_IP (default)
type (optional) = SOCK_STREAM for TCP (default) or SOCK_DGRAM for UDP
retry_count (optional) = 0 (default) number of times to retry binding
and retry_delay (optional) = 15 (default) seconds to wait before a retry

COM class
Class used for serial port communications - introduced in v3.15b

To create a new COM object: var c = new COM(device)
where device = COMx (e.g. COM1) for Win32 or /dev/ttyXY for *nix (e.g. /dev/ttyu0)

COM methods
Name Returns Usage Ver Description
closevoidCOM.close() 3.15 Close the port immediately
openbooleanCOM.open() 3.15 Connect to a COM port
sendbooleanCOM.send(data) 3.15 Send a string (AKA write)
sendfilebooleanCOM.sendfile(path/filename) 3.15 Send an entire file over the port
sendBinbooleanCOM.sendBin(value [,bytes=4]) 3.15 Send a binary integer over the port, default number of bytes is 4 (32-bits)
recvstringCOM.recv([maxlen=512 [,timeout=30]]) 3.15 Receive a string, default maxlen is 512 characters, default timeout is 30 seconds (AKA read)
recvlinestringCOM.recvline([maxlen=512] [,timeout=30.0]) 3.15 Receive a line-feed terminated string, default maxlen is 512 characters, default timeout is 30 seconds (AKA readline and readln)
recvBinnumberCOM.recvBin([bytes=4 [,timeout=30]) 3.15 Receive a binary integer from the port, default number of bytes is 4 (32-bits), default timeout is 30 seconds

COM properties
Name Type Ver Description
errornumber 3.15 Error status for the last COM operation that failed - READ ONLY
is_openboolean 3.15 true if port is in a connected state - READ ONLY
debugboolean 3.15 Enable debug logging
descriptornumber 3.15 COM handle (advanced uses only)
network_byte_orderboolean 3.15 true if binary data is to be sent in Network Byte Order (big end first), default is true
baud_ratenumber 3.15 COM port Baud rate
devicestring 3.15 Device name
dtrboolean 3.15 Data Terminal Ready
ctsboolean 3.15 Clear To Send
dsrboolean 3.15 Data Set Ready
ringboolean 3.15 Ring Indicator
dcdboolean 3.15 Data Carrier Detect

conio object
Console Input/Output Object (DOS conio library functionality for jsexec) - introduced in v3.15

conio methods
Name Returns Usage Ver Description
initbooleanconio.init([mode]) 3.15 Initialize the conio library and creates a window if needed. Mode is a string with one of the following values:
"AUTO" (default)Automatically select the "best" output mode.
"ANSI"Use ANSI escape sequences directly
"STDIO"Use stdio, worst, but most compatible mode.
"X"Use X11 output *nix only)
"CONIO"Use the native conio library (Windows only)
"CONIO_FULLSCREEN"Use the native conio library and request full-screen (full-screen does not work on all versions of Windows) (Windows only)
"CURSES"Use the curses terminal library (*nix only)
"CURSES_IBM"Use the curses terminal library and write extended ASCII characters directly as-is, assuming the terminal is using CP437. (*nix only)
"CURSES_ASCII"Use the curses terminal library and write US-ASCII characters only. (*nix only)
"SDL"Use the SDL library for output.
"SDL_FULLSCREEN"Use the SDL library for output (fullscreen).
suspendvoidconio.suspend() 3.15 Suspend conio in CONIO or CURSES modes so the terminal can be used for other things.
clreolvoidconio.clreol() 3.15 Clear to end of line
clrscrvoidconio.clrscr() 3.15 Clear the screen
wscrollvoidconio.wscroll() 3.15 Scroll the currently defined window up by one line.
dellinevoidconio.delline() 3.15 Delete the current line and moves lines below up by one line.
inslinevoidconio.insline() 3.15 Insert a new blank line on the current line and scrolls lines below down to make room.
normvideovoidconio.normvideo() 3.15 Set the current attribute to "normal" (light grey on black)
getchnumberconio.getch() 3.15 Wait for and returns a character from the user. Extended keys are returned as two characters.
getchenumberconio.getche() 3.15 Wait for a character from the user, then echos it. Extended keys can not be returned and are lost.
beepvoidconio.beep() 3.15 Beep.
getfontnumberconio.getfont(fnum) 3.15 Return the current font ID or -1 if fonts aren't supported.
hidemousenumberconio.hidemouse() 3.15 Hide the mouse cursor. Returns -1 if it cannot be hidden.
showmousenumberconio.showmouse() 3.15 Show the mouse cursor. Returns -1 if it cannot be shown.
setcursortypevoidconio.setcursortype(type) 3.15 Set the cursor type. Legal values:
0No cursor
1Solid cursor (fills whole cell)
2Normal cursor
gotoxyvoidconio.gotoxy(x, y) 3.15 Move the cursor to the given x/y position.
putchnumberconio.putch(charcode) 3.15 Put the character with the specified ASCII character on the screen and advances the cursor. Returns the character code passed in.
ungetchnumberconio.ungetch(charcode) 3.15 Push the specified charcode into the input buffer. The next getch() call will get this character.
loadfontvoidconio.loadfont(filename) 3.15 Load the filename as the current font. Returns -1 on failure.
settitlevoidconio.settitle(title) 3.15 Set the window title if possible.
setnamevoidconio.setname(name) 3.15 Set the application name. In some modes, this overwrites the window title.
cputsvoidconio.cputs(string) 3.15 Output string to the console.
setfontnumberconio.setfont(font [, force, fnum]) 3.15 Set a current font to the specified font. If force is set, will change video modes if the current one callot use the specified font. fnum selects which current font to change:
0Default font
1Main font
2First alternate font
3Second alternate font
4Third alternate font

Returns -1 on failure
getpassstringconio.getpass(prompt) 3.15 Prompt for a password, and waits for it to be entered. Characters are not echoed to the screen.
windowvoidconio.window(start_x, start_y, end_x, end_y) 3.15 Set the current window.
cgetsvoidconio.cgets(max_len) 3.15 Input a string, echoing as it's typed, with the specified max_len (up to 255).
movetextvoidconio.movetext(start_x, start_y, end_x, end_y, dest_x, dest_y) 3.15 Copy the specified screen contents to dest_x/dest_y.
puttextbooleanconio.puttext(start_x, start_y, end_x, end_y, bytes) 3.15 Put the contents of the bytes array onto the screen filling the specified rectange. The array is a sequences if integers between 0 and 255 specifying first the ascii character code, then the attribute for that character.
gettextarrayconio.gettext(start_x, start_y, end_x, end_y) 3.15 Return an array containing the characters and attributes for the specified rectangle.

conio properties
Name Type Ver Description
wscrollboolean 3.15 Allows windows to scroll
directvideoboolean 3.15 Enables direct video writes (does nothing)
hold_updateboolean 3.15 Do not update the screen when characters are printed
puttext_can_moveboolean 3.15 Calling puttext() (and some other things implemented using it) can move the cursor position
modenumber 3.15 The current video mode - READ ONLY
mouseboolean 3.15 Mouse enabled (1) or disabled (0) - READ ONLY
ESCDELAYnumber 3.15 Delay in MS after getting an escape character before assuming it is not part of a sequence. For curses and ANSI modes
textattrnumber 3.15 Current text attribute
kbhitboolean 3.15 True if a keystroke is pending - READ ONLY
wherexnumber 3.15 Current x position on the screen
whereynumber 3.15 Current y position on the screen
textmodenumber 3.15 Current text mode
winleftnumber 3.15 Left column of current window - READ ONLY
wintopnumber 3.15 Top row of current window - READ ONLY
winrightnumber 3.15 Right column of current window - READ ONLY
winbottomnumber 3.15 Bottom row of current window - READ ONLY
screenwidthnumber 3.15 Width of the screen - READ ONLY
screenheightnumber 3.15 Height of the screen - READ ONLY
normattrnumber 3.15 Attribute considered "normal" - READ ONLY
textbackgroundnumber 3.15 Background colour
textcolornumber 3.15 Foreground colour
clipboardstring 3.15 Text in the clipboard
lowvideoboolean 3.15 Current attribute is low intensity
highvideoboolean 3.15 Current attribute is high intensity

CryptContext class
Class used for encryption/decryption - introduced in v3.16b

To create a new CryptContext object: var c = new CryptContext(algorithm)
where algorithm is a property of CryptContext.ALGO

CryptContext methods
Name Returns Usage Ver Description
generate_keyvoidCryptContext.generate_key() 3.16 Generate a new key for the context.
set_keyvoidCryptContext.set_key(key_str) 3.16 Set the key for the context directly.
derive_keyvoidCryptContext.derive_key(keying_data) 3.16 Derive the key from the keying data using keying_algo, keying_iterations, and keying_salt.
encryptstringCryptContext.encrypt(plaintext) 3.16 Encrypt the string and return as a new string.
decryptstringCryptContext.decrypt(ciphertext) 3.16 Decrypt the string and return as a new string.
create_signaturestringCryptContext.create_signature(sigContext) 3.16 Create a signature signed with the sigContext CryptContext object.

CryptContext properties
Name Type Ver Description
algonumber 3.16 Algorithm constant (CryptContext.ALGO.XXX)
blocksizenumber 3.16 Cipher block size in bytes
hashvalueundefined 3.16 Output of hasing algorithms (ie: MD5, SHA1, etc)
ivundefined 3.16 Cipher IV
ivsizenumber 3.16 Cipher IV size in bytes
keying_algoundefined 3.16 The keying algorithm used to derive the key
keying_iterationsnumber 3.16 The number of iterates used to derive the key
keying_saltundefined 3.16 The salt value used to derive an encryption key from a key (Length must be between 8 and 64)
keysizenumber 3.16 Key size in bytes
labelundefined 3.16 Key label
modenumber 3.16 Mode constant (CryptContext.MODE.XXX)
algo_namestring 3.16 Algorithm name
mode_namestring 3.16 Mode name

CryptContext class object

CryptContext.ALGO object
Associative array of crypto algorithm constants - introduced in v3.18

CryptContext.ALGO properties
Name Type Description
Nonenumber No encryption
DESnumber

DES is a 64-bit block cipher with a 56-bit key. Note that this algorithm is no longer considered secure and should not be used. It is present in cryptlib only for compatibility with legacy applications.

Although cryptlib uses 64-bit DES keys, only 56 bits of the key are actually used. The least significant bit in each byte is used as a parity bit (cryptlib will set the correct parity values for you, so you don't have to worry about this). You can treat the algorithm as having a 64-bit key, but bear in mind that only the high 7 bits of each byte are actually used as keying material.

Loading a key will return a CRYPT_ERROR_PARAM3 error if the key is a weak key. cryptExportKey will export the correct parity-adjusted version of the key.

3DESnumber

Triple DES is a 64-bit block cipher with a 112/168-bit key.

Although cryptlib uses 128, or 192-bit DES keys (depending on whether two- or three-key triple DES is being used), only 112 or 168 bits of the key are actually used. The least significant bit in each byte is used as a parity bit (cryptlib will set the correct parity values for you, so you don't have to worry about this). You can treat the algorithm as having a 128 or 192-bit key, but bear in mind that only the high 7 bits of each byte are actually used as keying material.

Loading a key will return a CRYPT_ERROR_PARAM3 error if the key is a weak key. cryptExportKey will export the correct parity-adjusted version of the key.

IDEAnumber IDEA is a 64-bit block cipher with a 128-bit key. IDEA was formerly covered by patents, but these have now all expired.
CASTnumber CAST-128 is a 64-bit block cipher with a 128-bit key
RC2number RC2 (disabled by default, used for PKCS #12)
RC4number RC4 is an 8-bit stream cipher with a key of up to 1024 bits. Some weaknesses have been found in this algorithm, and it's proven to be extremely difficult to employ in a safe manner. For this reason it should not be used any more except for legacy application support, and is disabled by default.

The term "RC4" is trademarked in the US. It may be necessary to refer to it as "an algorithm compatible with RC4" in products that use RC4 and are distributed in the US. Common practice is to refer to it as ArcFour.

AESnumber AES is a 128-bit block cipher with a 128-bit key.
ChaCha20number ChaCha20 is a 512-bit state stream cipher with a 128 or 256-bit key size.
DHnumber

Diffie-Hellman is a key-agreement algorithm with a key size of up to 4096 bits.

Diffie-Hellman was formerly covered by a patent in the US, this has now expired.

RSAnumber

RSA is a public-key encryption/digital signature algorithm with a key size of up to 4096 bits.

RSA was formerly covered by a patent in the US, this has now expired.

DSAnumber

DSA is a digital signature algorithm with a key size of up to 1024 bits and has the cryptlib algorithm identifier CRYPT_ALGO_DSA.

DSA is covered by US patent 5,231,668, with the patent held by the US government. This patent has been made available royalty-free to all users world-wide. The US Department of Commerce is not aware of any other patents that would be infringed by the DSA. US patent 4,995,082, "Method for identifying subscribers and for generating and verifying electronic signatures in a data exchange system" ("the Schnorr patent") relates to the DSA algorithm but only applies to a very restricted set of smart-card based applications and does not affect the DSA implementation in cryptlib.

ELGAMALnumber

Elgamal is a public-key encryption/digital signature algorithm with a key size of up to 4096 bits.

Elgamal was formerly covered (indirectly) by a patent in the US, this has now expired.

ECDSAnumber ECDSA is a digital signature algorithm with a key size of up to 521 bits.
ECDHnumber ECDH is a key-agreement algorithm with a key size of up to 521 bits.
EDDSAnumber EDDSA is a digital signature scheme using a variant of Schnorr signature based on twisted Edwards curves.
X25519number X25519 is a digital signature scheme using one of the fastest curves in ECC, and is not covered by any known patents.
MD5number MD5 (only used for TLS 1.0/1.1)
SHA1number SHA1 is a message digest/hash algorithm with a digest/hash size of 160 bits. This algorithm has poor long-term security prospects and should be deprecated in favour of SHA-2.
SHA2number SHA2/SHA256 is a message digest/hash algorithm with a digest/hash size of 256 bits.
SHAngnumber Future SHA-nextgen standard
HMAC-SHA1number HMAC-SHA1 is a MAC algorithm with a key size of up to 1024 bits.
HMAC-SHA2number HMAC-SHA2 is a MAC algorithm with a key size of up to 1024 bits.
HMAC-SHAngnumber HMAC-future-SHA-nextgen
Poly1305number Poly1305 is a universal hash family designed for use in cryptography.

CryptContext.MODE object
Associative array of crypto mode constants - introduced in v3.18

CryptContext.MODE properties
Name Type Description
Nonenumber No encryption mode
ECBnumber ECB
CBCnumber CBC
CFBnumber CFB
GCMnumber GCM

CryptKeyset class
Class used for storing CryptContext keys - introduced in v3.16b

To create a new CryptKeyset object: var c = new CryptKeyset(filename [ opts = CryptKeyset.KEYOPT.NONE ])
where filename is the name of the file to create, and opts is a value from CryptKeyset.KEYOPT

CryptKeyset methods
Name Returns Usage Ver Description
add_private_keyvoidCryptKeyset.add_private_key(CryptContext, password) 3.16 Add a private key to the keyset, encrypting it with <password>.
add_public_keyvoidCryptKeyset.add_public_key(CryptCert) 3.16 Add a public key (certificate) to the keyset.
closevoidCryptKeyset.close() 3.16 Close the keyset.
delete_keyvoidCryptKeyset.delete_key(label) 3.16 Delete the key with <label> from the keyset.
get_private_keyobjectCryptKeyset.get_private_key(label, password) 3.16 Return a CryptContext from the private key with
get_public_keyobjectCryptKeyset.get_public_key(label) 3.16 Return a CryptCert from the public key with <label>.

CryptKeyset class object

CryptKeyset.KEYOPT object
Associative array of keyset option constants - introduced in v3.18

CryptKeyset.KEYOPT properties
Name Type Description
NONEnumber No special access options (this option implies read/write access).
READONLYnumber

Read-only keyset access. This option is automatically enabled by cryptlib for keyset types that have read-only restrictions enforced by the nature of the keyset, the operating system, or user access rights.

Unless you specifically require write access to the keyset, you should use this option since it allows cryptlib to optimise its buffering and access strategies for the keyset.

CREATEnumber Create a new keyset. This option is only valid for writeable keyset types, which includes keysets implemented as databases and cryptlib key files.

CryptCert class
Class used for Certificates - introduced in v3.16b

To create a new CryptCert object: var c = new CryptCert(type | cert)
where type is a value from CryptCert.TYPE and cert is a DER encoded certificate string

CryptCert methods
Name Returns Usage Ver Description
add_extensionvoidCryptCert.add_extension(oid, critical, extension) 3.16 Adds a DER encoded certificate extension.
checkbooleanCryptCert.check() 3.16 Checks the certificate for validity.
destroyvoidCryptCert.destroy() 3.16 Destroys the certificate.
export_certstringCryptCert.export_cert(format) 3.16 Exports the certificate in the format chosen from CryptCert.FORMAT.
get_attributevoidCryptCert.get_attribute(attr) 3.16 Gets the specified attribute as an integer
get_attribute_stringvoidCryptCert.get_attribute_string(attr) 3.16 Gets the specified attribute as a string
get_attribute_timevoidCryptCert.get_attribute_time(attr) 3.16 Gets the specified attribute as a time
set_attributevoidCryptCert.set_attribute(attr, value) 3.16 Sets the specified attribute to the specified value
set_attribute_stringvoidCryptCert.set_attribute_string(attr, value) 3.16 Sets the specified attribute to the specified value
set_attribute_timevoidCryptCert.set_attribute_time(attr, value) 3.16 Sets the specified attribute to the specified value
signvoidCryptCert.sign(key) 3.16 Signs the certificate with the specified CryptContext

CryptCert properties
Name Type Ver Description
selfsignednumber 3.16
immutablenumber 3.16
xyzzynumber 3.16
certtypenumber 3.16
fingerprint_sha1undefined 3.16
fingerprint_sha2undefined 3.16
fingerprint_shangundefined 3.16
current_certificateundefined 3.16
trusted_usageundefined 3.16
trusted_implicitundefined 3.16
signaturelevelundefined 3.16
versionnumber 3.16
serialnumberundefined 3.16
subjectpublickeyinfoundefined 3.16
certificateundefined 3.16
cacertificateundefined 3.16
issuernameundefined 3.16
validfromundefined 3.16
validtoundefined 3.16
subjectnameundefined 3.16
issueruniqueidundefined 3.16
subjectuniqueidundefined 3.16
certrequestundefined 3.16
thisupdateundefined 3.16
nextupdateundefined 3.16
revocationdateundefined 3.16
revocationstatusundefined 3.16
certstatusundefined 3.16
dnundefined 3.16
pkiuser_idundefined 3.16
pkiuser_issuepasswordundefined 3.16
pkiuser_revpasswordundefined 3.16
pkiuser_raundefined 3.16
countrynameundefined 3.16
stateorprovincenameundefined 3.16
localitynameundefined 3.16
organizationnameundefined 3.16
organizationalunitnameundefined 3.16
commonnameundefined 3.16
othername_typeidundefined 3.16
othername_valueundefined 3.16
rfc822nameundefined 3.16
dnsnameundefined 3.16
directorynameundefined 3.16
edipartyname_nameassignerundefined 3.16
edipartyname_partynameundefined 3.16
uniformresourceidentifierundefined 3.16
ipaddressundefined 3.16
registeredidundefined 3.16
challengepasswordundefined 3.16
crlextreasonundefined 3.16
keyfeaturesundefined 3.16
authorityinfoaccessundefined 3.16
authorityinfo_rtcsundefined 3.16
authorityinfo_ocspundefined 3.16
authorityinfo_caissuersundefined 3.16
authorityinfo_certstoreundefined 3.16
authorityinfo_crlsundefined 3.16
biometricinfoundefined 3.16
biometricinfo_typeundefined 3.16
biometricinfo_hashalgoundefined 3.16
biometricinfo_hashundefined 3.16
biometricinfo_urlundefined 3.16
qcstatementundefined 3.16
qcstatement_semanticsundefined 3.16
qcstatement_registrationauthorityundefined 3.16
ipaddressblocksundefined 3.16
ipaddressblocks_addressfamilyundefined 3.16
ipaddressblocks_prefixundefined 3.16
ipaddressblocks_minundefined 3.16
ipaddressblocks_maxundefined 3.16
autonomoussysidsundefined 3.16
autonomoussysids_asnum_idundefined 3.16
autonomoussysids_asnum_minundefined 3.16
autonomoussysids_asnum_maxundefined 3.16
ocsp_nonceundefined 3.16
ocsp_responseundefined 3.16
ocsp_response_ocspundefined 3.16
ocsp_nocheckundefined 3.16
ocsp_archivecutoffundefined 3.16
subjectinfoaccessundefined 3.16
subjectinfo_timestampingundefined 3.16
subjectinfo_carepositoryundefined 3.16
subjectinfo_signedobjectrepositoryundefined 3.16
subjectinfo_rpkimanifestundefined 3.16
subjectinfo_signedobjectundefined 3.16
sigg_dateofcertgenundefined 3.16
sigg_procurationundefined 3.16
sigg_procure_countryundefined 3.16
sigg_procure_typeofsubstitutionundefined 3.16
sigg_procure_signingforundefined 3.16
sigg_admissionsundefined 3.16
sigg_admissions_authorityundefined 3.16
sigg_admissions_namingauthidundefined 3.16
sigg_admissions_namingauthurlundefined 3.16
sigg_admissions_namingauthtextundefined 3.16
sigg_admissions_professionitemundefined 3.16
sigg_admissions_professionoidundefined 3.16
sigg_admissions_registrationnumberundefined 3.16
sigg_monetarylimitundefined 3.16
sigg_monetary_currencyundefined 3.16
sigg_monetary_amountundefined 3.16
sigg_monetary_exponentundefined 3.16
sigg_declarationofmajorityundefined 3.16
sigg_declarationofmajority_countryundefined 3.16
sigg_restrictionundefined 3.16
sigg_certhashundefined 3.16
sigg_additionalinformationundefined 3.16
strongextranetundefined 3.16
strongextranet_zoneundefined 3.16
strongextranet_idundefined 3.16
subjectdirectoryattributesundefined 3.16
subjectdir_typeundefined 3.16
subjectdir_valuesundefined 3.16
subjectkeyidentifierundefined 3.16
keyusageundefined 3.16
privatekeyusageperiodundefined 3.16
privatekey_notbeforeundefined 3.16
privatekey_notafterundefined 3.16
subjectaltnameundefined 3.16
issueraltnameundefined 3.16
basicconstraintsundefined 3.16
caundefined 3.16
pathlenconstraintundefined 3.16
crlnumberundefined 3.16
crlreasonundefined 3.16
holdinstructioncodeundefined 3.16
invaliditydateundefined 3.16
deltacrlindicatorundefined 3.16
issuingdistributionpointundefined 3.16
issuingdist_fullnameundefined 3.16
issuingdist_usercertsonlyundefined 3.16
issuingdist_cacertsonlyundefined 3.16
issuingdist_somereasonsonlyundefined 3.16
issuingdist_indirectcrlundefined 3.16
certificateissuerundefined 3.16
nameconstraintsundefined 3.16
permittedsubtreesundefined 3.16
excludedsubtreesundefined 3.16
crldistributionpointundefined 3.16
crldist_fullnameundefined 3.16
crldist_reasonsundefined 3.16
crldist_crlissuerundefined 3.16
certificatepoliciesundefined 3.16
certpolicyidundefined 3.16
certpolicy_cpsuriundefined 3.16
certpolicy_organizationundefined 3.16
certpolicy_noticenumbersundefined 3.16
certpolicy_explicittextundefined 3.16
policymappingsundefined 3.16
issuerdomainpolicyundefined 3.16
subjectdomainpolicyundefined 3.16
authoritykeyidentifierundefined 3.16
authority_keyidentifierundefined 3.16
authority_certissuerundefined 3.16
authority_certserialnumberundefined 3.16
policyconstraintsundefined 3.16
requireexplicitpolicyundefined 3.16
inhibitpolicymappingundefined 3.16
extkeyusageundefined 3.16
extkey_ms_individualcodesigningundefined 3.16
extkey_ms_commercialcodesigningundefined 3.16
extkey_ms_certtrustlistsigningundefined 3.16
extkey_ms_timestampsigningundefined 3.16
extkey_ms_servergatedcryptoundefined 3.16
extkey_ms_encryptedfilesystemundefined 3.16
extkey_serverauthundefined 3.16
extkey_clientauthundefined 3.16
extkey_codesigningundefined 3.16
extkey_emailprotectionundefined 3.16
extkey_ipsecendsystemundefined 3.16
extkey_ipsectunnelundefined 3.16
extkey_ipsecuserundefined 3.16
extkey_timestampingundefined 3.16
extkey_ocspsigningundefined 3.16
extkey_directoryserviceundefined 3.16
extkey_anykeyusageundefined 3.16
extkey_ns_servergatedcryptoundefined 3.16
extkey_vs_servergatedcrypto_caundefined 3.16
crlstreamidentifierundefined 3.16
freshestcrlundefined 3.16
freshestcrl_fullnameundefined 3.16
freshestcrl_reasonsundefined 3.16
freshestcrl_crlissuerundefined 3.16
orderedlistundefined 3.16
baseupdatetimeundefined 3.16
deltainfoundefined 3.16
deltainfo_locationundefined 3.16
deltainfo_nextdeltaundefined 3.16
inhibitanypolicyundefined 3.16
toberevokedundefined 3.16
toberevoked_certissuerundefined 3.16
toberevoked_reasoncodeundefined 3.16
toberevoked_revocationtimeundefined 3.16
toberevoked_certserialnumberundefined 3.16
revokedgroupsundefined 3.16
revokedgroups_certissuerundefined 3.16
revokedgroups_reasoncodeundefined 3.16
revokedgroups_invaliditydateundefined 3.16
revokedgroups_startingnumberundefined 3.16
revokedgroups_endingnumberundefined 3.16
expiredcertsoncrlundefined 3.16
aaissuingdistributionpointundefined 3.16
aaissuingdist_fullnameundefined 3.16
aaissuingdist_somereasonsonlyundefined 3.16
aaissuingdist_indirectcrlundefined 3.16
aaissuingdist_userattrcertsundefined 3.16
aaissuingdist_aacertsundefined 3.16
aaissuingdist_soacertsundefined 3.16
ns_certtypeundefined 3.16
ns_baseurlundefined 3.16
ns_revocationurlundefined 3.16
ns_carevocationurlundefined 3.16
ns_certrenewalurlundefined 3.16
ns_capolicyurlundefined 3.16
ns_sslservernameundefined 3.16
ns_commentundefined 3.16
set_hashedrootkeyundefined 3.16
set_rootkeythumbprintundefined 3.16
set_certificatetypeundefined 3.16
set_merchantdataundefined 3.16
set_meridundefined 3.16
set_meracquirerbinundefined 3.16
set_merchantlanguageundefined 3.16
set_merchantnameundefined 3.16
set_merchantcityundefined 3.16
set_merchantstateprovinceundefined 3.16
set_merchantpostalcodeundefined 3.16
set_merchantcountrynameundefined 3.16
set_mercountryundefined 3.16
set_merauthflagundefined 3.16
set_certcardrequiredundefined 3.16
set_tunnelingundefined 3.16
set_tunnelingflagundefined 3.16
set_tunnelingalgidundefined 3.16
cms_contenttypeundefined 3.16
cms_messagedigestundefined 3.16
cms_signingtimeundefined 3.16
cms_countersignatureundefined 3.16
cms_signingdescriptionundefined 3.16
cms_smimecapabilitiesundefined 3.16
cms_smimecap_3desundefined 3.16
cms_smimecap_aesundefined 3.16
cms_smimecap_cast128undefined 3.16
cms_smimecap_shangundefined 3.16
cms_smimecap_sha2undefined 3.16
cms_smimecap_sha1undefined 3.16
cms_smimecap_hmac_shangundefined 3.16
cms_smimecap_hmac_sha2undefined 3.16
cms_smimecap_hmac_sha1undefined 3.16
cms_smimecap_authenc256undefined 3.16
cms_smimecap_authenc128undefined 3.16
cms_smimecap_rsa_shangundefined 3.16
cms_smimecap_rsa_sha2undefined 3.16
cms_smimecap_rsa_sha1undefined 3.16
cms_smimecap_dsa_sha1undefined 3.16
cms_smimecap_ecdsa_shangundefined 3.16
cms_smimecap_ecdsa_sha2undefined 3.16
cms_smimecap_ecdsa_sha1undefined 3.16
cms_smimecap_prefersigneddataundefined 3.16
cms_smimecap_cannotdecryptanyundefined 3.16
cms_smimecap_preferbinaryinsideundefined 3.16
cms_receiptrequestundefined 3.16
cms_receipt_contentidentifierundefined 3.16
cms_receipt_fromundefined 3.16
cms_receipt_toundefined 3.16
cms_securitylabelundefined 3.16
cms_seclabel_policyundefined 3.16
cms_seclabel_classificationundefined 3.16
cms_seclabel_privacymarkundefined 3.16
cms_seclabel_cattypeundefined 3.16
cms_seclabel_catvalueundefined 3.16
cms_mlexpansionhistoryundefined 3.16
cms_mlexp_entityidentifierundefined 3.16
cms_mlexp_timeundefined 3.16
cms_mlexp_noneundefined 3.16
cms_mlexp_insteadofundefined 3.16
cms_mlexp_inadditiontoundefined 3.16
cms_contenthintsundefined 3.16
cms_contenthint_descriptionundefined 3.16
cms_contenthint_typeundefined 3.16
cms_equivalentlabelundefined 3.16
cms_eqvlabel_policyundefined 3.16
cms_eqvlabel_classificationundefined 3.16
cms_eqvlabel_privacymarkundefined 3.16
cms_eqvlabel_cattypeundefined 3.16
cms_eqvlabel_catvalueundefined 3.16
cms_signingcertificateundefined 3.16
cms_signingcert_esscertidundefined 3.16
cms_signingcert_policiesundefined 3.16
cms_signingcertificatev2undefined 3.16
cms_signingcertv2_esscertidv2undefined 3.16
cms_signingcertv2_policiesundefined 3.16
cms_signaturepolicyidundefined 3.16
cms_sigpolicyidundefined 3.16
cms_sigpolicyhashundefined 3.16
cms_sigpolicy_cpsuriundefined 3.16
cms_sigpolicy_organizationundefined 3.16
cms_sigpolicy_noticenumbersundefined 3.16
cms_sigpolicy_explicittextundefined 3.16
cms_sigtypeidentifierundefined 3.16
cms_sigtypeid_originatorsigundefined 3.16
cms_sigtypeid_domainsigundefined 3.16
cms_sigtypeid_additionalattributesundefined 3.16
cms_sigtypeid_reviewsigundefined 3.16
cms_nonceundefined 3.16
scep_messagetypeundefined 3.16
scep_pkistatusundefined 3.16
scep_failinfoundefined 3.16
scep_sendernonceundefined 3.16
scep_recipientnonceundefined 3.16
scep_transactionidundefined 3.16
cms_spcagencyinfoundefined 3.16
cms_spcagencyurlundefined 3.16
cms_spcstatementtypeundefined 3.16
cms_spcstmt_individualcodesigningundefined 3.16
cms_spcstmt_commercialcodesigningundefined 3.16
cms_spcopusinfoundefined 3.16
cms_spcopusinfo_nameundefined 3.16
cms_spcopusinfo_urlundefined 3.16

CryptCert class object

CryptCert.CURSOR object
Associative array of cursor constants - introduced in v3.18

CryptCert.CURSOR properties
Name Type Description
FIRSTnumber Move the cursor to the first group or attribute.
PREVIOUSnumber Move the cursor to the last group or attribute.
NEXTnumber Move the cursor to the next group or attribute.
LASTnumber Move the cursor to the previous group or attribute.
CURRENT_GROUPnumber
CURRENTnumber
CURRENT_INSTANCEnumber
CURRENT_CERTIFICATEnumber

CryptCert.TYPE object
Associative array of certificate type constants - introduced in v3.18

CryptCert.TYPE properties
Name Type Description
NONEnumber No certificate type
CERTIFICATEnumber Certificate.
ATTRIBUTE_CERTnumber Attribute certificate.
CERTCHAINnumber PKCS #7 certificate chain.
CERTREQUESTnumber PKCS #10 certification request.
REQUEST_CERTnumber CRMF certificate request
REQUEST_REVOCATIONnumber CRMF certificate revocation request
CRLnumber CRL
CMS_ATTRIBUTESnumber PKCS #7/CMS attributes.
RTCS_REQUESTnumber RTCS request
RTCS_RESPONSEnumber RTCS response
OCSP_REQUESTnumber OCSP request
OCSP_RESPONSEnumber OCSP response
PKIUSERnumber PKI user information.

CryptCert.FORMAT object
Associative array of certificate format constants - introduced in v3.18

CryptCert.FORMAT properties
Name Type Description
NONEnumber No certificate format
CERTIFICATEnumber A certification request, certificate, or CRL in binary data format. The certificate object is encoded according to the ASN.1 distinguished encoding rules. This is the normal certificate encoding format.
CERTCHAINnumber A certificate encoded as a PKCS #7 certificate chain.
TEXT_CERTIFICATEnumber As CERTIFICATE but with base64 armouring of the binary data.
TEXT_CERTCHAINnumber As CERTCHAIN but with base64 armouring of the binary data.
XML_CERTIFICATEnumber XML wrapped cert
XML_CERTCHAINnumber XML wrapped certchain

CryptCert.ATTR object
Associative array of certificate attribute constants - introduced in v3.18

CryptCert.ATTR properties
Name Type Description
SELFSIGNEDnumber
IMMUTABLEnumber
XYZZYnumber
CERTTYPEnumber
FINGERPRINT_SHA1number
FINGERPRINT_SHA2number
FINGERPRINT_SHAngnumber
CURRENT_CERTIFICATEnumber
TRUSTED_USAGEnumber
TRUSTED_IMPLICITnumber
SIGNATURELEVELnumber
VERSIONnumber
SERIALNUMBERnumber
SUBJECTPUBLICKEYINFOnumber
CERTIFICATEnumber
CACERTIFICATEnumber
ISSUERNAMEnumber
VALIDFROMnumber
VALIDTOnumber
SUBJECTNAMEnumber
ISSUERUNIQUEIDnumber
SUBJECTUNIQUEIDnumber
CERTREQUESTnumber
THISUPDATEnumber
NEXTUPDATEnumber
REVOCATIONDATEnumber
REVOCATIONSTATUSnumber
CERTSTATUSnumber
DNnumber
PKIUSER_IDnumber
PKIUSER_ISSUEPASSWORDnumber
PKIUSER_REVPASSWORDnumber
PKIUSER_RAnumber
COUNTRYNAMEnumber
STATEORPROVINCENAMEnumber
LOCALITYNAMEnumber
ORGANIZATIONNAMEnumber
ORGANIZATIONALUNITNAMEnumber
COMMONNAMEnumber
OTHERNAME_TYPEIDnumber
OTHERNAME_VALUEnumber
RFC822NAMEnumber
DNSNAMEnumber
DIRECTORYNAMEnumber
EDIPARTYNAME_NAMEASSIGNERnumber
EDIPARTYNAME_PARTYNAMEnumber
UNIFORMRESOURCEIDENTIFIERnumber
IPADDRESSnumber
REGISTEREDIDnumber
CHALLENGEPASSWORDnumber
CRLEXTREASONnumber
KEYFEATURESnumber
AUTHORITYINFOACCESSnumber
AUTHORITYINFO_RTCSnumber
AUTHORITYINFO_OCSPnumber
AUTHORITYINFO_CAISSUERSnumber
AUTHORITYINFO_CERTSTOREnumber
AUTHORITYINFO_CRLSnumber
BIOMETRICINFOnumber
BIOMETRICINFO_TYPEnumber
BIOMETRICINFO_HASHALGOnumber
BIOMETRICINFO_HASHnumber
BIOMETRICINFO_URLnumber
QCSTATEMENTnumber
QCSTATEMENT_SEMANTICSnumber
QCSTATEMENT_REGISTRATIONAUTHORITYnumber
IPADDRESSBLOCKSnumber
IPADDRESSBLOCKS_ADDRESSFAMILYnumber
IPADDRESSBLOCKS_PREFIXnumber
IPADDRESSBLOCKS_MINnumber
IPADDRESSBLOCKS_MAXnumber
AUTONOMOUSSYSIDSnumber
AUTONOMOUSSYSIDS_ASNUM_IDnumber
AUTONOMOUSSYSIDS_ASNUM_MINnumber
AUTONOMOUSSYSIDS_ASNUM_MAXnumber
OCSP_NONCEnumber
OCSP_RESPONSEnumber
OCSP_RESPONSE_OCSPnumber
OCSP_NOCHECKnumber
OCSP_ARCHIVECUTOFFnumber
SUBJECTINFOACCESSnumber
SUBJECTINFO_TIMESTAMPINGnumber
SUBJECTINFO_CAREPOSITORYnumber
SUBJECTINFO_SIGNEDOBJECTREPOSITORYnumber
SUBJECTINFO_RPKIMANIFESTnumber
SUBJECTINFO_SIGNEDOBJECTnumber
SIGG_DATEOFCERTGENnumber
SIGG_PROCURATIONnumber
SIGG_PROCURE_COUNTRYnumber
SIGG_PROCURE_TYPEOFSUBSTITUTIONnumber
SIGG_PROCURE_SIGNINGFORnumber
SIGG_ADMISSIONSnumber
SIGG_ADMISSIONS_AUTHORITYnumber
SIGG_ADMISSIONS_NAMINGAUTHIDnumber
SIGG_ADMISSIONS_NAMINGAUTHURLnumber
SIGG_ADMISSIONS_NAMINGAUTHTEXTnumber
SIGG_ADMISSIONS_PROFESSIONITEMnumber
SIGG_ADMISSIONS_PROFESSIONOIDnumber
SIGG_ADMISSIONS_REGISTRATIONNUMBERnumber
SIGG_MONETARYLIMITnumber
SIGG_MONETARY_CURRENCYnumber
SIGG_MONETARY_AMOUNTnumber
SIGG_MONETARY_EXPONENTnumber
SIGG_DECLARATIONOFMAJORITYnumber
SIGG_DECLARATIONOFMAJORITY_COUNTRYnumber
SIGG_RESTRICTIONnumber
SIGG_CERTHASHnumber
SIGG_ADDITIONALINFORMATIONnumber
STRONGEXTRANETnumber
STRONGEXTRANET_ZONEnumber
STRONGEXTRANET_IDnumber
SUBJECTDIRECTORYATTRIBUTESnumber
SUBJECTDIR_TYPEnumber
SUBJECTDIR_VALUESnumber
SUBJECTKEYIDENTIFIERnumber
KEYUSAGEnumber
PRIVATEKEYUSAGEPERIODnumber
PRIVATEKEY_NOTBEFOREnumber
PRIVATEKEY_NOTAFTERnumber
SUBJECTALTNAMEnumber
ISSUERALTNAMEnumber
BASICCONSTRAINTSnumber
CAnumber
PATHLENCONSTRAINTnumber
CRLNUMBERnumber
CRLREASONnumber
HOLDINSTRUCTIONCODEnumber
INVALIDITYDATEnumber
DELTACRLINDICATORnumber
ISSUINGDISTRIBUTIONPOINTnumber
ISSUINGDIST_FULLNAMEnumber
ISSUINGDIST_USERCERTSONLYnumber
ISSUINGDIST_CACERTSONLYnumber
ISSUINGDIST_SOMEREASONSONLYnumber
ISSUINGDIST_INDIRECTCRLnumber
CERTIFICATEISSUERnumber
NAMECONSTRAINTSnumber
PERMITTEDSUBTREESnumber
EXCLUDEDSUBTREESnumber
CRLDISTRIBUTIONPOINTnumber
CRLDIST_FULLNAMEnumber
CRLDIST_REASONSnumber
CRLDIST_CRLISSUERnumber
CERTIFICATEPOLICIESnumber
CERTPOLICYIDnumber
CERTPOLICY_CPSURInumber
CERTPOLICY_ORGANIZATIONnumber
CERTPOLICY_NOTICENUMBERSnumber
CERTPOLICY_EXPLICITTEXTnumber
POLICYMAPPINGSnumber
ISSUERDOMAINPOLICYnumber
SUBJECTDOMAINPOLICYnumber
AUTHORITYKEYIDENTIFIERnumber
AUTHORITY_KEYIDENTIFIERnumber
AUTHORITY_CERTISSUERnumber
AUTHORITY_CERTSERIALNUMBERnumber
POLICYCONSTRAINTSnumber
REQUIREEXPLICITPOLICYnumber
INHIBITPOLICYMAPPINGnumber
EXTKEYUSAGEnumber
EXTKEY_MS_INDIVIDUALCODESIGNINGnumber
EXTKEY_MS_COMMERCIALCODESIGNINGnumber
EXTKEY_MS_CERTTRUSTLISTSIGNINGnumber
EXTKEY_MS_TIMESTAMPSIGNINGnumber
EXTKEY_MS_SERVERGATEDCRYPTOnumber
EXTKEY_MS_ENCRYPTEDFILESYSTEMnumber
EXTKEY_SERVERAUTHnumber
EXTKEY_CLIENTAUTHnumber
EXTKEY_CODESIGNINGnumber
EXTKEY_EMAILPROTECTIONnumber
EXTKEY_IPSECENDSYSTEMnumber
EXTKEY_IPSECTUNNELnumber
EXTKEY_IPSECUSERnumber
EXTKEY_TIMESTAMPINGnumber
EXTKEY_OCSPSIGNINGnumber
EXTKEY_DIRECTORYSERVICEnumber
EXTKEY_ANYKEYUSAGEnumber
EXTKEY_NS_SERVERGATEDCRYPTOnumber
EXTKEY_VS_SERVERGATEDCRYPTO_CAnumber
CRLSTREAMIDENTIFIERnumber
FRESHESTCRLnumber
FRESHESTCRL_FULLNAMEnumber
FRESHESTCRL_REASONSnumber
FRESHESTCRL_CRLISSUERnumber
ORDEREDLISTnumber
BASEUPDATETIMEnumber
DELTAINFOnumber
DELTAINFO_LOCATIONnumber
DELTAINFO_NEXTDELTAnumber
INHIBITANYPOLICYnumber
TOBEREVOKEDnumber
TOBEREVOKED_CERTISSUERnumber
TOBEREVOKED_REASONCODEnumber
TOBEREVOKED_REVOCATIONTIMEnumber
TOBEREVOKED_CERTSERIALNUMBERnumber
REVOKEDGROUPSnumber
REVOKEDGROUPS_CERTISSUERnumber
REVOKEDGROUPS_REASONCODEnumber
REVOKEDGROUPS_INVALIDITYDATEnumber
REVOKEDGROUPS_STARTINGNUMBERnumber
REVOKEDGROUPS_ENDINGNUMBERnumber
EXPIREDCERTSONCRLnumber
AAISSUINGDISTRIBUTIONPOINTnumber
AAISSUINGDIST_FULLNAMEnumber
AAISSUINGDIST_SOMEREASONSONLYnumber
AAISSUINGDIST_INDIRECTCRLnumber
AAISSUINGDIST_USERATTRCERTSnumber
AAISSUINGDIST_AACERTSnumber
AAISSUINGDIST_SOACERTSnumber
NS_CERTTYPEnumber
NS_BASEURLnumber
NS_REVOCATIONURLnumber
NS_CAREVOCATIONURLnumber
NS_CERTRENEWALURLnumber
NS_CAPOLICYURLnumber
NS_SSLSERVERNAMEnumber
NS_COMMENTnumber
SET_HASHEDROOTKEYnumber
SET_ROOTKEYTHUMBPRINTnumber
SET_CERTIFICATETYPEnumber
SET_MERCHANTDATAnumber
SET_MERIDnumber
SET_MERACQUIRERBINnumber
SET_MERCHANTLANGUAGEnumber
SET_MERCHANTNAMEnumber
SET_MERCHANTCITYnumber
SET_MERCHANTSTATEPROVINCEnumber
SET_MERCHANTPOSTALCODEnumber
SET_MERCHANTCOUNTRYNAMEnumber
SET_MERCOUNTRYnumber
SET_MERAUTHFLAGnumber
SET_CERTCARDREQUIREDnumber
SET_TUNNELINGnumber
SET_TUNNELINGFLAGnumber
SET_TUNNELINGALGIDnumber
CMS_CONTENTTYPEnumber
CMS_MESSAGEDIGESTnumber
CMS_SIGNINGTIMEnumber
CMS_COUNTERSIGNATUREnumber
CMS_SIGNINGDESCRIPTIONnumber
CMS_SMIMECAPABILITIESnumber
CMS_SMIMECAP_3DESnumber
CMS_SMIMECAP_AESnumber
CMS_SMIMECAP_CAST128number
CMS_SMIMECAP_SHAngnumber
CMS_SMIMECAP_SHA2number
CMS_SMIMECAP_SHA1number
CMS_SMIMECAP_HMAC_SHAngnumber
CMS_SMIMECAP_HMAC_SHA2number
CMS_SMIMECAP_HMAC_SHA1number
CMS_SMIMECAP_AUTHENC256number
CMS_SMIMECAP_AUTHENC128number
CMS_SMIMECAP_RSA_SHAngnumber
CMS_SMIMECAP_RSA_SHA2number
CMS_SMIMECAP_RSA_SHA1number
CMS_SMIMECAP_DSA_SHA1number
CMS_SMIMECAP_ECDSA_SHAngnumber
CMS_SMIMECAP_ECDSA_SHA2number
CMS_SMIMECAP_ECDSA_SHA1number
CMS_SMIMECAP_PREFERSIGNEDDATAnumber
CMS_SMIMECAP_CANNOTDECRYPTANYnumber
CMS_SMIMECAP_PREFERBINARYINSIDEnumber
CMS_RECEIPTREQUESTnumber
CMS_RECEIPT_CONTENTIDENTIFIERnumber
CMS_RECEIPT_FROMnumber
CMS_RECEIPT_TOnumber
CMS_SECURITYLABELnumber
CMS_SECLABEL_POLICYnumber
CMS_SECLABEL_CLASSIFICATIONnumber
CMS_SECLABEL_PRIVACYMARKnumber
CMS_SECLABEL_CATTYPEnumber
CMS_SECLABEL_CATVALUEnumber
CMS_MLEXPANSIONHISTORYnumber
CMS_MLEXP_ENTITYIDENTIFIERnumber
CMS_MLEXP_TIMEnumber
CMS_MLEXP_NONEnumber
CMS_MLEXP_INSTEADOFnumber
CMS_MLEXP_INADDITIONTOnumber
CMS_CONTENTHINTSnumber
CMS_CONTENTHINT_DESCRIPTIONnumber
CMS_CONTENTHINT_TYPEnumber
CMS_EQUIVALENTLABELnumber
CMS_EQVLABEL_POLICYnumber
CMS_EQVLABEL_CLASSIFICATIONnumber
CMS_EQVLABEL_PRIVACYMARKnumber
CMS_EQVLABEL_CATTYPEnumber
CMS_EQVLABEL_CATVALUEnumber
CMS_SIGNINGCERTIFICATEnumber
CMS_SIGNINGCERT_ESSCERTIDnumber
CMS_SIGNINGCERT_POLICIESnumber
CMS_SIGNINGCERTIFICATEV2number
CMS_SIGNINGCERTV2_ESSCERTIDV2number
CMS_SIGNINGCERTV2_POLICIESnumber
CMS_SIGNATUREPOLICYIDnumber
CMS_SIGPOLICYIDnumber
CMS_SIGPOLICYHASHnumber
CMS_SIGPOLICY_CPSURInumber
CMS_SIGPOLICY_ORGANIZATIONnumber
CMS_SIGPOLICY_NOTICENUMBERSnumber
CMS_SIGPOLICY_EXPLICITTEXTnumber
CMS_SIGTYPEIDENTIFIERnumber
CMS_SIGTYPEID_ORIGINATORSIGnumber
CMS_SIGTYPEID_DOMAINSIGnumber
CMS_SIGTYPEID_ADDITIONALATTRIBUTESnumber
CMS_SIGTYPEID_REVIEWSIGnumber
CMS_NONCEnumber
SCEP_MESSAGETYPEnumber
SCEP_PKISTATUSnumber
SCEP_FAILINFOnumber
SCEP_SENDERNONCEnumber
SCEP_RECIPIENTNONCEnumber
SCEP_TRANSACTIONIDnumber
CMS_SPCAGENCYINFOnumber
CMS_SPCAGENCYURLnumber
CMS_SPCSTATEMENTTYPEnumber
CMS_SPCSTMT_INDIVIDUALCODESIGNINGnumber
CMS_SPCSTMT_COMMERCIALCODESIGNINGnumber
CMS_SPCOPUSINFOnumber
CMS_SPCOPUSINFO_NAMEnumber
CMS_SPCOPUSINFO_URLnumber

uifc object
User InterFaCe object - Text User Interface (TUI) menu system for JSexec - introduced in v3.14

uifc methods
Name Returns Usage Ver Description
initbooleanuifc.init(string title [,string interface_mode]) 3.14 Initialize the UIFC library with the specified application/script title (e.g. name and maybe version).
interface_mode is a string representing the desired console mode, one of 'STDIO', 'AUTO', 'X', 'CURSES', 'ANSI', 'CONIO', or 'SDL' (see conio.init() for details).
Return true upon successful UIFC library initialization, false upon error.
bailvoiduifc.bail() 3.14 Uninitialize the UIFC library
msgvoiduifc.msg(string text) 3.14 Print a short text message and wait for user acknowledgment
popvoiduifc.pop([string text]) 3.14 Pop-up (or down) a short text message. Pop-down by passing no text argument.
inputstringuifc.input([number mode] [,number left] [,number top] [,string prompt] [,string default] [,number maxlen [,number k_mode]]) 3.14 Prompt for a string input.
mode is an optional combination of WIN_ mode flags from uifcdefs.js.
left and top are optional window offsets to display the input dialog box.
prompt is an optional text string to display as part of the string input dialog box.
default is an optional original text string that the user can edit (requires the K_EDIT k_mode flag).
maxlen is an optional maximum input string length (default is 40 characters).
k_mode is an optional combination of K_ mode flags from either sbbsdefs.js or uifcdefs.js.

Return the new/edited string or undefined if editing was aborted (e.g. via ESC key press).

listnumberuifc.list([number mode,] string title, array options [,uifc.list.CTX ctx]) 3.14 Select from a list of displayed options.
title is the brief description of the list (menu) to be displayed in the list heading.
options is an array of items (typically strings) that comprise the displayed list.
The CTX (context) object can be created using new uifc.list.CTX and if the same object is passed in successive calls, allows WIN_SAV to work correctly.
The context object has the following properties (numbers):
cur, bar, left, top, width

Return -1 if list is aborted (e.g. via ESC key press), false upon error (e.g. no option array provided), or the 0-based numeric index of the option selected by the user.
Other negative values may be returned in advanced modes/use-cases (e.g. copy/paste), see MSK_ and related WIN_ constants/comments in uifcdefs.js for details.

showhelpvoiduifc.showhelp() 3.17 Show the current help text
scrnbooleanuifc.scrn(string text) 3.18c Fill the screen with the appropriate background attribute. string is the title for the application banner.
showbufvoiduifc.showbuf(number mode, string title, string helpbuf [,uifc.showbuf.CTX ctx]) 3.18c Show a scrollable text buffer - optionally parsing "help markup codes"
The context object can be created using new uifc.showbuf.CTX and if the same object is passed, allows WIN_SAV to work correctly.
The context object has the following properties (numbers):
cur, bar, left, top, width, height
timedisplayvoiduifc.timedisplay([bool force = false]) 3.18c Update time in upper right corner of screen with current time in ASCII/Unix format
bottomlinevoiduifc.bottomline(number mode) 3.18c Display the bottom line using the WIN_* mode flags
getstrxystringuifc.getstrxy(number left, number top, number width, number max, number mode [,string original][, uifc.getstrxy.CTX ctx]) 3.18c String input/exit box at a specified positionThe context object can be created using new uifc.showbuf.CTX and if the same object is passed, allows WIN_SAV to work correctly.
The context object has the following properties: number lastkey

uifc properties
Name Type Ver Description
initializedboolean 3.14 UIFC library has been successfully initialized
modenumber 3.14 Current mode flags (see uifcdefs.js)
changesboolean 3.14 A change has occurred in an input call. You are expected to set this to false before calling the input if you care about it.
save_numnumber 3.14 Save buffer depth (advanced)
screen_lengthnumber 3.14 Current screen length
screen_widthnumber 3.14 Current screen width
list_heightnumber 3.14 When WIN_FIXEDHEIGHT mode flag is set, specifies the height used by a list method
esc_delaynumber 3.14 Delay before a single ESC char is parsed and assumed to not be an ANSI sequence (advanced)
help_textstring 3.14 Text that will be displayed when F1 or '?' keys are pressed
background_colornumber 3.14 Background colour
frame_colornumber 3.14 Frame colour
text_colornumber 3.14 Text colour
inverse_colornumber 3.14 Inverse colour
lightbar_colornumber 3.14 Lightbar colour

Totals: 895 properties, 257 methods