Lines Matching defs:code

46  * fmd_msg_gettext_id - format the entire message for the given event code
51 * fmd_msg_getitem_id - format a single message item for the given event code
60 * EINVAL - Invalid argument (e.g. bad event code, illegal fmd_msg_item_t)
363 return; /* simplify caller code */
795 * FMA event members use hyphens.) This code specifically cannot use
798 * non-C locale, but this code needs to always operate on C characters.
993 nvlist_t *nvl, const char *dict, const char *code, fmd_msg_item_t item)
996 size_t len = strlen(code) + 1 + strlen(istr) + 1;
1019 * as the URL base concatenated with the code. Otherwise the item text
1020 * is derived by looking up the key <code>.<istr> in the dict object.
1024 len = strlen(url) + strlen(code) + 1;
1026 (void) snprintf(key, len, "%s%s", url, code);
1029 len = strlen(code) + 1 + strlen(istr) + 1;
1031 (void) snprintf(key, len, "%s.%s", code, istr);
1035 c = fmd_msg_mbstowcs(code);
1263 nvlist_t *nvl, const char *dict, const char *code)
1286 items[i] = fmd_msg_getitem_locked(h, nvl, dict, code, i);
1339 len = snprintf(NULL, 0, format, code,
1350 (void) snprintf(buf, len + 1, format, code,
1363 * Common code for fmd_msg_getitem_nv() and fmd_msg_getitem_id(): this function
1368 const char *locale, nvlist_t *nvl, const char *code, fmd_msg_item_t item)
1375 if ((p = strchr(code, '-')) == NULL || p == code) {
1383 dict = strndupa(code, p - code);
1398 * Compute the lookup code for FMD_MSG_ITEM_TYPE: we'll use this to
1399 * determine if the dictionary contains any data for this code at all.
1401 len = strlen(code) + 1 + strlen(fmd_msg_items[FMD_MSG_ITEM_TYPE]) + 1;
1405 code, fmd_msg_items[FMD_MSG_ITEM_TYPE]);
1419 * default locale, attempt to fall back to the C locale for this code.
1431 s = fmd_msg_getitem_locked(h, nvl, dict, code, item);
1453 char *code;
1460 if (nvlist_lookup_string(nvl, FM_SUSPECT_DIAG_CODE, &code) != 0) {
1465 return (fmd_msg_getitem(h, locale, nvl, code, item));
1470 const char *locale, const char *code, fmd_msg_item_t item)
1477 return (fmd_msg_getitem(h, locale, NULL, code, item));
1538 * Common code for fmd_msg_gettext_nv() and fmd_msg_gettext_id(): this function
1543 const char *locale, nvlist_t *nvl, const char *code)
1550 if ((p = strchr(code, '-')) == NULL || p == code) {
1558 dict = strndupa(code, p - code);
1573 * Compute the lookup code for FMD_MSG_ITEM_TYPE: we'll use this to
1574 * determine if the dictionary contains any data for this code at all.
1576 len = strlen(code) + 1 + strlen(fmd_msg_items[FMD_MSG_ITEM_TYPE]) + 1;
1580 code, fmd_msg_items[FMD_MSG_ITEM_TYPE]);
1594 * default locale, attempt to fall back to the C locale for this code.
1606 s = fmd_msg_gettext_locked(h, nvl, dict, code);
1627 char *code;
1629 if (nvlist_lookup_string(nvl, FM_SUSPECT_DIAG_CODE, &code) != 0) {
1634 return (fmd_msg_gettext(h, locale, nvl, code));
1638 fmd_msg_gettext_id(fmd_msg_hdl_t *h, const char *locale, const char *code)
1640 return (fmd_msg_gettext(h, locale, NULL, code));