[svn:parrot] r46441 - in trunk: include/parrot src

petdance at svn.parrot.org petdance at svn.parrot.org
Sun May 9 20:57:59 UTC 2010


Author: petdance
Date: Sun May  9 20:57:59 2010
New Revision: 46441
URL: https://trac.parrot.org/parrot/changeset/46441

Log:
include/parrot/embed.h is now headerized, although there are some imperfections with two redundant headers cut-and-pasted in there

Modified:
   trunk/include/parrot/embed.h
   trunk/include/parrot/packfile.h
   trunk/src/embed.c
   trunk/src/packfile.c

Modified: trunk/include/parrot/embed.h
==============================================================================
--- trunk/include/parrot/embed.h	Sun May  9 20:50:08 2010	(r46440)
+++ trunk/include/parrot/embed.h	Sun May  9 20:57:59 2010	(r46441)
@@ -1,5 +1,5 @@
 /* embed.h
- *  Copyright (C) 2001-2003, Parrot Foundation.
+ *  Copyright (C) 2001-2010, Parrot Foundation.
  *  SVN Info
  *     $Id$
  *  Overview:
@@ -25,61 +25,188 @@
     enum_DIS_HEADER    = 2
 } Parrot_disassemble_options;
 
+/* Parrot_set_config_hash exists in *_config.o (e.g install_config.o),
+   so if you make this call then you will need to link with it in
+   addition to libparrot */
+void Parrot_set_config_hash(void);
+
 PARROT_EXPORT
-PARROT_CANNOT_RETURN_NULL
-PARROT_MALLOC
-Parrot_Interp Parrot_new(ARGIN_NULLOK(Parrot_Interp parent));
+PARROT_DOES_NOT_RETURN
+PARROT_COLD
+void
+Parrot_exit(PARROT_INTERP, int status);
 
-PARROT_EXPORT void Parrot_init_stacktop(PARROT_INTERP, void *);
+PARROT_EXPORT
+void Parrot_destroy(PARROT_INTERP)
+        __attribute__nonnull__(1);
 
-PARROT_EXPORT void Parrot_set_flag(PARROT_INTERP, Parrot_Int);
-PARROT_EXPORT void Parrot_clear_flag(PARROT_INTERP, Parrot_Int);
-PARROT_EXPORT Parrot_Int Parrot_test_flag(PARROT_INTERP, Parrot_Int);
 
-PARROT_EXPORT void Parrot_set_trace(PARROT_INTERP, Parrot_UInt);
-PARROT_EXPORT void Parrot_clear_trace(PARROT_INTERP, Parrot_UInt);
-PARROT_EXPORT Parrot_UInt Parrot_test_trace(PARROT_INTERP, Parrot_UInt);
+/* HEADERIZER BEGIN: src/embed.c */
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
-PARROT_EXPORT void Parrot_set_debug(PARROT_INTERP, Parrot_UInt);
-PARROT_EXPORT void Parrot_clear_debug(PARROT_INTERP, Parrot_UInt);
-PARROT_EXPORT Parrot_UInt Parrot_test_debug(PARROT_INTERP, Parrot_UInt);
+PARROT_EXPORT
+void Parrot_clear_debug(PARROT_INTERP, Parrot_UInt flag)
+        __attribute__nonnull__(1);
 
-PARROT_EXPORT void Parrot_set_executable_name(PARROT_INTERP, Parrot_String);
+PARROT_EXPORT
+void Parrot_clear_flag(PARROT_INTERP, Parrot_Int flag)
+        __attribute__nonnull__(1);
 
-PARROT_EXPORT void Parrot_set_run_core(PARROT_INTERP, Parrot_Run_core_t core);
+PARROT_EXPORT
+void Parrot_clear_trace(PARROT_INTERP, Parrot_UInt flag)
+        __attribute__nonnull__(1);
 
-PARROT_EXPORT void Parrot_setwarnings(PARROT_INTERP, Parrot_warnclass);
+PARROT_EXPORT
+Parrot_PMC Parrot_compile_string(PARROT_INTERP,
+    Parrot_String type,
+    ARGIN(const char *code),
+    ARGOUT(Parrot_String *error))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(3)
+        __attribute__nonnull__(4)
+        FUNC_MODIFIES(*error);
 
-PARROT_EXPORT Parrot_PackFile Parrot_pbc_read(PARROT_INTERP, ARGIN_NULLOK(const char *), int);
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+Parrot_Opcode * Parrot_debug(PARROT_INTERP,
+    ARGIN(Parrot_Interp debugger),
+    ARGIN(Parrot_Opcode *pc))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2)
+        __attribute__nonnull__(3);
 
-PARROT_EXPORT void Parrot_pbc_load(PARROT_INTERP, Parrot_PackFile);
+PARROT_EXPORT
+void Parrot_disassemble(PARROT_INTERP,
+    ARGIN(const char *outfile),
+    Parrot_disassemble_options options)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-PARROT_EXPORT void Parrot_pbc_fixup_loaded(PARROT_INTERP);
+PARROT_EXPORT
+void Parrot_init_stacktop(PARROT_INTERP, ARGIN(void *stack_top))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-PARROT_EXPORT void Parrot_runcode(PARROT_INTERP, int argc, ARGIN(const char **argv));
+PARROT_EXPORT
+PARROT_CANNOT_RETURN_NULL
+PARROT_MALLOC
+Parrot_Interp Parrot_new(ARGIN_NULLOK(Parrot_Interp parent));
 
-PARROT_EXPORT Parrot_PMC Parrot_compile_string(PARROT_INTERP,
-        Parrot_String type, ARGIN(const char *code), ARGOUT(Parrot_String *error));
+PARROT_EXPORT
+void Parrot_pbc_fixup_loaded(PARROT_INTERP)
+        __attribute__nonnull__(1);
 
-PARROT_EXPORT void Parrot_destroy(PARROT_INTERP);
+PARROT_EXPORT
+void Parrot_pbc_load(PARROT_INTERP, ARGIN(Parrot_PackFile pf))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
 
-PARROT_EXPORT Parrot_Opcode * Parrot_debug(PARROT_INTERP, ARGIN(Parrot_Interp debugger), ARGIN(Parrot_Opcode *pc));
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+Parrot_PackFile Parrot_pbc_read(PARROT_INTERP,
+    ARGIN_NULLOK(const char *fullname),
+    const int debug)
+        __attribute__nonnull__(1);
 
-PARROT_EXPORT void Parrot_disassemble(PARROT_INTERP, ARGIN(const char *outfile),
-        Parrot_disassemble_options options);
+PARROT_EXPORT
+void Parrot_run_native(PARROT_INTERP, native_func_t func)
+        __attribute__nonnull__(1);
 
 PARROT_EXPORT
-PARROT_DOES_NOT_RETURN
-void Parrot_exit(PARROT_INTERP, int status);
+void Parrot_runcode(PARROT_INTERP, int argc, ARGIN(const char **argv))
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(3);
 
-PARROT_EXPORT void Parrot_run_native(PARROT_INTERP, native_func_t func);
+PARROT_EXPORT
+void Parrot_set_debug(PARROT_INTERP, Parrot_UInt flag)
+        __attribute__nonnull__(1);
 
-PARROT_EXPORT void Parrot_load_bytecode(PARROT_INTERP, Parrot_String file_str);
+PARROT_EXPORT
+void Parrot_set_executable_name(PARROT_INTERP, Parrot_String name)
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
+void Parrot_set_flag(PARROT_INTERP, Parrot_Int flag)
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
+void Parrot_set_run_core(PARROT_INTERP, Parrot_Run_core_t core)
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
+void Parrot_set_trace(PARROT_INTERP, Parrot_UInt flag)
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
+void Parrot_setwarnings(PARROT_INTERP, Parrot_warnclass wc)
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
+Parrot_UInt Parrot_test_debug(PARROT_INTERP, Parrot_UInt flag)
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
+Parrot_Int Parrot_test_flag(PARROT_INTERP, Parrot_Int flag)
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
+Parrot_UInt Parrot_test_trace(PARROT_INTERP, Parrot_UInt flag)
+        __attribute__nonnull__(1);
+
+#define ASSERT_ARGS_Parrot_clear_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_clear_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_clear_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_compile_string __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(code) \
+    , PARROT_ASSERT_ARG(error))
+#define ASSERT_ARGS_Parrot_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(debugger) \
+    , PARROT_ASSERT_ARG(pc))
+#define ASSERT_ARGS_Parrot_disassemble __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(outfile))
+#define ASSERT_ARGS_Parrot_init_stacktop __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(stack_top))
+#define ASSERT_ARGS_Parrot_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
+#define ASSERT_ARGS_Parrot_pbc_fixup_loaded __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_pbc_load __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(pf))
+#define ASSERT_ARGS_Parrot_pbc_read __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_run_native __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_runcode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp) \
+    , PARROT_ASSERT_ARG(argv))
+#define ASSERT_ARGS_Parrot_set_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_set_executable_name __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_set_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_set_run_core __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_set_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_setwarnings __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_test_debug __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_test_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+#define ASSERT_ARGS_Parrot_test_trace __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
+       PARROT_ASSERT_ARG(interp))
+/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
+/* HEADERIZER END: src/embed.c */
 
-/* Parrot_set_config_hash exists in *_config.o (e.g install_config.o),
-   so if you make this call then you will need to link with it in
-   addition to libparrot */
-void Parrot_set_config_hash(void);
 
 #endif /* PARROT_EMBED_H_GUARD */
 

Modified: trunk/include/parrot/packfile.h
==============================================================================
--- trunk/include/parrot/packfile.h	Sun May  9 20:50:08 2010	(r46440)
+++ trunk/include/parrot/packfile.h	Sun May  9 20:57:59 2010	(r46441)
@@ -759,7 +759,8 @@
         __attribute__nonnull__(1);
 
 PARROT_EXPORT
-void Parrot_load_bytecode(PARROT_INTERP, ARGIN_NULLOK(STRING *file_str))
+void Parrot_load_bytecode(PARROT_INTERP,
+    ARGIN_NULLOK(Parrot_String file_str))
         __attribute__nonnull__(1);
 
 PARROT_EXPORT

Modified: trunk/src/embed.c
==============================================================================
--- trunk/src/embed.c	Sun May  9 20:50:08 2010	(r46440)
+++ trunk/src/embed.c	Sun May  9 20:57:59 2010	(r46441)
@@ -29,7 +29,7 @@
 
 #include "embed.str"
 
-/* HEADERIZER HFILE: none */ /* The visible types are different than what we use in here */
+/* HEADERIZER HFILE: include/parrot/embed.h */
 
 /* HEADERIZER BEGIN: static */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
@@ -109,7 +109,7 @@
 
 PARROT_EXPORT
 void
-Parrot_init_stacktop(PARROT_INTERP, void *stack_top)
+Parrot_init_stacktop(PARROT_INTERP, ARGIN(void *stack_top))
 {
     interp->lo_var_ptr = stack_top;
     init_world_once(interp);
@@ -118,7 +118,7 @@
 
 /*
 
-=item C<void Parrot_set_flag(PARROT_INTERP, INTVAL flag)>
+=item C<void Parrot_set_flag(PARROT_INTERP, Parrot_Int flag)>
 
 Sets on any of the following flags, specified by C<flag>, in the interpreter:
 
@@ -132,7 +132,7 @@
 
 PARROT_EXPORT
 void
-Parrot_set_flag(PARROT_INTERP, INTVAL flag)
+Parrot_set_flag(PARROT_INTERP, Parrot_Int flag)
 {
     /* These two macros (from interpreter.h) do exactly what they look like. */
 
@@ -150,7 +150,7 @@
 
 /*
 
-=item C<void Parrot_set_debug(PARROT_INTERP, UINTVAL flag)>
+=item C<void Parrot_set_debug(PARROT_INTERP, Parrot_UInt flag)>
 
 Set a debug flag: C<PARROT_DEBUG_FLAG>.
 
@@ -160,7 +160,7 @@
 
 PARROT_EXPORT
 void
-Parrot_set_debug(PARROT_INTERP, UINTVAL flag)
+Parrot_set_debug(PARROT_INTERP, Parrot_UInt flag)
 {
     interp->debug_flags |= flag;
 }
@@ -190,7 +190,7 @@
 
 /*
 
-=item C<void Parrot_set_trace(PARROT_INTERP, UINTVAL flag)>
+=item C<void Parrot_set_trace(PARROT_INTERP, Parrot_UInt flag)>
 
 Set a trace flag: C<PARROT_TRACE_FLAG>
 
@@ -200,7 +200,7 @@
 
 PARROT_EXPORT
 void
-Parrot_set_trace(PARROT_INTERP, UINTVAL flag)
+Parrot_set_trace(PARROT_INTERP, Parrot_UInt flag)
 {
     Parrot_pcc_trace_flags_on(interp, interp->ctx, flag);
     Parrot_runcore_switch(interp, Parrot_str_new_constant(interp, "slow"));
@@ -209,7 +209,7 @@
 
 /*
 
-=item C<void Parrot_clear_flag(PARROT_INTERP, INTVAL flag)>
+=item C<void Parrot_clear_flag(PARROT_INTERP, Parrot_Int flag)>
 
 Clears a flag in the interpreter.
 
@@ -219,7 +219,7 @@
 
 PARROT_EXPORT
 void
-Parrot_clear_flag(PARROT_INTERP, INTVAL flag)
+Parrot_clear_flag(PARROT_INTERP, Parrot_Int flag)
 {
     Interp_flags_CLEAR(interp, flag);
 }
@@ -227,7 +227,7 @@
 
 /*
 
-=item C<void Parrot_clear_debug(PARROT_INTERP, UINTVAL flag)>
+=item C<void Parrot_clear_debug(PARROT_INTERP, Parrot_UInt flag)>
 
 Clears a flag in the interpreter.
 
@@ -237,7 +237,7 @@
 
 PARROT_EXPORT
 void
-Parrot_clear_debug(PARROT_INTERP, UINTVAL flag)
+Parrot_clear_debug(PARROT_INTERP, Parrot_UInt flag)
 {
     interp->debug_flags &= ~flag;
 }
@@ -245,7 +245,7 @@
 
 /*
 
-=item C<void Parrot_clear_trace(PARROT_INTERP, UINTVAL flag)>
+=item C<void Parrot_clear_trace(PARROT_INTERP, Parrot_UInt flag)>
 
 Clears a flag in the interpreter.
 
@@ -255,7 +255,7 @@
 
 PARROT_EXPORT
 void
-Parrot_clear_trace(PARROT_INTERP, UINTVAL flag)
+Parrot_clear_trace(PARROT_INTERP, Parrot_UInt flag)
 {
     Parrot_pcc_trace_flags_off(interp, interp->ctx, flag);
 }
@@ -263,7 +263,7 @@
 
 /*
 
-=item C<Parrot_Int Parrot_test_flag(PARROT_INTERP, INTVAL flag)>
+=item C<Parrot_Int Parrot_test_flag(PARROT_INTERP, Parrot_Int flag)>
 
 Test the interpreter flags specified in C<flag>.
 
@@ -273,7 +273,7 @@
 
 PARROT_EXPORT
 Parrot_Int
-Parrot_test_flag(PARROT_INTERP, INTVAL flag)
+Parrot_test_flag(PARROT_INTERP, Parrot_Int flag)
 {
     return Interp_flags_TEST(interp, flag);
 }
@@ -281,7 +281,7 @@
 
 /*
 
-=item C<UINTVAL Parrot_test_debug(PARROT_INTERP, UINTVAL flag)>
+=item C<Parrot_UInt Parrot_test_debug(PARROT_INTERP, Parrot_UInt flag)>
 
 Test the interpreter flags specified in C<flag>.
 
@@ -290,8 +290,8 @@
 */
 
 PARROT_EXPORT
-UINTVAL
-Parrot_test_debug(PARROT_INTERP, UINTVAL flag)
+Parrot_UInt
+Parrot_test_debug(PARROT_INTERP, Parrot_UInt flag)
 {
     return interp->debug_flags & flag;
 }
@@ -299,7 +299,7 @@
 
 /*
 
-=item C<UINTVAL Parrot_test_trace(PARROT_INTERP, UINTVAL flag)>
+=item C<Parrot_UInt Parrot_test_trace(PARROT_INTERP, Parrot_UInt flag)>
 
 Test the interpreter flags specified in C<flag>.
 
@@ -308,8 +308,8 @@
 */
 
 PARROT_EXPORT
-UINTVAL
-Parrot_test_trace(PARROT_INTERP, UINTVAL flag)
+Parrot_UInt
+Parrot_test_trace(PARROT_INTERP, Parrot_UInt flag)
 {
     return Parrot_pcc_trace_flags_test(interp, interp->ctx, flag);
 }
@@ -376,8 +376,8 @@
 
 /*
 
-=item C<PackFile * Parrot_pbc_read(PARROT_INTERP, const char *fullname, const
-int debug)>
+=item C<Parrot_PackFile Parrot_pbc_read(PARROT_INTERP, const char *fullname,
+const int debug)>
 
 Read in a bytecode, unpack it into a C<PackFile> structure, and do fixups.
 
@@ -387,7 +387,7 @@
 
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
-PackFile *
+Parrot_PackFile
 Parrot_pbc_read(PARROT_INTERP, ARGIN_NULLOK(const char *fullname), const int debug)
 {
     PackFile *pf;
@@ -567,7 +567,7 @@
 
 /*
 
-=item C<void Parrot_pbc_load(PARROT_INTERP, PackFile *pf)>
+=item C<void Parrot_pbc_load(PARROT_INTERP, Parrot_PackFile pf)>
 
 Loads the C<PackFile> returned by C<Parrot_pbc_read()>.
 
@@ -577,7 +577,7 @@
 
 PARROT_EXPORT
 void
-Parrot_pbc_load(PARROT_INTERP, ARGIN(PackFile *pf))
+Parrot_pbc_load(PARROT_INTERP, ARGIN(Parrot_PackFile pf))
 {
     if (!pf) {
         Parrot_io_eprintf(interp, "Invalid packfile\n");
@@ -793,8 +793,8 @@
 
 /*
 
-=item C<opcode_t * Parrot_debug(PARROT_INTERP, Parrot_Interp debugger, opcode_t
-*pc)>
+=item C<Parrot_Opcode * Parrot_debug(PARROT_INTERP, Parrot_Interp debugger,
+Parrot_Opcode *pc)>
 
 Runs the interpreter's bytecode in debugging mode.
 
@@ -804,8 +804,8 @@
 
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
-opcode_t *
-Parrot_debug(PARROT_INTERP, ARGIN(Parrot_Interp debugger), ARGIN(opcode_t *pc))
+Parrot_Opcode *
+Parrot_debug(PARROT_INTERP, ARGIN(Parrot_Interp debugger), ARGIN(Parrot_Opcode *pc))
 {
     PDB_t      * const pdb = debugger->pdb;
 

Modified: trunk/src/packfile.c
==============================================================================
--- trunk/src/packfile.c	Sun May  9 20:50:08 2010	(r46440)
+++ trunk/src/packfile.c	Sun May  9 20:57:59 2010	(r46441)
@@ -4801,7 +4801,7 @@
 
 /*
 
-=item C<void Parrot_load_bytecode(PARROT_INTERP, STRING *file_str)>
+=item C<void Parrot_load_bytecode(PARROT_INTERP, Parrot_String file_str)>
 
 Load a bytecode, PIR, or PASM file into the interpreter.
 
@@ -4812,7 +4812,7 @@
 /* intermediate hook during changes */
 PARROT_EXPORT
 void
-Parrot_load_bytecode(PARROT_INTERP, ARGIN_NULLOK(STRING *file_str))
+Parrot_load_bytecode(PARROT_INTERP, ARGIN_NULLOK(Parrot_String file_str))
 {
     ASSERT_ARGS(Parrot_load_bytecode)
     STRING         *wo_ext, *ext, *pbc, *path;


More information about the parrot-commits mailing list