XML configs implemented
authorVictor Kirhenshtein <victor@netxms.org>
Mon, 4 May 2009 14:25:47 +0000 (14:25 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Mon, 4 May 2009 14:25:47 +0000 (14:25 +0000)
13 files changed:
.gitattributes
include/nms_util.h
include/nxconfig.h
include/nxcpapi.h
netxms.sln
src/agent/core/nxagentd.cpp
src/agent/subagents/winperf/winperf.cpp
src/libexpat/libexpat/libexpatw.def [deleted file]
src/libexpat/libexpat/libexpatw.vcproj [deleted file]
src/libnetxms/config.cpp
src/libnetxms/message.cpp
src/libnetxms/string.cpp
src/libnetxms/unicode.cpp

index d887a1c..5a199ed 100644 (file)
@@ -411,7 +411,6 @@ src/libexpat/conftools/config.sub -text
 src/libexpat/conftools/install-sh -text
 src/libexpat/conftools/mkinstalldirs -text
 src/libexpat/libexpat/libexpat.vcproj -text
-src/libexpat/libexpat/libexpatw.vcproj -text
 src/libexpat/vms/descrip.mms -text
 src/libnetxms/libnetxms.vcp eol=crlf
 src/libnetxms/libnetxms.vcproj -text
index fbd7ca2..8be768d 100644 (file)
@@ -257,6 +257,9 @@ public:
        void AddString(const TCHAR *pStr, DWORD dwLen);
        void AddDynamicString(TCHAR *pszStr) { if (pszStr != NULL) { *this += pszStr; free(pszStr); } }
 
+       void AddMultiByteString(const char *pStr, DWORD dwSize, int nCodePage);
+       void AddWideCharString(const WCHAR *pStr, DWORD dwSize);
+
    void AddFormattedString(const TCHAR *pszFormat, ...);
    void EscapeCharacter(int ch, int esc);
    void Translate(const TCHAR *pszSrc, const TCHAR *pszDst);
index 18ee624..0cb2748 100644 (file)
@@ -86,9 +86,9 @@ public:
        Config();
        ~Config();
 
-       bool loadConfig(const TCHAR *file);
        bool loadXmlConfig(const TCHAR *file);
-       bool loadIniConfig(const TCHAR *file, const TCHAR *defaultSectionName);
+       bool loadIniConfig(const TCHAR *file, const TCHAR *defaultIniSection);
+       bool loadConfig(const TCHAR *file, const TCHAR *defaultIniSection);
 
        bool loadConfigDirectory(const TCHAR *path);
 
index 182a035..8743e79 100644 (file)
@@ -68,7 +68,7 @@ public:
    CSCPMessage(int nVersion = NXCP_VERSION);
    CSCPMessage(CSCPMessage *pMsg);
    CSCPMessage(CSCP_MESSAGE *pMsg, int nVersion = NXCP_VERSION);
-   CSCPMessage(char *xml);
+   CSCPMessage(const char *xml);
    ~CSCPMessage();
 
    CSCP_MESSAGE *CreateMessage(void);
index 04aa7fb..d0cb0ae 100644 (file)
@@ -10,15 +10,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnetxms", "src\libnetxms\
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnetxmsw", "src\libnetxms\libnetxmsw.vcproj", "{AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}"
        ProjectSection(ProjectDependencies) = postProject
-               {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA} = {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}
+               {6A88EF62-C4F2-4295-A833-549DAE4DF5ED} = {6A88EF62-C4F2-4295-A833-549DAE4DF5ED}
        EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libexpatw", "src\libexpat\libexpat\libexpatw.vcproj", "{F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}"
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxlp", "src\libnxlp\libnxlp.vcproj", "{64EFC0C2-C67B-41F6-851D-F11DAB27A60B}"
        ProjectSection(ProjectDependencies) = postProject
-               {6A88EF62-C4F2-4295-A833-549DAE4DF5ED} = {6A88EF62-C4F2-4295-A833-549DAE4DF5ED}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {6A88EF62-C4F2-4295-A833-549DAE4DF5ED} = {6A88EF62-C4F2-4295-A833-549DAE4DF5ED}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxagentd", "src\agent\core\nxagentd.vcproj", "{57598B02-3295-4FE8-9322-94CE871CC84D}"
@@ -78,8 +76,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "odbcquery", "src\agent\suba
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "logwatch", "src\agent\subagents\logwatch\logwatch.vcproj", "{F8A8749E-E539-4A3B-A21C-2C5C86AE33EA}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {64EFC0C2-C67B-41F6-851D-F11DAB27A60B} = {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ecs", "src\agent\subagents\ecs\ecs.vcproj", "{BBE9028E-725C-45C6-97C9-BFC443F19DB6}"
@@ -101,94 +99,94 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxmapw", "src\libnxmap\l
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxcl", "src\libnxcl\libnxcl.vcproj", "{3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}"
        ProjectSection(ProjectDependencies) = postProject
-               {AB386821-B630-49F5-95C3-677B9DCE1270} = {AB386821-B630-49F5-95C3-677B9DCE1270}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {AB386821-B630-49F5-95C3-677B9DCE1270} = {AB386821-B630-49F5-95C3-677B9DCE1270}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxclw", "src\libnxcl\libnxclw.vcproj", "{3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}"
        ProjectSection(ProjectDependencies) = postProject
-               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
                {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B} = {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
        EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{39BF23C9-D903-4C20-8E88-19533A745625}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxalarm", "src\client\nxalarm\nxalarm.vcproj", "{F9FFAAE9-D669-451E-B9EF-18BC8AD37FAB}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxevent", "src\client\nxevent\nxevent.vcproj", "{C7A460E8-12A8-4FC7-9F59-C9C5CE17ED20}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxpush", "src\client\nxpush\nxpush.vcproj", "{B8671BF7-94E1-4615-A8C2-F5C78DB8C515}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxsms", "src\client\nxsms\nxsms.vcproj", "{B0A70A32-A8F0-4071-8044-FDA3C834A5C5}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxsnmp", "src\snmp\libnxsnmp\libnxsnmp.vcproj", "{7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {E7410EB4-3355-4C83-8E05-D2877581CDA1} = {E7410EB4-3355-4C83-8E05-D2877581CDA1}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxzlib", "src\zlib\nxzlib.vcproj", "{E7410EB4-3355-4C83-8E05-D2877581CDA1}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxsnmpget", "src\snmp\nxsnmpget\nxsnmpget.vcproj", "{0A4CE471-020A-42C6-91C0-DFEFA7E815E0}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxsnmpw", "src\snmp\libnxsnmp\libnxsnmpw.vcproj", "{7DC90EE4-E31C-4F12-8F1E-81F10E9099FC}"
        ProjectSection(ProjectDependencies) = postProject
-               {E7410EB4-3355-4C83-8E05-D2877581CDA1} = {E7410EB4-3355-4C83-8E05-D2877581CDA1}
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {E7410EB4-3355-4C83-8E05-D2877581CDA1} = {E7410EB4-3355-4C83-8E05-D2877581CDA1}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxsnmpset", "src\snmp\nxsnmpset\nxsnmpset.vcproj", "{9EA98E79-EB7D-4F6C-8105-AC7B231ABB10}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxsnmpwalk", "src\snmp\nxsnmpwalk\nxsnmpwalk.vcproj", "{5FA3AADC-3AD7-4B17-A581-D5E02DE17727}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxmibc", "src\snmp\nxmibc\nxmibc.vcproj", "{9F722C62-78FD-4D8C-A7C7-2815B09F1943}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxsrv", "src\server\libnxsrv\libnxsrv.vcproj", "{CB89D905-C8BE-4027-B2D8-F96C245E9160}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxcore", "src\server\core\nxcore.vcproj", "{3B172035-5EEC-45A3-8471-2C390B7ED683}"
        ProjectSection(ProjectDependencies) = postProject
-               {B2988503-1921-4B9F-BBC1-5E5CF62F335E} = {B2988503-1921-4B9F-BBC1-5E5CF62F335E}
-               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
-               {AB386821-B630-49F5-95C3-677B9DCE1270} = {AB386821-B630-49F5-95C3-677B9DCE1270}
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
-               {64EFC0C2-C67B-41F6-851D-F11DAB27A60B} = {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}
                {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FB}
+               {64EFC0C2-C67B-41F6-851D-F11DAB27A60B} = {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {AB386821-B630-49F5-95C3-677B9DCE1270} = {AB386821-B630-49F5-95C3-677B9DCE1270}
+               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
+               {B2988503-1921-4B9F-BBC1-5E5CF62F335E} = {B2988503-1921-4B9F-BBC1-5E5CF62F335E}
        EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nxsl", "nxsl", "{CE0DA89E-CF0C-452C-9C33-75A143355BDC}"
@@ -200,23 +198,23 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libnxsl", "src\libnxsl\libn
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxscript", "src\nxscript\nxscript.vcproj", "{BA263F92-D5A9-4F26-9606-5A1C1495FEA5}"
        ProjectSection(ProjectDependencies) = postProject
-               {B2988503-1921-4B9F-BBC1-5E5CF62F335E} = {B2988503-1921-4B9F-BBC1-5E5CF62F335E}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {B2988503-1921-4B9F-BBC1-5E5CF62F335E} = {B2988503-1921-4B9F-BBC1-5E5CF62F335E}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netxmsd", "src\server\netxmsd\netxmsd.vcproj", "{E417A0C4-41F1-4F87-8C33-8526ECB1F8AF}"
        ProjectSection(ProjectDependencies) = postProject
-               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
-               {3B172035-5EEC-45A3-8471-2C390B7ED683} = {3B172035-5EEC-45A3-8471-2C390B7ED683}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {3B172035-5EEC-45A3-8471-2C390B7ED683} = {3B172035-5EEC-45A3-8471-2C390B7ED683}
+               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
        EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "dbdrv", "dbdrv", "{81E9FE79-5A9E-410F-9594-4F9F48BF7D84}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sqlite", "src\server\dbdrv\sqlite\sqlite.vcproj", "{AA18FD4D-7B01-4932-BA04-B0F54F001F66}"
        ProjectSection(ProjectDependencies) = postProject
-               {87CAA25D-991E-45E1-BB69-337D45121F19} = {87CAA25D-991E-45E1-BB69-337D45121F19}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {87CAA25D-991E-45E1-BB69-337D45121F19} = {87CAA25D-991E-45E1-BB69-337D45121F19}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pgsql", "src\server\dbdrv\pgsql\pgsql.vcproj", "{4D92E883-1776-4012-A5C0-439104DE3441}"
@@ -248,8 +246,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{64482674
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxaction", "src\server\tools\nxaction\nxaction.vcproj", "{BF5CE6BA-C84A-4448-B1B7-1B355AC77D12}"
        ProjectSection(ProjectDependencies) = postProject
-               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxadm", "src\server\tools\nxadm\nxadm.vcproj", "{67E35735-2115-45FF-9E93-EE67AF5C9C2C}"
@@ -259,30 +257,30 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxadm", "src\server\tools\n
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxget", "src\server\tools\nxget\nxget.vcproj", "{1AC3C8D1-E309-4327-9E17-0E4CE0FC68CF}"
        ProjectSection(ProjectDependencies) = postProject
-               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxupload", "src\server\tools\nxupload\nxupload.vcproj", "{DA863269-ED58-4910-AA6A-2572A3EE745D}"
        ProjectSection(ProjectDependencies) = postProject
-               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxdbmgr", "src\server\tools\nxdbmgr\nxdbmgr.vcproj", "{4940613E-A11C-4259-95C8-8D23217EE60E}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
-               {87CAA25D-991E-45E1-BB69-337D45121F19} = {87CAA25D-991E-45E1-BB69-337D45121F19}
                {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
+               {87CAA25D-991E-45E1-BB69-337D45121F19} = {87CAA25D-991E-45E1-BB69-337D45121F19}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "webui", "webui", "{7C6B32C4-53F9-4378-903E-1DA05748376B}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxhttpd", "src\webui\nxhttpd\nxhttpd.vcproj", "{AC0CB89C-E27A-43FA-A049-1FF4B2FE2121}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
                {F5287CFB-0894-4169-B5B5-1AEE4F2FF585} = {F5287CFB-0894-4169-B5B5-1AEE4F2FF585}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB531}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "src\webui\libgd\libpng\libpng.vcproj", "{E9F4A68D-4BF2-45AD-BDD6-210AFF857661}"
@@ -298,61 +296,61 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "smsdrv", "smsdrv", "{5818CC
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "generic", "src\server\smsdrv\generic\generic.vcproj", "{41A5009F-4467-4D89-A171-5A919FEFE16E}"
        ProjectSection(ProjectDependencies) = postProject
-               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxagent", "src\server\smsdrv\nxagent\nxagent.vcproj", "{C317231C-B984-4423-ACF2-C19DE8B6AA3F}"
        ProjectSection(ProjectDependencies) = postProject
-               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {CB89D905-C8BE-4027-B2D8-F96C245E9160} = {CB89D905-C8BE-4027-B2D8-F96C245E9160}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libgd", "src\webui\libgd\gd\libgd.vcproj", "{F5287CFB-0894-4169-B5B5-1AEE4F2FF585}"
        ProjectSection(ProjectDependencies) = postProject
-               {55B7161B-683F-4E7A-96F6-277A1681D6C5} = {55B7161B-683F-4E7A-96F6-277A1681D6C5}
-               {E9F4A68D-4BF2-45AD-BDD6-210AFF857661} = {E9F4A68D-4BF2-45AD-BDD6-210AFF857661}
-               {E7410EB4-3355-4C83-8E05-D2877581CDA1} = {E7410EB4-3355-4C83-8E05-D2877581CDA1}
                {0D98A1CD-48E0-4F11-9151-B53497E1F7DA} = {0D98A1CD-48E0-4F11-9151-B53497E1F7DA}
+               {E7410EB4-3355-4C83-8E05-D2877581CDA1} = {E7410EB4-3355-4C83-8E05-D2877581CDA1}
+               {E9F4A68D-4BF2-45AD-BDD6-210AFF857661} = {E9F4A68D-4BF2-45AD-BDD6-210AFF857661}
+               {55B7161B-683F-4E7A-96F6-277A1681D6C5} = {55B7161B-683F-4E7A-96F6-277A1681D6C5}
        EndProjectSection
 EndProject
 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "windows", "windows", "{69EC5B74-D466-422E-B8D1-1386B0421D54}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxlexer", "src\client\nxlexer\nxlexer.vcproj", "{F0FAC738-1BC6-46A5-A54A-8D7F2219302D}"
        ProjectSection(ProjectDependencies) = postProject
-               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
                {8E5A517B-93AB-4EA8-BB53-AE6346756343} = {8E5A517B-93AB-4EA8-BB53-AE6346756343}
+               {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "scilexer", "src\client\scilexer\scilexer.vcproj", "{8E5A517B-93AB-4EA8-BB53-AE6346756343}"
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxuilib", "src\client\windows\nxuilib\nxuilib.vcproj", "{BECC966D-AFC8-48F6-97B1-2FE92062D7B4}"
        ProjectSection(ProjectDependencies) = postProject
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxav", "src\client\windows\nxav\nxav.vcproj", "{23F22F68-D562-4E80-8267-9F1DD9398357}"
        ProjectSection(ProjectDependencies) = postProject
-               {BECC966D-AFC8-48F6-97B1-2FE92062D7B4} = {BECC966D-AFC8-48F6-97B1-2FE92062D7B4}
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
+               {BECC966D-AFC8-48F6-97B1-2FE92062D7B4} = {BECC966D-AFC8-48F6-97B1-2FE92062D7B4}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxnotify", "src\client\windows\nxnotify\nxnotify.vcproj", "{169A4446-A035-4CF7-8377-3C517ADF0C50}"
        ProjectSection(ProjectDependencies) = postProject
-               {BECC966D-AFC8-48F6-97B1-2FE92062D7B4} = {BECC966D-AFC8-48F6-97B1-2FE92062D7B4}
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
+               {BECC966D-AFC8-48F6-97B1-2FE92062D7B4} = {BECC966D-AFC8-48F6-97B1-2FE92062D7B4}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxcon", "src\client\windows\nxcon\nxcon.vcproj", "{956DD617-0939-4B25-B8D0-E10AA645064E}"
        ProjectSection(ProjectDependencies) = postProject
-               {BECC966D-AFC8-48F6-97B1-2FE92062D7B4} = {BECC966D-AFC8-48F6-97B1-2FE92062D7B4}
-               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
-               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC}
-               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
                {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B} = {0A5E80F3-485D-40C8-BE1E-9D7EE744DB8B}
+               {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}
+               {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC} = {7DC90EE4-E31C-4F12-8F1E-81F10E9099FC}
+               {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532} = {3CB9B8C6-E6BF-4002-A61A-7A21FEADB532}
+               {BECC966D-AFC8-48F6-97B1-2FE92062D7B4} = {BECC966D-AFC8-48F6-97B1-2FE92062D7B4}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxcptest", "src\nxcptest\nxcptest.vcproj", "{418E47B0-3E78-4820-A101-CA9C4439F9AB}"
@@ -362,8 +360,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxcptest", "src\nxcptest\nx
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxlptest", "src\nxlptest\nxlptest.vcproj", "{1EA79FC6-F395-43DF-9E3C-2030CA05ED1D}"
        ProjectSection(ProjectDependencies) = postProject
-               {64EFC0C2-C67B-41F6-851D-F11DAB27A60B} = {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {B1745870-F3ED-4ACB-B813-0C4F47EF0793}
+               {64EFC0C2-C67B-41F6-851D-F11DAB27A60B} = {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}
        EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nxsqlite", "src\sqlite\nxsqlite.vcproj", "{87CAA25D-991E-45E1-BB69-337D45121F19}"
@@ -417,16 +415,6 @@ Global
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}.Release|Win32.Build.0 = Release|Win32
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}.Release|x64.ActiveCfg = Release|x64
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA}.Release|x64.Build.0 = Release|x64
-               {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|x64
-               {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}.Debug|Win32.ActiveCfg = Debug|Win32
-               {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}.Debug|Win32.Build.0 = Debug|Win32
-               {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}.Debug|x64.ActiveCfg = Debug|x64
-               {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}.Debug|x64.Build.0 = Debug|x64
-               {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|x64
-               {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}.Release|Win32.ActiveCfg = Release|Win32
-               {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}.Release|Win32.Build.0 = Release|Win32
-               {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}.Release|x64.ActiveCfg = Release|x64
-               {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}.Release|x64.Build.0 = Release|x64
                {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|x64
                {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}.Debug|Win32.ActiveCfg = Debug|Win32
                {64EFC0C2-C67B-41F6-851D-F11DAB27A60B}.Debug|Win32.Build.0 = Debug|Win32
@@ -1012,7 +1000,6 @@ Global
        GlobalSection(NestedProjects) = preSolution
                {B1745870-F3ED-4ACB-B813-0C4F47EF0793} = {71683564-472B-4216-BA74-0F34BC843D92}
                {AEB182ED-7F5C-4F5A-BCE1-9A38E98579BA} = {71683564-472B-4216-BA74-0F34BC843D92}
-               {F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA} = {71683564-472B-4216-BA74-0F34BC843D92}
                {64EFC0C2-C67B-41F6-851D-F11DAB27A60B} = {71683564-472B-4216-BA74-0F34BC843D92}
                {6A88EF62-C4F2-4295-A833-549DAE4DF5ED} = {71683564-472B-4216-BA74-0F34BC843D92}
                {AB386821-B630-49F5-95C3-677B9DCE1270} = {71683564-472B-4216-BA74-0F34BC843D92}
index ce82ebd..ebf5628 100644 (file)
@@ -1278,7 +1278,7 @@ int main(int argc, char *argv[])
             }
          }
 
-                       if (g_config->loadIniConfig(g_szConfigFile, _T("agent")) && g_config->bindParameters(_T("agent"), m_cfgTemplate))
+                       if (g_config->loadConfig(g_szConfigFile, _T("agent")) && g_config->bindParameters(_T("agent"), m_cfgTemplate))
                        {
        // Set exception handler
 #ifdef _WIN32
index 67a56c6..dbdb5b8 100644 (file)
@@ -349,7 +349,7 @@ static LONG H_CounterAlias(const TCHAR *pszParam, const TCHAR *pArg, TCHAR *pVal
 // Initialize subagent
 //
 
-static BOOL SubAgentInit(TCHAR *pszConfigFile)
+static BOOL SubAgentInit(Config *config)
 {
    // Create shutdown condition object
    g_hCondShutdown = CreateEvent(NULL, TRUE, FALSE, NULL);
@@ -474,7 +474,7 @@ static void AddPredefinedCounters(void)
 //
 
 static TCHAR *m_pszCounterList = NULL;
-static NX_CFG_TEMPLATE cfgTemplate[] =
+static NX_CFG_TEMPLATE m_cfgTemplate[] =
 {
    { _T("Counter"), CT_STRING_LIST, _T('\n'), 0, 0, 0, &m_pszCounterList },
    { _T("EnableDefaultCounters"), CT_BOOLEAN, 0, 0, WPF_ENABLE_DEFAULT_COUNTERS, 0, &m_dwFlags },
@@ -487,9 +487,9 @@ static NX_CFG_TEMPLATE cfgTemplate[] =
 //
 
 extern "C" BOOL __declspec(dllexport) __cdecl 
-   NxSubAgentRegister(NETXMS_SUBAGENT_INFO **ppInfo, TCHAR *pszConfigFile)
+   NxSubAgentRegister(NETXMS_SUBAGENT_INFO **ppInfo, Config *config)
 {
-   DWORD i, dwResult, dwBufferSize, dwBytes, dwType, dwStatus;
+   DWORD i, dwBufferSize, dwBytes, dwType, dwStatus;
        TCHAR *pBuffer, *newName;
 
        if (m_info.pParamList != NULL)
@@ -527,8 +527,8 @@ extern "C" BOOL __declspec(dllexport) __cdecl
        }
 
    // Load configuration
-   dwResult = NxLoadConfig(pszConfigFile, _T("WinPerf"), cfgTemplate, FALSE);
-   if (dwResult == NXCFG_ERR_OK)
+       bool success = config->bindParameters(_T("WinPerf"), m_cfgTemplate);
+       if (success)
    {
       TCHAR *pItem, *pEnd;
 
@@ -557,7 +557,7 @@ extern "C" BOOL __declspec(dllexport) __cdecl
       safe_free(m_pszCounterList);
    }
    *ppInfo = &m_info;
-   return dwResult == NXCFG_ERR_OK;
+   return success;
 }
 
 
diff --git a/src/libexpat/libexpat/libexpatw.def b/src/libexpat/libexpat/libexpatw.def
deleted file mode 100644 (file)
index 3920bbc..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-; DEF file for MS VC++
-
-LIBRARY
-EXPORTS
-  XML_DefaultCurrent @1
-  XML_ErrorString @2
-  XML_ExpatVersion @3
-  XML_ExpatVersionInfo @4
-  XML_ExternalEntityParserCreate @5
-  XML_GetBase @6
-  XML_GetBuffer @7
-  XML_GetCurrentByteCount @8
-  XML_GetCurrentByteIndex @9
-  XML_GetCurrentColumnNumber @10
-  XML_GetCurrentLineNumber @11
-  XML_GetErrorCode @12
-  XML_GetIdAttributeIndex @13
-  XML_GetInputContext @14
-  XML_GetSpecifiedAttributeCount @15
-  XML_Parse @16
-  XML_ParseBuffer @17
-  XML_ParserCreate @18
-  XML_ParserCreateNS @19
-  XML_ParserCreate_MM @20
-  XML_ParserFree @21
-  XML_SetAttlistDeclHandler @22
-  XML_SetBase @23
-  XML_SetCdataSectionHandler @24
-  XML_SetCharacterDataHandler @25
-  XML_SetCommentHandler @26
-  XML_SetDefaultHandler @27
-  XML_SetDefaultHandlerExpand @28
-  XML_SetDoctypeDeclHandler @29
-  XML_SetElementDeclHandler @30
-  XML_SetElementHandler @31
-  XML_SetEncoding @32
-  XML_SetEndCdataSectionHandler @33
-  XML_SetEndDoctypeDeclHandler @34
-  XML_SetEndElementHandler @35
-  XML_SetEndNamespaceDeclHandler @36
-  XML_SetEntityDeclHandler @37
-  XML_SetExternalEntityRefHandler @38
-  XML_SetExternalEntityRefHandlerArg @39
-  XML_SetNamespaceDeclHandler @40
-  XML_SetNotStandaloneHandler @41
-  XML_SetNotationDeclHandler @42
-  XML_SetParamEntityParsing @43
-  XML_SetProcessingInstructionHandler @44
-  XML_SetReturnNSTriplet @45
-  XML_SetStartCdataSectionHandler @46
-  XML_SetStartDoctypeDeclHandler @47
-  XML_SetStartElementHandler @48
-  XML_SetStartNamespaceDeclHandler @49
-  XML_SetUnknownEncodingHandler @50
-  XML_SetUnparsedEntityDeclHandler @51
-  XML_SetUserData @52
-  XML_SetXmlDeclHandler @53
-  XML_UseParserAsHandlerArg @54
-; added with version 1.95.3
-  XML_ParserReset @55
-  XML_SetSkippedEntityHandler @56
-; added with version 1.95.5
-  XML_GetFeatureList @57
-  XML_UseForeignDTD @58
-; added with version 1.95.6
-  XML_FreeContentModel @59
-  XML_MemMalloc @60
-  XML_MemRealloc @61
-  XML_MemFree @62
-; added with version 1.95.8
-  XML_StopParser @63
-  XML_ResumeParser @64
-  XML_GetParsingStatus @65
diff --git a/src/libexpat/libexpat/libexpatw.vcproj b/src/libexpat/libexpat/libexpatw.vcproj
deleted file mode 100644 (file)
index 8306f1d..0000000
+++ /dev/null
@@ -1,432 +0,0 @@
-<?xml version="1.0" encoding="windows-1251"?>\r
-<VisualStudioProject\r
-       ProjectType="Visual C++"\r
-       Version="8.00"\r
-       Name="libexpatw"\r
-       ProjectGUID="{F16F9CA8-9438-4118-8A3C-F6DDC3DDCFDA}"\r
-       RootNamespace="libexpatw"\r
-       Keyword="Win32Proj"\r
-       >\r
-       <Platforms>\r
-               <Platform\r
-                       Name="Win32"\r
-               />\r
-               <Platform\r
-                       Name="x64"\r
-               />\r
-       </Platforms>\r
-       <ToolFiles>\r
-       </ToolFiles>\r
-       <Configurations>\r
-               <Configuration\r
-                       Name="Debug|Win32"\r
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
-                       IntermediateDirectory="$(ConfigurationName)_UNICODE"\r
-                       ConfigurationType="2"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
-                               PreprocessorDefinitions="COMPILED_FROM_DSP,XML_UNICODE_WCHAR_T"\r
-                               MinimalRebuild="true"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="3"\r
-                               UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="false"\r
-                               DebugInformationFormat="4"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               LinkIncremental="2"\r
-                               ModuleDefinitionFile="libexpatw.def"\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="2"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Debug|x64"\r
-                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
-                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)_UNICODE"\r
-                       ConfigurationType="2"\r
-                       CharacterSet="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                               TargetEnvironment="3"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               Optimization="0"\r
-                               PreprocessorDefinitions="COMPILED_FROM_DSP,XML_UNICODE_WCHAR_T"\r
-                               MinimalRebuild="true"\r
-                               BasicRuntimeChecks="3"\r
-                               RuntimeLibrary="3"\r
-                               UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="true"\r
-                               DebugInformationFormat="3"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               LinkIncremental="2"\r
-                               ModuleDefinitionFile="libexpatw.def"\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="2"\r
-                               TargetMachine="17"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|Win32"\r
-                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
-                       IntermediateDirectory="$(ConfigurationName)_UNICODE"\r
-                       ConfigurationType="2"\r
-                       CharacterSet="1"\r
-                       WholeProgramOptimization="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               PreprocessorDefinitions="COMPILED_FROM_DSP,XML_UNICODE_WCHAR_T"\r
-                               RuntimeLibrary="2"\r
-                               UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="false"\r
-                               DebugInformationFormat="3"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               LinkIncremental="1"\r
-                               ModuleDefinitionFile="libexpatw.def"\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="2"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               TargetMachine="1"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-               <Configuration\r
-                       Name="Release|x64"\r
-                       OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)"\r
-                       IntermediateDirectory="$(PlatformName)\$(ConfigurationName)_UNICODE"\r
-                       ConfigurationType="2"\r
-                       CharacterSet="1"\r
-                       WholeProgramOptimization="1"\r
-                       >\r
-                       <Tool\r
-                               Name="VCPreBuildEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCustomBuildTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXMLDataGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebServiceProxyGeneratorTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCMIDLTool"\r
-                               TargetEnvironment="3"\r
-                       />\r
-                       <Tool\r
-                               Name="VCCLCompilerTool"\r
-                               PreprocessorDefinitions="COMPILED_FROM_DSP,XML_UNICODE_WCHAR_T"\r
-                               RuntimeLibrary="2"\r
-                               UsePrecompiledHeader="0"\r
-                               WarningLevel="3"\r
-                               Detect64BitPortabilityProblems="true"\r
-                               DebugInformationFormat="3"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManagedResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCResourceCompilerTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPreLinkEventTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCLinkerTool"\r
-                               LinkIncremental="1"\r
-                               ModuleDefinitionFile="libexpatw.def"\r
-                               GenerateDebugInformation="true"\r
-                               SubSystem="2"\r
-                               OptimizeReferences="2"\r
-                               EnableCOMDATFolding="2"\r
-                               TargetMachine="17"\r
-                       />\r
-                       <Tool\r
-                               Name="VCALinkTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCManifestTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCXDCMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCBscMakeTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCFxCopTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCAppVerifierTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCWebDeploymentTool"\r
-                       />\r
-                       <Tool\r
-                               Name="VCPostBuildEventTool"\r
-                       />\r
-               </Configuration>\r
-       </Configurations>\r
-       <References>\r
-       </References>\r
-       <Files>\r
-               <Filter\r
-                       Name="Source Files"\r
-                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
-                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
-                       >\r
-                       <File\r
-                               RelativePath=".\libexpat.cpp"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\xmlparse.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\xmlrole.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\xmltok.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\xmltok_impl.c"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\xmltok_ns.c"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
-                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
-                       >\r
-                       <File\r
-                               RelativePath=".\ascii.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\asciitab.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\expat.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\expat_external.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\iasciitab.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\internal.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\latin1tab.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\macconfig.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\nametab.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\utf8tab.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\winconfig.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\xmlrole.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\xmltok.h"\r
-                               >\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\xmltok_impl.h"\r
-                               >\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
-                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
-                       >\r
-               </Filter>\r
-       </Files>\r
-       <Globals>\r
-       </Globals>\r
-</VisualStudioProject>\r
index f3aeef2..737ab79 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "libnetxms.h"
 #include <nxconfig.h>
+#include <expat.h>
 
 
 //
@@ -260,10 +261,58 @@ bool Config::bindParameters(const TCHAR *section, NX_CFG_TEMPLATE *cfgTemplate)
 
 
 //
+// Get value
+//
+
+const TCHAR *Config::getValue(const TCHAR *path)
+{
+       ConfigEntry *entry = getEntry(path);
+       return (entry != NULL) ? entry->getValue() : NULL;
+}
+
+
+//
+// Get entry
+//
+
+ConfigEntry *Config::getEntry(const TCHAR *path)
+{
+       const TCHAR *curr, *end;
+       TCHAR name[256];
+       ConfigEntry *entry = m_root;
+
+       if ((path == NULL) || (*path != _T('/')))
+               return NULL;
+
+       if (!_tcscmp(path, _T("/")))
+               return m_root;
+
+       curr = path + 1;
+       while(entry != NULL)
+       {
+               end = _tcschr(curr, _T('/'));
+               if (end != NULL)
+               {
+                       int len = min((int)(end - curr), 255);
+                       _tcsncpy(name, curr, len);
+                       name[len] = 0;
+                       entry = entry->findEntry(name);
+                       curr = end + 1;
+               }
+               else
+               {
+                       return entry->findEntry(curr);
+               }
+       }
+       return NULL;
+}
+
+
+//
 // Load INI-style config
 //
 
-bool Config::loadIniConfig(const TCHAR *file, const TCHAR *defaultSectionName)
+bool Config::loadIniConfig(const TCHAR *file, const TCHAR *defaultIniSection)
 {
        FILE *cfg;
        TCHAR buffer[4096], *ptr;
@@ -277,10 +326,10 @@ bool Config::loadIniConfig(const TCHAR *file, const TCHAR *defaultSectionName)
                return false;
        }
 
-       currentSection = m_root->findEntry(defaultSectionName);
+       currentSection = m_root->findEntry(defaultIniSection);
        if (currentSection == NULL)
        {
-               currentSection = new ConfigEntry(defaultSectionName, m_root, file, 0);
+               currentSection = new ConfigEntry(defaultIniSection, m_root, file, 0);
        }
 
    while(!feof(cfg))
@@ -341,45 +390,147 @@ bool Config::loadIniConfig(const TCHAR *file, const TCHAR *defaultSectionName)
 
 
 //
-// Get value
+// Load config from XML file
 //
 
-const TCHAR *Config::getValue(const TCHAR *path)
+#define MAX_STACK_DEPTH                256
+
+typedef struct
 {
-       ConfigEntry *entry = getEntry(path);
-       return (entry != NULL) ? entry->getValue() : NULL;
+       XML_Parser parser;
+       Config *config;
+       const TCHAR *file;
+       int level;
+       ConfigEntry *stack[MAX_STACK_DEPTH];
+       String charData[MAX_STACK_DEPTH];
+} XML_PARSER_STATE;
+
+static void StartElement(void *userData, const char *name, const char **attrs)
+{
+       XML_PARSER_STATE *ps = (XML_PARSER_STATE *)userData;
+
+       if (ps->level == 0)
+       {
+               if (!stricmp(name, "config"))
+               {
+                       ps->stack[ps->level++] = ps->config->getEntry(_T("/"));
+               }
+               else
+               {
+                       ps->level = -1;
+               }
+       }
+       else if (ps->level > 0)
+       {
+               if (ps->level < MAX_STACK_DEPTH)
+               {
+#ifdef UNICODE
+                       WCHAR wname[256];
+
+                       MultiByteToWideChar(CP_UTF8, 0, name, -1, wname, 256);
+                       wname[255] = 0;
+                       ps->stack[ps->level] = ps->stack[ps->level - 1]->findEntry(wname);
+                       if (ps->stack[ps->level] == NULL)
+                               ps->stack[ps->level] = new ConfigEntry(wname, ps->stack[ps->level - 1], ps->file, XML_GetCurrentLineNumber(ps->parser));
+#else
+                       ps->stack[ps->level] = ps->stack[ps->level - 1]->findEntry(name);
+                       if (ps->stack[ps->level] == NULL)
+                               ps->stack[ps->level] = new ConfigEntry(name, ps->stack[ps->level - 1], ps->file, XML_GetCurrentLineNumber(ps->parser));
+#endif
+                       ps->charData[ps->level] = _T("");
+                       ps->level++;
+               }
+               else
+               {
+                       ps->level++;
+               }
+       }
 }
 
+static void EndElement(void *userData, const char *name)
+{
+       XML_PARSER_STATE *ps = (XML_PARSER_STATE *)userData;
 
-//
-// Get entry
-//
+       if (ps->level > MAX_STACK_DEPTH)
+       {
+               ps->level--;
+       }
+       else if (ps->level > 0)
+       {
+               ps->level--;
+               ps->stack[ps->level]->addValue(ps->charData[ps->level]);
+       }
+}
 
-ConfigEntry *Config::getEntry(const TCHAR *path)
+static void CharData(void *userData, const XML_Char *s, int len)
 {
-       const TCHAR *curr, *end;
-       TCHAR name[256];
-       ConfigEntry *entry = m_root;
+       XML_PARSER_STATE *ps = (XML_PARSER_STATE *)userData;
 
-       if ((path == NULL) || (*path != _T('/')))
-               return NULL;
+       if ((ps->level > 0) && (ps->level <= MAX_STACK_DEPTH))
+               ps->charData[ps->level - 1].AddMultiByteString(s, len, CP_UTF8);
+}
 
-       curr = path + 1;
-       while(entry != NULL)
+bool Config::loadXmlConfig(const TCHAR *file)
+{
+       BYTE *xml;
+       DWORD size;
+       bool success;
+
+       xml = LoadFile(file, &size);
+       if (xml != NULL)
        {
-               end = _tcschr(curr, _T('/'));
-               if (end != NULL)
-               {
-                       int len = min((int)(end - curr), 255);
-                       _tcsncpy(name, curr, len);
-                       name[len] = 0;
-                       entry = entry->findEntry(name);
-                       curr = end + 1;
-               }
-               else
+               XML_PARSER_STATE state;
+
+               XML_Parser parser = XML_ParserCreate(NULL);
+               XML_SetUserData(parser, &state);
+               XML_SetElementHandler(parser, StartElement, EndElement);
+               XML_SetCharacterDataHandler(parser, CharData);
+
+               state.config = this;
+               state.level = 0;
+               state.parser = parser;
+               state.file = file;
+
+               success = (XML_Parse(parser, (char *)xml, size, TRUE) != XML_STATUS_ERROR);
+               if (!success)
                {
-                       return entry->findEntry(curr);
+                       error(_T("%s at line %d"), XML_ErrorString(XML_GetErrorCode(parser)),
+               XML_GetCurrentLineNumber(parser));
                }
        }
-       return NULL;
+       else
+       {
+               success = false;
+       }
+
+       return success;
+}
+
+
+//
+// Load config file with format auto detection
+//
+
+bool Config::loadConfig(const TCHAR *file, const TCHAR *defaultIniSection)
+{
+       FILE *f;
+       int ch;
+
+       f = _tfopen(file, _T("r"));
+       if (f == NULL)
+       {
+               error(_T("Cannot open file %s"), file);
+               return false;
+       }
+
+       // Skip all space/newline characters
+       do
+       {
+               ch = fgetc(f);
+       } while(isspace(ch));
+
+       fclose(f);
+
+       // If first non-space character is < assume XML format, otherwise assume INI format
+       return (ch == '<') ? loadXmlConfig(file) : loadIniConfig(file, defaultIniSection);
 }
index d38aaaa..7a7ae1f 100644 (file)
@@ -274,7 +274,7 @@ static void CharData(void *userData, const XML_Char *s, int len)
 
 #endif
 
-CSCPMessage::CSCPMessage(char *xml)
+CSCPMessage::CSCPMessage(const char *xml)
 {
 #if HAVE_LIBEXPAT
        XML_Parser parser = XML_ParserCreate(NULL);
index 9601ca7..e8339db 100644 (file)
@@ -105,7 +105,7 @@ void String::AddFormattedString(const TCHAR *pszFormat, ...)
 
 
 //
-// Add formatted string to the end of buffer
+// Add string to the end of buffer
 //
 
 void String::AddString(const TCHAR *pStr, DWORD dwSize)
@@ -118,6 +118,40 @@ void String::AddString(const TCHAR *pStr, DWORD dwSize)
 
 
 //
+// Add multibyte string to the end of buffer
+//
+
+void String::AddMultiByteString(const char *pStr, DWORD dwSize, int nCodePage)
+{
+#ifdef UNICODE
+   m_pszBuffer = (TCHAR *)realloc(m_pszBuffer, (m_dwBufSize + dwSize) * sizeof(TCHAR));
+       MultiByteToWideChar(nCodePage, (nCodePage == CP_UTF8) ? 0 : MB_PRECOMPOSED, pStr, dwSize, &m_pszBuffer[m_dwBufSize - 1], dwSize);
+   m_dwBufSize += dwSize;
+       m_pszBuffer[m_dwBufSize - 1] = 0;
+#else
+       AddString(pStr, dwSize);
+#endif
+}
+
+
+//
+// Add widechar string to the end of buffer
+//
+
+void String::AddWideCharString(const WCHAR *pStr, DWORD dwSize)
+{
+#ifdef UNICODE
+       AddString(pStr, dwSize);
+#else
+   m_pszBuffer = (TCHAR *)realloc(m_pszBuffer, (m_dwBufSize + dwSize) * sizeof(TCHAR));
+       WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK | WC_DEFAULTCHAR, pStr, dwSize, &m_pszBuffer[m_dwBufSize - 1], dwSize, NULL, NULL);
+   m_dwBufSize += dwSize;
+       m_pszBuffer[m_dwBufSize - 1] = 0;
+#endif
+}
+
+
+//
 // Escape given character
 //
 
index 023c5de..1c78b4f 100644 (file)
@@ -987,10 +987,22 @@ static WCHAR *ReplaceFormatSpecs(const WCHAR *oldFormat)
                if ((*p == _T('%')) && (*(p + 1) != 0))
                {
                        p++;
-                       if (*p == _T('s'))
-                               *p = _T('S');
-                       else if (*p == _T('c'))
-                               *p = _T('C');
+                       switch(*p)
+                       {
+                               case _T('s'):
+                                       *p = _T('S');
+                                       break;
+                               case _T('S'):
+                                       *p = _T('s');
+                                       break;
+                               case _T('c'):
+                                       *p = _T('C');
+                                       break;
+                               case _T('C'):
+                                       *p = _T('c');
+                                       break;
+                               default:
+                                       break;
                }
        return fmt;
 }