{
#ifdef HAVE_ICU
UErrorCode status = U_ZERO_ERROR;
+ struct icu_chain *chain = 0;
while (xml_node && xml_node->type != XML_ELEMENT_NODE)
xml_node = xml_node->next;
- struct icu_chain *chain = icu_chain_xml_config(xml_node, &status);
+ chain = icu_chain_xml_config(xml_node, &status);
if (!chain || U_FAILURE(status)){
//xmlDocPtr icu_doc = 0;
//xmlChar *xmlstr = 0;
#ifdef HAVE_ICU
if (pct->icu_chn)
{
- pct->icu_sts = U_ZERO_ERROR;
int ok = 0;
+ pct->icu_sts = U_ZERO_ERROR;
ok = icu_chain_assign_cstr(pct->icu_chn, buf, &pct->icu_sts);
//printf("\nfield ok: %d '%s'\n", ok, buf);
prt->pct = pct;
int errcode;
socklen_t errlen = sizeof(errcode);
- if (getsockopt(cs_fileno(co->link), SOL_SOCKET, SO_ERROR, &errcode,
+ if (getsockopt(cs_fileno(co->link), SOL_SOCKET, SO_ERROR, (char*) &errcode,
&errlen) < 0 || errcode != 0)
{
client_fatal(cl);
xmlNode *node = 0;
struct icu_chain * chain = 0;
+ xmlChar *xml_id = 0;
+ xmlChar *xml_locale = 0;
if (!xml_node
||xml_node->type != XML_ELEMENT_NODE
return 0;
- xmlChar *xml_id = xmlGetProp(xml_node, (xmlChar *) "id");
- xmlChar *xml_locale = xmlGetProp(xml_node, (xmlChar *) "locale");
+ xml_id = xmlGetProp(xml_node, (xmlChar *) "id");
+ xml_locale = xmlGetProp(xml_node, (xmlChar *) "locale");
if (!xml_id || !strlen((const char *) xml_id)
|| !xml_locale || !strlen((const char *) xml_locale))
for (node = xml_node->children; node; node = node->next)
{
+ xmlChar *xml_rule = 0;
+ struct icu_chain_step * step = 0;
if (node->type != XML_ELEMENT_NODE)
continue;
- xmlChar *xml_rule = xmlGetProp(node, (xmlChar *) "rule");
- struct icu_chain_step * step = 0;
+ xml_rule = xmlGetProp(node, (xmlChar *) "rule");
if (!strcmp((const char *) node->name,
(const char *) "casemap")){
#if HAVE_CONFIG_H
#include <config.h>
#endif
+#ifdef WIN32
+#include <winsock.h>
+#endif
#include <signal.h>
#include <assert.h>
exit(0);
}
+#ifdef WIN32
+static int tcpip_init (void)
+{
+ WORD requested;
+ WSADATA wd;
+
+ requested = MAKEWORD(1, 1);
+ if (WSAStartup(requested, &wd))
+ return 0;
+ return 1;
+}
+#endif
+
+
int main(int argc, char **argv)
{
int daemon = 0;
#ifndef WIN32
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR)
yaz_log(YLOG_WARN|YLOG_ERRNO, "signal");
+#else
+ tcpip_init();
#endif
yaz_log_init_prefix("pazpar2");
yaz_log_xml_errors(0, YLOG_WARN);
#endif
+
while ((ret = options("dDf:h:l:p:t:u:VX", argv, argc, &arg)) != -2)
{
switch (ret)
# This file is part of Pazpar2.
# Copyright (C) 2006-2008 Index Data
-DEBUG=0 # 0 for release, 1 for debug
+DEBUG=1 # 0 for release, 1 for debug
USE_MANIFEST = 0 # Can be enabled Visual Studio 2005
PACKAGE_NAME=pazpar2
PACKAGE_VERSION=1.0.7
LIBXML2_DIR=\libxml2-2.6.28.win32
LIBXSLT_DIR=\libxslt-1.1.19.win32
+# ICU
+HAVE_ICU=1
+ICU_DIR=c:\icu
+
default: all
all: dirs yaz libxslt pazpar2
TMPDIR=$(ROOTDIR)\win\tmp
TMP=$(TMPDIR)
-# Targets - what to make
-
PAZPAR2_EXE=$(BINDIR)\pazpar2.exe
pazpar2: $(PAZPAR2_EXE)
yaz: $(BINDIR)\$(YAZD).dll
$(BINDIR)\$(YAZD).dll: "$(YAZ_DIR)\bin\$(YAZD).dll"
+ copy "$(YAZ_DIR)\bin\icu*.dll" $(BINDIR)
copy "$(YAZ_DIR)\bin\$(YAZD).dll" $(BINDIR)
# Copy libxslt and associates to our bin directory
"$(LIBXML2_DIR)\lib\libxml2.lib" \
"$(LIBXSLT_DIR)\lib\libxslt.lib"
+!if $(HAVE_ICU)
+ICU_DEF=/DHAVE_ICU=1 /D HAVE_ICU_H=1 /I"$(ICU_DIR)\include"
+ICU_LIB= $(ICU_DIR)\lib\icudt.lib \
+ $(ICU_DIR)\lib\icuin.lib \
+ $(ICU_DIR)\lib\icuuc.lib
+!else
+ICU_DEF=/DHAVE_ICU=0
+ICU_LIB=
+!endif
+
COMMON_C_OPTIONS= \
/nologo /W3 /EHsc /FD /c \
/D "_CRT_SECURE_NO_DEPRECATE" \
/D "PACKAGE_NAME=\"$(PACKAGE_NAME)\"" \
/D "VERSION=\"$(PACKAGE_VERSION)\"" \
$(YAZ_DEF) \
+ $(ICU_DEF) \
$(LIBXSLT_DEF) \
/D "_WINDOWS" \
/D "WIN32" \
LINK_LIBS= kernel32.lib user32.lib gdi32.lib advapi32.lib uuid.lib \
wsock32.lib advapi32.lib \
- $(YAZ_LIB) $(LIBXSLT_LIB)
+ $(YAZ_LIB) $(ICU_LIB) $(LIBXSLT_LIB)
COMMON_LNK_OPTIONS= /nologo /subsystem:windows /machine:i386 /incremental:no
{$(SRCDIR)}.c{$(OBJDIR)}.obj:
$(CPP) $(COPT) $<
-### The RC compiler (resource files)
-RSC=rc.exe
-COMMON_RC_OPTIONS= /l 0x406 /i"$(ROOTDIR)"
-DEBUG_RC_OPTIONS=/d "_DEBUG"
-RELEASE_RC_OPTIONS=/d "NDEBUG"
-
-!if $(DEBUG)
-RSOPT=/d_DEBUG
-!else
-RSOPT=/d_NDEBUG
-!endif
!if $(USE_MANIFEST)
MT=mt.exe /nologo