Introduction to Limbo Modules


[Contents]

Limbo Modules

The modules described in this section provide an interface between Limbo applications and the Inferno system. The files that specify module interfaces are conventionally designated with the extension .m and are typically located in /module.The modules are as follows:


[Contents]

Limbo System Module

Namespace Operations

bind - configure namespace
mount - add to namespace
unmount - remove from namespace

File and Directory Manipulation

fildes - create a new file descriptor
dup - duplicate an open file descriptor
open, create - open/create a file for reading or writing
read, write, stream - read, write, or stream file
remove - remove a file
seek - change file offset
stat, fstat, fwstat, wstat - get and put file status
chdir - change working directory
dirread - read directory

Process Control, Timing

pctl - process control
millisec - millisecond timer
sleep - delay execution

Exception Handling

Exception adt
raise - raise an exception
rescue - install rescue block for exception
rescued - post-rescue action
unrescue - remove exception handler

Network Connections

dial, announce, export, listen - network connections
file2chan - create file connected to Limbo channel

Pipes

pipe - create a pipe

Character and String Operations

byte2char, char2byte - conversion functions
tokenize - split string into words
utfbytes - compute the Unicode length of a UTF byte sequence

Printing

print, fprint, sprint - print formatted output


[Contents]

Security Modules, Utilities and Daemons

Authentication, Login Functions

Auth module - authenticated connections
auth, readauthinfo, writeauthinfo - authenticate a connection
getauthinfo - obtain a certificate for authentication
Login module - communicate with certificate authority
logind - login daemon
verify - command to authenticate receiver of blinded certificate

Password Management

changelogin - command to create/update the password file
get, put - read and write password entries in the password file

Key Management

certtostr, pktostr, sktostr, strtocert, strtopk, strtosk -encryption key conversion functions
createsignerkey - create signer key on authentication server
genSK, genSKfromPK, sktopk, dhparams - generate keys

Secure Sockets Layer (SSL)

connect, secret - interface to the Secure Sockets Layer device
I/O
getstring, putstring, getbytearray, putbytearray, puterror- delimited I/O

Set-top Box Functions

manufacture - command to emulate set-top-box-id in ROM
register - command to register set-top-box identity with signer
signer, countersigner - daemons for set-top box authentication

Cryptography

sha, md5, sign, verify - cryptographic digests and digital signatures

Utilities

IPint adt - 'infinite' precision integer utility functions
randomint, randombuf - interface to random number device

[Contents]

Draw Module
context - graphics environment
display - connection to draw device
font - character images for Unicode text
Image - pictures and drawing
point - coordinate position
pointer - state of a pointer device such as a mouse
rectangle - rectangular portion of the plane
screen - type to define the abstract data structures for the windows on a display


[Contents]

Prefab Module
compound - windows for ITV toolkit
element - menu and display elements for ITV toolkit
environ - environment for ITV toolkit graphics
style - fonts and colors for ITV toolkit


[Contents]

Toolkit Module
Tk - graphics toolkit


[Contents]

Math Module
elem - elementary functions of applied mathematics
fp - floating point operations
linalg - linear algebra primitives


[Contents]

Miscellaneous Modules
bufio - buffered input/output module
daytime - time conversions
DB - database support
devpointer - I/O interface for the pointer device
filepat - file pattern matching
hash - hash support
imagefile - processing external image file formats
ir - infrared remote control
mpeg - interface to the mpeg device driver
newns - build a new name space from a description file
pipe: fds, files - get read/write file pair for a pipe
plumbmsg - plumbing message module
readdir - read directory and sort files
regex - regular expression recognizer
sh - command interface
srv - miscellaneous services from the host operating system
string - string operations
timedio - read, write with timout
virgil - pose question to virgild daemon


[Contents]

Using Modules

The modules are accessed by including the appropriate interface files into Limbo program code. See The Limbo Programming Language in the Inferno User's Guide for information about the syntax for including modules in an application.

Prior to calling a module's functions, an application must load the module. The application uses the resulting handle as the module qualifier. The examples shown in the following Synopsis illustrate the style. It will usually be necessary to qualify names with the appropriate module pointer or to import the types and functions. The program examples shown in this manual assume the names are accessible in the current scope.

Although many modules are self-contained, dependencies may exist. The system module (Sys), for example, provides basic services that some other modules require.

Sometimes functions are packaged as individual modules but share a single include file. For example, see /include/security.m.

The subsequent chapters contain detailed descriptions of the modules. These descriptions show how to include a module definition during compilation and load an implementation during execution. The program examples also list the functions, abstract data types, and constants. Although the include files declare these components, the manual pages list them explicitly to facilitate their explanation. In all cases, the enclosing module declaration is assumed so that unqualified identifiers can be used in the text without ambiguity.

The Limbo modules are identical on any machine that is running Inferno, in either a native mode or emulation mode. This enables Limbo programs to be written and tested on any Inferno system.While the current modules should be sufficient for general application development, special situations, such as particular IR hardware, may require the development of additional modules.

Some modules are described in a single page, such as regex. Larger modules are divided into several related pages, such as Limbo Math Module, elem - elementary functions of applied mathematics, fp - floating point operations, and linalg - linear algebra primitives.

Synopsis

include "sys.m";

sys:= load Sys Sys->PATH;

include "draw.m";

draw:= load Draw Draw->PATH;

include "tk.m";

tk:= load Tk Tk->PATH;

...

Generically:

include "module.m";

mod:= load Module Module ->PATH;





infernosupport@lucent.com
Copyright © 1997, Lucent Technologies, Inc.. All rights reserved.