[gthumb: 15/57] [webalbums] added a prefix to the flex and bison functions



commit 1533a4f3299822e0a808597485c3f1558943481e
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Wed Jun 9 21:44:36 2010 +0200

    [webalbums] added a  prefix to the flex and bison functions
    
    changed the default yy prefix to add gth_albumtheme_yy to avoid possible collisions with other lexers and parsers.

 extensions/webalbums/Makefile.am          |    7 +++----
 extensions/webalbums/albumtheme-private.h |    1 +
 extensions/webalbums/albumtheme.l         |    9 ++++-----
 extensions/webalbums/albumtheme.y         |   11 ++++++-----
 4 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/extensions/webalbums/Makefile.am b/extensions/webalbums/Makefile.am
index 2722833..843506a 100644
--- a/extensions/webalbums/Makefile.am
+++ b/extensions/webalbums/Makefile.am
@@ -17,13 +17,12 @@ libwebalbums_la_SOURCES = 		\
 	dlg-web-exporter.h		\
 	main.c
 
-albumtheme-lex.c: albumtheme.l 
-	$(AM_V_GEN)( $(FLEX) $< && mv $(LEX_OUTPUT_ROOT).c albumtheme-lex.c ) 
+albumtheme-lex.c: albumtheme.l
+	$(AM_V_GEN)( $(FLEX) -Pgth_albumtheme_yy -oalbumtheme-lex.c $< )
 	
 albumtheme.c: albumtheme.y albumtheme-lex.c
-	$(AM_V_GEN)( $(BISON) $< -o albumtheme.c ) 
-	
 libwebalbums_la_CFLAGS = $(GTHUMB_CFLAGS) -I$(top_srcdir) -I$(top_builddir)/gthumb 
+	$(AM_V_GEN)( $(BISON) $< -p gth_albumtheme_yy -o albumtheme.c )
 libwebalbums_la_LDFLAGS = $(EXTENSION_LIBTOOL_FLAGS)
 libwebalbums_la_LIBADD = $(GTHUMB_LIBS)
 libwebalbums_la_DEPENDENCIES = $(top_builddir)/gthumb/gthumb$(EXEEXT)
diff --git a/extensions/webalbums/albumtheme-private.h b/extensions/webalbums/albumtheme-private.h
index e5c1606..4d89b7d 100644
--- a/extensions/webalbums/albumtheme-private.h
+++ b/extensions/webalbums/albumtheme-private.h
@@ -216,6 +216,7 @@ void     gth_tag_free                (GthTag       *tag);
 
 /* Utils */
 
+int      gth_albumtheme_yyparse      (void);
 void     gth_parsed_doc_free         (GList *parsed_doc);
 
 #endif /* ALBUMTHEME_PRIVATE_H */
diff --git a/extensions/webalbums/albumtheme.l b/extensions/webalbums/albumtheme.l
index 7127eb7..3bd219d 100644
--- a/extensions/webalbums/albumtheme.l
+++ b/extensions/webalbums/albumtheme.l
@@ -25,10 +25,10 @@
 GFileInputStream *yy_istream;
 
 #undef YY_INPUT
-#define YY_INPUT(buf,result,max_size)                                      	                  \
-{                                                                          	                  \
-	gssize n = g_input_stream_read (G_INPUT_STREAM(yy_istream), buf, max_size, NULL, NULL);   \
-	result = (n <= 0 ? YY_NULL : n);                                                          \
+#define YY_INPUT(buf,result,max_size)									\
+{													\
+	gssize n = g_input_stream_read (G_INPUT_STREAM (yy_istream), buf, max_size, NULL, NULL);	\
+	result = (n <= 0 ? YY_NULL : n);								\
 }
 
 %}
@@ -344,4 +344,3 @@ string           ([^'\n]|\\')*
 				}
 
 %%
-
diff --git a/extensions/webalbums/albumtheme.y b/extensions/webalbums/albumtheme.y
index 70d2053..243e60d 100644
--- a/extensions/webalbums/albumtheme.y
+++ b/extensions/webalbums/albumtheme.y
@@ -25,9 +25,9 @@
 #include <gio/gio.h>
 #include "albumtheme-private.h"
 
-void  yyerror (char *fmt, ...);
-int   yywrap  (void);
-int   yylex   (void);
+int   gth_albumtheme_yylex ();
+void  gth_albumtheme_yyerror (char *fmt, ...);
+int   gth_albumtheme_yywrap  (void);
 
 #define YY_NO_UNPUT
 
@@ -452,13 +452,14 @@ arg		: NAME '=' expr {
 %%
 
 int
-yywrap (void)
+gth_albumtheme_yywrap (void)
 {
 	return 1;
 }
 
 
-void yyerror (char *fmt, ...)
+void
+gth_albumtheme_yyerror (char *fmt, ...)
 {
 	va_list ap;
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]