Skip to content

Commit

Permalink
Reorganizando la exportacion de las funciones del parser del tipo de …
Browse files Browse the repository at this point in the history
…archivo qgames
  • Loading branch information
silvioq committed Jul 28, 2010
1 parent f554268 commit 7e1d518
Show file tree
Hide file tree
Showing 14 changed files with 273 additions and 202 deletions.
8 changes: 4 additions & 4 deletions bin/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ bin_PROGRAMS = qgames-ncurses qgames-console

qgames_ncurses_SOURCES = qgames-ncurses.c
qgames_ncurses_LDFLAGS = -lmenu @CURSES_LIBS@ @GD_LIBS@ @PNG_LIBS@
qgames_ncurses_DEPENDENCIES = $(DEPENDENCIES)
qgames_ncurses_LDADD = $(DEPENDENCIES)
qgames_ncurses_DEPENDENCIES = $(DEPENDENCIES) $(top_builddir)/parser/libpgn-parser.a
qgames_ncurses_LDADD = $(DEPENDENCIES) $(top_builddir)/parser/libpgn-parser.a

qgames_console_SOURCES = qgames-console.c
qgames_console_LDFLAGS = @GD_LIBS@ @PNG_LIBS@
qgames_console_DEPENDENCIES = $(DEPENDENCIES)
qgames_console_LDADD = $(DEPENDENCIES)
qgames_console_DEPENDENCIES = $(DEPENDENCIES) $(top_builddir)/parser/libpgn-parser.a
qgames_console_LDADD = $(DEPENDENCIES) $(top_builddir)/parser/libpgn-parser.a

AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/common -I$(top_srcdir)/vm

Expand Down
8 changes: 4 additions & 4 deletions bin/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -196,12 +196,12 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
qgames_ncurses_SOURCES = qgames-ncurses.c
qgames_ncurses_LDFLAGS = -lmenu @CURSES_LIBS@ @GD_LIBS@ @PNG_LIBS@
qgames_ncurses_DEPENDENCIES = $(DEPENDENCIES)
qgames_ncurses_LDADD = $(DEPENDENCIES)
qgames_ncurses_DEPENDENCIES = $(DEPENDENCIES) $(top_builddir)/parser/libpgn-parser.a
qgames_ncurses_LDADD = $(DEPENDENCIES) $(top_builddir)/parser/libpgn-parser.a
qgames_console_SOURCES = qgames-console.c
qgames_console_LDFLAGS = @GD_LIBS@ @PNG_LIBS@
qgames_console_DEPENDENCIES = $(DEPENDENCIES)
qgames_console_LDADD = $(DEPENDENCIES)
qgames_console_DEPENDENCIES = $(DEPENDENCIES) $(top_builddir)/parser/libpgn-parser.a
qgames_console_LDADD = $(DEPENDENCIES) $(top_builddir)/parser/libpgn-parser.a
AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/common -I$(top_srcdir)/vm
all: all-am

Expand Down
2 changes: 1 addition & 1 deletion bin/qgames-console.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ int main(int argc, char** argv) {
if( interactivo ) usage(argv[0]);
ret = pgnscan_file( stdin );
if( !ret ){
ret = qgz_parse( stdin, "-", flags );
ret = qgz_parse_file( stdin, flags );
} else {
par = check_game( "-", flags );
if( par ) ret = 1; else ret = 0;
Expand Down
2 changes: 1 addition & 1 deletion bin/qgames-ncurses.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ int main(int argc, char** argv) {
par = check_game( "-", flags );
if( par ) ret = 1; else ret = 0;
} else {
ret = qgz_parse( stdin, "-", flags );
ret = qgz_parse_file( stdin, flags );
}
} else {
char* filename = argv[optind];
Expand Down
2 changes: 1 addition & 1 deletion lib/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ lib_LTLIBRARIES = libqgames.la
libqgames_la_SOURCES = ../common/list.c ../common/list.h \
../common/md5.c ../common/md5.h \
../common/log.c ../common/log.h \
qgames.c
qgames.c qgames_analyzer.c

# libqgames_la_SOURCES = libqgames-core.a $(top_builddir)/parser/libpgn-parser.a

Expand Down
6 changes: 4 additions & 2 deletions lib/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ libqgames_la_DEPENDENCIES = $(top_builddir)/parser/libpgn-parser.a \
$(top_builddir)/parser/libqgames-parser.a \
$(top_builddir)/src/libqgames-core.a \
$(top_builddir)/vm/libqcode.a
am_libqgames_la_OBJECTS = list.lo md5.lo log.lo qgames.lo
am_libqgames_la_OBJECTS = list.lo md5.lo log.lo qgames.lo \
qgames_analyzer.lo
libqgames_la_OBJECTS = $(am_libqgames_la_OBJECTS)
libqgames_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
Expand Down Expand Up @@ -201,7 +202,7 @@ lib_LTLIBRARIES = libqgames.la
libqgames_la_SOURCES = ../common/list.c ../common/list.h \
../common/md5.c ../common/md5.h \
../common/log.c ../common/log.h \
qgames.c
qgames.c qgames_analyzer.c


# libqgames_la_SOURCES = libqgames-core.a $(top_builddir)/parser/libpgn-parser.a
Expand Down Expand Up @@ -289,6 +290,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/md5.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgames.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgames_analyzer.Plo@am__quote@

.c.o:
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
Expand Down
22 changes: 22 additions & 0 deletions lib/qgames.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
/****************************************************************************
* Copyright (c) 2009-2010 Silvio Quadri *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************/

#include <stdlib.h>
#include <stdio.h>
Expand Down
43 changes: 43 additions & 0 deletions lib/qgames_analyzer.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/****************************************************************************
* Copyright (c) 2009-2010 Silvio Quadri *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
* "Software"), to deal in the Software without restriction, including *
* without limitation the rights to use, copy, modify, merge, publish, *
* distribute, distribute with modifications, sublicense, and/or sell *
* copies of the Software, and to permit persons to whom the Software is *
* furnished to do so, subject to the following conditions: *
* *
* The above copyright notice and this permission notice shall be included *
* in all copies or substantial portions of the Software. *
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
* IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
* DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
* THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************/

#include <stdio.h>
#include <qgames.h>
#include <qgames_analyzer.h>

#include "config.h"
#include "qgames_core.h"

Tipojuego* parser_qgames_filename( char* filename, int flags );
Tipojuego* parser_qgames_file ( FILE* file, int flags );
Tipojuego* parser_qgames_string ( char* string, int flags );

DLL_PUBLIC Tipojuego* qgz_parse_filename( char* filename, int flags ){
return parser_qgames_filename( filename, flags );
}
DLL_PUBLIC Tipojuego* qgz_parse_file ( FILE* file, int flags ){
return parser_qgames_file( file, flags );
}
DLL_PUBLIC Tipojuego* qgz_parse_string ( char* string, int flags ){
return parser_qgames_string( string, flags );
}
5 changes: 4 additions & 1 deletion parser/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ libpgn_parser_a_SOURCES = pgn_scanner.l pgn_scanner.h

AM_YFLAGS = -d -v -p qgz
AM_LFLAGS = --prefix qgz -o lex.yy.c
AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/common -I$(top_srcdir)/vm -fPIC
AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/common -I$(top_srcdir)/vm \
-fPIC \
$(CFLAG_VISIBILITY)


libpgn_parser_a_LFLAGS = --prefix pgn -o lex.yy.c

Expand Down
5 changes: 4 additions & 1 deletion parser/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,10 @@ libqgames_parser_a_SOURCES = qgames_parser.y qgames_parser.h qgames_scanner.l sy
libpgn_parser_a_SOURCES = pgn_scanner.l pgn_scanner.h
AM_YFLAGS = -d -v -p qgz
AM_LFLAGS = --prefix qgz -o lex.yy.c
AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/common -I$(top_srcdir)/vm -fPIC
AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/common -I$(top_srcdir)/vm \
-fPIC \
$(CFLAG_VISIBILITY)

libpgn_parser_a_LFLAGS = --prefix pgn -o lex.yy.c
test_pgn_SOURCES = test-pgn.c
test_pgn_DEPENDENCIES = $(srcdir)/libpgn-parser.a
Expand Down
Loading

0 comments on commit 7e1d518

Please sign in to comment.