Renamed a few files for consistency

This commit is contained in:
Pierre Pronchery 2012-05-15 03:17:39 +00:00
parent 98a0b29062
commit 23281ed069
15 changed files with 118 additions and 43 deletions

View File

@ -33,12 +33,12 @@ dist:
$(PACKAGE)-$(VERSION)/doc/gtkdoc/tmpl/c99.sgml \
$(PACKAGE)-$(VERSION)/doc/gtkdoc/tmpl/target.sgml \
$(PACKAGE)-$(VERSION)/doc/gtkdoc/tmpl/project.conf \
$(PACKAGE)-$(VERSION)/include/c99.h \
$(PACKAGE)-$(VERSION)/include/C99.h \
$(PACKAGE)-$(VERSION)/include/Makefile \
$(PACKAGE)-$(VERSION)/include/project.conf \
$(PACKAGE)-$(VERSION)/include/c99/target.h \
$(PACKAGE)-$(VERSION)/include/c99/Makefile \
$(PACKAGE)-$(VERSION)/include/c99/project.conf \
$(PACKAGE)-$(VERSION)/include/C99/target.h \
$(PACKAGE)-$(VERSION)/include/C99/Makefile \
$(PACKAGE)-$(VERSION)/include/C99/project.conf \
$(PACKAGE)-$(VERSION)/src/c99.c \
$(PACKAGE)-$(VERSION)/src/code.c \
$(PACKAGE)-$(VERSION)/src/main.c \

75
include/C99.h Normal file
View File

@ -0,0 +1,75 @@
/* $Id$ */
/* Copyright (c) 2012 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS Devel c99 */
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
#ifndef C99_C99_H
# define C99_C99_H
# include <sys/types.h>
/* C99 */
/* private */
/* types */
typedef struct _C99 C99;
/* public */
/* types */
typedef struct _C99Helper
{
struct _C99 * c99;
int (*define_add)(C99 * c99, char const * name, char const * value);
} C99Helper;
typedef struct _C99Option
{
char const * name;
char const * value;
} C99Option;
typedef struct _C99Prefs
{
int flags;
char const * outfile;
const char ** paths;
size_t paths_cnt;
char ** defines;
size_t defines_cnt;
const char ** undefines;
size_t undefines_cnt;
int optlevel;
int warn;
char const * target;
C99Option * options;
size_t options_cnt;
} C99Prefs;
# define C99PREFS_c 0x1
# define C99PREFS_E 0x2
# define C99PREFS_g 0x4
# define C99PREFS_s 0x8
/* functions */
C99 * c99_new(C99Prefs const * prefs, char const * pathname);
int c99_delete(C99 * c99);
/* useful */
int c99_define_add(C99 * c99, char const * name, char const * value);
int c99_parse(C99 * c99);
#endif /* !C99_C99_H */

View File

@ -1,4 +1,4 @@
SUBDIRS = c99
SUBDIRS = C99
PREFIX = /usr/local
DESTDIR =
RM ?= rm -f
@ -22,10 +22,10 @@ distclean:
install:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) install) || exit; done
$(MKDIR) $(DESTDIR)$(INCLUDEDIR)
$(INSTALL) -m 0644 -- c99.h $(DESTDIR)$(INCLUDEDIR)/c99.h
$(INSTALL) -m 0644 -- C99.h $(DESTDIR)$(INCLUDEDIR)/C99.h
uninstall:
@for i in $(SUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit; done
$(RM) -- $(DESTDIR)$(INCLUDEDIR)/c99.h
$(RM) -- $(DESTDIR)$(INCLUDEDIR)/C99.h
.PHONY: all subdirs clean distclean install uninstall

View File

@ -1,3 +1,3 @@
subdirs=c99
subdirs=C99
dist=Makefile
includes=c99.h
includes=C99.h

View File

@ -28,19 +28,19 @@ c99_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
c99: $(c99_OBJS)
$(CC) -o c99 $(c99_OBJS) $(c99_LDFLAGS)
c99.o: c99.c common.h code.h parser.h ../include/c99.h
c99.o: c99.c common.h code.h parser.h ../include/C99.h
$(CC) $(c99_CFLAGS) -c c99.c
code.o: code.c ../include/c99/target.h code.h ../config.h
code.o: code.c ../include/C99/target.h code.h ../config.h
$(CC) $(c99_CFLAGS) -c code.c
main.o: main.c ../include/c99.h ../config.h
main.o: main.c ../include/C99.h ../config.h
$(CC) $(c99_CFLAGS) -c main.c
parser.o: parser.c common.h code.h tokenset.h scanner.h ../include/c99.h ../config.h
parser.o: parser.c common.h code.h tokenset.h scanner.h ../include/C99.h ../config.h
$(CC) $(c99_CFLAGS) -c parser.c
scanner.o: scanner.c ../include/c99.h ../config.h
scanner.o: scanner.c ../include/C99.h ../config.h
$(CC) $(c99_CFLAGS) -c scanner.c
tokenset.o: tokenset.c common.h code.h tokenset.h

View File

@ -23,7 +23,7 @@
#endif
#include <string.h>
#include <errno.h>
#include "c99/target.h"
#include "C99/target.h"
#include "code.h"
#include "../config.h"

View File

@ -14,19 +14,19 @@ sources=c99.c,code.c,main.c,parser.c,scanner.c,tokenset.c
install=$(BINDIR)
[c99.c]
depends=common.h,code.h,parser.h,../include/c99.h
depends=common.h,code.h,parser.h,../include/C99.h
[code.c]
depends=../include/c99/target.h,code.h,../config.h
depends=../include/C99/target.h,code.h,../config.h
[main.c]
depends=../include/c99.h,../config.h
depends=../include/C99.h,../config.h
[parser.c]
depends=common.h,code.h,tokenset.h,scanner.h,../include/c99.h,../config.h
depends=common.h,code.h,tokenset.h,scanner.h,../include/C99.h,../config.h
[scanner.c]
depends=../include/c99.h,../config.h
depends=../include/C99.h,../config.h
[tokenset.c]
depends=common.h,code.h,tokenset.h

View File

@ -40,13 +40,13 @@ indent_LDFLAGS = $(LDFLAGSF) $(LDFLAGS)
indent.so: $(indent_OBJS)
$(CCSHARED) -o indent.so $(indent_OBJS) $(indent_LDFLAGS)
asm.o: asm.c ../../include/c99/target.h ../../config.h
asm.o: asm.c ../../include/C99/target.h ../../config.h
$(CC) $(asm_CFLAGS) -c asm.c
graph.o: graph.c ../../include/c99/target.h
graph.o: graph.c ../../include/C99/target.h
$(CC) $(graph_CFLAGS) -c graph.c
indent.o: indent.c ../../include/c99/target.h
indent.o: indent.c ../../include/C99/target.h
$(CC) $(indent_CFLAGS) -c indent.c
clean:
@ -56,16 +56,16 @@ distclean: clean
$(RM) -- $(TARGETS)
install: $(TARGETS)
$(MKDIR) $(DESTDIR)$(LIBDIR)/c99/target
$(INSTALL) -m 0644 -- asm.so $(DESTDIR)$(LIBDIR)/c99/target/asm.so
$(MKDIR) $(DESTDIR)$(LIBDIR)/c99/target
$(INSTALL) -m 0644 -- graph.so $(DESTDIR)$(LIBDIR)/c99/target/graph.so
$(MKDIR) $(DESTDIR)$(LIBDIR)/c99/target
$(INSTALL) -m 0644 -- indent.so $(DESTDIR)$(LIBDIR)/c99/target/indent.so
$(MKDIR) $(DESTDIR)$(LIBDIR)/C99/target
$(INSTALL) -m 0644 -- asm.so $(DESTDIR)$(LIBDIR)/C99/target/asm.so
$(MKDIR) $(DESTDIR)$(LIBDIR)/C99/target
$(INSTALL) -m 0644 -- graph.so $(DESTDIR)$(LIBDIR)/C99/target/graph.so
$(MKDIR) $(DESTDIR)$(LIBDIR)/C99/target
$(INSTALL) -m 0644 -- indent.so $(DESTDIR)$(LIBDIR)/C99/target/indent.so
uninstall:
$(RM) -- $(DESTDIR)$(LIBDIR)/c99/target/asm.so
$(RM) -- $(DESTDIR)$(LIBDIR)/c99/target/graph.so
$(RM) -- $(DESTDIR)$(LIBDIR)/c99/target/indent.so
$(RM) -- $(DESTDIR)$(LIBDIR)/C99/target/asm.so
$(RM) -- $(DESTDIR)$(LIBDIR)/C99/target/graph.so
$(RM) -- $(DESTDIR)$(LIBDIR)/C99/target/indent.so
.PHONY: all clean distclean install uninstall

View File

@ -20,7 +20,7 @@
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "c99/target.h"
#include "C99/target.h"
#ifdef DEBUG
# include "../../config.h"
#endif

View File

@ -19,7 +19,7 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "c99/target.h"
#include "C99/target.h"
/* graph */
@ -89,7 +89,7 @@ static int _graph_exit(void)
ret |= error_set_code(1, "%s: %s", _filename, strerror(errno));
free(_filename);
free(_function);
return 0;
return ret;
}
@ -103,7 +103,7 @@ static int _graph_function_begin(char const * name)
#endif
free(_function);
if((_function = strdup(name)) == NULL)
ret = error_set_code(1, "%s", strerror(errno));
ret |= error_set_code(1, "%s", strerror(errno));
return ret;
}

View File

@ -20,7 +20,7 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "c99/target.h"
#include "C99/target.h"
#include "../common.h"
#define max(a, b) ((a) > (b) ? (a) : (b))

View File

@ -11,23 +11,23 @@ type=plugin
sources=asm.c
cflags=`pkg-config --cflags asm`
ldflags=`pkg-config --libs asm`
install=$(LIBDIR)/c99/target
install=$(LIBDIR)/C99/target
[asm.c]
depends=../../include/c99/target.h,../../config.h
depends=../../include/C99/target.h,../../config.h
[graph]
type=plugin
sources=graph.c
install=$(LIBDIR)/c99/target
install=$(LIBDIR)/C99/target
[graph.c]
depends=../../include/c99/target.h
depends=../../include/C99/target.h
[indent]
type=plugin
sources=indent.c
install=$(LIBDIR)/c99/target
install=$(LIBDIR)/C99/target
[indent.c]
depends=../../include/c99/target.h
depends=../../include/C99/target.h