/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 2000-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*/
static const char usage[] =
"[-?\n@(#)$Id: msgget (AT&T Research) 2001-04-21 $\n]"
"[+NAME?msgget - get a message from a message catalog]"
"[+DESCRIPTION?\bmsgget\b gets the message corresponding to the parameters."
" If \alocale\a is \b-\b then the current locale is used. \acommand\a"
" may be specified for command specific messages. \acatalog\a specifies"
" the message catalog name. [\aset\a.]]\anumber\a identifies the message"
" by message \anumber\a and an optional message \aset\a; if specified as"
" \b-\b then the message set and number are determined by looking up"
" \atext\a in the corresponding \bC\b locale message catalog.]"
"\n"
"\nlocale [command:]catalog [set.]number [ text ]\n"
"\n"
"[+SEE ALSO?\biconv\b(1), \bmsgcc\b(1), \bmsggen\b(1)]"
;
#include <ast.h>
#include <error.h>
#include <mc.h>
int
{
register char* s;
char* loc;
char* cmd;
char* cat;
char* msg;
int set;
int num;
for (;;)
{
{
case '?':
continue;
case ':':
continue;
}
break;
}
if (streq(s, "-"))
else
msg = "";
else if (*argv)
loc = 0;
*cat++ = 0;
if (!mcfind(loc, cmd, LC_MESSAGES, 0, path, sizeof(path)) && (!cat || !mcfind(loc, cat, LC_MESSAGES, 0, path, sizeof(path))))
{
if (cat)
*--cat = ':';
}
if (set)
else
return error_info.errors != 0;
}