Author: petdance
Date: Wed Jun 6 17:34:03 2007
New Revision: 18851
Modified:
trunk/config/gen/makefiles/root.in
trunk/include/parrot/datatypes.h
trunk/include/parrot/intlist.h
trunk/src/datatypes.c
trunk/src/intlist.c
trunk/src/pmc/pmcproxy.pmc
trunk/tools/build/headerize.pl
Log:
intlist.c and datatypes.c are now headerized
Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in (original)
+++ trunk/config/gen/makefiles/root.in Wed Jun 6 17:34:03 2007
@@ -1812,6 +1812,11 @@
tags.dummy:
+# This target will eventually create all the headers automatically.
+# If you are having problems with linkage in Win32 (or elsewhere), because
something
+# is not PARROT_API, but should be, then put PARROT_API in the C file and
+# run "make hwork". The .h file will get updated.
+
HEADERIZER_O_FILES = \
$(INTERP_O_FILES) \
$(CHARSET_O_FILES) \
@@ -1819,30 +1824,25 @@
$(CLASS_O_FILES) \
$(ENCODING_O_FILES)
-# This target will eventually create all the headers automatically.
-# If you are having problems with linkage in Win32 (or elsewhere), because
something
-# is not PARROT_API, but should be, then put PARROT_API in the C file and
-# run "make hwork". The .h file will get updated.
+# Slowing working my way up to having everything headerized in
$(HEADERIZER_O_FILES)
+HEADERIZER_O_FILES = \
+ src/string.o \
+ src/string_primitives.o \
+ src/pic.o \
+ src/stacks.o \
+ src/stack_common.o \
+ src/mmd.o \
+ src/objects.o \
+ src/key.o \
+ src/hash.o \
+ src/pmc.o \
+ src/list.o \
+ src/intlist.o \
+ src/datatypes.o \
headerizer:
$(PERL) $(BUILD_TOOLS_DIR)/headerize.pl $(HEADERIZER_O_FILES)
-# Slowing working my way up to having everything headerized in
$(HEADERIZER_O_FILES)
-hwork:
- $(PERL) $(BUILD_TOOLS_DIR)/headerize.pl \
- src/string.o \
- src/string_primitives.o \
- src/pic.o \
- src/stacks.o \
- src/stack_common.o \
- src/mmd.o \
- src/objects.o \
- src/key.o \
- src/hash.o \
- src/pmc.o \
- src/list.o \
-
-
###############################################################################
#
# smoke:
Modified: trunk/include/parrot/datatypes.h
==============================================================================
--- trunk/include/parrot/datatypes.h (original)
+++ trunk/include/parrot/datatypes.h Wed Jun 6 17:34:03 2007
@@ -126,9 +126,14 @@
extern const struct _data_types data_types[];
#endif
+/* HEADERIZER BEGIN: src/datatypes.c */
-PARROT_API INTVAL Parrot_get_datatype_enum(Parrot_Interp, const STRING *);
-PARROT_API STRING * Parrot_get_datatype_name(Parrot_Interp, INTVAL );
+PARROT_API INTVAL Parrot_get_datatype_enum( Interp *interp,
+ const STRING *typename /*NN*/ )
+ __attribute__nonnull__(2);
+
+PARROT_API STRING * Parrot_get_datatype_name( Interp *interp, INTVAL type );
+/* HEADERIZER END: src/datatypes.c */
#endif /* PARROT_DATATYPES_H_GUARD */
Modified: trunk/include/parrot/intlist.h
==============================================================================
--- trunk/include/parrot/intlist.h (original)
+++ trunk/include/parrot/intlist.h Wed Jun 6 17:34:03 2007
@@ -1,5 +1,5 @@
/* stacks.h
- * Copyright (C) 2001-2003, The Perl Foundation.
+ * Copyright (C) 2001-2007, The Perl Foundation.
* SVN Info
* $Id$
* Overview:
@@ -38,28 +38,36 @@
typedef IntList_Chunk IntList;
-void intlist_mark(Interp *, IntList*);
+/* HEADERIZER BEGIN: src/intlist.c */
-IntList *intlist_clone(Interp *i, IntList *list);
+void intlist_assign( Interp *i, IntList *l /*NN*/, INTVAL idx, INTVAL val )
+ __attribute__nonnull__(2);
-IntList *intlist_new(Interp *);
+IntList * intlist_clone( Interp *i, IntList *list );
+void intlist_dump( FILE *fp, IntList *list /*NN*/, int verbose )
+ __attribute__nonnull__(2);
-INTVAL intlist_length(Interp *interp, IntList* list);
+INTVAL intlist_get( Interp *i, IntList *l /*NN*/, INTVAL idx )
+ __attribute__nonnull__(2);
-void intlist_assign(Interp *, IntList*, INTVAL idx, INTVAL val);
+INTVAL intlist_length( Interp *interp, IntList *list /*NN*/ )
+ __attribute__nonnull__(2);
-void intlist_push(Interp *, IntList*, INTVAL);
+void intlist_mark( Interp *i, IntList *l );
+IntList * intlist_new( Interp *i );
+INTVAL intlist_pop( Interp *i, IntList *l /*NN*/ )
+ __attribute__nonnull__(2);
-INTVAL intlist_pop(Interp*, IntList*);
+void intlist_push( Interp *i, IntList *l /*NN*/, INTVAL val )
+ __attribute__nonnull__(2);
-void intlist_unshift(Interp*, IntList**, INTVAL);
+INTVAL intlist_shift( Interp *i, IntList **l /*NN*/ )
+ __attribute__nonnull__(2);
-INTVAL intlist_shift(Interp *, IntList**);
+void intlist_unshift( Interp *i, IntList **l /*NN*/, INTVAL val )
+ __attribute__nonnull__(2);
-INTVAL intlist_get(Interp*, IntList*, INTVAL idx);
-
-/* Debugging use only */
-void intlist_dump(FILE* fp, IntList* list, int verbose);
+/* HEADERIZER END: src/intlist.c */
#endif /* PARROT_INTLIST_H_GUARD */
Modified: trunk/src/datatypes.c
==============================================================================
--- trunk/src/datatypes.c (original)
+++ trunk/src/datatypes.c Wed Jun 6 17:34:03 2007
@@ -15,29 +15,24 @@
=head2 Functions
-=over 4
-
-=cut
-
*/
#include "parrot/parrot.h"
-/*
+/* HEADER: include/parrot/datatypes.h */
-=item C<INTVAL
-Parrot_get_datatype_enum(Interp *interp, STRING *typename)>
+/*
+FUNCDOC: Parrot_get_datatype_enum
Return datatype C<enum> for C<STRING*> typename.
-=cut
-
*/
+PARROT_API
INTVAL
-Parrot_get_datatype_enum(Interp *interp, const STRING *_typename /* NN */)
+Parrot_get_datatype_enum(Interp *interp, const STRING * const typename /*NN*/)
{
- char * const type = string_to_cstring(interp, _typename);
+ char * const type = string_to_cstring(interp, typename);
int i;
for (i = enum_first_type; i < enum_last_type; i++) {
@@ -54,36 +49,29 @@
/*
-=item C<STRING *
-Parrot_get_datatype_name(Interp *interp, INTVAL type)>
-
+FUNCDOC:
Return datatype name for C<type>.
-=cut
-
*/
+PARROT_API
STRING *
Parrot_get_datatype_name(Interp *interp, INTVAL type)
{
- const char *s;
- if (type < enum_first_type || type >= enum_last_type)
- s = "illegal";
- else
- s = data_types[type - enum_first_type].name;
+ const char * const s =
+ (type < enum_first_type || type >= enum_last_type)
+ ? "illegal"
+ : data_types[type - enum_first_type].name;
+
return string_make(interp, s, strlen(s), NULL, PObj_external_FLAG);
}
/*
-=back
-
=head1 SEE ALSO
F<include/parrot/datatypes.h>.
-=cut
-
*/
Modified: trunk/src/intlist.c
==============================================================================
--- trunk/src/intlist.c (original)
+++ trunk/src/intlist.c Wed Jun 6 17:34:03 2007
@@ -1,5 +1,5 @@
/*
-Copyright (C) 2001-2003, The Perl Foundation.
+Copyright (C) 2001-2007, The Perl Foundation.
$Id$
=head1 NAME
@@ -134,7 +134,9 @@
*/
-#include <parrot/parrot.h>
+#include "parrot/parrot.h"
+
+/* HEADER: include/parrot/intlist.h */
/*
@@ -199,7 +201,7 @@
*/
INTVAL
-intlist_length(Interp *interp, IntList *list)
+intlist_length(Interp *interp, IntList *list /*NN*/)
{
UNUSED(interp);
return ((List *)list)->length;
@@ -217,7 +219,7 @@
*/
void
-intlist_assign(Interp *i, IntList *l, INTVAL idx, INTVAL val)
+intlist_assign(Interp *i, IntList *l /*NN*/, INTVAL idx, INTVAL val)
{
list_assign(i, (List *)l, idx, INTVAL2PTR(void *, val), enum_type_INTVAL);
}
@@ -234,7 +236,7 @@
*/
void
-intlist_push(Interp *i, IntList *l, INTVAL val)
+intlist_push(Interp *i, IntList *l /*NN*/, INTVAL val)
{
list_push(i, (List *)l, INTVAL2PTR(void *, val), enum_type_INTVAL);
}
@@ -251,7 +253,7 @@
*/
void
-intlist_unshift(Interp *i, IntList **l, INTVAL val)
+intlist_unshift(Interp *i, IntList **l /*NN*/, INTVAL val)
{
list_unshift(i, (List *)*l, INTVAL2PTR(void *, val), enum_type_INTVAL);
}
@@ -268,10 +270,10 @@
*/
INTVAL
-intlist_pop(Interp *i, IntList *l)
+intlist_pop(Interp *i, IntList *l /*NN*/)
{
- void *ret = list_pop(i, (List *)l, enum_type_INTVAL);
- INTVAL retval = ret == (void *)-1 ? 0 : *(INTVAL *)ret;
+ void * const ret = list_pop(i, (List *)l, enum_type_INTVAL);
+ const INTVAL retval = ret == (void *)-1 ? 0 : *(INTVAL *)ret;
return retval;
}
@@ -287,10 +289,10 @@
*/
INTVAL
-intlist_shift(Interp *i, IntList **l)
+intlist_shift(Interp *i, IntList **l /*NN*/)
{
- void *ret = list_shift(i, (List *)*l, enum_type_INTVAL);
- INTVAL retval = ret == (void *)-1 ? 0 : *(INTVAL *)ret;
+ void * const ret = list_shift(i, (List *)*l, enum_type_INTVAL);
+ const INTVAL retval = ret == (void *)-1 ? 0 : *(INTVAL *)ret;
return retval;
}
@@ -306,10 +308,10 @@
*/
INTVAL
-intlist_get(Interp *i, IntList *l, INTVAL idx)
+intlist_get(Interp *i, IntList *l /*NN*/, INTVAL idx)
{
- void *ret = list_get(i, (List *)l, idx, enum_type_INTVAL);
- INTVAL retval = ret == (void *)-1 ? 0 : *(INTVAL *)ret;
+ void * const ret = list_get(i, (List *)l, idx, enum_type_INTVAL);
+ const INTVAL retval = ret == (void *)-1 ? 0 : *(INTVAL *)ret;
return retval;
}
@@ -325,7 +327,7 @@
*/
void
-intlist_dump(FILE *fp, IntList *list, int verbose)
+intlist_dump(FILE *fp, IntList *list /*NN*/, int verbose)
{
#ifdef LIST_DEBUG
list_dump(fp, (List *)list, verbose);
Modified: trunk/src/pmc/pmcproxy.pmc
==============================================================================
--- trunk/src/pmc/pmcproxy.pmc (original)
+++ trunk/src/pmc/pmcproxy.pmc Wed Jun 6 17:34:03 2007
@@ -105,7 +105,7 @@
/* We put ourself on the all parents list. */
VTABLE_push_pmc(interp, _pmc->all_parents, SELF);
-
+
PMC_data(SELF) = _pmc;
}
Modified: trunk/tools/build/headerize.pl
==============================================================================
--- trunk/tools/build/headerize.pl (original)
+++ trunk/tools/build/headerize.pl Wed Jun 6 17:34:03 2007
@@ -247,7 +247,7 @@
my $source = do { local $/; <$fh> };
close $fh;
- print "\n=== $cfile ===\n";
+ print "=== $cfile ===\n";
die "can't find HEADER directive in '$cfile'"
unless $source =~ m#/\*\s+HEADER:\s+([^*]+?)\s+\*/#s;