Renamed TargetPlugin to C99TargetPlugin

This commit is contained in:
Pierre Pronchery 2012-05-15 03:29:34 +00:00
parent 23281ed069
commit 656f6582e7
17 changed files with 111 additions and 79 deletions

View File

@ -36,6 +36,7 @@ dist:
$(PACKAGE)-$(VERSION)/include/C99.h \
$(PACKAGE)-$(VERSION)/include/Makefile \
$(PACKAGE)-$(VERSION)/include/project.conf \
$(PACKAGE)-$(VERSION)/include/C99/c99.h \
$(PACKAGE)-$(VERSION)/include/C99/target.h \
$(PACKAGE)-$(VERSION)/include/C99/Makefile \
$(PACKAGE)-$(VERSION)/include/C99/project.conf \

View File

@ -15,61 +15,10 @@
#ifndef C99_C99_H
# define C99_C99_H
#ifndef DEVEL_C99_H
# define DEVEL_C99_H
# include <sys/types.h>
# include "C99/c99.h"
# include "C99/target.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 */
#endif /* !DEVEL_C99_H */

View File

@ -14,10 +14,13 @@ clean:
distclean: clean
install:
$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/c99
$(INSTALL) -m 0644 -- target.h $(DESTDIR)$(INCLUDEDIR)/c99/target.h
$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/C99
$(INSTALL) -m 0644 -- c99.h $(DESTDIR)$(INCLUDEDIR)/C99/c99.h
$(MKDIR) $(DESTDIR)$(INCLUDEDIR)/C99
$(INSTALL) -m 0644 -- target.h $(DESTDIR)$(INCLUDEDIR)/C99/target.h
uninstall:
$(RM) -- $(DESTDIR)$(INCLUDEDIR)/c99/target.h
$(RM) -- $(DESTDIR)$(INCLUDEDIR)/C99/c99.h
$(RM) -- $(DESTDIR)$(INCLUDEDIR)/C99/target.h
.PHONY: all clean distclean install uninstall

75
include/C99/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 DEVEL_C99_C99_H
# define DEVEL_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 /* !DEVEL_C99_C99_H */

View File

@ -1,5 +1,8 @@
includes=target.h
includes=c99.h,target.h
dist=Makefile
[c99.h]
install=$(INCLUDEDIR)/C99
[target.h]
install=$(INCLUDEDIR)/c99
install=$(INCLUDEDIR)/C99

View File

@ -1,5 +1,5 @@
/* $Id$ */
/* Copyright (c) 2011 Pierre Pronchery <khorben@defora.org> */
/* 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
@ -15,16 +15,17 @@
#ifndef _C99_TARGET_TARGET_H
# define _C99_TARGET_TARGET_H
#ifndef DEVEL_C99_TARGET_H
# define DEVEL_C99_TARGET_H
# include <cpp.h>
# include "c99.h"
/* Target */
/* C99Target */
/* public */
/* types */
typedef struct _TargetPlugin
typedef struct _C99TargetPlugin
{
C99Helper * helper;
C99Option * options;
@ -36,6 +37,6 @@ typedef struct _TargetPlugin
int (*function_call)(char const * name);
int (*function_end)(void);
int (*label_set)(char const * name);
} TargetPlugin;
} C99TargetPlugin;
#endif /* !_C99_TARGET_TARGET_H */
#endif /* !DEVEL_C99_TARGET_H */

View File

@ -23,7 +23,7 @@
#include "common.h"
#include "code.h"
#include "parser.h"
#include "c99.h"
#include "C99/c99.h"
/* private */

View File

@ -98,7 +98,7 @@ struct _Code
/* target */
C99Helper * helper;
Plugin * plugin;
TargetPlugin * target;
C99TargetPlugin * target;
/* types */
CodeType * types;
size_t types_cnt;

View File

@ -18,7 +18,7 @@
#ifndef _C99_CODE_H
# define _C99_CODE_H
# include "c99.h"
# include "C99/c99.h"
/* Code */

View File

@ -21,7 +21,7 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include "c99.h"
#include "C99/c99.h"
#include "../config.h"

View File

@ -27,7 +27,7 @@
#include "common.h"
#include "tokenset.h"
#include "scanner.h"
#include "c99.h"
#include "parser.h"
#include "../config.h"
#ifdef DEBUG

View File

@ -18,7 +18,7 @@
#ifndef C99_PARSER_H
# define C99_PARSER_H
# include "c99.h"
# include "C99/c99.h"
/* protected */

View File

@ -18,7 +18,7 @@
#include <string.h>
#include <ctype.h>
#include "common.h"
#include "c99.h"
#include "scanner.h"
#include "../config.h"

View File

@ -18,7 +18,7 @@
#ifndef C99_SCANNER_H
# define C99_SCANNER_H
# include "c99.h"
# include "C99/c99.h"
/* protected */

View File

@ -85,7 +85,7 @@ static int _asm_section(char const * name);
/* public */
/* variables */
TargetPlugin target_plugin =
C99TargetPlugin target_plugin =
{
NULL,
_asm_options,

View File

@ -41,7 +41,7 @@ static int _graph_function_end(void);
/* public */
/* variables */
TargetPlugin target_plugin =
C99TargetPlugin target_plugin =
{
NULL, /* helper */
NULL, /* options */

View File

@ -48,7 +48,7 @@ static int _indent_function_end(void);
/* public */
/* variables */
TargetPlugin target_plugin =
C99TargetPlugin target_plugin =
{
NULL, /* helper */
NULL, /* options */