Author: petdance
Date: Sat Jun 9 12:57:25 2007
New Revision: 18891
Modified:
trunk/config/gen/makefiles/root.in
trunk/include/parrot/hash.h
trunk/include/parrot/headers.h
trunk/include/parrot/memory.h
trunk/include/parrot/misc.h
trunk/include/parrot/mmd.h
trunk/include/parrot/objects.h
trunk/include/parrot/pic.h
trunk/include/parrot/pmc.h
trunk/include/parrot/register.h
trunk/include/parrot/smallobject.h
trunk/include/parrot/stacks.h
trunk/include/parrot/string_funcs.h
trunk/tools/build/headerize.pl
Log:
Headerizer now sorts the PARROT_API funcs to the top
Modified: trunk/config/gen/makefiles/root.in
==============================================================================
--- trunk/config/gen/makefiles/root.in (original)
+++ trunk/config/gen/makefiles/root.in Sat Jun 9 12:57:25 2007
@@ -1828,25 +1828,25 @@
# 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/datatypes.o \
+ src/gc/memory.o \
+ src/gc/register.o \
+ src/gc/resources.o \
+ src/gc/smallobject.o \
+ src/hash.o \
+ src/headers.o \
+ src/intlist.o \
+ src/key.o \
+ src/list.o \
src/mmd.o \
src/objects.o \
- src/key.o \
- src/hash.o \
+ src/pic.o \
src/pmc.o \
- src/list.o \
- src/intlist.o \
- src/datatypes.o \
- src/gc/resources.o \
+ src/stack_common.o \
+ src/stacks.o \
+ src/string.o \
+ src/string_primitives.o \
src/utils.o \
- src/headers.o \
- src/gc/smallobject.o \
- src/gc/memory.o \
- src/gc/register.o \
headerizer:
$(PERL) $(BUILD_TOOLS_DIR)/headerize.pl $(HEADERIZER_O_FILES)
Modified: trunk/include/parrot/hash.h
==============================================================================
--- trunk/include/parrot/hash.h (original)
+++ trunk/include/parrot/hash.h Sat Jun 9 12:57:25 2007
@@ -74,7 +74,6 @@
/* HEADERIZER BEGIN: src/hash.c */
-PARROT_API PMC* Parrot_new_INTVAL_hash( Interp *interp, UINTVAL flags );
PARROT_API void parrot_dump_hash( Interp *interp, const Hash *hash );
PARROT_API void parrot_hash_clone( Interp *interp,
Hash *hash /*NN*/,
@@ -126,6 +125,11 @@
PARROT_API void parrot_new_cstring_hash( Interp *interp, Hash **hptr );
PARROT_API void parrot_new_hash( Interp *interp, Hash **hptr );
+PARROT_API PMC* Parrot_new_INTVAL_hash( Interp *interp, UINTVAL flags );
+PARROT_API void parrot_new_pmc_hash( Interp *interp, PMC *container );
+PARROT_API void parrot_new_pointer_hash( Interp *interp, Hash **hptr /*NN*/ )
+ __attribute__nonnull__(2);
+
void parrot_new_hash_x( Interp *interp,
Hash **hptr /*NN*/,
PARROT_DATA_TYPES val_type,
@@ -134,7 +138,6 @@
hash_hash_key_fn keyhash )
__attribute__nonnull__(2);
-PARROT_API void parrot_new_pmc_hash( Interp *interp, PMC *container );
void parrot_new_pmc_hash_x( Interp *interp,
PMC *container /*NN*/,
PARROT_DATA_TYPES val_type,
@@ -143,9 +146,6 @@
hash_hash_key_fn keyhash )
__attribute__nonnull__(2);
-PARROT_API void parrot_new_pointer_hash( Interp *interp, Hash **hptr /*NN*/ )
- __attribute__nonnull__(2);
-
/* HEADERIZER END: src/hash.c */
#endif /* PARROT_HASH_H_GUARD */
Modified: trunk/include/parrot/headers.h
==============================================================================
--- trunk/include/parrot/headers.h (original)
+++ trunk/include/parrot/headers.h Sat Jun 9 12:57:25 2007
@@ -48,22 +48,6 @@
/* HEADERIZER BEGIN: src/headers.c */
-void Parrot_destroy_header_pools( Interp *interp );
-int Parrot_forall_header_pools( Interp *interp,
- int flag,
- void *arg,
- pool_iter_fn func /*NN*/ )
- __attribute__nonnull__(4);
-
-void Parrot_initialize_header_pool_names( Interp *interp );
-void Parrot_initialize_header_pools( Interp *interp /*NN*/ )
- __attribute__nonnull__(1);
-
-void Parrot_merge_header_pools( Interp *dest_interp /*NN*/,
- Interp *source_interp /*NN*/ )
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
void add_pmc_ext( Interp *interp /*NN*/, PMC *pmc /*NN*/ )
__attribute__nonnull__(1)
__attribute__nonnull__(2);
@@ -133,6 +117,22 @@
__attribute__nonnull__(1)
__attribute__warn_unused_result__;
+void Parrot_destroy_header_pools( Interp *interp );
+int Parrot_forall_header_pools( Interp *interp,
+ int flag,
+ void *arg,
+ pool_iter_fn func /*NN*/ )
+ __attribute__nonnull__(4);
+
+void Parrot_initialize_header_pool_names( Interp *interp );
+void Parrot_initialize_header_pools( Interp *interp /*NN*/ )
+ __attribute__nonnull__(1);
+
+void Parrot_merge_header_pools( Interp *dest_interp /*NN*/,
+ Interp *source_interp /*NN*/ )
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
/* HEADERIZER END: src/headers.c */
Modified: trunk/include/parrot/memory.h
==============================================================================
--- trunk/include/parrot/memory.h (original)
+++ trunk/include/parrot/memory.h Sat Jun 9 12:57:25 2007
@@ -43,6 +43,22 @@
/* HEADERIZER BEGIN: src/gc/memory.c */
+PARROT_API void * mem__sys_realloc( void *from /*NULLOK*/, size_t size )
+ __attribute__warn_unused_result__;
+
+PARROT_API void * mem__sys_realloc_zeroed(
+ void *from /*NULLOK*/,
+ size_t size,
+ size_t old_size )
+ __attribute__warn_unused_result__;
+
+PARROT_API void * mem_sys_allocate( size_t size )
+ __attribute__warn_unused_result__;
+
+PARROT_API void * mem_sys_allocate_zeroed( size_t size )
+ __attribute__warn_unused_result__;
+
+PARROT_API void mem_sys_free( void * from );
void * mem__internal_allocate( size_t size, const char *file, int line )
__attribute__warn_unused_result__;
@@ -64,25 +80,9 @@
__attribute__nonnull__(3)
__attribute__warn_unused_result__;
-PARROT_API void * mem__sys_realloc( void *from /*NULLOK*/, size_t size )
- __attribute__warn_unused_result__;
-
-PARROT_API void * mem__sys_realloc_zeroed(
- void *from /*NULLOK*/,
- size_t size,
- size_t old_size )
- __attribute__warn_unused_result__;
-
void mem_setup_allocator( Interp *interp /*NN*/ )
__attribute__nonnull__(1);
-PARROT_API void * mem_sys_allocate( size_t size )
- __attribute__warn_unused_result__;
-
-PARROT_API void * mem_sys_allocate_zeroed( size_t size )
- __attribute__warn_unused_result__;
-
-PARROT_API void mem_sys_free( void * from );
/* HEADERIZER END: src/gc/memory.c */
PARROT_API void *mem_sys_allocate(size_t);
Modified: trunk/include/parrot/misc.h
==============================================================================
--- trunk/include/parrot/misc.h (original)
+++ trunk/include/parrot/misc.h Sat Jun 9 12:57:25 2007
@@ -73,6 +73,11 @@
PARROT_API void Parrot_srand( INTVAL seed );
PARROT_API INTVAL Parrot_uint_rand( INTVAL how_random );
+PARROT_API PMC* tm_to_array(
+ Parrot_Interp interp,
+ const struct tm *tm /*NN*/ )
+ __attribute__nonnull__(2);
+
FLOATVAL floatval_mod( FLOATVAL n2, FLOATVAL n3 )
__attribute__pure__
__attribute__warn_unused_result__;
@@ -81,11 +86,6 @@
__attribute__pure__
__attribute__warn_unused_result__;
-PARROT_API PMC* tm_to_array(
- Parrot_Interp interp,
- const struct tm *tm /*NN*/ )
- __attribute__nonnull__(2);
-
/* HEADERIZER END: src/utils.c */
/*
Modified: trunk/include/parrot/mmd.h
==============================================================================
--- trunk/include/parrot/mmd.h (original)
+++ trunk/include/parrot/mmd.h Sat Jun 9 12:57:25 2007
@@ -46,23 +46,6 @@
/* HEADERIZER BEGIN: src/mmd.c */
-PARROT_API PMC * Parrot_MMD_search_default_infix( Interp *interp,
- STRING *meth,
- INTVAL left_type,
- INTVAL right_type );
-
-PARROT_API void Parrot_mmd_rebuild_table( Interp* interp,
- INTVAL type,
- INTVAL func_nr );
-
-PARROT_API void Parrot_mmd_register_table( Interp* interp,
- INTVAL type,
- const MMD_init *mmd_table,
- INTVAL n );
-
-PARROT_API PMC * Parrot_mmd_sort_candidate_list( Interp *interp,
- PMC *candidates );
-
PARROT_API funcptr_t get_mmd_dispatch_type( Interp *interp,
INTVAL func_nr,
INTVAL left_type,
@@ -155,6 +138,23 @@
INTVAL left,
INTVAL right );
+PARROT_API void Parrot_mmd_rebuild_table( Interp* interp,
+ INTVAL type,
+ INTVAL func_nr );
+
+PARROT_API void Parrot_mmd_register_table( Interp* interp,
+ INTVAL type,
+ const MMD_init *mmd_table,
+ INTVAL n );
+
+PARROT_API PMC * Parrot_MMD_search_default_infix( Interp *interp,
+ STRING *meth,
+ INTVAL left_type,
+ INTVAL right_type );
+
+PARROT_API PMC * Parrot_mmd_sort_candidate_list( Interp *interp,
+ PMC *candidates );
+
/* HEADERIZER END: src/mmd.c */
/*
Modified: trunk/include/parrot/objects.h
==============================================================================
--- trunk/include/parrot/objects.h (original)
+++ trunk/include/parrot/objects.h Sat Jun 9 12:57:25 2007
@@ -31,35 +31,26 @@
/* HEADERIZER BEGIN: src/objects.c */
-PARROT_API void Parrot_ComposeRole( Interp *interp,
- PMC *role,
- PMC *exclude,
- int got_exclude,
- PMC *alias,
- int got_alias,
- PMC *methods_hash,
- PMC *roles_list );
-
-PARROT_API PMC* Parrot_ComputeMRO_C3( Interp *interp, PMC *_class );
-PARROT_API INTVAL Parrot_MMD_method_idx( Interp *interp, const char *name )
- __attribute__warn_unused_result__
- __attribute__pure__;
-
-PARROT_API const char* Parrot_MMD_method_name( Interp *interp, INTVAL idx )
- __attribute__warn_unused_result__
- __attribute__pure__;
-
PARROT_API INTVAL Parrot_add_attribute( Interp *interp,
PMC* _class,
STRING* attr );
PARROT_API void Parrot_add_parent( Interp *interp, PMC *_class, PMC *parent );
PARROT_API PMC * Parrot_class_lookup( Interp *interp, STRING *class_name );
-PMC * Parrot_class_lookup_p( Interp *interp, PMC *class_name );
PARROT_API INTVAL Parrot_class_offset( Interp *interp,
PMC *object,
STRING *_class );
+PARROT_API void Parrot_ComposeRole( Interp *interp,
+ PMC *role,
+ PMC *exclude,
+ int got_exclude,
+ PMC *alias,
+ int got_alias,
+ PMC *methods_hash,
+ PMC *roles_list );
+
+PARROT_API PMC* Parrot_ComputeMRO_C3( Interp *interp, PMC *_class );
PARROT_API PMC * Parrot_find_class_constructor( Interp *interp,
STRING *_class,
INTVAL classtoken );
@@ -107,6 +98,14 @@
STRING *_class,
STRING *meth );
+PARROT_API INTVAL Parrot_MMD_method_idx( Interp *interp, const char *name )
+ __attribute__warn_unused_result__
+ __attribute__pure__;
+
+PARROT_API const char* Parrot_MMD_method_name( Interp *interp, INTVAL idx )
+ __attribute__warn_unused_result__
+ __attribute__pure__;
+
PARROT_API PMC * Parrot_multi_subclass( Interp *interp,
PMC *base_class_array,
STRING *child_class_name );
@@ -151,11 +150,12 @@
PMC *base_class,
PMC *name /*NULLOK*/ );
-void destroy_object_cache( Interp *interp );
-void mark_object_cache( Interp *interp );
PARROT_API STRING* readable_name( Interp *interp, PMC *name /*NN*/ )
__attribute__nonnull__(2);
+void destroy_object_cache( Interp *interp );
+void mark_object_cache( Interp *interp );
+PMC * Parrot_class_lookup_p( Interp *interp, PMC *class_name );
/* HEADERIZER END: src/objects.c */
/* Objects, classes and PMCarrays all use the same data scheme:
Modified: trunk/include/parrot/pic.h
==============================================================================
--- trunk/include/parrot/pic.h (original)
+++ trunk/include/parrot/pic.h Sat Jun 9 12:57:25 2007
@@ -80,15 +80,6 @@
size_t n )
__attribute__nonnull__(2);
-void parrot_PIC_destroy( Interp *interp, struct PackFile_ByteCode *cs /*NN*/ )
- __attribute__nonnull__(2);
-
-int parrot_PIC_op_is_cached( Interp *interp, int op_code );
-void parrot_PIC_prederef( Interp *interp,
- opcode_t op,
- void **pc_pred,
- int core );
-
int parrot_pic_check_sig( Interp *interp,
const PMC *sig1 /*NN*/,
const PMC *sig2 /*NN*/,
@@ -97,6 +88,9 @@
__attribute__nonnull__(3)
__attribute__nonnull__(4);
+void parrot_PIC_destroy( Interp *interp, struct PackFile_ByteCode *cs /*NN*/ )
+ __attribute__nonnull__(2);
+
void parrot_pic_find_infix_v_pp( Interp *interp,
PMC *left /*NN*/,
PMC *right /*NN*/,
@@ -107,7 +101,13 @@
__attribute__nonnull__(4)
__attribute__nonnull__(5);
+int parrot_PIC_op_is_cached( Interp *interp, int op_code );
void * parrot_pic_opcode( Interp *interp, INTVAL op );
+void parrot_PIC_prederef( Interp *interp,
+ opcode_t op,
+ void **pc_pred,
+ int core );
+
/* HEADERIZER END: src/pic.c */
Modified: trunk/include/parrot/pmc.h
==============================================================================
--- trunk/include/parrot/pmc.h (original)
+++ trunk/include/parrot/pmc.h Sat Jun 9 12:57:25 2007
@@ -22,12 +22,6 @@
/* HEADERIZER BEGIN: src/pmc.c */
-PARROT_API void Parrot_create_mro( Interp *interp /*NN*/, INTVAL type )
- __attribute__nonnull__(1);
-
-PARROT_API void Parrot_create_pmc_proxy( Interp* interp /*NN*/, int type_num )
- __attribute__nonnull__(1);
-
PARROT_API PMC * constant_pmc_new( Interp *interp, INTVAL base_type );
PARROT_API PMC * constant_pmc_new_init( Interp *interp,
INTVAL base_type,
@@ -37,7 +31,10 @@
PARROT_API void dod_register_pmc( Interp* interp /*NN*/, PMC* pmc )
__attribute__nonnull__(1);
-void dod_unregister_pmc( Interp* interp /*NN*/, PMC* pmc )
+PARROT_API void Parrot_create_mro( Interp *interp /*NN*/, INTVAL type )
+ __attribute__nonnull__(1);
+
+PARROT_API void Parrot_create_pmc_proxy( Interp* interp /*NN*/, int type_num )
__attribute__nonnull__(1);
PARROT_API PMC * pmc_new( Interp *interp, INTVAL base_type );
@@ -61,6 +58,9 @@
PARROT_API INTVAL pmc_type_p( Interp* interp /*NN*/, PMC *name )
__attribute__nonnull__(1);
+void dod_unregister_pmc( Interp* interp /*NN*/, PMC* pmc )
+ __attribute__nonnull__(1);
+
/* HEADERIZER END: src/pmc.c */
/* Internal use */
Modified: trunk/include/parrot/register.h
==============================================================================
--- trunk/include/parrot/register.h (original)
+++ trunk/include/parrot/register.h Sat Jun 9 12:57:25 2007
@@ -71,11 +71,6 @@
/* HEADERIZER BEGIN: src/gc/register.c */
-struct Parrot_Context * Parrot_alloc_context( Interp *interp /*NN*/,
- INTVAL *n_regs_used /*NN*/ )
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
PARROT_API void Parrot_clear_i( Interp *interp /*NN*/ )
__attribute__nonnull__(1);
@@ -88,17 +83,15 @@
PARROT_API void Parrot_clear_s( Interp *interp /*NN*/ )
__attribute__nonnull__(1);
-struct Parrot_Context * Parrot_dup_context( Interp *interp /*NN*/,
- const struct Parrot_Context *old /*NN*/ )
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
PARROT_API void Parrot_free_context( Interp *interp /*NN*/,
struct Parrot_Context *ctxp /*NN*/,
int re_use )
__attribute__nonnull__(1)
__attribute__nonnull__(2);
+PARROT_API void parrot_gc_context( Interp *interp /*NN*/ )
+ __attribute__nonnull__(1);
+
PARROT_API void Parrot_pop_context( Interp *interp /*NN*/ )
__attribute__nonnull__(1);
@@ -125,8 +118,15 @@
void mark_register_stack( Parrot_Interp interp, Stack_Chunk_t* chunk /*NN*/ )
__attribute__nonnull__(2);
-PARROT_API void parrot_gc_context( Interp *interp /*NN*/ )
- __attribute__nonnull__(1);
+struct Parrot_Context * Parrot_alloc_context( Interp *interp /*NN*/,
+ INTVAL *n_regs_used /*NN*/ )
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
+struct Parrot_Context * Parrot_dup_context( Interp *interp /*NN*/,
+ const struct Parrot_Context *old /*NN*/ )
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
void setup_register_stacks( Interp *interp /*NN*/ )
__attribute__nonnull__(1);
Modified: trunk/include/parrot/smallobject.h
==============================================================================
--- trunk/include/parrot/smallobject.h (original)
+++ trunk/include/parrot/smallobject.h Sat Jun 9 12:57:25 2007
@@ -134,6 +134,18 @@
/* HEADERIZER BEGIN: src/gc/smallobject.c */
+INTVAL contained_in_pool( Interp *interp,
+ Small_Object_Pool *pool /*NN*/,
+ void *ptr )
+ __attribute__nonnull__(2)
+ __attribute__warn_unused_result__;
+
+void gc_pmc_ext_pool_init( Interp *interp, Small_Object_Pool *pool );
+Small_Object_Pool * new_small_object_pool( Interp *interp,
+ size_t object_size,
+ size_t objects_per_alloc )
+ __attribute__warn_unused_result__;
+
void Parrot_add_to_free_list( Interp *interp,
Small_Object_Pool *pool /*NN*/,
Small_Object_Arena *arena /*NN*/,
@@ -162,18 +174,6 @@
__attribute__nonnull__(2)
__attribute__nonnull__(3);
-INTVAL contained_in_pool( Interp *interp,
- Small_Object_Pool *pool /*NN*/,
- void *ptr )
- __attribute__nonnull__(2)
- __attribute__warn_unused_result__;
-
-void gc_pmc_ext_pool_init( Interp *interp, Small_Object_Pool *pool );
-Small_Object_Pool * new_small_object_pool( Interp *interp,
- size_t object_size,
- size_t objects_per_alloc )
- __attribute__warn_unused_result__;
-
/* HEADERIZER END: src/gc/smallobject.c */
#endif /* PARROT_SMALLOBJECT_H_GUARD */
Modified: trunk/include/parrot/stacks.h
==============================================================================
--- trunk/include/parrot/stacks.h (original)
+++ trunk/include/parrot/stacks.h Sat Jun 9 12:57:25 2007
@@ -49,11 +49,6 @@
/* HEADERIZER BEGIN: src/stacks.c */
-PARROT_API void Parrot_dump_dynamic_environment( Interp *interp /*NN*/,
- Stack_Chunk_t *dynamic_env /*NN*/ )
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
-
PARROT_API Stack_entry_type get_entry_type( Interp *interp,
const Stack_Entry_t *entry /*NN*/ )
__attribute__nonnull__(2)
@@ -68,6 +63,11 @@
__attribute__nonnull__(2)
__attribute__warn_unused_result__;
+PARROT_API void Parrot_dump_dynamic_environment( Interp *interp /*NN*/,
+ Stack_Chunk_t *dynamic_env /*NN*/ )
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2);
+
PARROT_API void * pop_dest( Interp *interp /*NN*/ )
__attribute__nonnull__(1);
Modified: trunk/include/parrot/string_funcs.h
==============================================================================
--- trunk/include/parrot/string_funcs.h (original)
+++ trunk/include/parrot/string_funcs.h Sat Jun 9 12:57:25 2007
@@ -22,6 +22,15 @@
/* HEADERIZER BEGIN: src/string.c */
+PARROT_API STRING * const_string( Interp *interp, const char *buffer /*NN*/ )
+ __attribute__nonnull__(2);
+
+PARROT_API STRING * int_to_str( Interp *interp,
+ char *tc /*NN*/,
+ HUGEINTVAL num,
+ char base )
+ __attribute__nonnull__(2);
+
PARROT_API STRING * Parrot_make_COW_reference( Interp *interp,
STRING *s /*NULLOK*/ );
@@ -66,15 +75,6 @@
PARROT_API void Parrot_unmake_COW( Interp *interp, STRING *s /*NN*/ )
__attribute__nonnull__(2);
-PARROT_API STRING * const_string( Interp *interp, const char *buffer /*NN*/ )
- __attribute__nonnull__(2);
-
-PARROT_API STRING * int_to_str( Interp *interp,
- char *tc /*NN*/,
- HUGEINTVAL num,
- char base )
- __attribute__nonnull__(2);
-
PARROT_API STRING * string_append( Interp *interp,
STRING *a /*NULLOK*/,
STRING *b /*NULLOK*/ );
Modified: trunk/tools/build/headerize.pl
==============================================================================
--- trunk/tools/build/headerize.pl (original)
+++ trunk/tools/build/headerize.pl Sat Jun 9 12:57:25 2007
@@ -307,7 +307,7 @@
for my $cfile ( sort keys %{$cfiles} ) {
my $funcs = $cfiles->{$cfile};
- my @funcs = sort { $a->[3] cmp $b->[3] } @{$funcs};
+ my @funcs = sort api_first_then_alpha @{$funcs};
my @function_decls = make_function_decls( @funcs );
@@ -327,6 +327,14 @@
return;
}
+sub api_first_then_alpha {
+ return
+ ( ($b->[0]||0) <=> ($a->[0]||0) )
+ ||
+ ( lc $a->[3] cmp lc $b->[3] )
+ ;
+}
+
# Local Variables:
# mode: cperl
# cperl-indent-level: 4