mms_cat.c revision cee0fb94c0d4227de0a00efc162fb2739844b641
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <nl_types.h>
#include <mms.h>
#include "msg_sub.h"
/*
* Message Catalog Functions
*/
#define MMS_MSG_CAT_FILE "mm.cat"
#define MMS_MSG_CAT_PATH "/usr/lib/mms/"
int
mms_msg_cat_open(void)
{
/* open message catalog */
(void) catclose(mms_mm_msg_catd);
}
(void) catclose(mms_mm_msg_catd);
}
return (1);
}
}
return (0);
}
void
mms_msg_cat_close(void)
{
(void) catclose(mms_mm_msg_catd);
}
}
char *
mms_get_cat_msg(int msgid)
{
char *fmt;
if (mms_msg_cat_open()) {
"message catalog");
return (NULL);
}
return (fmt);
}
char *
{
int msgid;
char *p;
char *fmt;
char *man;
char *model;
char err_msg[128];
/*
* Parse and localize command's message-clause
*/
/* lookup localized message */
/* No message found in catalog, obtain loctext */
/* if one exists and output it */
goto get_loctext;
}
/* Make copy so args can be substituted */
/* Get any arguments for message */
NULL)) {
/* Substitue each argument with value in message */
goto get_loctext;
"argument substitution failed");
goto get_loctext;
}
text = p;
}
}
return (text);
return (NULL);
"message is:\n%s", text);
return (text);
}
}
}
"no loctext found in message");
"Unknown Message: Manufacturer: %s, Model: %s, "
return (text);
}