For Development HEAD DRAFTSearch (procedure/syntax/module):

Next: , Previous: , Up: Library modules - SRFIs   [Contents][Index]

11.63 srfi.238 - Codesets

Module: srfi.238

This module provides a unified interface for system-defined set of code values, such as errno or signal numbers.

In Gauche, we have predefined integer constants for errnos (e.g. EINTR) and signals (e.g. SIGINT) in gauche module, and we have built-in procedures to convert integer code to symbols (sys-errno->symbol, sys-signal-name) and to string messages (sys-strerror, sys-strsignal). You may want to use this srfi for portable code, though.

Function: codeset? obj

[SRFI-238]{srfi.238} Returns #t if obj is an object that can be used as a codeset argument for this srfi’s API, #f otherwise. In Gauche, obj must be either a symbol errno or signal.

Function: codeset-symbols codeset

[SRFI-238]{srfi.238} Returns a list of symbols defined in a codeset designated by codeset. In Gauche, codeset must be a symbol. If it does not name a supported codeset, an empty list is returned.

(codeset-symbols 'errno)
 ⇒ (EPERM ENOENT ESRCH EINTR EIO ...)
Function: codeset-symbol codeset code
Function: codeset-number codeset code
Function: codeset-message codeset code

[SRFI-238]{srfi.238} Returns a symbol, an exact integer, or a message string associated to the code in the codeset designated by codeset, respectively

The code argument can be either a symbol or an exact integer. The codeset argument must be a symbol.

If codeset is not a name of supported codesets (in Gauche, we have errno and signale), or code is not in the specified codeset, #f is returned.

(codeset-symbol 'errno 'EINTR) ⇒ EINTR
(codeset-symbol 'errno EINTR)  ⇒ EINTR  ; Gauche has predefined constant

(codeset-number 'errno 'EINTR) ⇒ 4      ; Actual number is platform dependent
(codeset-number 'errno 4)      ⇒ 4

(codeset-message 'errno EINTR) ⇒ "Interrupted system call"

(codeset-message 'errno 'NoSuchErrno) ⇒ #f

Next: , Previous: , Up: Library modules - SRFIs   [Contents][Index]


For Development HEAD DRAFTSearch (procedure/syntax/module):
DRAFT