Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

ed(1)

extract(1int)

strextract(1int)

strmerge(1int)

trans(1int)

patterns(5int)

NAME

patterns − patterns for use with internationalization tools

SYNTAX

See below

DESCRIPTION

The patterns file contains the patterns that are must be matched for the internationalization tools extract, strextract, and strmerge.

The pattern file on this reference page is a typical example. 

$SRCHEAD1
/* This text will be inserted at the head of the
 * first source file.
 */
 $SRCHEAD2
/* This text will be inserted at the head of the
 * second and subsequent source files.
 */
 $CATHEAD
\$ This text will appear at the head of
\$ the msf file
\$ quote "
\$ set 1
 # This is how patterns that are matched will get rewritten.
# Comment lines begin with hash, backslash () will escape.
#
$REWRITE
catgets(catd, 1, %n, %t)
#
#
# The % descriptors are rewritten thus:
#     %    - a %
#     n    - the message number (from the cat file)
#     t    - the actual text
#     l    - the length of the text string %t
#     r    - the raw text with quotes removed
#
#
# Following is a list of the sort of strings we are looking for.
# The regular expression syntax is based on regexp(3).
#
$MATCH
"[^"]*"
#
# Now reject some special C constructs.
#
$REJECT
# the empty string
""
# string with just one format descriptor
"%."
# string with just line control in
"\."
# ignore cpp commands
\#.*
#
#ignore certain C functions and string constructs
[sS][cC][cC][sS][iI][dD][][ ]*=[ ]*".*"
fopen[ ]*([^,]*,[^)]*)
creat[ ]*([^,]",[^)]*)
# Print a warning for initialized strings.
#
$ERROR initialized strings cannot be replaced
#
^char[^=]*=[ ]*"[^"]*"
char[ ]*[A-Za-z][A-Za-z0-9]*[[^]*][ ]*=[ ]*"[^"]*"

SEE ALSO

ed(1), extract(1int), strextract(1int), strmerge(1int), trans(1int)

File Formats

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