Skip to content

Commit

Permalink
rename the rest of the functions in pmc.c, start updating the rest of…
Browse files Browse the repository at this point in the history
… the codebase but not complete yet

git-svn-id: https://svn.parrot.org/parrot/branches/pmc_func_cleanup@44034 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
whiteknight committed Feb 16, 2010
1 parent 7c5b966 commit 3d80534
Show file tree
Hide file tree
Showing 37 changed files with 294 additions and 292 deletions.
138 changes: 71 additions & 67 deletions include/parrot/pmc.h
Expand Up @@ -23,72 +23,84 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PMC * constant_pmc_new(PARROT_INTERP, INTVAL base_type)
void Parrot_pmc_create_mro(PARROT_INTERP, INTVAL type)
__attribute__nonnull__(1);

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PMC * constant_pmc_new_init(PARROT_INTERP,
INTVAL base_type,
ARGIN_NULLOK(PMC *init))
__attribute__nonnull__(1);
void Parrot_pmc_destroy(PARROT_INTERP, ARGMOD(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*pmc);

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PMC * constant_pmc_new_noinit(PARROT_INTERP, INTVAL base_type)
__attribute__nonnull__(1);
void Parrot_pmc_gc_register(PARROT_INTERP, ARGIN(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_EXPORT
void gc_register_pmc(PARROT_INTERP, ARGIN(PMC *pmc))
void Parrot_pmc_gc_unregister(PARROT_INTERP, ARGIN(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_EXPORT
void gc_unregister_pmc(PARROT_INTERP, ARGIN(PMC *pmc))
INTVAL Parrot_pmc_get_type(PARROT_INTERP, ARGIN(PMC *name))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_EXPORT
void Parrot_create_mro(PARROT_INTERP, INTVAL type)
PARROT_WARN_UNUSED_RESULT
INTVAL Parrot_pmc_get_type_str(PARROT_INTERP, ARGIN_NULLOK(STRING *name))
__attribute__nonnull__(1);

PARROT_EXPORT
void Parrot_pmc_destroy(PARROT_INTERP, ARGMOD(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*pmc);

PARROT_EXPORT
INTVAL Parrot_pmc_is_null(SHIM_INTERP, ARGIN_NULLOK(const PMC *pmc));

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
PMC * pmc_new(PARROT_INTERP, INTVAL base_type)
PMC * Parrot_pmc_new(PARROT_INTERP, INTVAL base_type)
__attribute__nonnull__(1);

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PMC * Parrot_pmc_new_constant(PARROT_INTERP, INTVAL base_type)
__attribute__nonnull__(1);

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PMC * pmc_new_init(PARROT_INTERP, INTVAL base_type, ARGOUT(PMC *init))
PMC * Parrot_pmc_new_constant_init(PARROT_INTERP,
INTVAL base_type,
ARGIN_NULLOK(PMC *init))
__attribute__nonnull__(1);

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PMC * Parrot_pmc_new_constant_noinit(PARROT_INTERP, INTVAL base_type)
__attribute__nonnull__(1);

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PMC * Parrot_pmc_new_init(PARROT_INTERP,
INTVAL base_type,
ARGOUT(PMC *init))
__attribute__nonnull__(1)
__attribute__nonnull__(3)
FUNC_MODIFIES(*init);

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PMC * pmc_new_noinit(PARROT_INTERP, INTVAL base_type)
PMC * Parrot_pmc_new_noinit(PARROT_INTERP, INTVAL base_type)
__attribute__nonnull__(1);

PARROT_EXPORT
INTVAL pmc_register(PARROT_INTERP, ARGIN(STRING *name))
INTVAL Parrot_pmc_register_new_type(PARROT_INTERP, ARGIN(STRING *name))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PARROT_IGNORABLE_RESULT
PMC * pmc_reuse(PARROT_INTERP,
PMC * Parrot_pmc_reuse(PARROT_INTERP,
ARGIN(PMC *pmc),
INTVAL new_type,
UINTVAL flags)
Expand All @@ -98,7 +110,7 @@ PMC * pmc_reuse(PARROT_INTERP,
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PARROT_IGNORABLE_RESULT
PMC * pmc_reuse_by_class(PARROT_INTERP,
PMC * Parrot_pmc_reuse_by_class(PARROT_INTERP,
ARGMOD(PMC *pmc),
ARGIN(PMC *class_),
UINTVAL flags)
Expand All @@ -110,7 +122,7 @@ PMC * pmc_reuse_by_class(PARROT_INTERP,
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
PARROT_IGNORABLE_RESULT
PMC * pmc_reuse_init(PARROT_INTERP,
PMC * Parrot_pmc_reuse_init(PARROT_INTERP,
ARGIN(PMC *pmc),
INTVAL new_type,
ARGIN(PMC *init),
Expand All @@ -119,78 +131,70 @@ PMC * pmc_reuse_init(PARROT_INTERP,
__attribute__nonnull__(2)
__attribute__nonnull__(4);

PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
INTVAL pmc_type(PARROT_INTERP, ARGIN_NULLOK(STRING *name))
__attribute__nonnull__(1);

PARROT_EXPORT
INTVAL pmc_type_p(PARROT_INTERP, ARGIN(PMC *name))
__attribute__nonnull__(1)
__attribute__nonnull__(2);

INTVAL get_new_vtable_index(PARROT_INTERP)
__attribute__nonnull__(1);

void temporary_pmc_free(PARROT_INTERP, ARGMOD(PMC *pmc))
void Parrot_pmc_free_temporary(PARROT_INTERP, ARGMOD(PMC *pmc))
__attribute__nonnull__(1)
__attribute__nonnull__(2)
FUNC_MODIFIES(*pmc);

INTVAL Parrot_pmc_get_new_vtable_index(PARROT_INTERP)
__attribute__nonnull__(1);

PARROT_CANNOT_RETURN_NULL
PMC * temporary_pmc_new(PARROT_INTERP, INTVAL base_type)
PMC * Parrot_pmc_new_temporary(PARROT_INTERP, INTVAL base_type)
__attribute__nonnull__(1);

#define ASSERT_ARGS_constant_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_constant_pmc_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_create_mro __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_constant_pmc_new_noinit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_gc_register_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
#define ASSERT_ARGS_gc_unregister_pmc __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_gc_register __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
#define ASSERT_ARGS_Parrot_create_mro __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_pmc_destroy __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_gc_unregister __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
#define ASSERT_ARGS_Parrot_pmc_get_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(name))
#define ASSERT_ARGS_Parrot_pmc_get_type_str __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_pmc_is_null __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_pmc_new_constant __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_pmc_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_new_constant_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_pmc_new_constant_noinit \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_pmc_new_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(init))
#define ASSERT_ARGS_pmc_new_noinit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_new_noinit __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_pmc_register __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_register_new_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(name))
#define ASSERT_ARGS_pmc_reuse __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_reuse __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
#define ASSERT_ARGS_pmc_reuse_by_class __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_reuse_by_class __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc) \
, PARROT_ASSERT_ARG(class_))
#define ASSERT_ARGS_pmc_reuse_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_reuse_init __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc) \
, PARROT_ASSERT_ARG(init))
#define ASSERT_ARGS_pmc_type __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_pmc_type_p __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(name))
#define ASSERT_ARGS_get_new_vtable_index __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_temporary_pmc_free __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_free_temporary __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp) \
, PARROT_ASSERT_ARG(pmc))
#define ASSERT_ARGS_temporary_pmc_new __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
#define ASSERT_ARGS_Parrot_pmc_get_new_vtable_index \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_pmc_new_temporary __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/pmc.c */
Expand Down
2 changes: 1 addition & 1 deletion lib/Parrot/Ops2c/Utils.pm
Expand Up @@ -1063,7 +1063,7 @@ $load_func(PARROT_INTERP);
$self->{sym_export} PMC*
$load_func(PARROT_INTERP)
{
PMC *const lib = pmc_new(interp, enum_class_ParrotLibrary);
PMC *const lib = Parrot_pmc_new(interp, enum_class_ParrotLibrary);
((Parrot_ParrotLibrary_attributes*)PMC_data(lib))->oplib_init = (void *) $self->{init_func};
dynop_register(interp, lib);
return lib;
Expand Down
6 changes: 3 additions & 3 deletions lib/Parrot/Pmc2c/Attribute.pm
Expand Up @@ -207,23 +207,23 @@ EOA
}
elsif ($attrtype eq "INTVAL") {
$decl .= <<"EOA";
PMC * const attr_value = pmc_new(interp, enum_class_Integer); \\
PMC * const attr_value = Parrot_pmc_new(interp, enum_class_Integer); \\
VTABLE_set_integer_native(interp, attr_value, value); \\
VTABLE_set_attr_str(interp, pmc, \\
Parrot_str_new_constant(interp, "$attrname"), attr_value); \\
EOA
}
elsif ($attrtype eq "FLOATVAL") {
$decl .= <<"EOA";
PMC * const attr_value = pmc_new(interp, enum_class_Float); \\
PMC * const attr_value = Parrot_pmc_new(interp, enum_class_Float); \\
VTABLE_set_number_native(interp, attr_value, value); \\
VTABLE_set_attr_str(interp, pmc, \\
Parrot_str_new_constant(interp, "$attrname"), attr_value); \\
EOA
}
elsif ($attrtype =~ $isptrtostring) {
$decl .= <<"EOA";
PMC * const attr_value = pmc_new(interp, enum_class_String); \\
PMC * const attr_value = Parrot_pmc_new(interp, enum_class_String); \\
VTABLE_set_string_native(interp, attr_value, value); \\
VTABLE_set_attr_str(interp, pmc, \\
Parrot_str_new_constant(interp, "$attrname"), attr_value); \\
Expand Down
4 changes: 2 additions & 2 deletions lib/Parrot/Pmc2c/PMCEmitter.pm
Expand Up @@ -703,7 +703,7 @@ EOC
}
/* set up MRO and _namespace */
Parrot_create_mro(interp, entry);
Parrot_pmc_create_mro(interp, entry);
EOC

# declare each nci method for this class
Expand Down Expand Up @@ -870,7 +870,7 @@ PARROT_CANNOT_RETURN_NULL
PARROT_WARN_UNUSED_RESULT
PMC* Parrot_${classname}_get_mro(PARROT_INTERP, PMC* mro) {
if (PMC_IS_NULL(mro)) {
mro = pmc_new(interp, enum_class_ResizableStringArray);
mro = Parrot_pmc_new(interp, enum_class_ResizableStringArray);
}
$get_mro
VTABLE_unshift_string(interp, mro,
Expand Down
2 changes: 1 addition & 1 deletion lib/Parrot/Pmc2c/UtilFunctions.pm
Expand Up @@ -163,7 +163,7 @@ EOC
int pass;
/* create a library PMC */
pmc = constant_pmc_new(interp, enum_class_ParrotLibrary);
pmc = Parrot_pmc_new_constant(interp, enum_class_ParrotLibrary);
/* TODO: stuff some info into this PMC's props */
Expand Down

0 comments on commit 3d80534

Please sign in to comment.