* { font-family: Consolas, Lucida Console, Courier New; font-size: 100%; }
h1 { font-size: 150%; }
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 100%; width: 100%; }
.highlight span { width: 100%; display:-moz-inline-stack; display:inline-block; zoom:1; *display:inline; }
body { background: #ffffff; }
body .c { color: #999988; font-style: italic } /* Comment */
body .err { color: #a61717; background-color: #e3d2d2 } /* Error */
body .k { font-weight: bold } /* Keyword */
body .o { font-weight: bold } /* Operator */
body .cm { color: #999988; font-style: italic } /* Comment.Multiline */
body .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
body .c1 { color: #999988; font-style: italic } /* Comment.Single */
body .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
body .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
body .ge { font-style: italic } /* Generic.Emph */
body .gr { color: #aa0000 } /* Generic.Error */
body .gh { color: #999999 } /* Generic.Heading */
body .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
body .go { color: #888888 } /* Generic.Output */
body .gp { color: #555555 } /* Generic.Prompt */
body .gs { font-weight: bold } /* Generic.Strong */
body .gu { color: #aaaaaa } /* Generic.Subheading */
body .gt { color: #aa0000 } /* Generic.Traceback */
body .kc { font-weight: bold } /* Keyword.Constant */
body .kd { font-weight: bold } /* Keyword.Declaration */
body .kp { font-weight: bold } /* Keyword.Pseudo */
body .kr { font-weight: bold } /* Keyword.Reserved */
body .kt { color: #445588; font-weight: bold } /* Keyword.Type */
body .m { color: #009999 } /* Literal.Number */
body .s { color: #bb8844 } /* Literal.String */
body .na { color: #008080 } /* Name.Attribute */
body .nb { color: #999999 } /* Name.Builtin */
body .nc { color: #445588; font-weight: bold } /* Name.Class */
body .no { color: #008080 } /* Name.Constant */
body .ni { color: #800080 } /* Name.Entity */
body .ne { color: #990000; font-weight: bold } /* Name.Exception */
body .nf { color: #990000; font-weight: bold } /* Name.Function */
body .nn { color: #555555 } /* Name.Namespace */
body .nt { color: #000080 } /* Name.Tag */
body .nv { color: #008080 } /* Name.Variable */
body .ow { font-weight: bold } /* Operator.Word */
body .w { color: #bbbbbb } /* Text.Whitespace */
body .mf { color: #009999 } /* Literal.Number.Float */
body .mh { color: #009999 } /* Literal.Number.Hex */
body .mi { color: #009999 } /* Literal.Number.Integer */
body .mo { color: #009999 } /* Literal.Number.Oct */
body .sb { color: #bb8844 } /* Literal.String.Backtick */
body .sc { color: #bb8844 } /* Literal.String.Char */
body .sd { color: #bb8844 } /* Literal.String.Doc */
body .s2 { color: #bb8844 } /* Literal.String.Double */
body .se { color: #bb8844 } /* Literal.String.Escape */
body .sh { color: #bb8844 } /* Literal.String.Heredoc */
body .si { color: #bb8844 } /* Literal.String.Interpol */
body .sx { color: #bb8844 } /* Literal.String.Other */
body .sr { color: #808000 } /* Literal.String.Regex */
body .s1 { color: #bb8844 } /* Literal.String.Single */
body .ss { color: #bb8844 } /* Literal.String.Symbol */
body .bp { color: #999999 } /* Name.Builtin.Pseudo */
body .vc { color: #008080 } /* Name.Variable.Class */
body .vg { color: #008080 } /* Name.Variable.Global */
body .vi { color: #008080 } /* Name.Variable.Instance */
body .il { color: #009999 } /* Literal.Number.Integer.Long */
Info
Revision:3300
Author:victor
Date:2008-06-09 23:31:03 +0300 (Mon, 09 Jun 2008)
Comment:CodeToText() moved to libnetxms
Changes
U trunk/include/nms_util.h
U trunk/src/client/console/include/nxmc_api.h
U trunk/src/console/PocketPC/globals.h
U trunk/src/console/PocketPC/tools.cpp
U trunk/src/console/win32/CondDCIPropDlg.cpp
U trunk/src/console/win32/globals.h
U trunk/src/console/win32/tools.cpp
U trunk/src/libnetxms/tools.cpp
U trunk/src/nxhttpd/nxhttpd.h
U trunk/src/nxhttpd/tools.cpp
Diff
Modified: trunk/include/nms_util.h
===================================================================
--- trunk/include/nms_util.h 2008-06-05 22:45:06 UTC (rev 3299)
+++ trunk/include/nms_util.h 2008-06-09 20:31:03 UTC (rev 3300)
@@ -306,6 +306,17 @@
//
+// Code translation structure
+//
+
+typedef struct __CODE_TO_TEXT
+{
+ int code;
+ const TCHAR *text;
+} CODE_TO_TEXT;
+
+
+//
// getopt() prototype if needed
//
@@ -487,6 +498,12 @@
TCHAR LIBNETXMS_EXPORTABLE *EscapeStringForXML(const TCHAR *string, int length);
+#ifdef __cplusplus
+ const TCHAR LIBNETXMS_EXPORTABLE *CodeToText(int iCode, CODE_TO_TEXT *pTranslator, const TCHAR *pszDefaultText = _T("Unknown"));
+#else
+ const TCHAR LIBNETXMS_EXPORTABLE *CodeToText(int iCode, CODE_TO_TEXT *pTranslator, const TCHAR *pszDefaultText);
+#endif
+
#ifdef _WIN32
TCHAR LIBNETXMS_EXPORTABLE *GetSystemErrorText(DWORD dwError, TCHAR *pszBuffer, int iBufSize);
#endif
Modified: trunk/src/client/console/include/nxmc_api.h
===================================================================
--- trunk/src/client/console/include/nxmc_api.h 2008-06-05 22:45:06 UTC (rev 3299)
+++ trunk/src/client/console/include/nxmc_api.h 2008-06-09 20:31:03 UTC (rev 3300)
@@ -276,17 +276,6 @@
//
-// Code translation structure
-//
-
-struct CODE_TO_TEXT
-{
- int code;
- TCHAR *text;
-};
-
-
-//
// libnxcl object index structure
//
Modified: trunk/src/console/PocketPC/globals.h
===================================================================
--- trunk/src/console/PocketPC/globals.h 2008-06-05 22:45:06 UTC (rev 3299)
+++ trunk/src/console/PocketPC/globals.h 2008-06-09 20:31:03 UTC (rev 3300)
@@ -117,17 +117,6 @@
//
-// Code translation structure
-//
-
-struct CODE_TO_TEXT
-{
- int iCode;
- TCHAR *pszText;
-};
-
-
-//
// Default image table
//
@@ -182,7 +171,6 @@
TCHAR *FormatTimeStamp(DWORD dwTimeStamp, TCHAR *pszBuffer, int iType);
CSize GetScreenSize(void);
/*CSize GetWindowSize(CWnd *pWnd);
-const TCHAR *CodeToText(int iCode, CODE_TO_TEXT *pTranslator, const TCHAR *pszDefaultText = "Unknown");
TCHAR *TranslateUNIXText(const TCHAR *pszText);
void RestoreMDIChildPlacement(CMDIChildWnd *pWnd, WINDOWPLACEMENT *pwp);
void EnableDlgItem(CDialog *pWnd, int nCtrl, BOOL bEnable);*/
Modified: trunk/src/console/PocketPC/tools.cpp
===================================================================
--- trunk/src/console/PocketPC/tools.cpp 2008-06-05 22:45:06 UTC (rev 3299)
+++ trunk/src/console/PocketPC/tools.cpp 2008-06-09 20:31:03 UTC (rev 3300)
@@ -110,22 +110,7 @@
//
-// Translate given code to text
//
-
-const TCHAR *CodeToText(int iCode, CODE_TO_TEXT *pTranslator, const TCHAR *pszDefaultText)
-{
- int i;
-
- for(i = 0; pTranslator[i].pszText != NULL; i++)
- if (pTranslator[i].iCode == iCode)
- return pTranslator[i].pszText;
- return pszDefaultText;
-}
-
-
-//
-//
// Create image list with event severity icons
//
Modified: trunk/src/console/win32/CondDCIPropDlg.cpp
===================================================================
--- trunk/src/console/win32/CondDCIPropDlg.cpp 2008-06-05 22:45:06 UTC (rev 3299)
+++ trunk/src/console/win32/CondDCIPropDlg.cpp 2008-06-09 20:31:03 UTC (rev 3300)
@@ -66,8 +66,8 @@
CDialog::OnInitDialog();
- for(i = 0; m_ctFunctions[i].pszText != NULL; i++)
- m_wndComboFunc.AddString(m_ctFunctions[i].pszText);
+ for(i = 0; m_ctFunctions[i].text != NULL; i++)
+ m_wndComboFunc.AddString(m_ctFunctions[i].text);
m_wndComboFunc.SelectString(-1, CodeToText(m_nFunction, m_ctFunctions, _T("error")));
EnableDlgItem(this, IDC_EDIT_POLLS, m_nFunction == F_AVERAGE);
@@ -85,10 +85,10 @@
int i;
m_wndComboFunc.GetWindowText(szText, 256);
- for(i = 0; m_ctFunctions[i].pszText != NULL; i++)
- if (!_tcscmp(szText, m_ctFunctions[i].pszText))
+ for(i = 0; m_ctFunctions[i].text != NULL; i++)
+ if (!_tcscmp(szText, m_ctFunctions[i].text))
{
- m_nFunction = m_ctFunctions[i].iCode;
+ m_nFunction = m_ctFunctions[i].code;
break;
}
CDialog::OnOK();
Modified: trunk/src/console/win32/globals.h
===================================================================
--- trunk/src/console/win32/globals.h 2008-06-05 22:45:06 UTC (rev 3299)
+++ trunk/src/console/win32/globals.h 2008-06-09 20:31:03 UTC (rev 3300)
@@ -194,17 +194,6 @@
//
-// Code translation structure
-//
-
-struct CODE_TO_TEXT
-{
- int iCode;
- TCHAR *pszText;
-};
-
-
-//
// Default image table
//
@@ -337,7 +326,6 @@
TCHAR *FormatTimeStamp(DWORD dwTimeStamp, TCHAR *pszBuffer, int iType);
CSize GetWindowSize(CWnd *pWnd);
void SelectListViewItem(CListCtrl *pListCtrl, int iItem);
-const TCHAR *CodeToText(int iCode, CODE_TO_TEXT *pTranslator, const TCHAR *pszDefaultText = _T("Unknown"));
TCHAR *TranslateUNIXText(const TCHAR *pszText);
void RestoreMDIChildPlacement(CMDIChildWnd *pWnd, WINDOWPLACEMENT *pwp);
BOOL IsButtonChecked(CDialog *pWnd, int nCtrl);
Modified: trunk/src/console/win32/tools.cpp
===================================================================
--- trunk/src/console/win32/tools.cpp 2008-06-05 22:45:06 UTC (rev 3299)
+++ trunk/src/console/win32/tools.cpp 2008-06-09 20:31:03 UTC (rev 3300)
@@ -158,21 +158,6 @@
//
-// Translate given code to text
-//
-
-const TCHAR *CodeToText(int iCode, CODE_TO_TEXT *pTranslator, const TCHAR *pszDefaultText)
-{
- int i;
-
- for(i = 0; pTranslator[i].pszText != NULL; i++)
- if (pTranslator[i].iCode == iCode)
- return pTranslator[i].pszText;
- return pszDefaultText;
-}
-
-
-//
// Translate UNIX text to MSDOS (i.e. convert LF to CR/LF)
//
Modified: trunk/src/libnetxms/tools.cpp
===================================================================
--- trunk/src/libnetxms/tools.cpp 2008-06-05 22:45:06 UTC (rev 3299)
+++ trunk/src/libnetxms/tools.cpp 2008-06-09 20:31:03 UTC (rev 3300)
@@ -1030,6 +1030,21 @@
//
+// Translate given code to text
+//
+
+const TCHAR LIBNETXMS_EXPORTABLE *CodeToText(int iCode, CODE_TO_TEXT *pTranslator, const TCHAR *pszDefaultText)
+{
+ int i;
+
+ for(i = 0; pTranslator[i].text != NULL; i++)
+ if (pTranslator[i].code == iCode)
+ return pTranslator[i].text;
+ return pszDefaultText;
+}
+
+
+//
// Extract option value from string of form option=value;option=value;...
//
Modified: trunk/src/nxhttpd/nxhttpd.h
===================================================================
--- trunk/src/nxhttpd/nxhttpd.h 2008-06-05 22:45:06 UTC (rev 3299)
+++ trunk/src/nxhttpd/nxhttpd.h 2008-06-09 20:31:03 UTC (rev 3300)
@@ -73,17 +73,6 @@
//
-// Code translation structure
-//
-
-struct CODE_TO_TEXT
-{
- int iCode;
- const TCHAR *pszText;
-};
-
-
-//
// HTTP request
//
@@ -351,7 +340,6 @@
const TCHAR *pszFunction, const TCHAR *pszArgs);
void AddActionMenu(HttpResponse &response, const TCHAR *sid, ...);
-const TCHAR *CodeToText(int iCode, CODE_TO_TEXT *pTranslator, const TCHAR *pszDefaultText);
TCHAR *FormatTimeStamp(DWORD dwTimeStamp, TCHAR *pszBuffer, int iType);
DWORD *IdListFromString(const TCHAR *pszStr, DWORD *pdwCount);
BOOL IsListMember(DWORD dwId, DWORD dwCount, DWORD *pdwList);
Modified: trunk/src/nxhttpd/tools.cpp
===================================================================
--- trunk/src/nxhttpd/tools.cpp 2008-06-05 22:45:06 UTC (rev 3299)
+++ trunk/src/nxhttpd/tools.cpp 2008-06-09 20:31:03 UTC (rev 3300)
@@ -49,21 +49,6 @@
//
-// Translate given code to text
-//
-
-const TCHAR *CodeToText(int iCode, CODE_TO_TEXT *pTranslator, const TCHAR *pszDefaultText)
-{
- int i;
-
- for(i = 0; pTranslator[i].pszText != NULL; i++)
- if (pTranslator[i].iCode == iCode)
- return pTranslator[i].pszText;
- return pszDefaultText;
-}
-
-
-//
// Format time stamp
//
Received on Mon Jun 09 2008 - 23:31:03 EEST
This archive was generated by hypermail 2.2.0 : Mon Jun 09 2008 - 23:28:10 EEST