Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gencat(1)

mkcatdefs(1)

catgets(3)

catopen(3)

gettxt(3)  —  Subroutines

NAME

gettxt - return the session ID of the terminal

LIBRARY

Standard C Library (libc.a)

SYNOPSIS

#include <unistd.h>

char ∗gettxt (
         const char ∗msgid
         const char ∗dflt_str );

PARAMETERS

∗msgidSpecifies the message identification text string.  The format of this string is discussed in more detail below. 

dflt_strSpecifies the default string to use if the text string is not found. 

DESCRIPTION

A message file is a catalog of text strings that can be accessed for use by other programs.  Message files are created using the gencat(1) and mkcatdefs(1) commands.  The function, gettxt, searches a message file for a specified text string.  If the text string is available, this information is returned.  If attempts to retrieve the text string do not succeed, the specified default text string is used. 

You can request that messages be displayed in a specific language by setting environment variables.  Likewise, you can also change the language in which the messages are displayed by invoking the setlocale(3) function with the appropriate arguments. 

To obtain a text string, you must use the following format when specifying the msgid parameter:

[msgfilename]:msgnumber

The arguments are defined as follows:

msgfilenameSpecifies the message database that contains the localized version of the text string.  Characters in the text string can be any set of characters excluding null ( ), the ASCII symbols for slash (/), and the colon (:). 

msgnumberSpecified as a positive number only, this argument denotes the index of the text string in the message database. 

If the text string specified does not exist in the locale, or if the message number exceeds its bounds, attempts are made to retrieve this message from the C locale.  Should the second attempt be unsuccessful, the text string specified by the dflt_str is used. 

RETURN VALUES

The statement Message not found!!\n is returned if the value for the msgfilename argument is invalid, a catalog number has not been specified, the value for msgnumber is not a positive number, or a message could not be retrieved and the dflt_str parameter was not specified. 

RESTRICTIONS

On this operating system, the gettxt function parses the directory local as described on the catopen(3) and catgets(3) reference pages. 

ERRORS

There are no errors defined for this routine. 

RELATED INFORMATION

Commands: gencat(1), mkcatdefs(1). 

Functions: catgets(3), catopen(3). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026