Synchronet JavaScript Object Model Reference

Generated for Synchronet v3.19b, compiled Jan 2 2022 15:24
Property and Method version numbers (when available) indicate the Synchronet version when the item was added or modified.
  1. [+]  global object
  2. [+]  js object
  3. [+]  system object
  4. [+]  server object
  5. [+]  client object
  6. [+]  user object
  7. [+]  bbs object
  8. [+]  console object
  9. [+]  msg_area object
  10. [+]  file_area object
  11. [+]  xtrn_area object
  12. [+]  MsgBase class
  13. [+]  FileBase class
  14. [+]  File class
  15. [+]  Archive class
  16. [+]  Queue class
  17. [+]  Socket class
  18. [+]  ConnectedSocket class
  19. [+]  ListeningSocket class
  20. [+]  COM class
  21. [+]  conio object
  22. [+]  uifc object
  23. [+]  CryptContext class
  24. [+]  CryptKeyset class
  25. [+]  CryptCert class

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

global methods
Name Returns Usage Ver Description
logstringlog([level,] value [,value]) 3.11 add a line of text to the server and/or system log, values are typically string constants or variables, level is the debug level/priority (default: LOG_INFO)
readstringread([count]) 3.11 read up to count characters from input stream
readlnstringreadln([count]) 3.11 read a single line, up to count characters, from input stream
writevoidwrite(value [,value]) 3.11 send one or more values (typically strings) to the server output
write_rawvoidwrite_raw(value [,value]) 3.14 send a stream of bytes (possibly containing NULLs or special control code sequences) to the server output
writelnvoidwriteln(value [,value]) 3.11 send a line of text to the console or event log with automatic line termination (CRLF), values are typically string constants or variables (AKA print)
printfstringprintf(string format [,value][,value]) 3.10 print a formatted string - CAUTION: for experienced C programmers ONLY
alertvoidalert(value) 3.10 print an alert message (ala client-side JS)
promptstringprompt([text] [,value] [,mode=K_EDIT]) 3.10 displays a prompt (text) and returns a string of user input (ala client-side JS)
confirmbooleanconfirm(value) 3.10 displays a Yes/No prompt and returns true or false based on user's confirmation (ala client-side JS, true = yes)
denybooleandeny(value) 3.15b displays a No/Yes prompt and returns true or false based on user's denial (true = no)
exitvoidexit([exit_code]) 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 (added in v3.12):
If background 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 millisecond wait/sleep routine (AKA sleep), returns number of elapsed clock ticks (in v3.13)
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 Jan-01-1970)
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) 3.11 return ASCII control character representing character passed - Example: ctrl('C') returns ''
asciiundefinedascii([string text] or [number value]) 3.10 convert single character to numeric ASCII value or vice-versa (returns number OR string)
ascii_strstringascii_str(text) 3.10 convert extended-ASCII (CP437) characters in text string to plain US-ASCII equivalent, returns modified string
strip_ctrlstringstrip_ctrl(text) 3.10 strip control characters from string, returns modified string
strip_ansistringstrip_ansi(text) 3.18c strip all ANSI terminal control sequences from string, returns modified string
strip_exasciistringstrip_exascii(text) 3.10 strip all extended-ASCII characters from string, returns modified string
skipspstringskipsp(text) 3.15 skip (trim) white-space characters off beginning of string, returns modified string
truncspstringtruncsp(text) 3.10 truncate (trim) white-space characters off end of string, returns modified string
truncstrstringtruncstr(text, charset) 3.10 truncate (trim) string at first char in charset, returns modified string
lfexpandstringlfexpand(text) 3.10 expand line-feeds (LF) to carriage-return/line-feeds (CRLF), returns modified string
wildmatchbooleanwildmatch([case_sensitive=false,] string [,pattern='*'] [,path=false]) 3.14 returns true if the string matches the wildcard pattern (wildcards supported are '*' and '?'), if path is true, '*' will not match path delimeter characters (e.g. '/')
backslashstringbackslash(path) 3.12 returns directory path with trailing (platform-specific) path delimeter (i.e. "slash" or "backslash")
fullpathstringfullpath(path) 3.15 Creates an absolute or full path name for the specified relative path name.
file_getnamestringfile_getname(path/filename) 3.11 returns filename portion of passed path string
file_getextstringfile_getext(path/filename) 3.11 returns file extension portion of passed path/filename string (including '.') or undefined if no extension is found
file_getcasestringfile_getcase(path/filename) 3.11 returns 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 returns 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 returns DOS-compatible (Micros~1 shortened) version of specified path/filename(on Windows only)
returns 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 backup 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_chmodnumberfile_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 updates 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 [,text=local_hostname] [,max_age=0]) 3.12 attempts to create an mutual-exclusion (e.g. lock) file, optionally with the contents of text. If a non-zero max_age (supported in v3.13b+) 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 returns an array of directory entries, pattern is the path and filename or wildcards to search for (e.g. '/subdir/*.txt'), flags is a bitfield of optional glob flags (default is GLOB_MARK)
dir_freespacenumberdir_freespace(directory [,unit_size=1]) 3.11 returns the amount of available disk space in the specified directory using the specified unit_size in bytes (default: 1), specify a unit_size of 1024 to return the available space in kilobytes.
disk_sizenumberdisk_size(directory [,unit_size=1]) 3.14 returns the total disk size of the specified directory using the specified unit_size in bytes (default: 1), specify a unit_size of 1024 to return the total disk size in kilobytes.
socket_selectarraysocket_select([array of socket objects or descriptors] [,timeout=0] [,write=false]) 3.11 checks 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
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
strftimestringstrftime(format [,time=current]) 3.10 return a formatted time string (ala C strftime)
formatstringformat(format [,args]) 3.10 return a formatted string (ala the standard C sprintf function)
html_encodestringhtml_encode(text [,ex_ascii=true] [,white_space=true] [,ansi=true] [,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
word_wrapstringword_wrap(text [,line_length=79 [, orig_line_length=79 [, handle_quotes=true [, is_utf8=false]]]]) 3.11 returns 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, and is_utf8 defaults to false
quote_msgstringquote_msg(text [,line_length=79] [,prefix=" > "]) 3.11 returns a quoted version of the message text string argument, line_length defaults to 79, prefix defaults to " > "
rot13_translatestringrot13_translate(text) 3.11 returns ROT13-translated version of text string (will encode or decode text)
base64_encodestringbase64_encode(text) 3.11 returns base64-encoded version of text string or null on error
base64_decodestringbase64_decode(text) 3.11 returns 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 [,hex=false]) 3.11 calculate and return 128-bit MD5 digest of text string, result encoded in base64 (default) or hexadecimal
sha1_calcstringsha1_calc(text [,hex=false]) 3.19 calculate and return 160-bit SHA-1 digest of text string, result encoded in base64 (default) or hexadecimal
resolve_ipstringresolve_ip(hostname [,array=false]) 3.11 resolve IP address of specified hostname (AKA gethostbyname). If array is true (added in 3.17), will return an array of all addresses rather than just the first one (upon success).
resolve_hoststringresolve_host(ip_address) 3.11 resolve hostname of specified IP address (AKA gethostbyaddr)
netaddr_typenumbernetaddr_type(email_address) 3.12 returns 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 returns 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) - (added in v3.13)
utf8_encodestringutf8_encode([string CP437] or [string UTF16] or [number codepoint]) 3.17c returns 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 returns CP437 representation of UTF-8 encoded text string or null on error (invalid UTF-8)
utf8_get_widthnumberutf8_get_width(text) 3.17c returns the fixed printed-width of the specified string of UTF-8 encoded characters
str_is_utf8booleanstr_is_utf8(text) 3.17c returns true if the specified string contains only valid UTF-8 encoded and US-ASCII characters
str_is_utf16booleanstr_is_utf16(text) 3.17c returns true if the specified string contains one or more UTF-16 encoded characters
str_is_asciibooleanstr_is_ascii(text) 3.17c returns true if the specified string contains only US-ASCII (no CP437 or UTF-8) characters
str_has_ctrlbooleanstr_has_ctrl(text) 3.17c returns true if the specified string contains any control characters (ASCII 0x01 - 0x1F)

global properties
Name Type Ver Description
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
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
get_parentobjectjs.get_parent(object) 3.14 return the parent of the specified object
get_sizenumberjs.get_size([object]) 3.16 return the size in bytes the object uses in memory (forces GC)
flatten_stringvoidjs.flatten_string([string]) 3.16 flatten a string, optimizing allocated memory used for concatenated strings
execnumberjs.exec(filename [, startup_dir], object scope [,...]) 3.17c execute a script within the specified scope. The main difference between this method and load() is that scripts called this way can call exit() without terminating the caller. If it does, any on_exit() handlers will be evaluated in scripts scope when the script exists.
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(){}'.
NOTE: 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. callback() will be called time ms after the function is called. returns an id which can be passed to clearTimeout()
setIntervalobjectjs.setInterval(callback, period[, thisObj]) 3.19 install a timeout. callback() will be called every period ms after setInterval() is called.returns and id which can be passed to clearIntervat()
clearTimeoutvoidjs.clearTimeout(id) 3.19 remove a timeout
clearIntervalvoidjs.clearInterval(id) 3.19 remove an interval
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 runqueue.
dispatchEventvoidjs.dispatchEvent(eventName [, thisObj]) 3.19 Add all listeners of eventName to the end of the runqueue. If obj is passed, specifies this in the callback (the js object is used otherwise).
setImmediatevoidjs.setImmediate(callback[, thisObj]) 3.19 adds the 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)
auto_terminateboolean 3.11 set to false to disable the automatic termination of the script upon external request
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
exec_pathstring N/A full path and filename of JS file executed
exec_filestring N/A directory of executed JS file
exec_dirstring N/A JS filename executed (with no path)
startup_dirstring N/A Either the configured startup directory in SCFG (for externals) or the cwd when jsexec is started
scopeobject N/A global scope for this script
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:
mods/load/somefile.js
exec/load/somefile.js
mods/somefile.js
exec/somefile.js

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

system methods
Name Returns Usage Ver Description
usernamestringsystem.username(user_number) 3.11 returns name of user in specified user record number, or empty string if not found
aliasstringsystem.alias(alias) 3.10 returns name of user that matches alias (if found in ctrl/alias.cfg)
matchusernumbersystem.matchuser(username [,sysop_alias=true]) 3.10 exact user name matching, returns number of user whose name/alias matches username or 0 if not found, matches well-known sysop aliases by default
matchuserdatanumbersystem.matchuserdata(field, data [,usernumber, match_next=false]) 3.10 search user database for data in a specific field (see U_* in sbbsdefs.js), returns first matching user record number, optional usernumber specifies user record to skip, or record at which to begin searching if optional match_next is true
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 date string (in either MM/DD/YY or DD/MM/YY format), defaults to current date if time not specified. If time is a string in the appropriate format, returns the time_t.
secondstrstringsystem.secondstr(seconds) 3.10 convert elapsed time in seconds into a string in hh:mm:ss format
spamlogbooleansystem.spamlog([protocol, action, reason, host, ip, to, from]) 3.10 log a suspected SPAM attempt
hacklogbooleansystem.hacklog([protocol, user, text, host, ip, port]) 3.10 log a suspected hack attempt
filter_ipbooleansystem.filter_ip([protocol, reason, host, ip, username, filename]) 3.11 add an IP address (with comment) to an IP filter file. If filename is not specified, the ip.can file is used
get_nodeobjectsystem.get_node(node_number) 3.17c read a node data record all at once (and leaving the record unlocked) returning an object matching the elements of system.node_list
get_node_messagestringsystem.get_node_message(node_number) 3.11 read any messages waiting for the specified node and return in a single string
put_node_messagebooleansystem.put_node_message(node_number, message_text) 3.10 send a node a short text message, delivered immediately
get_telegramstringsystem.get_telegram(user_number) 3.11 returns any short text messages waiting for the specified user
put_telegrambooleansystem.put_telegram(user_number, message_text) 3.10 sends a user a short text message, delivered immediately or during next logon
notifybooleansystem.notify(user_number, subject [,message_text]) 3.18b notify a user or operator via both email and a short text message about an important event
new_userobjectsystem.new_user(name/alias [,client object]) 3.10 creates a new user record, returns a new User object representing the new user account, on success.
returns an numeric error code on failure (optional client object argument added in v3.15a. As of 3.16c, the global client object is used if the argument is omitted)
del_userbooleansystem.del_user(user_number) 3.16 delete the specified user account
execnumbersystem.exec(command-line) 3.11 executes a native system/shell command-line, returns 0 on success
popenarraysystem.popen(command-line) 3.11 executes a native system/shell command-line, returns array of captured output lines on success (only functional on UNIX systems)
check_syspassbooleansystem.check_syspass(password) 3.11 compares the supplied password against the system password and returns true if it matches
check_namebooleansystem.check_name(name/alias) 3.15 checks that the provided name/alias string is suitable for a new user account, returns true if it is valid
check_pidbooleansystem.check_pid(process-ID) 3.15 checks 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 terminates executing process on the system with the specified process ID, returns true on success
textstringsystem.text(number) 3.18c returns specified text string from text.dat (like bbs.text()) or returns null upon error

system properties
Name Type Ver Description
namestring 3.10 BBS name
operatorstring 3.10 operator name
operator_availableboolean 3.18b operator is available for chat
qwk_idstring 3.10 system QWK-ID (for QWK packets)
settingsnumber 3.10 settings bitfield (see SYS_* in sbbsdefs.js for bit definitions)
inet_addrstring 3.11 Internet address (host or domain name)
locationstring 3.10 location (city, state)
timezonenumber 3.10 timezone (use system.zonestr() to get string representation)
pwdaysnumber 3.10 days between forced user password changes (0=never)
min_password_lengthnumber 3.17c minimum number of characters in user passwords
max_password_lengthnumber 3.17c maximum number of characters in user passwords
deldaysnumber 3.10 days to preserve deleted user records, record will not be reused/overwritten during this period
autodelnumber 3.17c days of user inactivity before auto-deletion (0=disabled), N/A to P-exempt users
lastusernumber 3.11 last user record number in user database (includes deleted and inactive user records)
lastuseronstring 3.10 name of last user to logoff
freediskspacenumber 3.10 amount of free disk space (in bytes)
freediskspaceknumber 3.10 amount of free disk space (in kilobytes)
nodesnumber 3.10 total number of BBS nodes
lastnodenumber 3.10 last displayable node number
newuser_passwordstring 3.10 new user password
newuser_magic_wordstring 3.10 new user magic word
newuser_levelnumber 3.10 new user level
newuser_flags1number 3.10 new user flag set #1
newuser_flags2number 3.10 new user flag set #2
newuser_flags3number 3.10 new user flag set #3
newuser_flags4number 3.10 new user flag set #4
newuser_restrictionsnumber 3.10 new user restriction flags
newuser_exemptionsnumber 3.10 new user exemption flags
newuser_creditsnumber 3.10 new user credits
newuser_minutesnumber 3.10 new user extra minutes
newuser_command_shellstring 3.10 new user command shell
newuser_editorstring 3.10 new user external editor
newuser_settingsnumber 3.10 new user settings
newuser_download_protocolstring 3.10 new user file transfer protocol (command key)
newuser_expiration_daysnumber 3.10 new user expiration days
newuser_questionsnumber 3.10 new user questions bitfield (see UQ_* in sbbsdefs.js for bit definitions)
expired_levelnumber 3.10 expired user level
expired_flags1number 3.10 expired user flag set #1
expired_flags2number 3.10 expired user flag set #2
expired_flags3number 3.10 expired user flag set #3
expired_flags4number 3.10 expired user flag set #4
expired_restrictionsnumber 3.10 expired user restriction flags
expired_exemptionsnumber 3.10 expired user exemption flags
node_dirstring 3.10 node directory
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)
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
host_namestring N/A public host name that uniquely identifies this system on the Internet (usually the same as system.inet_addr)
socket_libstring N/A socket library version information
uptimenumber N/A time/date system was brought online (in time_t format)
full_versionstring N/A Synchronet full version information (e.g. '3.10k Beta Debug')
compiled_whenstring N/A date and time compiled
versionstring N/A Synchronet version number (e.g. '3.10')
revisionstring N/A Synchronet revision letter (e.g. 'k')
beta_versionstring N/A Synchronet alpha/beta designation (e.g. ' beta')
version_noticestring N/A Synchronet version notice (includes version and platform)
version_numnumber N/A Synchronet version number in decimal (e.g. 31301 for v3.13b)
version_hexnumber N/A Synchronet version number in hexadecimal (e.g. 0x31301 for v3.13b)
git_branchstring N/A Synchronet Git repository branch name
git_hashstring N/A Synchronet Git repository commit hash
platformstring N/A platform description (e.g. 'Win32', 'Linux', 'FreeBSD')
architecturestring N/A architecture description (e.g. 'i386', 'i686', 'x86_64')
msgbase_libstring N/A message base library version information
compiled_withstring N/A compiler used to build Synchronet
copyrightstring N/A Synchronet copyright display
js_versionstring N/A JavaScript engine version information
os_versionstring N/A operating system version information
fido_addr_listobject N/A array of FidoNet Technology Network (FTN) addresses associated with this system

system.stats object
System statistics - introduced in v3.10

system.stats properties
Name Type Ver Description
total_logonsnumber 3.10 total logons
logons_todaynumber 3.10 logons today
total_timeonnumber 3.10 total time used
timeon_todaynumber 3.10 time used today
total_filesnumber 3.10 total files in file bases
files_uploaded_todaynumber 3.10 files uploaded today
bytes_uploaded_todaynumber 3.10 bytes uploaded today
files_downloaded_todaynumber 3.10 files downloaded today
bytes_downloaded_todaynumber 3.10 bytes downloaded today
total_messagesnumber 3.10 total messages in message bases
messages_posted_todaynumber 3.10 messages posted today
total_emailnumber 3.10 total messages in mail base
email_sent_todaynumber 3.10 email sent today
total_feedbacknumber 3.10 total feedback messages waiting
feedback_sent_todaynumber 3.10 feedback sent today
total_usersnumber 3.10 total user records (does not include deleted or inactive user records)
new_users_todaynumber 3.10 new users today

system.node_list array
BBS node listing - introduced in v3.10

system.node_list properties
Name Type Ver Description
statusnumber 3.10 status (see nodedefs.js for valid values)
errorsnumber 3.10 error counter
actionnumber 3.10 current user action (see nodedefs.js)
useronnumber 3.10 current user number
connectionnumber 3.10 connection speed (0xffff = Telnet or RLogin)
miscnumber 3.10 miscellaneous bitfield (see nodedefs.js)
auxnumber 3.10 auxillary value
extauxnumber 3.10 extended auxillary value
dirstring 3.15 node directory

server object
Server-specifc properties - introduced in v3.10

server properties
Name Type Ver Description
versionstring 3.10 server name and version number
version_detailstring 3.10 detailed version/build information
interface_ip_addressstring 3.11 First bound IPv4 address (0.0.0.0 = ANY) (obsolete since 3.17, see interface_ip_addr_list)
optionsnumber 3.11 bit-field of server-specific startup options
clientsnumber 3.11 number of active clients (if available)
interface_ip_addr_listobject N/A Array of IP addresses of bound network interface (0.0.0.0 = ANY)

client object
Represents a TCP/IP client session - introduced in v3.10

client properties
Name Type Ver Description
ip_addressstring 3.10 client's IPv4 or IPv6 address
host_namestring 3.10 client's host name (up to 64 characters)
portnumber 3.10 client's TCP or UDP port number
connect_timenumber 3.10 date/time of initial connection (in time_t format)
protocolstring 3.10 protocol/service name (e.g. 'Telnet', 'FTP', etc.)
user_namestring 3.10 user's name/alias
user_numbernumber 3.17c user's number (non-zero if logged in)
socketobject N/A instance of Socket class representing client's TCP/IP connection

user object
Instance of User class, representing current user online - introduced in v3.10

To create a new user object: var u = new User; or: var u = new User(number);

user methods
Name Returns Usage Ver Description
compare_arsbooleanuser.compare_ars(string ars) 3.10 Verify user meets access requirements string
Note: For the current user of the terminal server, use bbs.compare_ars() instead.
adjust_creditsbooleanuser.adjust_credits(count) 3.14 Adjust user's credits by count (negative to subtract)
adjust_minutesbooleanuser.adjust_minutes(count) 3.14 Adjust user's extra minutes count (negative to subtract)
posted_messagebooleanuser.posted_message([count]) 3.14 Adjust user's posted-messages statistics by count (default: 1) (negative to subtract)
sent_emailbooleanuser.sent_email([count] [,bool feedback]) 3.14 Adjust user's email/feedback-sent statistics by count (default: 1) (negative to subtract)
uploaded_filebooleanuser.uploaded_file([bytes] [,files]) 3.14 Adjust user's files/bytes-uploaded statistics
downloaded_filebooleanuser.downloaded_file([dir-code] [file path | name] [bytes] [,file-count]) 3.18 Handle the full or partial successful download of a file.
Adjust user's files/bytes-downloaded statistics and credits, file's stats, system's stats, and uploader's stats and credits.
get_time_leftnumberuser.get_time_left(start_time) 3.14b Returns the user's available remaining time online, in seconds,
based on the passed start_time value (in time_t format)
Note: this method does not account for pending forced timed events
Note: for the pre-defined user object on the BBS, you almost certainly want bbs.get_time_left() instead.

user properties
Name Type Ver Description
numbernumber 3.10 record number (1-based)
aliasstring 3.10 alias/name
namestring 3.10 real name
handlestring 3.10 chat handle
ip_addressstring 3.10 IP address last logged on from
notestring 3.10 Sysop note (AKA ip_address on 3.16 and before)
host_namestring 3.10 host name last logged on from
computerstring 3.10 AKA host_name
commentstring 3.10 sysop's comment
netmailstring 3.10 external e-mail address
emailstring 3.10 local Internet e-mail address - READ ONLY
addressstring 3.10 street address
locationstring 3.10 location (e.g. city, state)
zipcodestring 3.10 zip/postal code
phonestring 3.10 phone number
birthdatestring 3.10 birth date in 'YYYYMMDD' format or legacy format: 'MM/DD/YY' or 'DD/MM/YY', depending on system configuration
birthyearnumber 3.18c birth year
birthmonthnumber 3.18c birth month (1-12)
birthdaynumber 3.18c birth day of month (1-31)
agenumber 3.10 calculated age in years - READ ONLY
connectionstring 3.10 connection type (protocol)
modemstring 3.10 AKA connection
screen_rowsnumber 3.10 terminal rows (0 = auto-detect)
screen_columnsnumber 3.18c terminal columns (0 = auto-detect)
genderstring 3.10 gender type (e.g. M or F or any single-character)
cursubstring 3.10 current/last message sub-board (internal code)
curdirstring 3.10 current/last file directory (internal code)
curxtrnstring 3.10 current/last external program (internal code) run
editorstring 3.10 external message editor (internal code) or blank if none
command_shellstring 3.10 command shell (internal code)
settingsnumber 3.10 settings bitfield - see USER_* in sbbsdefs.js for bit definitions
qwk_settingsnumber 3.10 QWK packet settings bitfield - see QWK_* in sbbsdefs.js for bit definitions
chat_settingsnumber 3.10 chat settings bitfield - see CHAT_* in sbbsdefs.js for bit definitions
temp_file_extstring 3.10 temporary file type (extension)
new_file_timenumber 3.11 new file scan date/time (time_t format)
download_protocolstring 3.10 file transfer protocol (command key)
logontimenumber 3.10 logon time (time_t format)
cachedboolean 3.14 record is currently cached in memory
is_sysopboolean 3.15 user has a System Operator's security level

user.stats object
User statistics (all READ ONLY) - introduced in v3.10

user.stats properties
Name Type Ver Description
laston_datenumber 3.10 date of previous logon (time_t format)
firston_datenumber 3.10 date of first logon (time_t format)
total_logonsnumber 3.10 total number of logons
logons_todaynumber 3.10 total logons today
total_timeonnumber 3.10 total time used (in minutes)
timeon_todaynumber 3.10 time used today (in minutes)
timeon_last_logonnumber 3.10 time used last session (in minutes)
total_postsnumber 3.10 total messages posted
total_emailsnumber 3.10 total e-mails sent
total_feedbacksnumber 3.10 total feedback messages sent
email_todaynumber 3.10 e-mail sent today
posts_todaynumber 3.10 messages posted today
bytes_uploadednumber 3.10 total bytes uploaded
files_uploadednumber 3.10 total files uploaded
bytes_downloadednumber 3.10 total bytes downloaded
files_downloadednumber 3.10 total files downloaded
leech_attemptsnumber 3.10 suspected leech downloads
mail_waitingnumber 3.12 total number of e-mail messages currently waiting in inbox
read_mail_waitingnumber 3.18c number of read e-mail messages currently waiting in inbox
unread_mail_waitingnumber 3.18c number of unread e-mail messages currently waiting in inbox
spam_waitingnumber 3.18c number of SPAM e-mail messages currently waiting in inbox
mail_pendingnumber 3.12 number of e-mail messages sent, currently pending deletion

user.security object
User security settings - introduced in v3.10

user.security properties
Name Type Ver Description
passwordstring 3.10 password
password_datenumber 3.10 date password last modified (time_t format)
levelnumber 3.10 security level (0-99)
flags1number 3.10 flag set #1 (bitfield) can use +/-[A-?] notation
flags2number 3.10 flag set #2 (bitfield) can use +/-[A-?] notation
flags3number 3.10 flag set #3 (bitfield) can use +/-[A-?] notation
flags4number 3.10 flag set #4 (bitfield) can use +/-[A-?] notation
exemptionsnumber 3.10 exemption flags (bitfield) can use +/-[A-?] notation
restrictionsnumber 3.10 restriction flags (bitfield) can use +/-[A-?] notation
creditsnumber 3.10 credits
free_creditsnumber 3.10 free credits (for today only)
minutesnumber 3.10 extra minutes (time bank)
extra_timenumber 3.10 extra minutes (for today only)
expiration_datenumber 3.10 expiration date/time (time_t format)

user.limits object
User limitations based on security level (all READ ONLY) - introduced in v3.11

user.limits properties
Name Type Ver Description
time_per_logonnumber 3.11 time (in minutes) per logon
time_per_daynumber 3.11 time (in minutes) per day
logons_per_daynumber 3.11 logons per day
lines_per_messagenumber 3.11 lines per message (post or email)
email_per_daynumber 3.11 email sent per day
posts_per_daynumber 3.11 messages posted per day
free_credits_per_daynumber 3.11 free credits given per day

bbs object
Controls the Telnet/SSH/RLogin BBS experience - introduced in v3.10

bbs methods
Name Returns Usage Ver Description
atcodestringbbs.atcode(code_string) 3.10 returns @-code value, specified code string does not include @ character delimiters
textstringbbs.text(line_number) 3.10 returns specified text string from text.dat
replace_textbooleanbbs.replace_text(line_number, text) 3.10 replaces specified text string in memory
revert_textbooleanbbs.revert_text([line_number=all]) 3.10 reverts specified text string to original text string; if line_number unspecified, reverts all text lines
load_textbooleanbbs.load_text(base_filename) 3.10 load an alternate text.dat from ctrl directory, automatically appends '.dat' to basefilename
newuservoidbbs.newuser() 3.10 interactive new user procedure
loginbooleanbbs.login(user_name [,password_prompt] [,user_password] [,system_password]) 3.10 login with user_name, displaying password_prompt for user's password (if required), optionally supplying the user's password and the system password as arguments so as to not be prompted
logonbooleanbbs.logon() 3.10 interactive logon procedure
logoffvoidbbs.logoff([prompt=true]) 3.15 interactive logoff procedure, pass false for prompt argument to avoid yes/no prompt
logoutvoidbbs.logout() 3.10 non-interactive logout procedure
hangupvoidbbs.hangup() 3.10 hangup (disconnect) immediately
nodesyncvoidbbs.nodesync([clearline=false]) 3.10 synchronize with node database, checks for messages, interruption, etc. (AKA node_sync), clears the current console line if there's a message to print when clearline is true.
auto_msgvoidbbs.auto_msg() 3.10 read/create system's auto-message
time_bankvoidbbs.time_bank() 3.10 enter the time banking system
qwk_secvoidbbs.qwk_sec() 3.10 enter the QWK message packet upload/download/config section
text_secvoidbbs.text_sec() 3.10 enter the text files section
xtrn_secvoidbbs.xtrn_sec([section]) 3.10 enter the external programs section (or go directly to the specified section)
xfer_policyvoidbbs.xfer_policy() 3.10 display the file transfer policy
batch_menuvoidbbs.batch_menu() 3.10 enter the batch file transfer menu
batch_downloadbooleanbbs.batch_download() 3.10 start a batch download
batch_add_listvoidbbs.batch_add_list(list_filename) 3.10 add file list to batch download queue
view_filebooleanbbs.view_file(filename) 3.19 list contents of specified filename (complete path)
send_filebooleanbbs.send_file(filename [,protocol] [,description] [,autohang=true]) 3.14 send specified filename (complete path) to user via user-prompted (or optionally specified) protocol.
The optional description string is used for logging purposes.
When autohang=true, disconnect after transfer based on user's default setting.
receive_filebooleanbbs.receive_file(filename [,protocol] [,autohang=true]) 3.14 received specified filename (complete path) from user via user-prompted (or optionally specified) protocol.
When autohang=true, disconnect after transfer based on user's default setting.
temp_xfervoidbbs.temp_xfer() 3.10 enter the temporary file tranfer menu
user_syncvoidbbs.user_sync() 3.10 read the current user data from the database
user_configvoidbbs.user_config() 3.10 enter the user settings configuration menu
sys_infovoidbbs.sys_info() 3.10 display system information
sub_infovoidbbs.sub_info([sub-board=current]) 3.10 display message sub-board information (current sub-board, if unspecified)
dir_infovoidbbs.dir_info([directory=current]) 3.10 display file directory information (current directory, if unspecified)
user_infovoidbbs.user_info() 3.10 display current user information
vervoidbbs.ver() 3.10 display software version information
sys_statsvoidbbs.sys_stats() 3.10 display system statistics
node_statsvoidbbs.node_stats([node_number=current]) 3.10 display current (or specified) node statistics
list_usersvoidbbs.list_users([mode=UL_ALL]) 3.10 display user list(see UL_* in sbbsdefs.js for valid mode values)
edit_uservoidbbs.edit_user([user_number=current]) 3.10 enter the user editor
change_uservoidbbs.change_user() 3.10 change to a different user
list_logonsvoidbbs.list_logons([arguments]) 3.10 display the logon list (optionally passing arguments to the logon list module)
read_mailvoidbbs.read_mail([which=MAIL_YOUR] [,user_number=current] [,loadmail_mode=0]) 3.10 read private e-mail(see MAIL_* in sbbsdefs.js for valid which values)
emailbooleanbbs.email(to_user_number [,mode=WM_EMAIL] [,top=none] [,subject=none] [,object reply_header]) 3.10 send private e-mail to a local user (reply_header added in v3.17c)
netmailbooleanbbs.netmail([string address or array of addresses] [,mode=WM_NONE] [,subject=none] [,object reply_header]) 3.10 send private netmail (reply_header added in v3.17c, array of addresses added in v3.18a)
bulk_mailvoidbbs.bulk_mail([ars]) 3.10 send bulk private e-mail, if ars not specified, prompt for destination users
upload_filebooleanbbs.upload_file([directory=current]) 3.10 upload file to file directory specified by number or internal code
bulk_uploadbooleanbbs.bulk_upload([directory=current]) 3.10 add files (already in local storage path) to file directory specified by number or internal code
export_filelistnumberbbs.export_filelist(filename [,mode=FL_NONE]) 3.19 export list of files to a text file, optionally specifying a file list mode (e.g. FL_ULTIME), returning the number of files listed
list_filesnumberbbs.list_files([directory=current] [,filespec="*.*" or search_string] [,mode=FL_NONE]) 3.10 list files in the specified file directory, optionally specifying a file specification (wildcards) or a description search string, and mode (bitfield)
list_file_infonumberbbs.list_file_info([directory=current] [,filespec="*.*"] [,mode=FI_INFO]) 3.10 list extended file information for files in the specified file directory
post_msgbooleanbbs.post_msg([sub-board=current] [,mode=WM_NONE] [,object reply_header]) 3.13 post a message in the specified message sub-board (number or internal code) with optional mode (bitfield)
If reply_header is specified (a header object returned from MsgBase.get_msg_header()), that header will be used for the in-reply-to header fields.
forward_msgbooleanbbs.forward_msg(object header, string to [,string subject] [,string comment]) 3.18c Forward a message
edit_msgbooleanbbs.edit_msg(object header) 3.18c Edit a message
show_msgbooleanbbs.show_msg(object header [,mode=P_NONE] ) 3.17c show a message's header and body (text) with optional print mode (bitfield)
header must be a header object returned from MsgBase.get_msg_header())
show_msg_headervoidbbs.show_msg_header(object header [,subject] [,from] [,to]) 3.17c show a message's header (only)
header must be a header object returned from MsgBase.get_msg_header())
download_msg_attachmentsvoidbbs.download_msg_attachments(object header) 3.17c prompt the user to download each of the message's file attachments (if there are any)
header must be a header object returned from MsgBase.get_msg_header())
change_msg_attrnumberbbs.change_msg_attr(object header) 3.17c prompt the user to modify the specified message header attributes
cfg_msg_scanvoidbbs.cfg_msg_scan([type=SCAN_CFG_NEW]) 3.10 configure message scan (type is either SCAN_CFG_NEW or SCAN_CFG_TOYOU)
cfg_msg_ptrsvoidbbs.cfg_msg_ptrs() 3.10 change message scan pointer values
reinit_msg_ptrsvoidbbs.reinit_msg_ptrs() 3.10 re-initialize new message scan pointers
scan_subsvoidbbs.scan_subs([mode=SCAN_NEW] [,all=false]) 3.10 scan sub-boards for messages
scan_dirsvoidbbs.scan_dirs([mode=FL_NONE] [,all=false]) 3.10 scan directories for files
scan_msgsbooleanbbs.scan_msgs([sub-board=current] [,mode=SCAN_READ] [,find]) 3.10 scan messages in the specified message sub-board (number or internal code), optionally search for 'find' string (AKA scan_posts)
list_msgsnumberbbs.list_msgs([sub-board=current] [,mode=SCAN_INDEX] [,message_number=0] [,find]) 3.14 list messages in the specified message sub-board (number or internal code), optionally search for 'find' string, returns number of messages listed
menubooleanbbs.menu(base_filename [,mode=P_NONE] [,object scope]) 3.10 display a menu file from the text/menu directory.
See P_* in sbbsdefs.js for mode flags.
When scope is specified, @JS:property@ codes will expand the referenced property names.
To display a randomly-chosen menu file, including wild-card (* or ?) characters in the base_filename.
menu_existsbooleanbbs.menu_exists(base_filename) 3.17 returns true if the referenced menu file exists (i.e. in the text/menu directory)
log_keybooleanbbs.log_key(key [,comma=false]) 3.10 log key to node.log (comma optional)
log_strbooleanbbs.log_str(text) 3.10 log string to node.log
findusernumberbbs.finduser(username_or_number) 3.10 find user name (partial name support), interactive
trashcanbooleanbbs.trashcan(base_filename, search_string) 3.10 search file for pseudo-regexp (search string) in trashcan file (text/base_filename.can)
execnumberbbs.exec(cmdline [,mode=EX_NONE] [,startup_dir]) 3.10 execute a program, optionally changing current directory to startup_dir (see EX_* in sbbsdefs.js for valid mode flags.)
exec_xtrnbooleanbbs.exec_xtrn(xtrn_number_or_code) 3.10 execute external program by number or internal code
user_eventbooleanbbs.user_event(event_type) 3.10 execute user event by event type (see EVENT_* in sbbsdefs.js for valid values)
telnet_gatevoidbbs.telnet_gate(address [,mode=TG_NONE] [,timeout=10]) 3.10 external Telnet gateway (see TG_* in sbbsdefs.js for valid mode flags).
rlogin_gatevoidbbs.rlogin_gate(address [,client-user-name=user.alias, server-user-name=user.name, terminal=console.terminal] [,mode=TG_NONE] [,timeout=10]) 3.16 external RLogin gateway (see TG_* in sbbsdefs.js for valid mode flags).
check_syspassbooleanbbs.check_syspass([sys_pw]) 3.10 verify system password, prompting for the password if not passed as an argument
good_passwordbooleanbbs.good_password(password) 3.10 check if requested user password meets minimum password requirements (length, uniqueness, etc.)
page_sysopbooleanbbs.page_sysop() 3.10 page the sysop for chat, returns false if the sysop could not be paged
page_gurubooleanbbs.page_guru() 3.10 page the guru for chat
multinode_chatvoidbbs.multinode_chat() 3.10 enter multi-node chat
private_messagevoidbbs.private_message() 3.10 use the private inter-node message prompt
private_chatvoidbbs.private_chat([local=false]) 3.10 enter private inter-node chat, or local sysop chat (if local=true)
get_node_messagevoidbbs.get_node_message([clearline=false]) 3.10 receive and display an inter-node message
put_node_messagebooleanbbs.put_node_message([node_number] [,text]) 3.17 send an inter-node message (specify a node_number value of -1 for 'all active nodes')
get_telegramvoidbbs.get_telegram([user_number=current], [clearline=false]) 3.10 receive and display waiting telegrams for specified (or current) user
put_telegrambooleanbbs.put_telegram([user_number] [,text]) 3.17 send a telegram (short multi-line stored message) to a user
list_nodesvoidbbs.list_nodes() 3.10 list all nodes
whos_onlinevoidbbs.whos_online() 3.10 list active nodes only (who's online)
spyvoidbbs.spy(node_number) 3.10 spy on a node
cmdstrstringbbs.cmdstr(command_string [,fpath=""] [,fspec=""]) 3.10 return expanded command string using Synchronet command-line specifiers
get_filespecstringbbs.get_filespec() 3.10 returns a file specification input by the user (optionally with wildcards)
get_newscantimenumberbbs.get_newscantime(time=current) 3.10 confirm or change a new-scan time, returns the new new-scan time value (time_t format)
select_shellbooleanbbs.select_shell() 3.10 prompt user to select a new command shell
select_editorbooleanbbs.select_editor() 3.10 prompt user to select a new external message editor
get_time_leftnumberbbs.get_time_left() 3.14b check the user's available remaining time online and return the value, in seconds
This method will inform (and disconnect) the user when they are out of time
compare_arsbooleanbbs.compare_ars(ars) 3.15 verify the current user online meets the specified Access Requirements String
select_nodenumberbbs.select_node(all_is_an_option=false) 3.17 Choose an active node to interact with.
Returns the selected node number, 0 (for none) or -1 for 'All'.
select_usernumberbbs.select_user() 3.17 Choose a user to interact with.

bbs.mods object
Global repository for 3rd party modifications - introduced in v3.12


bbs properties
Name Type Ver Description
sys_statusnumber 3.10 system status bitfield (see SS_* in sbbsdefs.js for bit definitions)
startup_optionsnumber 3.10 startup options bitfield (see BBS_OPT_* in sbbsdefs.js for bit definitions)
answer_timenumber 3.10 answer time, in time_t format
logon_timenumber 3.10 logon time, in time_t format
start_timenumber 3.14 time from which user's time left is calculated, in time_t format
new_file_timenumber 3.10 current file new-scan time, in time_t format
last_new_file_timenumber 3.10 previous file new-scan time, in time_t format
onlinenumber 3.10 online (see ON_* in sbbsdefs.js for valid values)
time_leftnumber 3.11 time left (in seconds)
event_timenumber 3.11 time of next exclusive event (in time_t format), or 0 if none
event_codestring 3.11 internal code of next exclusive event
node_numnumber 3.10 current node number
node_settingsnumber 3.10 current node settings bitfield (see NM_* in sbbsdefs.js for bit definitions)
node_statusnumber 3.17 current node status value (see nodedefs.js for valid values)
node_errorsnumber 3.17 current node error counter
node_actionnumber 3.10 current node action (see nodedefs.js for valid values)
node_useronnumber 3.17 current node user number (useron value)
node_connectionnumber 3.17 current node connection type (see nodedefs.js for valid values)
node_miscnumber 3.17 current node misc value (see nodedefs.js for valid values)
node_auxnumber 3.17 current node aux value
node_extauxnumber 3.17 current node extended aux (extaux) value
node_val_usernumber 3.10 validation feedback user for this node (or 0 for no validation feedback required)
logon_ulbnumber 3.10 bytes uploaded during this session
logon_dlbnumber 3.10 bytes downloaded during this session
logon_ulsnumber 3.10 files uploaded during this session
logon_dlsnumber 3.10 files downloaded during this session
logon_postsnumber 3.10 messages posted during this session
logon_emailsnumber 3.10 e-mails sent during this session
logon_fbacksnumber 3.10 feedback messages sent during this session
posts_readnumber 3.10 messages read during this session
menu_dirstring 3.10 menu subdirectory (overrides default)
menu_filestring 3.10 menu file (overrides default)
main_cmdsnumber 3.10 total main menu commands received from user during this session
file_cmdsnumber 3.10 total file menu commands received from user during this session
curgrpnumber 3.10 current message group
cursubnumber 3.10 current message sub-board
cursub_codestring 3.14 current message sub-board internal code
curlibnumber 3.10 current file library
curdirnumber 3.10 current file directory
curdir_codestring 3.14 current file directory internal code
connectionstring 3.10 remote connection type
rlogin_namestring 3.10 login name given during RLogin negotiation
rlogin_passwordstring 3.15 password specified during RLogin negotiation
rlogin_terminalstring 3.16 terminal specified during RLogin negotiation
client_namestring 3.10 client name
errorlevelnumber 3.12 error level returned from last executed external program
smb_groupstring 3.10 message group name of message being read
smb_group_descstring 3.10 message group description of message being read
smb_group_numbernumber 3.10 message group number of message being read
smb_substring 3.10 sub-board name of message being read
smb_sub_descstring 3.10 sub-board description of message being read
smb_sub_codestring 3.10 sub-board internal code of message being read
smb_sub_numbernumber 3.10 sub-board number of message being read
smb_attrnumber 3.10 message base attributes
smb_last_msgnumber 3.10 highest message number in message base
smb_total_msgsnumber 3.10 total number of messages in message base
smb_msgsnumber 3.10 number of messages loaded from message base
smb_curmsgnumber 3.10 current message number in message base
msg_tostring 3.10 message recipient name
msg_to_extstring 3.10 message recipient extension
msg_to_netstring 3.10 message recipient network address
msg_to_agentnumber 3.10 message recipient agent type
msg_fromstring 3.10 message sender name
msg_from_extstring 3.10 message sender extension
msg_from_netstring 3.10 message sender network address
msg_from_bbsidstring 3.18c message sender BBS ID
msg_from_agentnumber 3.10 message sender agent type
msg_replytostring 3.10 message reply-to name
msg_replyto_extstring 3.10 message reply-to extension
msg_replyto_netstring 3.10 message reply-to network address
msg_replyto_agentnumber 3.10 message reply-to agent type
msg_subjectstring 3.10 message subject
msg_datenumber 3.10 message date/time
msg_timezonenumber 3.10 message time zone
msg_date_importednumber 3.10 message date/time imported
msg_attrnumber 3.10 message attributes
msg_auxattrnumber 3.10 message auxiliary attributes
msg_netattrnumber 3.10 message network attributes
msg_offsetnumber 3.10 message header offset
msg_numbernumber 3.10 message number (unique, monotonically incrementing)
msg_expirationnumber 3.10 message expiration
msg_forwardednumber 3.10 message forwarded
msg_thread_idnumber 3.16 message thread identifier (0 if unknown)
msg_thread_backnumber 3.12 message thread, back message number
msg_thread_nextnumber 3.10 message thread, next message number
msg_thread_firstnumber 3.10 message thread, message number of first reply to this message
msg_idstring 3.10 message identifier
msg_reply_idstring 3.10 message replied-to identifier
msg_delivery_attemptsnumber 3.10 message delivery attempt counter
msghdr_top_of_screennumber 3.17c message header displayed at top-of-screen
file_namestring 3.17 file name
file_descriptionstring 3.17 file description
file_dir_numberstring 3.17 file directory (number)
file_attrstring 3.17 file attribute flags
file_datestring 3.17 file date
file_sizestring 3.17 file size (in bytes)
file_creditsstring 3.17 file credit value
file_uploaderstring 3.17 file uploader (user name)
file_upload_datestring 3.17 file upload date
file_download_datestring 3.17 file last-download date
file_download_countstring 3.17 file download count
batch_upload_totalnumber 3.10 number of files in batch upload queue
batch_dnload_totalnumber 3.10 number of files in batch download queue
command_strstring 3.14 current command shell/module command string value

console object
Controls the remote terminal - introduced in v3.10

console methods
Name Returns Usage Ver Description
inkeystringconsole.inkey([mode=K_NONE] [,timeout=0]) 3.11 get a single key with optional timeout in milliseconds (defaults to 0, for no wait).
Returns an empty string (or null when the K_NUL mode flag is used) if there is no input (e.g. timeout occurs).
See K_* in sbbsdefs.js for mode flags.
getkeystringconsole.getkey([mode=K_NONE]) 3.10 get a single key, with wait.
See K_* in sbbsdefs.js for mode flags.
getstrstringconsole.getstr([string] [,maxlen=128] [,mode=K_NONE] [,history[]]) 3.10 get a text string from the user.
See K_* in sbbsdefs.js for mode flags.
history[], added in v3.17, allows a command history (string array) to be recalled using the up/down arrow keys.
getnumnumberconsole.getnum([maxnum[, default]]) 3.10 get a number between 1 and maxnum from the user with a default value of default
getkeysnumberconsole.getkeys([keys] [,maxnum] [,mode=K_UPPER]) 3.10 get one key from of a list of valid command keys (any key, if not specified), or a number between 1 and maxnum
gettemplatestringconsole.gettemplate(format [,string] [,mode=0]) 3.10 get an input string based on specified template
ungetstrvoidconsole.ungetstr(keys) 3.10 put one or more characters in the keyboard input buffer
yesnobooleanconsole.yesno(question [,mode = P_NONE]) 3.10 YES/no question - returns true if 'yes' is selected
noyesbooleanconsole.noyes(question [,mode = P_NONE]) 3.10 NO/yes question - returns true if 'no' is selected
mnemonicsvoidconsole.mnemonics(text) 3.10 print a mnemonics string, command keys highlighted with tilde (~) characters
clearvoidconsole.clear([attribute] [,autopause=true]) 3.10 clear screen and home cursor, optionally (in v3.13b+) setting current attribute first
homevoidconsole.home() 3.11 send cursor to home position (x,y:1,1)
clearlinevoidconsole.clearline([attribute]) 3.10 clear current line, optionally (in v3.13b+) setting current attribute first
cleartoeolvoidconsole.cleartoeol([attribute]) 3.11 clear to end-of-line, optionally (in v3.13b+) setting current attribute first
crlfvoidconsole.crlf([count=1]) 3.10 output count number of carriage-return/line-feed pairs (new-lines)
pausevoidconsole.pause() 3.10 display pause prompt and wait for key hit
beepvoidconsole.beep([count=1]) 3.11 beep for count number of times (default count is 1)
printvoidconsole.print([value [,value][...]] or [string [,mode=P_NONE]]) 3.10 display one or more values as strings (supports Ctrl-A codes, Telnet-escaping, auto-screen pausing, etc.).
Supports a limited set of P_* flags, e.g. P_PETSCII and P_UTF8.
writevoidconsole.write(value [,value]) 3.10 display one or more values as raw strings (may include NULs)
writelnvoidconsole.writeln(value [,value]) 3.15 display one or more values as raw strings followed by a single carriage-return/line-feed pair (new-line)
putmsgvoidconsole.putmsg(text [,mode=P_NONE] [,orig_columns=0] [,object scope]) 3.10 display message text (Ctrl-A codes, @-codes, pipe codes, etc.).
See P_* in sbbsdefs.js for mode flags.
When P_WORDWRAP mode flag is specified, orig_columns specifies the original text column width, if known.
When scope is specified, @JS:property@ codes will expand the referenced property names.
centervoidconsole.center(text [,width]) 3.10 display a string centered on the screen, with an optionally-specified screen width (in columns)
widevoidconsole.wide(text) 3.17c display a string double-wide on the screen (sending "fullwidth" Unicode characters when possible)
strlennumberconsole.strlen(text [,mode=P_NONE]) 3.10 returns the printed-length (number of columns) of the specified text, accounting for Ctrl-A codes
printfilebooleanconsole.printfile(filename [,mode=P_NONE] [,orig_columns=0] [,object scope]) 3.10 print a message text file with optional mode.
When P_WORDWRAP mode flag is specified, orig_columns specifies the original text column width, if known.
When scope is specified, @JS:property@ codes will expand the referenced property names.
printtailbooleanconsole.printtail(filename, lines [,mode=P_NONE] [,orig_columns=0] [,object scope]) 3.10 print the last n lines of file with optional mode, original column width, and scope.
editfilebooleanconsole.editfile(filename) 3.10 edit/create a text file using the user's preferred message editor
uselectnumberconsole.uselect([number, title, item] [,ars]) 3.12 user selection menu, call for each item, then with no args to display select menu
savelinebooleanconsole.saveline() 3.10 push the current console line of text and attributes to a (local) LIFO list of //saved lines//
restorelinebooleanconsole.restoreline() 3.10 pop the most recently //saved line// of text and attributes and display it on the remote console
ansistringconsole.ansi(attribute [,current_attribute]) 3.10 returns ANSI sequence required to generate specified terminal attribute (e.g. YELLOW|HIGH|BG_BLUE), if current_attribute is specified, an optimized ANSI sequence may be returned
pushxyvoidconsole.pushxy() 3.11 save the current cursor position (x and y coordinates) in the remote terminal
popxyvoidconsole.popxy() 3.11 restore a saved cursor position to the remote terminal (requires terminal support, e.g. ANSI)
gotoxyvoidconsole.gotoxy([x,y] or [object { x,y }]) 3.11 move cursor to a specific screen coordinate (ANSI or PETSCII, 1-based values), arguments can be separate x and y coordinates or an object with x and y properties (like that returned from console.getxy())
upvoidconsole.up([rows=1]) 3.11 move cursor up one or more rows
downvoidconsole.down([rows=1]) 3.11 move cursor down one or more rows
rightvoidconsole.right([columns=1]) 3.11 move cursor right one or more columns
leftvoidconsole.left([columns=1]) 3.11 move cursor left one or more columns
getdimensionsvoidconsole.getdimensions() 3.11 query the number of rows and columns on the remote terminal
getxyobjectconsole.getxy() 3.11 query the current cursor position on the remote (ANSI) terminal and returns the coordinates as an object (with x and y properties) or false on failure
lock_inputvoidconsole.lock_input([lock=true]) 3.10 lock the user input thread (allowing direct client socket access)
telnet_cmdbooleanconsole.telnet_cmd(command [,option=0] [,timeout=0]) 3.17 send Telnet command (with optional command option) to remote client, if the optional timeout is specified (in milliseconds, added in v3.17), then an acknowledgment will be expected and the return value will indicate whether or not one was received
handle_ctrlkeybooleanconsole.handle_ctrlkey(key [,mode=K_NONE]) 3.11 call internal control key handler for specified control key, returns true if handled
term_supportsbooleanconsole.term_supports([terminal_flags]) 3.14 either returns bool, indicating whether or not the current user/client supports all the specified terminal_flags, or returns the current user/client's terminal_flags (numeric bit-field) if no terminal_flags were specified
term_updatedbooleanconsole.term_updated() 3.18c update the node's terminal.ini file to match the current terminal settings
backspacevoidconsole.backspace([count=1]) 3.15 send a destructive backspace sequence
creturnvoidconsole.creturn([count=1]) 3.17 send a carriage return sequence
clearkeybuffervoidconsole.clearkeybuffer() 3.15 clear keyboard input buffer
getbytenumberconsole.getbyte([timeout=0]) 3.17 returns an unprocessed input byte from the remote terminal with optional timeout in milliseconds (defaults to 0, for no wait), returns null on failure (timeout)
putbytebooleanconsole.putbyte(value) 3.17 sends an unprocessed byte value to the remote terminal
add_hotspotvoidconsole.add_hotspot(cmd [,bool hungry=true] [,min_x] [,max_x] [,y]) 3.18 adds a mouse hot-spot (a clickable screen area that generates keyboard input)
clear_hotspotsvoidconsole.clear_hotspots() 3.18 clear all current mouse hot-spots
scroll_hotspotsvoidconsole.scroll_hotspots([rows=1]) 3.18 scroll all current mouse hot-spots by the specific number of rows
onnumberconsole.on(type, callback) 3.19 calls callback whenever the condition type specifies is possible. Currently, only 'read' is supported for type. Returns an id suitable for use with clearOn
oncenumberconsole.once(type, callback) 3.19 calls callback the first time the condition type specifies is possible. Currently, only 'read' is supported for type. Returns an id suitable for use with clearOnce
clearOnvoidconsole.clearOn(type, id) 3.19 removes a callback installed by on
clearOncevoidconsole.clearOnce(type, id) 3.19 removes a callback installed by once

console properties
Name Type Ver Description
statusnumber 3.10 status bit-field (see CON_* in sbbsdefs.js for bit definitions)
mouse_modenumber 3.18 mouse mode bit-field (see MOUSE_MODE_* in sbbsdefs.js for bit definitions)
line_counternumber 3.10 current 0-based line counter (used for automatic screen pause)
current_rownumber 3.18 current 0-based row counter
current_columnnumber 3.15 current 0-based column counter (used to auto-increment line_counter when screen wraps)
last_line_lengthnumber 3.17 length of last line sent to terminal (before a carriage-return or line-wrap)
attributesnumber 3.10 current display attributes (set with number or string value)
top_of_screennumber 3.10 set to true if the terminal cursor is already at the top of the screen - READ ONLY
screen_rowsnumber 3.10 number of remote terminal screen rows (in lines)
screen_columnsnumber 3.11 number of remote terminal screen columns (in character cells)
tabstopnumber 3.17 current tab stop interval (tab size), in columns
autotermnumber 3.10 bit-field of automatically detected terminal settings (see USER_* in sbbsdefs.js for bit definitions)
terminalstring 3.11 terminal type description, possibly supplied by client (e.g. 'ANSI')
typestring 3.17c terminal type (i.e. 'ANSI', 'RIP', 'PETSCII', or 'DUMB')
charsetstring 3.17c terminal character set (i.e. 'UTF-8', 'CP437', 'CBM-ASCII', or 'US-ASCII')
cterm_versionnumber 3.17 detected CTerm (SyncTERM) version as an integer > 1000 where major version is cterm_version / 1000 and minor version is cterm_version % 1000
inactivity_warningnumber 3.14b number of seconds before displaying warning (Are you really there?) due to user/keyboard inactivity
inactivity_hangupnumber 3.14b number of seconds before disconnection due to user/keyboard inactivity
timeoutnumber 3.10 user/keyboard inactivity timeout reference value (time_t format)
timeleft_warningnumber 3.10 number of low time-left (5 or fewer minutes remaining) warnings displayed to user
abortedboolean 3.10 input/output has been aborted
abortableboolean 3.10 remote output can be asynchronously aborted with Ctrl-C
telnet_modenumber 3.10 current Telnet mode bit-field (see TELNET_MODE_* in sbbsdefs.js for bit definitions)
wordwrapstring 3.10 word-wrap buffer (used by getstr) - READ ONLY
questionstring 3.10 current yes/no question (set by yesno and noyes)
getstr_offsetnumber 3.11 cursor position offset for use with getstr(K_USEOFFSET)
ctrlkey_passthrunumber 3.10 control key pass-through bit-mask, set bits represent control key combinations not handled by inkey() method This may optionally be specified as a string of characters. The format of this string is [+-][@-_]. If neither plus nor minus is the first character, the value will be replaced by one constructed from the string. A + indicates that characters following will be added to the set, and a - indicates they should be removed. ex: console.ctrlkey_passthru="-UP+AB" will clear CTRL-U and CTRL-P and set CTRL-A and CTRL-B.
input_buffer_levelnumber 3.12 number of bytes currently in the input buffer (from the remote client) - READ ONLY
input_buffer_spacenumber 3.12 number of bytes available in the input buffer - READ ONLY
output_buffer_levelnumber 3.12 number of bytes currently in the output buffer (from the local server) - READ ONLY
output_buffer_spacenumber 3.12 number of bytes available in the output buffer - READ ONLY
output_ratenumber 3.17c emulated serial data output rate, in bits-per-second (0 = unlimited)
keyboard_buffer_levelnumber 3.18 number of characters current in the keyboard input buffer (from ungetstr) - READ ONLY
keyboard_buffer_spacenumber 3.18 number of characters spaces available in the keyboard input buffer - READ ONLY

msg_area object
Message Areas - introduced in v3.10

msg_area properties
Name Type Description
settingsnumber message area settings (bitfield) - see MM_* in sbbsdefs.js for details
fido_netmail_settingsnumber FidoNet NetMail settings (bitfield) - see NMAIL_* in sbbsdefs.js for details
inet_netmail_settingsnumber Internet NetMail settings (bitfield) - see NMAIL_* in sbbsdefs.js for details

msg_area.grp object
Associative array of all groups (use name as index) - introduced in v3.12

msg_area.sub object
Associative array of all sub-boards (use internal code as index) - introduced in v3.11

msg_area.grp_list array
Message Groups (current user has access to) - introduced in v3.10

msg_area.grp_list properties
Name Type Description
indexnumber index into grp_list array (or -1 if not in array) (introduced in v3.12)
numbernumber unique number for this message group
namestring group name
descriptionstring group description
arsstring group access requirements
can_accessboolean user has sufficient access to list this group's sub-boards (introduced in v3.18)
code_prefixstring internal code prefix (for sub-boards) (introduced in v3.18c)

msg_area.grp_list.sub_list array
Message Sub-boards (current user has access to)

(all properties are READ ONLY except for scan_ptr, scan_cfg, and last_read) - introduced in v3.10
msg_area.grp_list.sub_list properties
Name Type Description
indexnumber index into sub_list array (or -1 if not in array) (introduced in v3.12)
grp_indexnumber group's index into grp_list array (introduced in v3.12)
numbernumber unique number for this sub-board
grp_numbernumber group number
grp_namestring group name (introduced in v3.12)
codestring sub-board internal code
namestring sub-board name
descriptionstring sub-board description
qwk_namestring QWK conference name
area_tagstring area tag for FidoNet-style echoes, a.k.a. EchoTag (introduced in v3.19)
newsgroupstring newsgroup name (as configured or dynamically generated)
arsstring sub-board access requirements
read_arsstring sub-board reading requirements
post_arsstring sub-board posting requirements
operator_arsstring sub-board operator requirements
moderated_arsstring sub-board moderated-user requirements (if non-blank)
data_dirstring sub-board data storage location
fidonet_originstring FidoNet origin line
qwknet_taglinestring QWK Network tagline
settingsnumber toggle options (bitfield) - see SUB_* in sbbsdefs.js for details
ptridxnumber index into message scan configuration/pointer file
qwk_confnumber QWK conference number
max_crcsnumber configured maximum number of message CRCs to store (for dupe checking)
max_msgsnumber configured maximum number of messages before purging
max_agenumber configured maximum age (in days) of messages before expiration
print_modenumber additional print mode flags to use when printing messages - see P_* in sbbsdefs.js for details
print_mode_negnumber print mode flags to negate when printing messages - see P_* in sbbsdefs.js for details
can_accessboolean user has sufficient access to see this sub-board
can_readboolean user has sufficient access to read messages in this sub-board
can_postboolean user has sufficient access to post messages in this sub-board
is_operatorboolean user has operator access to this sub-board
is_moderatedboolean user's posts are moderated
scan_ptrundefined user's current new message scan pointer (highest-read message number)
scan_cfgundefined user's message scan configuration (bitfield) - see SCAN_CFG_* in sbbsdefs.js for details
last_readundefined user's last-read message number
postsnumber number of messages currently posted to this sub-board (introduced in v3.18c)

file_area object
File Transfer Areas - introduced in v3.10

file_area properties
Name Type Description
min_diskspacenumber minimum amount of available disk space (in kilobytes) required for user uploads to be allowed
settingsnumber file area settings (bitfield) - see FM_* in sbbsdefs.js for details

file_area.lib object
Associative array of all libraries (use name as index) - introduced in v3.12

file_area.dir object
Associative array of all directories (use internal code as index) - introduced in v3.11

file_area.lib_list array
File Transfer Libraries (current user has access to) - introduced in v3.10

file_area.lib_list properties
Name Type Description
indexnumber index into lib_list array (or -1 if not in array) (introduced in v3.12)
numbernumber unique number for this library
namestring library name
descriptionstring library description
arsstring library access requirements
linkstring library link (for HTML index)
can_accessboolean user has sufficient access to this library's directories (introduced in v3.18)
code_prefixstring internal code prefix (for directories) (introduced in v3.18c)

file_area.lib_list.dir_list array
File Transfer Directories (current user has access to) - introduced in v3.10

file_area.lib_list.dir_list properties
Name Type Description
indexnumber index into dir_list array (or -1 if not in array) (introduced in v3.12)
numbernumber unique number for this directory
lib_indexnumber library index (introduced in v3.12)
lib_numbernumber library number
lib_namestring library name (introduced in v3.12)
codestring directory internal code
namestring directory name
descriptionstring directory description
area_tagstring directory area tag for file echoes (introduced in v3.19)
pathstring directory file storage location
arsstring directory access requirements
upload_arsstring directory upload requirements
download_arsstring directory download requirements
exempt_arsstring directory exemption requirements
operator_arsstring directory operator requirements
extensionsstring allowed file extensions (comma delimited)
upload_semstring upload semaphore file
data_dirstring directory data storage location
settingsnumber toggle options (bitfield)
seqdevnumber sequential (slow storage) device number
sortnumber sort order (see FileBase.SORT for valid values)
max_filesnumber configured maximum number of files
max_agenumber configured maximum age (in days) of files before expiration
upload_credit_pctnumber percent of file size awarded uploader in credits upon file upload
download_credit_pctnumber percent of file size awarded uploader in credits upon subsequent downloads
linkstring directory link (for HTML index)
filesnumber number of files currently in this directory (introduced in v3.18c)
update_timenumber timestamp of file base index of this directory (introduced in v3.19)
can_accessboolean user has sufficient access to view this directory (e.g. list files) (introduced in v3.18)
can_uploadboolean user has sufficient access to upload files to this directory
can_downloadboolean user has sufficient access to download files from this directory
is_exemptboolean user is exempt from download credit costs (or the directory is configured for free downloads)
is_operatorboolean user has operator access to this directory
is_offlineboolean directory is for offline storage (introduced in v3.14)
is_uploadboolean directory is for uploads only (introduced in v3.14)
is_sysopboolean directory is for uploads to sysop only (introduced in v3.14)

xtrn_area object
External Program Areas - introduced in v3.10

xtrn_area.sec object
Associative array of all external program sections (use internal code as index) - introduced in v3.12

xtrn_area.prog object
Associative array of all external programs (use internal code as index) - introduced in v3.11

xtrn_area.sec_list array
Online Program (door) Sections (current user has access to) - introduced in v3.10

xtrn_area.sec_list properties
Name Type Description
indexnumber index into sec_list array (or -1 if not in index) (introduced in v3.12)
numbernumber unique number for this external program section
codestring external program section internal code
namestring external program section name
arsstring external program section access requirements
can_accessboolean user has sufficient access to enter this section (introduced in v3.15)

xtrn_area.sec_list.prog_list array
Online External Programs (doors) (current user has access to) - introduced in v3.10

xtrn_area.sec_list.prog_list properties
Name Type Description
indexnumber index into prog_list array (or -1 if not in index) (introduced in v3.12)
numbernumber program number
sec_indexnumber program section index (introduced in v3.12)
sec_numbernumber program section number
sec_codestring program section internal code (introduced in v3.12)
codestring internal code
namestring name
cmdstring command-line
clean_cmdstring clean-up command-line
startup_dirstring startup directory
arsstring access requirements
execution_arsstring execution requirements
settingsnumber toggle options (bitfield)
typenumber drop file type
eventnumber event type (0=none)
textranumber extra time given to users running this program
max_timenumber maximum time allowed in program
costnumber execution cost (credits to run this program)
can_accessboolean user has sufficient access to see this program
can_runboolean user has sufficient access to run this program

xtrn_area.event object
Associative array of all timed events (use internal code as index) - introduced in v3.11

xtrn_area.event properties
Name Type Ver Description
cmdstring 3.11 command-line
startup_dirstring 3.11 startup directory
node_numnumber 3.11 node number
timenumber 3.11 time to execute (minutes since midnight)
freqnumber 3.11 frequency to execute
daysnumber 3.11 days of week to execute (bitfield)
mdaysnumber 3.11 days of month to execute (bitfield)
monthsnumber 3.11 months of year to execute (bitfield)
last_runnumber 3.11 date/time of last run (in time_t format)
next_runnumber 3.18c date/time of next run (in time_t format)
error_levelnumber 3.18c error log level
settingsnumber 3.11 toggle options (bitfield)

xtrn_area.editor object
Associative array of all external editors (use internal code as index) - introduced in v3.11

xtrn_area.editor properties
Name Type Description
namestring name
cmdstring command-line
arsstring access requirements
settingsnumber toggle options (bitfield)
typenumber drop file type

MsgBase class
Class used for accessing message bases - introduced in v3.10

To create a new MsgBase object: var msgbase = new MsgBase('code')
where code is a sub-board internal code, or mail for the e-mail message base.

The MsgBase retrieval methods that accept a by_offset argument as their optional first boolean argument will interpret the following number argument as either a 1-based unique message number (by_offset=false) or a 0-based message index-offset (by_offset=true). Retrieving messages by offset is faster than by number or message-id (string). Passing an existing message header object to the retrieval methods that support it (e.g. get_msg_body()) is even faster.

MsgBase methods
Name Returns Usage Ver Description
openbooleanMsgBase.open() 3.10 open message base
closebooleanMsgBase.close() 3.10 close message base (if open)
get_msg_headerobjectMsgBase.get_msg_header([by_offset=false,] number_or_offset_or_id [,expand_fields=true] [,include_votes=false]) 3.12 returns a specific message header, null on failure.
New in v3.12: Pass false for the expand_fields argument (default: true) if you will be re-writing the header later with put_msg_header()
Additional read-only header properties: mime_version, content_type, and is_utf8
get_all_msg_headersobjectMsgBase.get_all_msg_headers([include_votes=false] [,expand_fields=true]) 3.16 returns an object (associative array) of all message headers "indexed" by message number.
Message headers returned by this function include additional properties: upvotes, downvotes and total_votes.
Vote messages are excluded by default.
put_msg_headerbooleanMsgBase.put_msg_header([by_offset=false,] [number_or_offset_or_id,] object header) 3.10 modify an existing message header (must have been 'got' without expanded fields)
get_msg_bodystringMsgBase.get_msg_body([by_offset=false,] number_or_offset_or_id_or_header [,strip_ctrl_a=false] [,dot_stuffing=false] [,include_tails=true] [,plain_text=false]) 3.10 returns the entire body text of a specific message as a single String, null on failure. The default behavior is to leave Ctrl-A codes intact, do not stuff dots (e.g. per RFC-821), and to include tails (if any) in the returned body text. When plain_text is true, only the first plain-text portion of a multi-part MIME encoded message body is returned. The first argument (following the optional by_offset boolean) must be either a number (message number or index-offset), string (message-ID), or object (message header). The by_offfset (true) argument should only be passed when the argument following it is the numeric index-offset of the message to be retrieved. By default (by_offset=false), a numeric argument would be interpreted as the message number to be retrieved.
After reading a multi-part MIME-encoded message, new header properties may be available: text_charset and text_subtype.
get_msg_tailstringMsgBase.get_msg_tail([by_offset=false,] number_or_offset_or_id_or_header [,strip_ctrl_a]=false) 3.10 returns the tail text of a specific message, null on failure
get_msg_indexobjectMsgBase.get_msg_index([by_offset=false,] number_or_offset, [include_votes=false]) 3.11 returns a specific message index record, null on failure. The index object will contain the following properties:
attrAttribute bitfield
timeDate/time imported (in time_t format)
numberMessage number
offsetRecord number in index file
Indexes of regular messages will contain the following additional properties:
subjectCRC-16 of lowercase message subject
toCRC-16 of lowercase recipient's name (or user number if e-mail)
fromCRC-16 of lowercase sender's name (or user number if e-mail)
Indexes of vote messages will contain the following additional properties:
votevote value
remsgnumber of message this vote is in response to
get_indexarrayMsgBase.get_index() 3.17c return an array of message index records represented as objects, the same format as returned by get_msg_index()
This is the fastest method of obtaining a list of all message index records.
remove_msgbooleanMsgBase.remove_msg([by_offset=false,] number_or_offset_or_id) 3.11 mark message for deletion
save_msgbooleanMsgBase.save_msg(object header [,client=none] [,body_text=""] [,array rcpt_list=none]) 3.12 create a new message in message base, the header object may contain the following properties:
subjectMessage subject (required)
toRecipient's name (required)
to_extRecipient's user number (for local e-mail)
to_orgRecipient's organization
to_net_typeRecipient's network type (default: 0 for local)
to_net_addrRecipient's network address
to_agentRecipient's agent type
to_listComma-separated listed of primary recipients, RFC822-style
cc_listComma-separated listed of secondary recipients, RFC822-style
fromSender's name (required)
from_extSender's user number
from_orgSender's organization
from_net_typeSender's network type (default: 0 for local)
from_net_addrSender's network address
from_agentSender's agent type
from_ip_addrSender's IP address (if available, for security tracking)
from_host_nameSender's host name (if available, for security tracking)
from_protocolTCP/IP protocol used by sender (if available, for security tracking)
from_portTCP/UDP port number used by sender (if available, for security tracking)
sender_useridSender's user ID (if available, for security tracking)
sender_serverServer's host name (if available, for security tracking)
sender_timeTime/Date message was received from sender (if available, for security tracking)
replytoReplies should be sent to this name
replyto_extReplies should be sent to this user number
replyto_orgReplies should be sent to organization
replyto_net_typeReplies should be sent to this network type
replyto_net_addrReplies should be sent to this network address
replyto_agentReplies should be sent to this agent type
replyto_listComma-separated list of mailboxes to reply-to, RFC822-style
mime_versionMIME Version (optional)
content_typeMIME Content-Type (optional)
summaryMessage Summary (optional)
tagsMessage Tags (space-delimited, optional)
idMessage's RFC-822 compliant Message-ID
reply_idMessage's RFC-822 compliant Reply-ID
reverse_pathMessage's SMTP sender address
forward_pathArgument to SMTP 'RCPT TO' command
pathMessages's NNTP path
newsgroupsMessage's NNTP newsgroups header
ftn_msgidFidoNet FTS-9 Message-ID
ftn_replyFidoNet FTS-9 Reply-ID
ftn_areaFidoNet FTS-4 echomail AREA tag
ftn_flagsFidoNet FSC-53 FLAGS
ftn_pidFidoNet FSC-46 Program Identifier
ftn_tidFidoNet FSC-46 Tosser Identifier
ftn_charsetFidoNet FTS-5003 Character Set Identifier
dateRFC-822 formatted date/time
attrAttribute bitfield
auxattrAuxillary attribute bitfield
netattrNetwork attribute bitfield
when_written_timeDate/time (in time_t format)
when_written_zoneTime zone (in SMB format)
when_written_zone_offsetTime zone in minutes east of UTC
when_imported_timeDate/time message was imported
when_imported_zoneTime zone (in SMB format)
when_imported_zone_offsetTime zone in minutes east of UTC
thread_idThread identifier (originating message number)
thread_backMessage number that this message is a reply to
thread_nextMessage number of the next reply to the original message in this thread
thread_firstMessage number of the first reply to this message
votesBit-field of votes if ballot, maximum allowed votes per ballot if poll
priorityPriority value following the X-Priority email header schcme (1 = highest, 3 = normal, 5 = lowest, 0 = unspecified)
delivery_attemptsNumber of failed delivery attempts (e.g. over SMTP)
field_list[].typeOther SMB header fields (type)
field_list[].dataOther SMB header fields (data)
can_readtrue if the current user can read this validated or unmoderated message

New in v3.12: The optional client argument is an instance of the Client class to be used for the security log header fields (e.g. sender IP address, hostname, protocol, and port). As of version 3.16c, the global client object will be used if this is omitted.

New in v3.12: The optional rcpt_list is an array of objects that specifies multiple recipients for a single message (e.g. bulk e-mail). Each object in the array may include the following header properties (described above):
to, to_ext, to_org, to_net_type, to_net_addr, and to_agent
vote_msgbooleanMsgBase.vote_msg(object header) 3.17 create a new vote in message base, the header object should contain the following properties:
fromSender's name (required)
from_extSender's user number (if applicable)
from_net_typeSender's network type (default: 0 for local)
from_net_addrSender's network address
reply_idThe Reply-ID of the message being voted on (or specify thread_back)
thread_backMessage number of the message being voted on
attrShould be either MSG_UPVOTE, MSG_DOWNVOTE, or MSG_VOTE (if answer to poll)
add_pollbooleanMsgBase.add_poll(object header) 3.17 create a new poll in message base, the header object should contain the following properties:
subjectPolling question (required)
fromSender's name (required)
from_extSender's user number (if applicable)
from_net_typeSender's network type (default: 0 for local)
from_net_addrSender's network address
close_pollbooleanMsgBase.close_poll(message number, user name or alias) 3.17 close an existing poll
how_user_votednumberMsgBase.how_user_voted(message number, user name or alias) 3.17 Returns 0 for no votes, 1 for an up-vote, 2 for a down-vote, or in the case of a poll-response: a bit-field of votes.
dump_msg_headerarrayMsgBase.dump_msg_header(object header) 3.17c dump a message header object to an array of strings for diagnostic uses

MsgBase properties
Name Type Ver Description
errorstring 3.10 last occurred message base error - READ ONLY
statusnumber 3.12 return value of last SMB Library function call - READ ONLY
filestring 3.10 base path and filename of message base - READ ONLY
retry_timenumber 3.10 message base open/lock retry timeout (in seconds)
retry_delaynumber 3.11 delay between message base open/lock retries (in milliseconds)
first_msgnumber 3.10 first message number - READ ONLY
last_msgnumber 3.10 last message number - READ ONLY
total_msgsnumber 3.10 total number of messages - READ ONLY
max_crcsnumber 3.10 maximum number of message CRCs to store (for dupe checking) - READ ONLY
max_msgsnumber 3.10 maximum number of messages before expiration - READ ONLY
max_agenumber 3.10 maximum age (in days) of messages to store - READ ONLY
attributesnumber 3.10 message base attributes - READ ONLY
subnumnumber 3.10 sub-board number (0-based, 65535 for e-mail) - READ ONLY
is_openboolean 3.10 true if the message base has been opened successfully - READ ONLY

MsgBase.cfg object
Configuration parameters for this message area (sub-boards only) - READ ONLY - introduced in v3.10

MsgBase.cfg properties
Name Type Description
indexundefined index into sub_list array (or -1 if not in array) (introduced in v3.12)
grp_indexundefined group's index into grp_list array (introduced in v3.12)
numbernumber unique number for this sub-board
grp_numbernumber group number
grp_namestring group name (introduced in v3.12)
codestring sub-board internal code
namestring sub-board name
descriptionstring sub-board description
qwk_namestring QWK conference name
area_tagstring area tag for FidoNet-style echoes, a.k.a. EchoTag (introduced in v3.19)
newsgroupstring newsgroup name (as configured or dynamically generated)
arsstring sub-board access requirements
read_arsstring sub-board reading requirements
post_arsstring sub-board posting requirements
operator_arsstring sub-board operator requirements
moderated_arsstring sub-board moderated-user requirements (if non-blank)
data_dirstring sub-board data storage location
fidonet_originstring FidoNet origin line
qwknet_taglinestring QWK Network tagline
settingsnumber toggle options (bitfield) - see SUB_* in sbbsdefs.js for details
ptridxnumber index into message scan configuration/pointer file
qwk_confnumber QWK conference number
max_crcsnumber configured maximum number of message CRCs to store (for dupe checking)
max_msgsnumber configured maximum number of messages before purging
max_agenumber configured maximum age (in days) of messages before expiration
print_modenumber additional print mode flags to use when printing messages - see P_* in sbbsdefs.js for details
print_mode_negnumber print mode flags to negate when printing messages - see P_* in sbbsdefs.js for details

MsgBase class object

MsgBase.IndexPrototype object
Prototype for all index objects. Can be used to extend these objects. - introduced in v3.17

MsgBase.HeaderPrototype object
Prototype for all header objects. Can be used to extend these objects. - introduced in v3.17

FileBase class
Class used for accessing file databases - introduced in v3.19

To create a new FileBase object: var filebase = new FileBase('code')
where code is a directory internal code.

FileBase methods
Name Returns Usage Ver Description
openbooleanFileBase.open() 3.19 open file base
closebooleanFileBase.close() 3.19 close file base (if open)
getobjectFileBase.get(filename or file-meta-object [,detail=FileBase.DETAIL.NORM]) 3.19 get a file metadata object or null on failure. The file-meta-object may contain the following properties (depending on detail value):
nameFilename (required)
descDescription (summary, 58 chars or less)
extdescExtended description (multi-line description, e.g. DIZ)
authorFile author name (e.g. from SAUCE record)
author_orgFile author organization (group, e.g. from SAUCE record)
fromUploader's user name (e.g. for awarding credits)
from_ip_addrUploader's IP address (if available, for security tracking)
from_host_nameUploader's host name (if available, for security tracking)
from_protocolTCP/IP protocol used by uploader (if available, for security tracking)
from_portTCP/UDP port number used by uploader (if available, for security tracking)
to_listComma-separated listed of recipient user numbers (for user-to-user transfers)
tagsSpace-separated list of tags
anontrue if the file was uploaded anonymously
sizeFile size, in bytes, at the time of upload
costFile credit value (0=free)
timeFile modification date/time (in time_t format)
addedDate/time file was uploaded/imported (in time_t format)
last_downlaodedDate/time file was last downloaded (in time_t format) or 0=never
times_downloadedTotal number of times file has been downloaded
crc1616-bit CRC of file contents
crc3232-bit CRC of file contents
md5128-bit MD5 digest of file contents (hexadecimal)
sha1160-bit SHA-1 digest of file contents (hexadecimal)
metadataFile metadata in JSON format
get_listarrayFileBase.get_list([filespec] [,detail=FileBase.DETAIL.NORM] [,since-time=0] [,sort=true [,order]]) 3.19 get a list (array) of file metadata objects, the default sort order is the sysop-configured order or FileBase.SORT.NAME_AI
get_namestringFileBase.get_name(path/filename) 3.19 returns index-formatted (e.g. shortened) version of filename without path (file base does not have to be open)
get_namesarrayFileBase.get_names([filespec] [,since-time=0] [,sort=true [,order]]) 3.19 get a list of index-formatted (e.g. shortened) filenames (strings) from file base index, the default sort order is the sysop-configured order or FileBase.SORT.NAME_AI
get_pathstringFileBase.get_path(filename) 3.19 get the full path to the local file
get_sizenumberFileBase.get_size(filename) 3.19 get the size of the local file, in bytes, or -1 if it does not exist
get_timenumberFileBase.get_time(filename) 3.19 get the modification date/time stamp of the local file
addbooleanFileBase.add(file-meta-object [,use_diz_always=false] [,object client=none]) 3.19 add a file to the file base, returning true on success or false upon failure.
removebooleanFileBase.remove(filename [,delete=false]) 3.19 remove an existing file from the file base and optionally delete file, may throw exception on errors (e.g. file remove failure)
updatebooleanFileBase.update(filename, file-meta-object [,use_diz_always=false] [,readd_always=false]) 3.19 update an existing file in the file base, may throw exception on errors (e.g. file rename failure)
renewbooleanFileBase.renew(filename) 3.19 remove and re-add (as new) an existing file in the file base
hashobjectFileBase.hash(filename_or_fullpath) 3.19 calculate hashes of a file's contents (file base does not have to be open)
dumparrayFileBase.dump(filename) 3.19 dump file header fields to an array of strings for diagnostic uses
format_namestringFileBase.format_name(path/filename [,number size=13] [,boolean pad=false]) 3.19 returns formatted (e.g. shortened) version of filename without path (file base does not have to be open) for display

FileBase properties
Name Type Ver Description
errorstring 3.19 last occurred file base error description - READ ONLY
statusnumber 3.19 return value of last SMB Library function call - READ ONLY
filestring 3.19 base path and filename of file base - READ ONLY
retry_timenumber 3.19 file base open/lock retry timeout (in seconds)
retry_delaynumber 3.19 delay between file base open/lock retries (in milliseconds)
first_filenumber 3.19 first file number - READ ONLY
last_filenumber 3.19 last file number - READ ONLY
last_file_timenumber 3.19 timestamp of last file - READ ONLY
filesnumber 3.19 total number of files - READ ONLY
update_timenumber 3.19 timestamp of file base index (only writable when file base is closed)
max_filesnumber 3.19 maximum number of files before expiration - READ ONLY
max_agenumber 3.19 maximum age (in days) of files to store - READ ONLY
attributesnumber 3.19 file base attributes - READ ONLY
dirnumnumber 3.19 directory number (0-based, -1 if invalid) - READ ONLY
is_openboolean 3.19 true if the file base has been opened successfully - READ ONLY

FileBase class object

FileBase.DETAIL object
Detail level numeric constants (in increasing verbosity)

FileBase.DETAIL properties
Name Type Description
MINnumber Include indexed-filenames only
NORMnumber Normal level of file detail (e.g. full filenames, minimal metadata)
EXTENDEDnumber Normal level of file detail plus extended descriptions
METADATAnumber Normal level of file detail plus extended descriptions and JSON-metadata
MAXnumber Maximum file detail, include undefined/null property values

FileBase.SORT object
Sort order numeric constants

FileBase.SORT properties
Name Type Description
NATURALnumber Natural sort order (same as DATE_A)
NAME_AInumber Filename ascending, case insensitive sort order
NAME_DInumber Filename descending, case insensitive sort order
NAME_ASnumber Filename ascending, case sensitive sort order
NAME_DSnumber Filename descending, case sensitive sort order
DATE_Anumber Import date/time ascending sort order
DATE_Dnumber Import date/time descending sort order

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 formated configuration files
      1. concept and support of root ini sections added in v3.12
    4. optional ROT13 encoding/translation
  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([mode="w+"] [,shareable=false] [,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 (introduced in v3.17)

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 nopen() 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 fopen(), 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([mode="r+"] [,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 decoding 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 formatted string to the file (ala fprintf) - CAUTION: for experienced C programmers ONLY
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'). returns the specified default value if the key or value is missing or invalid. to parse a key from the root section, pass null for section. Returns a bool, number, string, 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] [,lowercase=false] [,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) 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([name_property] [,prefix=none] [,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.
iniReadAllarrayFile.iniReadAll() 3.18c read entire .ini file into an array of string (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 opening, creating, reading, or writing archive files on the local file system - 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] [,boolean 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 [,boolean with_path = false] [,number max_files = 0] [,string file/pattern [...]]) 3.19 Extract files from an archive to specified output directory.
Returns the number of files extracted.
Will throw exception upon error.
listarrayArchive.list([,boolean hash = false] [,string file/pattern]) 3.19 Get list of archive contents as an array of objects.
Archived object properties:
  1. string type - item type: 'file', 'link', or 'directory'
  2. string name - item path/name
  3. string path - source path
  4. string symlink
  5. string hardlink
  6. number size - item size in bytes
  7. number time - modification date/time in time_t format
  8. number mode - permissions/mode flags
  9. string user - owner name
  10. string group - owner group
  11. string format - archive format
  12. string compression - compression method
  13. string fflags
  14. number crc16 - 16-bit CRC, when hash is true and type is file
  15. number crc32 - 32-bit CRC, when hash is true and type is file
  16. string md5 - hexadecimal MD-5 sum, when hash is true and type is file
  17. string sha1 - hexadecimal SHA-1 sum, when hash is true and type is file
When hash 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

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([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 [timeout=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([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.0]) 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.0 (seconds)
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.0]) 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)
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_addressstring 3.10 local IP address (string in dotted-decimal format)
local_portnumber 3.10 local TCP or UDP port number
remote_ip_addressstring 3.10 remote IP address (string in dotted-decimal format)
remote_portnumber 3.10 remote TCP or UDP port number
typenumber 3.10 socket type, SOCK_STREAM (TCP) or SOCK_DGRAM (UDP)
familynumber 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
option_listobject N/A array of socket option names supported by the current platform

Socket class object

Socket properties
Name Type Description
PF_INETnumber
PF_INET6number
AF_INETnumber
AF_INET6number

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 Initializes 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 Suspends 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 Clears the screen
wscrollvoidconio.wscroll() 3.15 Scrolls the currently defined window up by one line.
dellinevoidconio.delline() 3.15 Deletes the current line and moves lines below up by one line.
inslinevoidconio.insline() 3.15 Inserts a new blank line on the current line and scrolls lines below down to make room.
normvideovoidconio.normvideo() 3.15 Sets the current attribute to "normal" (light grey on black)
getchnumberconio.getch() 3.15 Waits for and returns a character from the user. Extended keys are returned as two characters.
getchenumberconio.getche() 3.15 Waits for a character from the user, then echos it. Extended keys can not be returned and are lost.
beepvoidconio.beep() 3.15 Beeps.
getfontnumberconio.getfont(fnum) 3.15 Returns the current font ID or -1 if fonts aren't supported.
hidemousenumberconio.hidemouse() 3.15 Hides the mouse cursor. Returns -1 if it cannot be hidden.
showmousenumberconio.showmouse() 3.15 Shows the mouse cursor. Returns -1 if it cannot be shown.
setcursortypevoidconio.setcursortype(type) 3.15 Sets the cursor type. Legal values:
0No cursor
1Solid cursor (fills whole cell)
2Normal cursor
gotoxyvoidconio.gotoxy(x, y) 3.15 Moves the cursor to the given x/y position.
putchnumberconio.putch(charcode) 3.15 Puts 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 Pushes the specified charcode into the input buffer. The next getch() call will get this character.
loadfontvoidconio.loadfont(filename) 3.15 Loads the filename as the current font. Returns -1 on failure.
settitlevoidconio.settitle(title) 3.15 Sets the window title if possible.
setnamevoidconio.setname(name) 3.15 Sets the application name. In some modes, this overwrites the window title.
cputsvoidconio.cputs(string) 3.15 Outputs string to the console.
setfontnumberconio.setfont(font [, force, fnum]) 3.15 Sets 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 Prompts 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 Sets the current window.
cgetsvoidconio.cgets(max_len) 3.15 Inputs 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 Copies the specified screen contents to dest_x/dest_y.
puttextbooleanconio.puttext(start_x, start_y, end_x, end_y, bytes) 3.15 Puts 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 Returns 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
mouseboolean 3.15
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
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
wintopnumber 3.15 Top row of current window
winrightnumber 3.15 Right column of current window
winbottomnumber 3.15 Bottom row of current window
screenwidthnumber 3.15 Width of the screen
screenheightnumber 3.15 Height of the screen
normattrnumber 3.15 Atrribute considered "normal"
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

uifc object
User InterFaCe object - used for jsexec menus - introduced in v3.14

uifc methods
Name Returns Usage Ver Description
initbooleanuifc.init(string title [, string mode]) 3.14 initialize. mode is a string representing the desired conio mode... one of STDIO, AUTO, X, CURSES, ANSI, CONIO, or SDL.
bailvoiduifc.bail() 3.14 uninitialize
msgvoiduifc.msg(string text) 3.14 print a message
popvoiduifc.pop([string text]) 3.14 popup (or down) a message
inputstringuifc.input([number mode] [,number left] [,number top] [,string default] [,number maxlen] [,number kmode]) 3.14 prompt for a string input
listnumberuifc.list([number mode,] string title, array options [,uifc.list.CTX object]) 3.14 select from a list of options.
The context object can be created using new uifc.list.CTX() and if the same object is passed, allows WIN_SAV to work correctly.
The context object has the following properties:
cur, bar, top, left, width
showhelpvoiduifc.showhelp() 3.17 Shows 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 object]) 3.18c Shows 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: cur, bar, top, left, width, height
timedisplayvoiduifc.timedisplay([bool force = false]) 3.18c Updates time in upper left corner of screen with current time in ASCII/Unix format
bottomlinevoiduifc.bottomline(number mode) 3.18c Displays 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 object]) 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: lastkey

uifc properties
Name Type Ver Description
initializedboolean 3.14 uifc has been initialized
modenumber 3.14 current mode bits (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 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 if F1 is 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

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

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 Returns a CryptContext from the private key with
get_public_keyobjectCryptKeyset.get_public_key(label) 3.16 Returns 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.CERTFORMAT.
get_attributevoidCryptCert.get_attribute(attr, value) 3.16 Sets the specified attribute to the specified value
get_attribute_stringvoidCryptCert.get_attribute_string(attr, value) 3.16 Sets the specified attribute to the specified value
get_attribute_timevoidCryptCert.get_attribute_time(attr, value) 3.16 Sets the specified attribute to the specified value
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.

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

Totals: 1379 properties, 462 methods