static FORMAT_PTR Named_Format(Format_Parse_Ptr parser, TokenPtr Token) { NAMED_FORMAT_PTR namedFormat; FORMAT_PTR format; if (parser->formatStack == NULL) { parser->formatStack = x_ipc_strListCreate(); } if (x_ipc_strListMemberItem(Token->value.str, parser->formatStack)) { /* found a recursive definition. just return pointer */ return new_n_formatter(Token->value.str); } x_ipc_strListPush(strdup(Token->value.str), parser->formatStack); LOCK_M_MUTEX; namedFormat = (NAMED_FORMAT_PTR)x_ipc_hashTableFind(Token->value.str, GET_M_GLOBAL(formatNamesTable)); UNLOCK_M_MUTEX; if (!namedFormat) { #ifdef NMP_IPC if (GET_C_GLOBAL(serverRead) != CENTRAL_SERVER_ID) { if (x_ipcQueryCentral(X_IPC_NAMED_FORM_QUERY, &Token->value.str, &format) != Success || !format) { X_IPC_MOD_WARNING2("Warning: Named Format %s is not registered\n%s\n", Token->value.str, parser->ParseString); format = new_f_formatter(BadFormatFMT, NULL); } } else #endif { X_IPC_MOD_WARNING2("Warning: Named Format %s is not registered\n%s\n", Token->value.str, parser->ParseString); format = new_f_formatter(BadFormatFMT, NULL); } } else { /* Need to use the named formatter -- parse it now */ if (!namedFormat->parsed) { namedFormat->format = (FORMAT_PTR)ParseFormatString(namedFormat->definition); namedFormat->parsed = TRUE; } format = copyFormatter(namedFormat->format); } x_ipcFree((void *)x_ipc_strListPopItem(parser->formatStack)); return format; }
X_IPC_RETURN_VALUE_TYPE centralBroadcast(const char *name, const void *data) { MSG_PTR msg; msg = x_ipc_msgFind(name); if (msg == NULL) return MsgUndefined; x_ipc_checkMessageClass(msg, BroadcastClass); if ((GET_C_GLOBAL(broadcastMsgs) == NULL) || (x_ipc_strListMemberItem(name, GET_C_GLOBAL(broadcastMsgs)))) return centralSendMessage((X_IPC_REF_PTR)NULL, msg, (char *)data, (char *)NULL); else return Success; }
void x_ipc_strListPushUnique(const char *item, STR_LIST_PTR strList) { if (!x_ipc_strListMemberItem(item,strList)) x_ipc_strListPush(item, strList); }
void x_ipc_strListDBPushUnique(const char* file, int line, const char *item, STR_LIST_PTR strList) { if (!x_ipc_strListMemberItem(item,strList)) x_ipc_strListDBPush(file, line, item, strList); }