Skip to content

Commit fe9fd4f

Browse files
committed
CWB patched
1 parent fc2fa3e commit fe9fd4f

54 files changed

Lines changed: 365 additions & 3250 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/cwb/CQi/auth.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <stdlib.h>
2424
#include <assert.h>
2525

26+
void Rprintf(const char *, ...);
27+
2628
#include "auth.h"
2729
#include "../cl/cl.h"
2830

src/cwb/CQi/cqpserver.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
#include "../cqp/options.h"
3232
#include "../cqp/corpmanag.h"
3333
#include "../cqp/groups.h"
34+
void Rprintf(const char *, ...);
3435

3536

3637
/** String containing the username sent by the currently-connect CQi client */

src/cwb/CQi/log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ cqiserver_debug_arglist(const char *arg_list, int n_args, int int_args)
146146
sprintf(mark += strlen(mark), "%d ", (int)arg_list[i]);
147147
else
148148
/* super creaky typecasting needed to get the compiler to not complain here */
149-
sprintf(mark += strlen(mark), "'%s' ", (char *)((long)arg_list[i]));
149+
sprintf(mark += strlen(mark), "'%s' ", arg_list);
150150
}
151151
return buf;
152152
}

src/cwb/CQi/server.c

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
* Public License for more details (in the file "COPYING", or available via
1515
* WWW at http://www.gnu.org/copyleft/gpl.html).
1616
*/
17+
#ifdef __MINGW__
18+
#include <winsock2.h>
19+
#define socklen_t int
20+
#endif
1721
#include <signal.h>
1822
#include <string.h>
1923
#include <unistd.h>
@@ -28,9 +32,6 @@
2832
#include <netinet/in.h>
2933
#include <arpa/inet.h>
3034
#include <netdb.h>
31-
#else
32-
#include <winsock2.h>
33-
#define socklen_t int
3435
#endif
3536

3637

@@ -48,6 +49,8 @@
4849
/** the att hash is initially sized to 2 to the power of 14 */
4950
#define ATTHASHSIZE 16384
5051

52+
void Rprintf(const char *, ...);
53+
5154
/** Error strings are limited to this many bytes. @see cqi_error_string */
5255
#define GENERAL_ERROR_SIZE 1024
5356

@@ -400,8 +403,8 @@ int
400403
cqi_send_byte(int n, int nosnoop)
401404
{
402405
#ifdef __MINGW__
403-
unsigned char prep;
404-
prep = (unsigned char) 0xff & n;
406+
const char prep = (const char) 0xff & n;
407+
/* prep = (unsigned char) 0xff & n; */
405408
#endif
406409

407410
if (!nosnoop)

src/cwb/CQi/server.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include "../cl/cl.h"
2222
#include "../cqp/corpmanag.h" /* for CorpusList */
2323

24-
typedef unsigned char cqi_byte;
24+
typedef char cqi_byte;
2525

2626
/* global errno variable; the error code is a CQi error message */
2727
/* utility functions such as cqi_lookup_attribute() set cqi_errno, so

src/cwb/cl/Makefile

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
## Read configuration settings and standard definitions
24-
TOP = $(shell pwd)/..
24+
TOP = $(R_PACKAGE_SOURCE)
2525
include $(TOP)/config.mk
2626

2727
## The following targets are available:
@@ -67,7 +67,7 @@ HDRS = globals.h cwb-globals.h ui-helpers.c \
6767
corpus.h attributes.h makecomps.h \
6868
$(PARSEH) \
6969
bitio.h \
70-
endian.h \
70+
endian2.h \
7171
compression.h \
7272
$(MMAPH)
7373

@@ -103,49 +103,20 @@ EXTRA_OBJS = dl_stub.o
103103

104104
all: libcl.a $(EXTRA_OBJS)
105105

106-
registry.tab.c registry.tab.h: registry.y corpus.h attributes.h globals.h cl.h
107-
@$(ECHO) " .... compile registry parser from Bison grammar"
108-
$(YACC) -p creg -v registry.y
109-
# NB: see comments in registry.y on use of "-p creg".
110-
111-
lex.creg.c: registry.l registry.y registry.tab.h corpus.h attributes.h globals.h cl.h
112-
@$(ECHO) " .... compile registry lexer from Flex grammar"
113-
$(LEX) registry.l
114-
115106
libcl.a: $(OBJS)
116-
@$(ECHO) " .... generate static library file for CL"
117107
$(RM) $@
118-
$(AR) $@ $^
119-
$(RANLIB) $@
108+
$(AR) cq $@ $^
120109

121110
install: libcl.a
122111
ifndef __MINGW__
123-
@$(ECHO) " .... install the CL static library file"
124112
if [ ! -d "$(LIBINSTDIR)" ]; then $(INSTALL) $(INST_FLAGS_DIR) "$(LIBINSTDIR)" ; fi;
125113
$(INSTALL) $(INST_FLAGS_DATA) libcl.a "$(LIBINSTDIR)"
126-
@$(ECHO) " .... install cwb/cl.h header file"
127114
if [ ! -d "$(REALINCINSTDIR)" ]; then $(INSTALL) $(INST_FLAGS_DIR) "$(REALINCINSTDIR)" ; fi;
128115
$(INSTALL) $(INST_FLAGS_DATA) cl.h "$(REALINCINSTDIR)"
129116
else
130-
@$(ECHO) "ERROR: install operation is not supported for Windows binaries!"
131117
endif
132118

133-
release: libcl.a
134-
@$(ECHO) " .... add to release: libcl static library file"
135-
if [ ! -d "$(RELEASE_DIR)/lib" ]; then $(INSTALL) $(INST_FLAGS_DIR) "$(RELEASE_DIR)/lib"; fi;
136-
$(INSTALL) $(INST_FLAGS_DATA) libcl.a "$(RELEASE_DIR)/lib"
137-
@$(ECHO) " .... add to release: cwb/cl.h header file"
138-
if [ ! -d "$(RELEASE_DIR)/include/cwb" ]; then $(INSTALL) $(INST_FLAGS_DIR) "$(RELEASE_DIR)/include/cwb"; fi;
139-
$(INSTALL) $(INST_FLAGS_DATA) cl.h "$(RELEASE_DIR)/include/cwb"
140-
141-
142-
uninstall:
143-
@$(ECHO) "ERROR: uninstall operation is currently not supported!"
144-
# $(RM) $(LIBINSTDIR)/libcl.a
145-
# (cd $(REALINCINSTDIR); $(RM) cl.h)
146-
147119
depend:
148-
@$(ECHO) " .... generate the CL's make dependencies"
149120
-$(RM) depend.mk
150121
$(MAKE) depend.mk
151122

@@ -155,16 +126,13 @@ depend.mk: $(PARSEH) $(PARSES) $(SRCS)
155126
$(DEPEND) $(DEPEND_CFLAGS_ALL) $(SRCS) > depend.mk
156127

157128
clean:
158-
@$(ECHO) " .... cleanup compiled CL library code"
159129
-$(RM) *.o libcl.a registry.output *~
160130

161131
realclean: clean
162-
@$(ECHO) " .... cleanup CL registry parser's automatic files"
163132
-$(RM) registry.tab.c registry.tab.c lex.creg.c registry.tab.h
164133
-$(RM) depend.mk
165134

166135
size: $(SRCS) $(HDRS)
167-
@$(ECHO) " .... count up lines of code in CL"
168136
# I am not sure if the following line will work to make these print even with .SILENT turned on ...
169137
@$(ECHO) `$(WC) $(SRCS) $(HDRS)`
170138
$(WC) $(SRCS) $(HDRS)

src/cwb/cl/attributes.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
* WWW at http://www.gnu.org/copyleft/gpl.html).
1616
*/
1717

18+
void Rprintf(const char *, ...);
19+
1820
#include <ctype.h>
1921
#include <sys/types.h>
2022

src/cwb/cl/bitfields.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ static int BaseTypeSize = sizeof(BFBaseType);
3030
* Size of the actual field of a Bitfield (in bits).
3131
*/
3232
static int BaseTypeBits = sizeof(BFBaseType) * CHAR_BIT;
33+
void Rprintf(const char *, ...);
3334

3435

3536
/**

src/cwb/cl/bitio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* WWW at http://www.gnu.org/copyleft/gpl.html).
1616
*/
1717

18+
void Rprintf(const char *, ...);
1819
#include <sys/types.h>
1920

2021
#include "globals.h"

src/cwb/cl/cdaccess.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "special-chars.h"
2929
#include "bitio.h"
3030
#include "compression.h"
31+
void Rprintf(const char *, ...);
3132

3233
/**
3334
* If COMPRESS_DEBUG is set to a positive integer, cl_cpos2id() will
@@ -2497,7 +2498,7 @@ cl_dynamic_call(Attribute *attribute,
24972498
break;
24982499

24992500
case ATTAT_STRING: /* copy output */
2500-
fgets(call, CL_MAX_LINE_LENGTH, pipe);
2501+
if (fgets(call, CL_MAX_LINE_LENGTH, pipe) == NULL) Rprintf("fgets failure");
25012502
dcr->value.charres = (char *)cl_strdup(call);
25022503
break;
25032504

0 commit comments

Comments
 (0)