[svn:parrot] r36308 - in branches/pdd28str_part2: compilers/imcc compilers/pirc/src config/gen/platform/generic config/gen/platform/win32 docs include/parrot languages/lua/src/pmc languages/pipp/src/pmc languages/regex/pmc src src/io src/ops src/pmc src/string tools/build
allison at svn.parrot.org
allison at svn.parrot.org
Tue Feb 3 00:52:57 UTC 2009
Author: allison
Date: Tue Feb 3 00:52:53 2009
New Revision: 36308
URL: https://trac.parrot.org/parrot/changeset/36308
Log:
[pdd28str] Renaming string conversion functions.
Modified:
branches/pdd28str_part2/compilers/imcc/imcc.y
branches/pdd28str_part2/compilers/imcc/imcparser.c
branches/pdd28str_part2/compilers/imcc/main.c
branches/pdd28str_part2/compilers/imcc/optimizer.c
branches/pdd28str_part2/compilers/imcc/pbc.c
branches/pdd28str_part2/compilers/pirc/src/pir.l
branches/pdd28str_part2/compilers/pirc/src/pirlexer.c
branches/pdd28str_part2/config/gen/platform/generic/exec.c
branches/pdd28str_part2/config/gen/platform/generic/stat.c
branches/pdd28str_part2/config/gen/platform/win32/exec.c
branches/pdd28str_part2/config/gen/platform/win32/stat.c
branches/pdd28str_part2/docs/embed.pod
branches/pdd28str_part2/include/parrot/string_funcs.h
branches/pdd28str_part2/languages/lua/src/pmc/lua.pmc
branches/pdd28str_part2/languages/lua/src/pmc/luaboolean.pmc
branches/pdd28str_part2/languages/lua/src/pmc/luanumber.pmc
branches/pdd28str_part2/languages/lua/src/pmc/luastring.pmc
branches/pdd28str_part2/languages/lua/src/pmc/luatable.pmc
branches/pdd28str_part2/languages/pipp/src/pmc/phparray.pmc
branches/pdd28str_part2/languages/pipp/src/pmc/phpstring.pmc
branches/pdd28str_part2/languages/regex/pmc/match.pmc
branches/pdd28str_part2/src/datatypes.c
branches/pdd28str_part2/src/debug.c
branches/pdd28str_part2/src/dynext.c
branches/pdd28str_part2/src/extend.c
branches/pdd28str_part2/src/hash.c
branches/pdd28str_part2/src/hll.c
branches/pdd28str_part2/src/inter_call.c
branches/pdd28str_part2/src/inter_misc.c
branches/pdd28str_part2/src/io/portable.c
branches/pdd28str_part2/src/io/socket_unix.c
branches/pdd28str_part2/src/io/socket_win32.c
branches/pdd28str_part2/src/io/unix.c
branches/pdd28str_part2/src/io/win32.c
branches/pdd28str_part2/src/jit_debug.c
branches/pdd28str_part2/src/jit_debug_xcoff.c
branches/pdd28str_part2/src/key.c
branches/pdd28str_part2/src/library.c
branches/pdd28str_part2/src/oo.c
branches/pdd28str_part2/src/ops/core.ops
branches/pdd28str_part2/src/ops/set.ops
branches/pdd28str_part2/src/ops/string.ops
branches/pdd28str_part2/src/packdump.c
branches/pdd28str_part2/src/packfile.c
branches/pdd28str_part2/src/pmc/bigint.pmc
branches/pdd28str_part2/src/pmc/codestring.pmc
branches/pdd28str_part2/src/pmc/complex.pmc
branches/pdd28str_part2/src/pmc/env.pmc
branches/pdd28str_part2/src/pmc/file.pmc
branches/pdd28str_part2/src/pmc/fixedintegerarray.pmc
branches/pdd28str_part2/src/pmc/fixedpmcarray.pmc
branches/pdd28str_part2/src/pmc/float.pmc
branches/pdd28str_part2/src/pmc/hash.pmc
branches/pdd28str_part2/src/pmc/integer.pmc
branches/pdd28str_part2/src/pmc/iterator.pmc
branches/pdd28str_part2/src/pmc/lexinfo.pmc
branches/pdd28str_part2/src/pmc/nci.pmc
branches/pdd28str_part2/src/pmc/os.pmc
branches/pdd28str_part2/src/pmc/scheduler.pmc
branches/pdd28str_part2/src/pmc/slice.pmc
branches/pdd28str_part2/src/pmc/string.pmc
branches/pdd28str_part2/src/pmc/sub.pmc
branches/pdd28str_part2/src/pmc/unmanagedstruct.pmc
branches/pdd28str_part2/src/spf_render.c
branches/pdd28str_part2/src/string/api.c
branches/pdd28str_part2/src/trace.c
branches/pdd28str_part2/tools/build/nativecall.pl
Modified: branches/pdd28str_part2/compilers/imcc/imcc.y
==============================================================================
--- branches/pdd28str_part2/compilers/imcc/imcc.y Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/compilers/imcc/imcc.y Tue Feb 3 00:52:53 2009 (r36308)
@@ -772,7 +772,7 @@
do_loadlib(PARROT_INTERP, ARGIN(const char *lib))
{
ASSERT_ARGS(do_loadlib)
- STRING * const s = string_unescape_cstring(interp, lib + 1, '"', NULL);
+ STRING * const s = Parrot_str_unescape(interp, lib + 1, '"', NULL);
PMC *ignored = Parrot_load_lib(interp, s, NULL);
UNUSED(ignored);
Parrot_register_HLL_lib(interp, s);
@@ -943,7 +943,7 @@
HLL STRINGC
{
- STRING * const hll_name = string_unescape_cstring(interp, $2 + 1, '"', NULL);
+ STRING * const hll_name = Parrot_str_unescape(interp, $2 + 1, '"', NULL);
CONTEXT(interp)->current_HLL =
Parrot_register_HLL(interp, hll_name);
@@ -954,9 +954,9 @@
{
Parrot_Context *ctx = CONTEXT(interp);
STRING * const built_in_name =
- string_unescape_cstring(interp, $2 + 1, '"', NULL);
+ Parrot_str_unescape(interp, $2 + 1, '"', NULL);
STRING * const language_name =
- string_unescape_cstring(interp, $4 + 1, '"', NULL);
+ Parrot_str_unescape(interp, $4 + 1, '"', NULL);
int built_in_type = pmc_type(interp, built_in_name);
int language_type = pmc_type(interp, language_name);
Modified: branches/pdd28str_part2/compilers/imcc/imcparser.c
==============================================================================
--- branches/pdd28str_part2/compilers/imcc/imcparser.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/compilers/imcc/imcparser.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -1098,7 +1098,7 @@
do_loadlib(PARROT_INTERP, ARGIN(const char *lib))
{
ASSERT_ARGS(do_loadlib)
- STRING * const s = string_unescape_cstring(interp, lib + 1, '"', NULL);
+ STRING * const s = Parrot_str_unescape(interp, lib + 1, '"', NULL);
PMC *ignored = Parrot_load_lib(interp, s, NULL);
UNUSED(ignored);
Parrot_register_HLL_lib(interp, s);
@@ -3044,7 +3044,7 @@
case 18:
#line 945 "compilers/imcc/imcc.y"
{
- STRING * const hll_name = string_unescape_cstring(interp, (yyvsp[(2) - (2)].s) + 1, '"', NULL);
+ STRING * const hll_name = Parrot_str_unescape(interp, (yyvsp[(2) - (2)].s) + 1, '"', NULL);
CONTEXT(interp)->current_HLL =
Parrot_register_HLL(interp, hll_name);
@@ -3058,9 +3058,9 @@
{
Parrot_Context *ctx = CONTEXT(interp);
STRING * const built_in_name =
- string_unescape_cstring(interp, (yyvsp[(2) - (4)].s) + 1, '"', NULL);
+ Parrot_str_unescape(interp, (yyvsp[(2) - (4)].s) + 1, '"', NULL);
STRING * const language_name =
- string_unescape_cstring(interp, (yyvsp[(4) - (4)].s) + 1, '"', NULL);
+ Parrot_str_unescape(interp, (yyvsp[(4) - (4)].s) + 1, '"', NULL);
int built_in_type = pmc_type(interp, built_in_name);
int language_type = pmc_type(interp, language_name);
Modified: branches/pdd28str_part2/compilers/imcc/main.c
==============================================================================
--- branches/pdd28str_part2/compilers/imcc/main.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/compilers/imcc/main.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -991,7 +991,7 @@
imc_compile_all_units(interp);
}
IMCC_CATCH(IMCC_FATAL_EXCEPTION) {
- char * const error_str = string_to_cstring(interp,
+ char * const error_str = Parrot_str_to_cstring(interp,
IMCC_INFO(interp)->error_message);
IMCC_INFO(interp)->error_code=IMCC_FATAL_EXCEPTION;
@@ -1001,7 +1001,7 @@
Parrot_exit(interp, IMCC_FATAL_EXCEPTION);
}
IMCC_CATCH(IMCC_FATALY_EXCEPTION) {
- char * const error_str = string_to_cstring(interp,
+ char * const error_str = Parrot_str_to_cstring(interp,
IMCC_INFO(interp)->error_message);
IMCC_INFO(interp)->error_code=IMCC_FATALY_EXCEPTION;
Modified: branches/pdd28str_part2/compilers/imcc/optimizer.c
==============================================================================
--- branches/pdd28str_part2/compilers/imcc/optimizer.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/compilers/imcc/optimizer.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -827,7 +827,7 @@
case 'N':
{
STRING * const s = Parrot_str_new(interp, r[i]->name, 0);
- REG_NUM(interp, i) = string_to_num(interp, s);
+ REG_NUM(interp, i) = Parrot_str_to_num(interp, s);
}
break;
case 'S':
@@ -1030,7 +1030,7 @@
break;
case 'S':
{
- char * const name = string_to_cstring(interp, REG_STR(interp, 0));
+ char * const name = Parrot_str_to_cstring(interp, REG_STR(interp, 0));
r[1] = mk_const(interp, name, r[0]->set);
Modified: branches/pdd28str_part2/compilers/imcc/pbc.c
==============================================================================
--- branches/pdd28str_part2/compilers/imcc/pbc.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/compilers/imcc/pbc.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -957,7 +957,7 @@
/* past delim */
buf = p + 1;
- s = string_unescape_cstring(interp, buf, '"', charset);
+ s = Parrot_str_unescape(interp, buf, '"', charset);
/* restore colon, as we may reuse this string */
p[-1] = ':';
@@ -965,7 +965,7 @@
}
else if (*buf == '"') {
buf++;
- return string_unescape_cstring(interp, buf, '"', NULL);
+ return Parrot_str_unescape(interp, buf, '"', NULL);
}
else if (*buf == '\'') { /* TODO handle python raw strings */
buf++;
@@ -999,7 +999,7 @@
/* past delim */
buf = p + 1;
- s = string_unescape_cstring(interp, buf, '"', charset);
+ s = Parrot_str_unescape(interp, buf, '"', charset);
/* restore colon, as we may reuse this string */
p[-1] = ':';
@@ -1007,7 +1007,7 @@
}
else if (*buf == '"') {
buf++;
- return string_unescape_cstring(interp, buf, '"', NULL);
+ return Parrot_str_unescape(interp, buf, '"', NULL);
}
else if (*buf == '\'') {
buf++;
@@ -1063,7 +1063,7 @@
STRING * const s = Parrot_str_new(interp, buf, 0);
interp->code->const_table->constants[k]->type = PFC_NUMBER;
- interp->code->const_table->constants[k]->u.number = string_to_num(interp, s);
+ interp->code->const_table->constants[k]->u.number = Parrot_str_to_num(interp, s);
return k;
}
@@ -1773,13 +1773,13 @@
PMC *p;
if (*r->name == '"')
- s = string_unescape_cstring(interp, r->name + 1, '"', NULL);
+ s = Parrot_str_unescape(interp, r->name + 1, '"', NULL);
else if (*r->name == '\'')
- s = string_unescape_cstring(interp, r->name + 1, '\'', NULL);
+ s = Parrot_str_unescape(interp, r->name + 1, '\'', NULL);
else
- s = string_unescape_cstring(interp, r->name, 0, NULL);
+ s = Parrot_str_unescape(interp, r->name, 0, NULL);
p = VTABLE_instantiate_str(interp, _class, s, PObj_constant_FLAG);
Modified: branches/pdd28str_part2/compilers/pirc/src/pir.l
==============================================================================
--- branches/pdd28str_part2/compilers/pirc/src/pir.l Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/compilers/pirc/src/pir.l Tue Feb 3 00:52:53 2009 (r36308)
@@ -411,10 +411,10 @@
*/
lexer_state * const lexer = yyget_extra(yyscanner);
- STRING *pstr = string_unescape_cstring(lexer->interp,
+ STRING *pstr = Parrot_str_unescape(lexer->interp,
yytext + 1, '"', "ascii");
- char *str = string_to_cstring(lexer->interp, pstr);
+ char *str = Parrot_str_to_cstring(lexer->interp, pstr);
yylval->sval = str;
return TK_STRINGC;
Modified: branches/pdd28str_part2/compilers/pirc/src/pirlexer.c
==============================================================================
--- branches/pdd28str_part2/compilers/pirc/src/pirlexer.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/compilers/pirc/src/pirlexer.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -2598,10 +2598,10 @@
*/
lexer_state * const lexer = yypirget_extra(yyscanner);
- STRING *pstr = string_unescape_cstring(lexer->interp,
+ STRING *pstr = Parrot_str_unescape(lexer->interp,
yytext + 1, '"', "ascii");
- char *str = string_to_cstring(lexer->interp, pstr);
+ char *str = Parrot_str_to_cstring(lexer->interp, pstr);
yylval->sval = str;
return TK_STRINGC;
Modified: branches/pdd28str_part2/config/gen/platform/generic/exec.c
==============================================================================
--- branches/pdd28str_part2/config/gen/platform/generic/exec.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/config/gen/platform/generic/exec.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -60,7 +60,7 @@
about to be something else */
int status;
status = execlp("sh", "sh", "-c",
- string_to_cstring(interp, command), (void *)NULL);
+ Parrot_str_to_cstring(interp, command), (void *)NULL);
/* if we get here, something's horribly wrong... */
if (status) {
exit(status);
@@ -116,7 +116,7 @@
argv = (char **)mem_sys_allocate((len+1)*sizeof (char *));
for (i = 0; i < len; ++i) {
s = VTABLE_get_string_keyed_int(interp, cmdargs, i);
- argv[i] = string_to_cstring(interp, s);
+ argv[i] = Parrot_str_to_cstring(interp, s);
}
cmd = argv[0];
argv[i] = NULL;
@@ -146,7 +146,7 @@
{
/* Be horribly profligate with memory, since we're
about to be something else */
- char *cmd = string_to_cstring(interp, command);
+ char *cmd = Parrot_str_to_cstring(interp, command);
int status = execlp("sh", "sh", "-c", cmd, (void *)NULL);
/* if we get here, something's horribly wrong... */
Modified: branches/pdd28str_part2/config/gen/platform/generic/stat.c
==============================================================================
--- branches/pdd28str_part2/config/gen/platform/generic/stat.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/config/gen/platform/generic/stat.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -160,7 +160,7 @@
struct stat statbuf;
/* Get the name of the file as something we can use */
- char * const filename = string_to_cstring(interp, file);
+ char * const filename = Parrot_str_to_cstring(interp, file);
/* Everything needs the result of stat, so just go do it */
const int status = stat(filename, &statbuf);
Modified: branches/pdd28str_part2/config/gen/platform/win32/exec.c
==============================================================================
--- branches/pdd28str_part2/config/gen/platform/win32/exec.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/config/gen/platform/win32/exec.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -45,7 +45,7 @@
int free_it = 0;
char* cmd = mem_sys_allocate(command->strlen + 4);
char* shell = Parrot_getenv("ComSpec", &free_it);
- char* cmdin = string_to_cstring(interp, command);
+ char* cmdin = Parrot_str_to_cstring(interp, command);
strcpy(cmd, "/c ");
strcat(cmd, cmdin);
@@ -112,7 +112,7 @@
/* Now build command line. */
for (i = 0; i < pmclen; i++) {
STRING *s = VTABLE_get_string_keyed_int(interp, cmdargs, i);
- char *cs = string_to_cstring(interp, s);
+ char *cs = Parrot_str_to_cstring(interp, s);
if (cmdlinepos + (int)s->strlen + 3 > cmdlinelen) {
cmdlinelen += s->strlen + 4;
cmdline = mem_sys_realloc(cmdline, cmdlinelen);
@@ -165,7 +165,7 @@
Parrot_Exec_OS_Command(PARROT_INTERP, STRING *command)
{
int status;
- char *in = string_to_cstring(interp, command);
+ char *in = Parrot_str_to_cstring(interp, command);
char *cmd = NULL;
const char **argv = mem_sys_allocate_zeroed(2 * sizeof (int));
Modified: branches/pdd28str_part2/config/gen/platform/win32/stat.c
==============================================================================
--- branches/pdd28str_part2/config/gen/platform/win32/stat.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/config/gen/platform/win32/stat.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -174,7 +174,7 @@
struct stat statbuf;
/* Get the name of the file as something we can use */
- char * const filename = string_to_cstring(interp, file);
+ char * const filename = Parrot_str_to_cstring(interp, file);
/* Everything needs the result of stat, so just go do it */
const int status = stat(filename, &statbuf);
Modified: branches/pdd28str_part2/docs/embed.pod
==============================================================================
--- branches/pdd28str_part2/docs/embed.pod Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/docs/embed.pod Tue Feb 3 00:52:53 2009 (r36308)
@@ -285,7 +285,7 @@
Returns the internal type number corresponding to C<type>. Useful for
instantiating various Parrot data types.
-=item C<char *string_to_cstring(PARROT_INTERP)>
+=item C<char *Parrot_str_to_cstring(PARROT_INTERP)>
XXX needs to be a formal Parrot_* API.
Returns the C string representation of a Parrot string.
Modified: branches/pdd28str_part2/include/parrot/string_funcs.h
==============================================================================
--- branches/pdd28str_part2/include/parrot/string_funcs.h Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/include/parrot/string_funcs.h Tue Feb 3 00:52:53 2009 (r36308)
@@ -266,13 +266,13 @@
PARROT_EXPORT
PARROT_CAN_RETURN_NULL
-STRING * string_escape_string(PARROT_INTERP,
+STRING * Parrot_str_escape(PARROT_INTERP,
ARGIN_NULLOK(const STRING *src))
__attribute__nonnull__(1);
PARROT_EXPORT
PARROT_CAN_RETURN_NULL
-STRING * string_escape_string_delimited(PARROT_INTERP,
+STRING * Parrot_str_escape_truncate(PARROT_INTERP,
ARGIN_NULLOK(const STRING *src),
UINTVAL limit)
__attribute__nonnull__(1);
@@ -289,13 +289,13 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-STRING * string_from_int(PARROT_INTERP, INTVAL i)
+STRING * Parrot_str_from_int(PARROT_INTERP, INTVAL i)
__attribute__nonnull__(1);
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-STRING * string_from_num(PARROT_INTERP, FLOATVAL f)
+STRING * Parrot_str_from_num(PARROT_INTERP, FLOATVAL f)
__attribute__nonnull__(1);
PARROT_EXPORT
@@ -307,7 +307,7 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
-size_t string_hash(PARROT_INTERP, ARGMOD_NULLOK(STRING *s))
+size_t Parrot_str_to_hashval(PARROT_INTERP, ARGMOD_NULLOK(STRING *s))
__attribute__nonnull__(1)
FUNC_MODIFIES(*s);
@@ -477,7 +477,7 @@
PARROT_EXPORT
PARROT_MALLOC
PARROT_CANNOT_RETURN_NULL
-char * string_to_cstring(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
+char * Parrot_str_to_cstring(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
__attribute__nonnull__(1);
PARROT_EXPORT
@@ -488,17 +488,17 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
-INTVAL string_to_int(SHIM_INTERP, ARGIN_NULLOK(const STRING *s));
+INTVAL Parrot_str_to_int(SHIM_INTERP, ARGIN_NULLOK(const STRING *s));
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
-FLOATVAL string_to_num(PARROT_INTERP, ARGIN(const STRING *s))
+FLOATVAL Parrot_str_to_num(PARROT_INTERP, ARGIN(const STRING *s))
__attribute__nonnull__(1)
__attribute__nonnull__(2);
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
-STRING * string_unescape_cstring(PARROT_INTERP,
+STRING * Parrot_str_unescape(PARROT_INTERP,
ARGIN(const char *cstring),
char delimiter,
ARGIN_NULLOK(const char *enc_char))
@@ -524,7 +524,7 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-STRING * int_to_str(PARROT_INTERP,
+STRING * Parrot_str_from_int_base(PARROT_INTERP,
ARGOUT(char *tc),
HUGEINTVAL num,
unsigned int base)
@@ -538,7 +538,7 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
-STRING* uint_to_str(PARROT_INTERP,
+STRING* Parrot_str_from_uint(PARROT_INTERP,
ARGOUT(char *tc),
UHUGEINTVAL num,
unsigned int base,
@@ -622,21 +622,21 @@
|| PARROT_ASSERT_ARG(s)
#define ASSERT_ARGS_Parrot_str_equal __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_escape_string __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_escape __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_escape_string_delimited \
+#define ASSERT_ARGS_Parrot_str_escape_truncate \
__attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_str_new __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_from_int __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_from_int __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_string_from_num __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_from_num __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_Parrot_str_resize __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_string_hash __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_to_hashval __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_string_increment __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
@@ -701,14 +701,14 @@
#define ASSERT_ARGS_string_titlecase_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_string_to_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_to_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_string_to_cstring_nullable __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_string_to_int __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
-#define ASSERT_ARGS_string_to_num __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_to_int __attribute__unused__ int _ASSERT_ARGS_CHECK = 0
+#define ASSERT_ARGS_Parrot_str_to_num __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_string_unescape_cstring __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_unescape __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(cstring)
#define ASSERT_ARGS_string_unpin __attribute__unused__ int _ASSERT_ARGS_CHECK = \
@@ -718,13 +718,13 @@
PARROT_ASSERT_ARG(interp)
#define ASSERT_ARGS_string_upcase_inplace __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp)
-#define ASSERT_ARGS_int_to_str __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_from_int_base __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(tc)
#define ASSERT_ARGS_string_free __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(s)
-#define ASSERT_ARGS_uint_to_str __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+#define ASSERT_ARGS_Parrot_str_from_uint __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(tc)
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
Modified: branches/pdd28str_part2/languages/lua/src/pmc/lua.pmc
==============================================================================
--- branches/pdd28str_part2/languages/lua/src/pmc/lua.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/languages/lua/src/pmc/lua.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -139,7 +139,7 @@
LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME
};
- char *loc = (locale != NULL) ? string_to_cstring(INTERP, locale) : NULL;
+ char *loc = (locale != NULL) ? Parrot_str_to_cstring(INTERP, locale) : NULL;
char *p = setlocale(cat[category], loc);
PMC *retval;
@@ -178,7 +178,7 @@
stm.tm_isdst = VTABLE_get_integer_keyed_int(INTERP, tm, 8);
{ /* Limit s scope and lifetime */
- char *s = string_to_cstring(INTERP, fmt);
+ char *s = Parrot_str_to_cstring(INTERP, fmt);
reslen = strftime(b, sizeof b, s, &stm);
string_cstring_free(s);
}
Modified: branches/pdd28str_part2/languages/lua/src/pmc/luaboolean.pmc
==============================================================================
--- branches/pdd28str_part2/languages/lua/src/pmc/luaboolean.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/languages/lua/src/pmc/luaboolean.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -63,7 +63,7 @@
res = constant_pmc_new(INTERP, type);
else
res = pmc_new(INTERP, type);
- PMC_int_val(res) = (string_to_int(INTERP, rep) != 0);
+ PMC_int_val(res) = (Parrot_str_to_int(INTERP, rep) != 0);
return res;
}
Modified: branches/pdd28str_part2/languages/lua/src/pmc/luanumber.pmc
==============================================================================
--- branches/pdd28str_part2/languages/lua/src/pmc/luanumber.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/languages/lua/src/pmc/luanumber.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -69,7 +69,7 @@
res = constant_pmc_new(INTERP, type);
else
res = pmc_new(INTERP, type);
- PMC_num_val(res) = string_to_num(INTERP, rep);
+ PMC_num_val(res) = Parrot_str_to_num(INTERP, rep);
return res;
}
Modified: branches/pdd28str_part2/languages/lua/src/pmc/luastring.pmc
==============================================================================
--- branches/pdd28str_part2/languages/lua/src/pmc/luastring.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/languages/lua/src/pmc/luastring.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -159,7 +159,7 @@
VTABLE void set_string_native(STRING *value) {
/* Only allow constant PMCs to embed constant strings */
if (PObj_constant_TEST(SELF) && !PObj_constant_TEST(value)) {
- const char *copy = string_to_cstring(INTERP, value);
+ const char *copy = Parrot_str_to_cstring(INTERP, value);
value = Parrot_str_new_constant(INTERP, copy);
}
@@ -1025,7 +1025,7 @@
METHOD PMC* tonumber() {
PMC *retval;
STRING *rep = SELF.get_string();
- char *s1 = string_to_cstring(INTERP, rep);
+ char *s1 = Parrot_str_to_cstring(INTERP, rep);
char *s2;
FLOATVAL d = strtod(s1, &s2);
@@ -1058,7 +1058,7 @@
METHOD PMC* tobase(INTVAL base) {
PMC *retval;
STRING *rep = SELF.get_string();
- char *s1 = string_to_cstring(INTERP, rep);
+ char *s1 = Parrot_str_to_cstring(INTERP, rep);
char *s2;
unsigned long n = strtoul(s1, &s2, base);
Modified: branches/pdd28str_part2/languages/lua/src/pmc/luatable.pmc
==============================================================================
--- branches/pdd28str_part2/languages/lua/src/pmc/luatable.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/languages/lua/src/pmc/luatable.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -101,7 +101,7 @@
h = PMC_int_val(key);
}
else if (PMC_type(key) == dynpmc_LuaString) {
- h = string_hash(interp, VTABLE_get_string(interp, key));
+ h = Parrot_str_to_hashval(interp, VTABLE_get_string(interp, key));
}
else {
h = (unsigned long)PMC_struct_val(key);
@@ -117,7 +117,7 @@
/* specialized version for strings */
static PMC** lua_getstr(PARROT_INTERP, const LuaHash *t, STRING *key)
{
- unsigned long h = string_hash(interp, key);
+ unsigned long h = Parrot_str_to_hashval(interp, key);
Node *n = &t->node[h&(t->size-1)];
do {
Modified: branches/pdd28str_part2/languages/pipp/src/pmc/phparray.pmc
==============================================================================
--- branches/pdd28str_part2/languages/pipp/src/pmc/phparray.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/languages/pipp/src/pmc/phparray.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -200,7 +200,7 @@
PippHashTable *ht;
PMC *p_val = pmc_new(INTERP, enum_class_Integer);
- STRING *s_key = string_from_int(INTERP, i_key);
+ STRING *s_key = Parrot_str_from_int(INTERP, i_key);
GET_ATTR_hash_table(INTERP, SELF, ht);
VTABLE_set_integer_native(INTERP, p_val, i_val);
@@ -274,7 +274,7 @@
VTABLE void set_pmc_keyed_int(INTVAL i_key, PMC *p_val) {
PippHashTable *ht;
- STRING *s_key = string_from_int(INTERP, i_key);
+ STRING *s_key = Parrot_str_from_int(INTERP, i_key);
GET_ATTR_hash_table(INTERP, SELF, ht);
pipp_hash_put(INTERP, ht, s_key, p_val);
@@ -349,7 +349,7 @@
VTABLE void set_string_keyed_int(INTVAL i_key, STRING *s_val) {
PippHashTable *ht;
- STRING *s_key = string_from_int(INTERP, i_key);
+ STRING *s_key = Parrot_str_from_int(INTERP, i_key);
PMC *p_val = pmc_new(INTERP, enum_class_String);
GET_ATTR_hash_table(INTERP, SELF, ht);
@@ -427,7 +427,7 @@
VTABLE void set_number_keyed_int(INTVAL i_key, FLOATVAL f_val) {
PippHashTable *ht;
- STRING *s_key = string_from_int(INTERP, i_key);
+ STRING *s_key = Parrot_str_from_int(INTERP, i_key);
PMC *p_val = pmc_new(INTERP, enum_class_Float);
GET_ATTR_hash_table(INTERP, SELF, ht);
@@ -509,7 +509,7 @@
PippHashTable *ht;
PMC *p_val;
- STRING *s_key = string_from_int(INTERP, i_key);
+ STRING *s_key = Parrot_str_from_int(INTERP, i_key);
GET_ATTR_hash_table(INTERP, SELF, ht);
p_val = pipp_hash_get(INTERP, ht, s_key);
@@ -598,7 +598,7 @@
VTABLE PMC *get_pmc_keyed_int(INTVAL i_key) {
PippHashTable *ht;
- STRING *s_key = string_from_int(INTERP, i_key);
+ STRING *s_key = Parrot_str_from_int(INTERP, i_key);
GET_ATTR_hash_table(INTERP, SELF, ht);
@@ -688,7 +688,7 @@
PippHashTable *ht;
PMC *p_val;
- STRING *s_key = string_from_int(INTERP, i_key);
+ STRING *s_key = Parrot_str_from_int(INTERP, i_key);
GET_ATTR_hash_table(INTERP, SELF, ht);
@@ -771,7 +771,7 @@
PippHashTable *ht;
PMC *p_val;
- STRING *s_key = string_from_int(INTERP, i_key);
+ STRING *s_key = Parrot_str_from_int(INTERP, i_key);
GET_ATTR_hash_table(INTERP, SELF, ht);
@@ -842,7 +842,7 @@
VTABLE INTVAL exists_keyed_int(INTVAL i_key) {
PippHashTable *ht;
- STRING *s_key = string_from_int(INTERP, i_key);
+ STRING *s_key = Parrot_str_from_int(INTERP, i_key);
GET_ATTR_hash_table(INTERP, SELF, ht);
@@ -917,7 +917,7 @@
VTABLE void delete_keyed_int(INTVAL i_key) {
PippHashTable *ht;
- STRING *s_key = string_from_int(INTERP, i_key);
+ STRING *s_key = Parrot_str_from_int(INTERP, i_key);
GET_ATTR_hash_table(INTERP, SELF, ht);
Modified: branches/pdd28str_part2/languages/pipp/src/pmc/phpstring.pmc
==============================================================================
--- branches/pdd28str_part2/languages/pipp/src/pmc/phpstring.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/languages/pipp/src/pmc/phpstring.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -68,7 +68,7 @@
METHOD INTVAL is_numeric(INTVAL allow_errors) {
INTVAL retval = 0;
STRING *rep = SELF.get_string();
- char *s = string_to_cstring(INTERP, rep);
+ char *s = Parrot_str_to_cstring(INTERP, rep);
char *s1, *s2;
INTVAL i;
@@ -107,7 +107,7 @@
METHOD PMC* to_base(INTVAL base) {
PMC *retval;
STRING *rep = SELF.get_string();
- char *s1 = string_to_cstring(INTERP, rep);
+ char *s1 = Parrot_str_to_cstring(INTERP, rep);
char *s2;
unsigned long n = strtoul(s1, &s2, base);
@@ -127,7 +127,7 @@
METHOD PMC* to_number() {
PMC *retval;
STRING *rep = SELF.get_string();
- char *s = string_to_cstring(INTERP, rep);
+ char *s = Parrot_str_to_cstring(INTERP, rep);
char *s1, *s2;
INTVAL i;
Modified: branches/pdd28str_part2/languages/regex/pmc/match.pmc
==============================================================================
--- branches/pdd28str_part2/languages/regex/pmc/match.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/languages/regex/pmc/match.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -75,7 +75,7 @@
{
if (val->vtable->base_type == MatchRange_type_id) {
STRING* valstr = match_range(interp, matchobj, val);
- return string_to_int(interp, valstr);
+ return Parrot_str_to_int(interp, valstr);
}
else {
return VTABLE_get_integer(interp, val);
@@ -145,7 +145,7 @@
result = parrot_hash_get_idx(interp, hash, key);
if (hash->key_type == Hash_key_type_int)
- return string_from_int(interp, (INTVAL)result);
+ return Parrot_str_from_int(interp, (INTVAL)result);
return (STRING *)result;
default:
@@ -181,7 +181,7 @@
if (hash->key_type == Hash_key_type_int)
return (INTVAL)result;
else
- return string_to_int(interp, (STRING *)result);
+ return Parrot_str_to_int(interp, (STRING *)result);
default:
keystr = make_hash_key(interp, key);
}
Modified: branches/pdd28str_part2/src/datatypes.c
==============================================================================
--- branches/pdd28str_part2/src/datatypes.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/datatypes.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -41,7 +41,7 @@
Parrot_get_datatype_enum(PARROT_INTERP, ARGIN(const STRING *type_name))
{
ASSERT_ARGS(Parrot_get_datatype_enum)
- char * const type = string_to_cstring(interp, type_name);
+ char * const type = Parrot_str_to_cstring(interp, type_name);
int i;
for (i = enum_first_type; i < enum_last_type; i++) {
Modified: branches/pdd28str_part2/src/debug.c
==============================================================================
--- branches/pdd28str_part2/src/debug.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/debug.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -1224,7 +1224,7 @@
if (!interp->pdb)
Parrot_ex_throw_from_c_args(interp, NULL, 0, "No debugger");
- file = string_to_cstring(interp, filename);
+ file = Parrot_str_to_cstring(interp, filename);
PDB_load_source(interp, file);
string_cstring_free(file);
}
@@ -2760,7 +2760,7 @@
case KEY_string_FLAG:
dest[size++] = '"';
{
- char * const temp = string_to_cstring(interp, PMC_str_val(k));
+ char * const temp = Parrot_str_to_cstring(interp, PMC_str_val(k));
strcpy(&dest[size], temp);
string_cstring_free(temp);
}
@@ -3647,9 +3647,9 @@
if (n >= 0 && n < CONTEXT(interp)->n_regs_used[t]) {
switch (t) {
case REGNO_INT:
- return string_from_int(interp, REG_INT(interp, n))->strstart;
+ return Parrot_str_from_int(interp, REG_INT(interp, n))->strstart;
case REGNO_NUM:
- return string_from_num(interp, REG_NUM(interp, n))->strstart;
+ return Parrot_str_from_num(interp, REG_NUM(interp, n))->strstart;
case REGNO_STR:
return REG_STR(interp, n)->strstart;
case REGNO_PMC:
Modified: branches/pdd28str_part2/src/dynext.c
==============================================================================
--- branches/pdd28str_part2/src/dynext.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/dynext.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -391,8 +391,8 @@
"Parrot_lib_%Ss_load", lib_name);
STRING * const init_func_name = Parrot_sprintf_c(interp,
"Parrot_lib_%Ss_init", lib_name);
- char * const cload_func_name = string_to_cstring(interp, load_name);
- char * const cinit_func_name = string_to_cstring(interp, init_func_name);
+ char * const cload_func_name = Parrot_str_to_cstring(interp, load_name);
+ char * const cinit_func_name = Parrot_str_to_cstring(interp, init_func_name);
/* get load_func */
load_func = (PMC * (*)(PARROT_INTERP))
@@ -452,7 +452,7 @@
{
ASSERT_ARGS(clone_string_into)
STRING * const orig = VTABLE_get_string(s, value);
- char * const raw_str = string_to_cstring(s, orig);
+ char * const raw_str = Parrot_str_to_cstring(s, orig);
STRING * const ret =
Parrot_str_new_init(d, raw_str, strlen(raw_str),
PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
Modified: branches/pdd28str_part2/src/extend.c
==============================================================================
--- branches/pdd28str_part2/src/extend.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/extend.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -376,7 +376,7 @@
PARROT_CALLIN_START(interp);
intermediate = VTABLE_get_string_keyed_int(interp, pmc, key);
- retval = string_to_cstring(interp, intermediate);
+ retval = Parrot_str_to_cstring(interp, intermediate);
PARROT_CALLIN_END(interp);
return retval;
@@ -406,7 +406,7 @@
PARROT_CALLIN_START(interp);
intermediate = VTABLE_get_string(interp, pmc);
- retval = string_to_cstring(interp, intermediate);
+ retval = Parrot_str_to_cstring(interp, intermediate);
PARROT_CALLIN_END(interp);
return retval;
@@ -438,7 +438,7 @@
char *retval;
PARROT_CALLIN_START(interp);
- retval = string_to_cstring(interp, VTABLE_get_string(interp, pmc));
+ retval = Parrot_str_to_cstring(interp, VTABLE_get_string(interp, pmc));
*length = strlen(retval);
PARROT_CALLIN_END(interp);
@@ -471,7 +471,7 @@
char *retval;
PARROT_CALLIN_START(interp);
- retval = string_to_cstring(interp,
+ retval = Parrot_str_to_cstring(interp,
VTABLE_get_string_keyed_int(interp, pmc, key));
*length = strlen(retval);
PARROT_CALLIN_END(interp);
Modified: branches/pdd28str_part2/src/hash.c
==============================================================================
--- branches/pdd28str_part2/src/hash.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/hash.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -188,7 +188,7 @@
if (s->hashval)
return s->hashval;
- return string_hash(interp, s);
+ return Parrot_str_to_hashval(interp, s);
}
Modified: branches/pdd28str_part2/src/hll.c
==============================================================================
--- branches/pdd28str_part2/src/hll.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/hll.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -95,7 +95,7 @@
PMC * const entry = constant_pmc_new(interp, enum_class_FixedPMCArray);
if (entry_name && !STRING_IS_EMPTY(entry_name)) {
- char * const cstring = string_to_cstring(interp, entry_name);
+ char * const cstring = Parrot_str_to_cstring(interp, entry_name);
const UINTVAL len = Parrot_str_byte_length(interp, entry_name);
STRING *const_name = Parrot_str_new_init(interp, cstring,
len, PARROT_DEFAULT_ENCODING, PARROT_DEFAULT_CHARSET,
Modified: branches/pdd28str_part2/src/inter_call.c
==============================================================================
--- branches/pdd28str_part2/src/inter_call.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/inter_call.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -892,7 +892,7 @@
UVal_num(st->val) = (FLOATVAL)UVal_int(st->val);
break;
case PARROT_ARG_STRING:
- UVal_str(st->val) = string_from_int(interp, UVal_int(st->val));
+ UVal_str(st->val) = Parrot_str_from_int(interp, UVal_int(st->val));
break;
case PARROT_ARG_PMC:
{
@@ -927,7 +927,7 @@
UVal_int(st->val) = (INTVAL)UVal_num(st->val);
break;
case PARROT_ARG_STRING:
- UVal_str(st->val) = string_from_num(interp, UVal_num(st->val));
+ UVal_str(st->val) = Parrot_str_from_num(interp, UVal_num(st->val));
break;
case PARROT_ARG_PMC:
{
@@ -960,10 +960,10 @@
ASSERT_ARGS(convert_arg_from_str)
switch (st->dest.sig & PARROT_ARG_TYPE_MASK) {
case PARROT_ARG_INTVAL:
- UVal_int(st->val) = string_to_int(interp, UVal_str(st->val));
+ UVal_int(st->val) = Parrot_str_to_int(interp, UVal_str(st->val));
break;
case PARROT_ARG_FLOATVAL:
- UVal_num(st->val) = string_to_num(interp, UVal_str(st->val));
+ UVal_num(st->val) = Parrot_str_to_num(interp, UVal_str(st->val));
break;
case PARROT_ARG_PMC:
{
@@ -2813,7 +2813,7 @@
/* create the signature string, and the various PMCs that are needed to
store all the parameters and parameter counts. */
- char * const signature = string_to_cstring(interp, VTABLE_get_string(interp, sig_obj));
+ char * const signature = Parrot_str_to_cstring(interp, VTABLE_get_string(interp, sig_obj));
PMC * const args_sig = temporary_pmc_new(interp, enum_class_FixedIntegerArray);
PMC * const results_sig = temporary_pmc_new(interp, enum_class_FixedIntegerArray);
PMC * const ret_cont = new_ret_continuation_pmc(interp, NULL);
Modified: branches/pdd28str_part2/src/inter_misc.c
==============================================================================
--- branches/pdd28str_part2/src/inter_misc.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/inter_misc.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -387,7 +387,7 @@
else {
/* Need to strip back to what follows the final / or \. */
STRING *fullname = VTABLE_get_string(interp, exe_name);
- char *fullname_c = string_to_cstring(interp, fullname);
+ char *fullname_c = Parrot_str_to_cstring(interp, fullname);
int pos = strlen(fullname_c) - 1;
while (pos > 0
Modified: branches/pdd28str_part2/src/io/portable.c
==============================================================================
--- branches/pdd28str_part2/src/io/portable.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/io/portable.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -144,7 +144,7 @@
flags |= PIO_F_FILE;
{ /* scope for temporary C string */
- char * const spath = string_to_cstring(interp, path);
+ char * const spath = Parrot_str_to_cstring(interp, path);
/* Try opening the file
* note that this can't really handle O_EXCL, etc. */
fptr = fopen(spath, oflags);
Modified: branches/pdd28str_part2/src/io/socket_unix.c
==============================================================================
--- branches/pdd28str_part2/src/io/socket_unix.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/io/socket_unix.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -76,7 +76,7 @@
/* Hard coded to IPv4 for now */
const int family = AF_INET;
- char * const s = string_to_cstring(interp, addr);
+ char * const s = Parrot_str_to_cstring(interp, addr);
/*
* due to a bug in OS/X, we've to zero the struct
* else bind is failing erratically
Modified: branches/pdd28str_part2/src/io/socket_win32.c
==============================================================================
--- branches/pdd28str_part2/src/io/socket_win32.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/io/socket_win32.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -340,7 +340,7 @@
{
struct sockaddr_in sa;
struct hostent *he;
- char * const s = string_to_cstring(interp, addr);
+ char * const s = Parrot_str_to_cstring(interp, addr);
/* Hard coded to IPv4 for now */
sa.sin_addr.s_addr = inet_addr(s);
Modified: branches/pdd28str_part2/src/io/unix.c
==============================================================================
--- branches/pdd28str_part2/src/io/unix.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/io/unix.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -156,7 +156,7 @@
"Invalid mode for file open");
oflags = convert_flags_to_unix(flags);
- spath = string_to_cstring(interp, path);
+ spath = Parrot_str_to_cstring(interp, path);
/* Only files for now */
flags |= PIO_F_FILE;
@@ -692,7 +692,7 @@
/* XXX ugly hack to be able to pass some arguments
* split cmd at blanks */
- orig_cmd = cmd = string_to_cstring(interp, command);
+ orig_cmd = cmd = Parrot_str_to_cstring(interp, command);
c = strdup(cmd);
for (n = 0, p = strtok(c, " "); n < 9 && p; p = strtok(NULL, " ")) {
Modified: branches/pdd28str_part2/src/io/win32.c
==============================================================================
--- branches/pdd28str_part2/src/io/win32.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/io/win32.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -224,7 +224,7 @@
flags |= PIO_F_FILE;
{ /* enclosing scope for temporary C string */
- char * const spath = string_to_cstring(interp, path);
+ char * const spath = Parrot_str_to_cstring(interp, path);
fd = CreateFile(spath, fAcc, fShare, NULL, fCreat,
FILE_ATTRIBUTE_NORMAL, NULL);
string_cstring_free(spath);
Modified: branches/pdd28str_part2/src/jit_debug.c
==============================================================================
--- branches/pdd28str_part2/src/jit_debug.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/jit_debug.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -283,7 +283,7 @@
if (interp->code->debugs) {
char *ext;
- char * const src = string_to_cstring(interp,
+ char * const src = Parrot_str_to_cstring(interp,
Parrot_debug_pc_to_filename(interp,
interp->code->debugs, 0));
pasmfile = string_make(interp, src, strlen(src), NULL,
@@ -310,7 +310,7 @@
stabsfile = debug_file(interp, file, "stabs.s");
ofile = debug_file(interp, file, "o");
{
- char *const temp = string_to_cstring(interp, stabsfile);
+ char *const temp = Parrot_str_to_cstring(interp, stabsfile);
stabs = fopen(temp, "w");
string_cstring_free(temp);
}
@@ -318,7 +318,7 @@
return;
{
- char * const temp = string_to_cstring(interp, pasmfile);
+ char * const temp = Parrot_str_to_cstring(interp, pasmfile);
/* filename info */
fprintf(stabs, ".data\n.text\n"); /* darwin wants it */
fprintf(stabs, ".stabs \"%s\"," N_SO ",0,0,0\n", temp);
@@ -364,7 +364,7 @@
cmd = Parrot_sprintf_c(interp, "as %Ss -o %Ss", stabsfile, ofile);
{
- char * const temp = string_to_cstring(interp, cmd);
+ char * const temp = Parrot_str_to_cstring(interp, cmd);
int status = system(temp);
if (status)
fprintf(stderr, "Assembly failed: %d\n%s\n", status, temp);
Modified: branches/pdd28str_part2/src/jit_debug_xcoff.c
==============================================================================
--- branches/pdd28str_part2/src/jit_debug_xcoff.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/jit_debug_xcoff.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -254,7 +254,7 @@
if (interp->code->debugs) {
char *ext;
- char * const src = string_to_cstring(interp,
+ char * const src = Parrot_str_to_cstring(interp,
Parrot_debug_pc_to_filename(interp,
interp->code->debugs, 0));
pasmfile = string_make(interp, src, strlen(src), NULL,
@@ -280,7 +280,7 @@
stabsfile = debug_file(interp, file, "stabs.s");
ofile = debug_file(interp, file, "o");
{
- char * const temp = string_to_cstring(interp, stabsfile);
+ char * const temp = Parrot_str_to_cstring(interp, stabsfile);
stabs = fopen(temp, "w");
string_cstring_free(temp);
}
@@ -288,7 +288,7 @@
return;
{
- char * const temp = string_to_cstring(interp, pasmfile);
+ char * const temp = Parrot_str_to_cstring(interp, pasmfile);
/* filename info */
fprintf(stabs, ".file \"%s\"\n", temp);
string_cstring_free(temp);
@@ -334,7 +334,7 @@
cmd = Parrot_sprintf_c(interp, "as %Ss -o %Ss", stabsfile, ofile);
{
- char * const temp = string_to_cstring(interp, cmd);
+ char * const temp = Parrot_str_to_cstring(interp, cmd);
system(temp);
string_cstring_free(temp);
}
Modified: branches/pdd28str_part2/src/key.c
==============================================================================
--- branches/pdd28str_part2/src/key.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/key.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -338,17 +338,17 @@
return VTABLE_get_integer(interp, reg);
}
case KEY_string_FLAG:
- return string_to_int(interp, PMC_str_val(key));
+ return Parrot_str_to_int(interp, PMC_str_val(key));
case KEY_string_FLAG | KEY_register_FLAG:
{
STRING * const s_reg = REG_STR(interp, PMC_int_val(key));
- return string_to_int(interp, s_reg);
+ return Parrot_str_to_int(interp, s_reg);
}
case KEY_string_FLAG | KEY_start_slice_FLAG:
case KEY_string_FLAG | KEY_inf_slice_FLAG:
{
STRING * const s_key = VTABLE_get_string(interp, key);
- return string_to_int(interp, s_key);
+ return Parrot_str_to_int(interp, s_key);
}
case KEY_start_slice_FLAG:
case KEY_inf_slice_FLAG:
@@ -440,9 +440,9 @@
return VTABLE_get_string(interp, reg);
}
case KEY_integer_FLAG:
- return string_from_int(interp, PMC_int_val(key));
+ return Parrot_str_from_int(interp, PMC_int_val(key));
case KEY_integer_FLAG | KEY_register_FLAG:
- return string_from_int(interp, REG_INT(interp, PMC_int_val(key)));
+ return Parrot_str_from_int(interp, REG_INT(interp, PMC_int_val(key)));
default:
case KEY_pmc_FLAG:
return VTABLE_get_string(interp, key);
@@ -595,7 +595,7 @@
switch (PObj_get_FLAGS(key) & KEY_type_FLAGS) {
case KEY_integer_FLAG:
value = Parrot_str_append(interp, value,
- string_from_int(interp, PMC_int_val(key)));
+ Parrot_str_from_int(interp, PMC_int_val(key)));
break;
case KEY_string_FLAG:
value = Parrot_str_append(interp, value, quote);
@@ -608,7 +608,7 @@
break;
case KEY_integer_FLAG | KEY_register_FLAG:
value = Parrot_str_append(interp, value,
- string_from_int(interp,
+ Parrot_str_from_int(interp,
REG_INT(interp, PMC_int_val(key))));
break;
case KEY_string_FLAG | KEY_register_FLAG:
Modified: branches/pdd28str_part2/src/library.c
==============================================================================
--- branches/pdd28str_part2/src/library.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/library.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -602,7 +602,7 @@
=item C<char* Parrot_locate_runtime_file>
Locate the full path for C<file_name> and the given file type(s). If
-successful, returns a C-string allocated with C<string_to_cstring> or
+successful, returns a C-string allocated with C<Parrot_str_to_cstring> or
NULL otherwise. Remember to free the string with C<string_cstring_free()>.
=item C<STRING* Parrot_locate_runtime_file_str>
@@ -692,7 +692,7 @@
*
* see also the log at #37814
*/
- return result ? string_to_cstring(interp, result) : NULL;
+ return result ? Parrot_str_to_cstring(interp, result) : NULL;
}
/*
@@ -728,7 +728,7 @@
if (VTABLE_elements(interp, config_hash)) {
STRING * const key = CONST_STRING(interp, "prefix");
STRING * const s = VTABLE_get_string_keyed_str(interp, config_hash, key);
- return string_to_cstring(interp, s);
+ return Parrot_str_to_cstring(interp, s);
}
else
return str_dup(".");
Modified: branches/pdd28str_part2/src/oo.c
==============================================================================
--- branches/pdd28str_part2/src/oo.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/oo.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -131,7 +131,7 @@
vtable_overrides, vtable_index_str);
/* Look up the name of the vtable function from the index. */
- const INTVAL vtable_index = string_to_int(interp, vtable_index_str);
+ const INTVAL vtable_index = Parrot_str_to_int(interp, vtable_index_str);
const char * const meth_c = Parrot_vtable_slot_names[vtable_index];
STRING *vtable_name = Parrot_str_new(interp, meth_c, 0);
@@ -406,7 +406,7 @@
Parrot_get_vtable_index(PARROT_INTERP, ARGIN(const STRING *name))
{
ASSERT_ARGS(Parrot_get_vtable_index)
- char * const name_c = string_to_cstring(interp, name);
+ char * const name_c = Parrot_str_to_cstring(interp, name);
/* some of the first "slots" don't have names. skip 'em. */
INTVAL low = PARROT_VTABLE_LOW;
@@ -532,7 +532,7 @@
STRING *classname = VTABLE_get_string(interp, _namespace);
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INVALID_OPERATION,
"Class %Ss already registered!\n",
- string_escape_string(interp, classname));
+ Parrot_str_escape(interp, classname));
}
/* Type doesn't exist, so go ahead and register it. Lock interpreter so
Modified: branches/pdd28str_part2/src/ops/core.ops
==============================================================================
--- branches/pdd28str_part2/src/ops/core.ops Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/ops/core.ops Tue Feb 3 00:52:53 2009 (r36308)
@@ -187,7 +187,7 @@
inline op branch_cs(in STR) :base_loop :check_event :flow {
PackFile_FixupEntry * fe;
{
- char * const label = string_to_cstring(interp, $1);
+ char * const label = Parrot_str_to_cstring(interp, $1);
fe = PackFile_find_fixup_entry(interp, enum_fixup_label, label);
string_cstring_free(label);
}
@@ -1331,7 +1331,7 @@
}
op dlfunc(out PMC, invar PMC, in STR, in STR) {
- char * const name = string_to_cstring(interp, ($3));
+ char * const name = Parrot_str_to_cstring(interp, ($3));
void * const ptr = Parrot_dlsym(
PMC_IS_NULL($2) ? NULL :
VTABLE_defined(interp, $2) ? PMC_data($2) :
@@ -1355,7 +1355,7 @@
}
op dlvar(out PMC, invar PMC, in STR) {
- char * const name = string_to_cstring(interp, ($3));
+ char * const name = Parrot_str_to_cstring(interp, ($3));
void * const p = Parrot_dlsym(PMC_IS_NULL($2) ? NULL : PMC_data($2), name);
if (p == NULL) {
const char * const err = Parrot_dlerror();
Modified: branches/pdd28str_part2/src/ops/set.ops
==============================================================================
--- branches/pdd28str_part2/src/ops/set.ops Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/ops/set.ops Tue Feb 3 00:52:53 2009 (r36308)
@@ -125,7 +125,7 @@
}
inline op set(out INT, in STR) :base_core {
- $1 = string_to_int(interp, $2);
+ $1 = Parrot_str_to_int(interp, $2);
}
inline op set(out NUM, in NUM) :base_core {
@@ -137,7 +137,7 @@
}
inline op set(out NUM, in STR) :base_core {
- $1 = string_to_num(interp, $2);
+ $1 = Parrot_str_to_num(interp, $2);
}
inline op set(out NUM, invar PMC) :base_core {
@@ -157,11 +157,11 @@
}
inline op set(out STR, in INT) :base_core {
- $1 = string_from_int(interp, $2);
+ $1 = Parrot_str_from_int(interp, $2);
}
inline op set(out STR, in NUM) :base_core {
- $1 = string_from_num(interp, $2);
+ $1 = Parrot_str_from_num(interp, $2);
}
inline op set(out PMC, inconst PMC) :base_core {
Modified: branches/pdd28str_part2/src/ops/string.ops
==============================================================================
--- branches/pdd28str_part2/src/ops/string.ops Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/ops/string.ops Tue Feb 3 00:52:53 2009 (r36308)
@@ -653,7 +653,7 @@
=cut
op escape(out STR, invar STR) {
- $1 = string_escape_string(interp, $2);
+ $1 = Parrot_str_escape(interp, $2);
}
op compose(out STR, in STR) {
Modified: branches/pdd28str_part2/src/packdump.c
==============================================================================
--- branches/pdd28str_part2/src/packdump.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/packdump.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -167,7 +167,7 @@
(long)i);
Parrot_io_printf(interp, " DATA => \"%Ss\"\n",
- string_escape_string(interp, self->u.string));
+ Parrot_str_escape(interp, self->u.string));
Parrot_io_printf(interp, " } ],\n");
break;
Modified: branches/pdd28str_part2/src/packfile.c
==============================================================================
--- branches/pdd28str_part2/src/packfile.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/packfile.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -2599,7 +2599,7 @@
Parrot_io_printf(interp, "\n mappings => [\n");
for (i = 0; i < debug->num_mappings; i++) {
- char * const filename = string_to_cstring(interp, PF_CONST(debug->code,
+ char * const filename = Parrot_str_to_cstring(interp, PF_CONST(debug->code,
debug->mappings[i]->filename)->u.string);;
Parrot_io_printf(interp, " #%d\n [\n", i);
Parrot_io_printf(interp, " OFFSET => %d,\n",
@@ -4067,7 +4067,7 @@
/* Dump keys. */
Parrot_io_printf(interp, "\n keys => [\n");
for (i = 0; i < self->num_keys; i++) {
- char * const key_name = string_to_cstring(interp, PF_CONST(self->code,
+ char * const key_name = Parrot_str_to_cstring(interp, PF_CONST(self->code,
self->keys[i]->name)->u.string);
Parrot_io_printf(interp, " #%d\n [\n", i);
Parrot_io_printf(interp, " NAME => %s\n", key_name);
@@ -4433,7 +4433,7 @@
/* remember wo_ext => full_path mapping */
VTABLE_set_string_keyed_str(interp, is_loaded_hash,
wo_ext, path);
- filename = string_to_cstring(interp, path);
+ filename = Parrot_str_to_cstring(interp, path);
if (file_type == PARROT_RUNTIME_FT_PBC) {
PackFile *pf = PackFile_append_pbc(interp, filename);
string_cstring_free(filename);
Modified: branches/pdd28str_part2/src/pmc/bigint.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/bigint.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/bigint.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -692,13 +692,13 @@
*/
VTABLE void set_string_native(STRING *value) {
- char * const s = string_to_cstring(INTERP, value);
+ char * const s = Parrot_str_to_cstring(INTERP, value);
bigint_set_str(INTERP, SELF, s, 10);
string_cstring_free(s);
}
VTABLE void set_string_keyed_int(INTVAL base, STRING *value) {
- char * const s = string_to_cstring(INTERP, value);
+ char * const s = Parrot_str_to_cstring(INTERP, value);
bigint_set_str(INTERP, SELF, s, base);
string_cstring_free(s);
}
Modified: branches/pdd28str_part2/src/pmc/codestring.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/codestring.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/codestring.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -83,7 +83,7 @@
}
else if (Parrot_string_is_cclass(INTERP, enum_cclass_numeric, fmt,
(UINTVAL)pos + 1)) {
- I0 = string_to_int(INTERP, key);
+ I0 = Parrot_str_to_int(INTERP, key);
repl = VTABLE_get_string_keyed_int(INTERP, args, I0);
}
else if (0 == Parrot_str_equal(INTERP, key, comma)) {
@@ -140,7 +140,7 @@
METHOD unique(STRING *format :optional, int has_fmt :opt_flag) {
static INTVAL counter = 10;
- STRING *counter_as_string = string_from_int(INTERP, counter);
+ STRING *counter_as_string = Parrot_str_from_int(INTERP, counter);
UNUSED(SELF);
counter++;
@@ -168,7 +168,7 @@
*/
METHOD escape(STRING *str) {
- STRING *escaped_str = string_escape_string(INTERP, str);
+ STRING *escaped_str = Parrot_str_escape(INTERP, str);
STRING *quote = CONST_STRING(INTERP, "\x22");
STRING *x = CONST_STRING(INTERP, "\\x");
INTVAL x_pos;
Modified: branches/pdd28str_part2/src/pmc/complex.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/complex.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/complex.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -41,7 +41,7 @@
static void
complex_parse_string(PARROT_INTERP, FLOATVAL *re, FLOATVAL *im, STRING *value) {
- char *str = string_to_cstring(interp, value);
+ char *str = Parrot_str_to_cstring(interp, value);
char *t = str;
char *first_num_offset = str;
char *second_num_offset = NULL;
@@ -165,7 +165,7 @@
if (first_num_length) {
/* there is a real part, interpret it */
S = Parrot_str_new(interp, first_num_offset, first_num_length);
- *re = string_to_num(interp, S);
+ *re = Parrot_str_to_num(interp, S);
}
else {
/* consider the real part 0.0 */
@@ -175,7 +175,7 @@
if (second_num_length) {
/* there is an imaginary part, interpret it */
S = Parrot_str_new(interp, second_num_offset, second_num_length);
- *im = string_to_num(interp, S);
+ *im = Parrot_str_to_num(interp, S);
}
else {
/* consider the imaginary part 0.0 */
Modified: branches/pdd28str_part2/src/pmc/env.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/env.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/env.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -157,7 +157,7 @@
}
}
else {
- char * const keyname = string_to_cstring(interp,
+ char * const keyname = Parrot_str_to_cstring(interp,
VTABLE_get_string(interp, key));
if (keyname) {
@@ -191,7 +191,7 @@
*/
VTABLE PMC *get_pmc_keyed(PMC *key) {
- char * const keyname = string_to_cstring(INTERP,
+ char * const keyname = Parrot_str_to_cstring(INTERP,
VTABLE_get_string(INTERP, key));
char *val = NULL;
@@ -230,9 +230,9 @@
*/
VTABLE void set_string_keyed(PMC *key, STRING *value) {
- char * const keyname = string_to_cstring(INTERP,
+ char * const keyname = Parrot_str_to_cstring(INTERP,
VTABLE_get_string(INTERP, key));
- char * const env_val = string_to_cstring(INTERP, value);
+ char * const env_val = Parrot_str_to_cstring(INTERP, value);
if (keyname && env_val)
Parrot_setenv(keyname, env_val);
@@ -255,11 +255,11 @@
*/
VTABLE void set_pmc_keyed(PMC *key, PMC *value) {
- char * const keyname = string_to_cstring(INTERP,
+ char * const keyname = Parrot_str_to_cstring(INTERP,
VTABLE_get_string(INTERP, key));
const STRING * const str_value = VTABLE_get_string(INTERP, value);
- char * const env_val = string_to_cstring(INTERP, str_value);
+ char * const env_val = Parrot_str_to_cstring(INTERP, str_value);
if (keyname && env_val)
Parrot_setenv(keyname, env_val);
@@ -282,7 +282,7 @@
*/
VTABLE INTVAL exists_keyed(PMC *key) {
- char * const keyname = string_to_cstring(INTERP,
+ char * const keyname = Parrot_str_to_cstring(INTERP,
VTABLE_get_string(INTERP, key));
if (keyname) {
@@ -311,7 +311,7 @@
*/
VTABLE void delete_keyed(PMC *key) {
- char * const keyname = string_to_cstring(INTERP,
+ char * const keyname = Parrot_str_to_cstring(INTERP,
VTABLE_get_string(INTERP, key));
if (keyname) {
Modified: branches/pdd28str_part2/src/pmc/file.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/file.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/file.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -65,7 +65,7 @@
METHOD exists(STRING *path) {
struct stat info;
- char * const cpath = string_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(interp, path);
#ifdef WIN32
int error = stat(cpath, &info);
#else
@@ -91,7 +91,7 @@
METHOD is_dir(STRING *path) {
struct stat info;
- char * const cpath = string_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(interp, path);
#ifdef WIN32
int error = stat(cpath, &info);
#else
@@ -123,7 +123,7 @@
METHOD is_file(STRING *path) {
struct stat info;
- char * const cpath = string_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(interp, path);
#ifdef WIN32
int error = stat(cpath, &info);
#else
@@ -160,7 +160,7 @@
#else
struct stat info;
- char * const cpath = string_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(interp, path);
int error = lstat(cpath, &info);
string_cstring_free(cpath);
@@ -197,13 +197,13 @@
METHOD copy(STRING *from, STRING *to) {
#define CHUNK_SIZE 1024
- char * const cfrom = string_to_cstring(interp, from);
+ char * const cfrom = Parrot_str_to_cstring(interp, from);
FILE * source = fopen(cfrom, "rb");
string_cstring_free(cfrom);
if (source) {
- char * const cto = string_to_cstring(interp, to);
+ char * const cto = Parrot_str_to_cstring(interp, to);
FILE * target = fopen(cto, "w+b");
string_cstring_free(cto);
@@ -251,8 +251,8 @@
*/
METHOD rename(STRING *from, STRING *to) {
- char * const cfrom = string_to_cstring(interp, from);
- char * const cto = string_to_cstring(interp, to);
+ char * const cfrom = Parrot_str_to_cstring(interp, from);
+ char * const cto = Parrot_str_to_cstring(interp, to);
int error = rename(cfrom, cto);
string_cstring_free(cfrom);
Modified: branches/pdd28str_part2/src/pmc/fixedintegerarray.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/fixedintegerarray.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/fixedintegerarray.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -80,7 +80,7 @@
Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_ENCODING,
"unhandled string encoding in constructor");
- source = string_to_cstring(interp, rep);
+ source = Parrot_str_to_cstring(interp, rep);
/* "()" - no args */
if (l <= 2 && *source == '(') {
Modified: branches/pdd28str_part2/src/pmc/fixedpmcarray.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/fixedpmcarray.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/fixedpmcarray.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -182,7 +182,7 @@
*/
VTABLE STRING *get_string() {
- return string_from_int(INTERP, SELF.elements());
+ return Parrot_str_from_int(INTERP, SELF.elements());
}
VTABLE STRING *get_repr() {
Modified: branches/pdd28str_part2/src/pmc/float.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/float.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/float.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -85,7 +85,7 @@
? constant_pmc_new(INTERP, type)
: pmc_new(INTERP, type);
- SET_ATTR_fv(INTERP, res, string_to_num(INTERP, rep));
+ SET_ATTR_fv(INTERP, res, Parrot_str_to_num(INTERP, rep));
return res;
}
@@ -149,7 +149,7 @@
*/
VTABLE STRING *get_string() {
- return string_from_num(INTERP, SELF.get_number());
+ return Parrot_str_from_num(INTERP, SELF.get_number());
}
VTABLE STRING *get_repr() {
Modified: branches/pdd28str_part2/src/pmc/hash.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/hash.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/hash.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -203,7 +203,7 @@
HashBucket *b;
if (hash->key_type == Hash_key_type_STRING)
- return SELF.get_integer_keyed_str(string_from_int(INTERP, key));
+ return SELF.get_integer_keyed_str(Parrot_str_from_int(INTERP, key));
b = parrot_hash_get_bucket(INTERP, hash, (void *)key);
@@ -240,7 +240,7 @@
else {
const STRING * const s =
(STRING *)parrot_hash_get_idx(INTERP, hash, key);
- return string_to_int(INTERP, s);
+ return Parrot_str_to_int(INTERP, s);
}
}
@@ -296,7 +296,7 @@
}
VTABLE FLOATVAL get_number_keyed_int(INTVAL key) {
- STRING * const s = string_from_int(INTERP, key);
+ STRING * const s = Parrot_str_from_int(INTERP, key);
return SELF.get_number_keyed_str(s);
}
/*
@@ -416,7 +416,7 @@
}
VTABLE STRING *get_string_keyed_int(INTVAL key) {
- STRING * const s = string_from_int(INTERP, key);
+ STRING * const s = Parrot_str_from_int(INTERP, key);
return SELF.get_string_keyed_str(s);
}
@@ -441,7 +441,7 @@
/* called from iterator with an integer idx in key */
if (hash->key_type == Hash_key_type_int) {
void *idx = parrot_hash_get_idx(INTERP, hash, key);
- return string_from_int(INTERP, (INTVAL)idx);
+ return Parrot_str_from_int(INTERP, (INTVAL)idx);
}
return (STRING *)parrot_hash_get_idx(INTERP, hash, key);
@@ -516,7 +516,7 @@
}
VTABLE PMC *get_pmc_keyed_int(INTVAL key) {
- STRING * const s = string_from_int(INTERP, key);
+ STRING * const s = Parrot_str_from_int(INTERP, key);
return SELF.get_pmc_keyed_str(s);
}
Modified: branches/pdd28str_part2/src/pmc/integer.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/integer.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/integer.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -114,7 +114,7 @@
: pmc_new(INTERP, type);
/* RT #46623 bigint overflow */
- VTABLE_set_integer_native(INTERP, res, string_to_int(INTERP, rep));
+ VTABLE_set_integer_native(INTERP, res, Parrot_str_to_int(INTERP, rep));
return res;
}
@@ -231,11 +231,11 @@
*/
VTABLE STRING *get_string() {
- return string_from_int(INTERP, SELF.get_integer());
+ return Parrot_str_from_int(INTERP, SELF.get_integer());
}
VTABLE STRING *get_repr() {
- return string_from_int(INTERP, SELF.get_integer());
+ return Parrot_str_from_int(INTERP, SELF.get_integer());
}
@@ -1322,7 +1322,7 @@
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_OUT_OF_BOUNDS,
"get_as_base: base out of bounds");
- result = int_to_str(interp, buf,
+ result = Parrot_str_from_int_base(interp, buf,
(HUGEINTVAL)VTABLE_get_integer(INTERP, SELF),
(unsigned int)base);
Modified: branches/pdd28str_part2/src/pmc/iterator.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/iterator.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/iterator.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -175,7 +175,7 @@
VTABLE STRING *get_string() {
PMC * const key = (PMC *)PMC_struct_val(SELF);
- return string_from_int(INTERP, key_integer(INTERP, key));
+ return Parrot_str_from_int(INTERP, key_integer(INTERP, key));
}
/*
Modified: branches/pdd28str_part2/src/pmc/lexinfo.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/lexinfo.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/lexinfo.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -69,7 +69,7 @@
(PARROT_DATA_TYPE)enum_hash_int,
Hash_key_type_STRING,
(hash_comp_fn)Parrot_str_equal, /* STRING compare */
- (hash_hash_key_fn)string_hash); /* hash */
+ (hash_hash_key_fn)Parrot_str_to_hashval); /* hash */
PObj_active_destroy_SET(SELF);
}
Modified: branches/pdd28str_part2/src/pmc/nci.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/nci.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/nci.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -22,7 +22,7 @@
void pcc_params(PARROT_INTERP, STRING *sig, Parrot_NCI_attributes * const nci_info);
void pcc_params(PARROT_INTERP, STRING *sig, Parrot_NCI_attributes * const nci_info) {
- char *sig_c = string_to_cstring(interp, sig);
+ char *sig_c = Parrot_str_to_cstring(interp, sig);
size_t sig_length = strlen(sig_c);
char *param_sig = mem_allocate_n_zeroed_typed(sig_length, char);
size_t j = 0;
@@ -168,7 +168,7 @@
VTABLE void set_pointer_keyed_str(STRING *key, void *func) {
Parrot_NCI_attributes * const nci_info = PARROT_NCI(SELF);
int jitted = 0;
- char * const key_c = string_to_cstring(INTERP, key);
+ char * const key_c = Parrot_str_to_cstring(INTERP, key);
/* Store the original function and signature. */
PMC_struct_val(SELF) = func;
Modified: branches/pdd28str_part2/src/pmc/os.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/os.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/os.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -110,7 +110,7 @@
METHOD chdir(STRING *path) {
int error;
- char * const cpath = string_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(interp, path);
#ifdef _MSC_VER
error = _chdir(cpath);
#else
@@ -137,7 +137,7 @@
METHOD rm(STRING *path) {
struct stat info;
- char * const cpath = string_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(interp, path);
int error = stat(cpath, &info);
if (error) {
@@ -182,7 +182,7 @@
*/
METHOD mkdir(STRING *path, INTVAL mode) {
- char * const cpath = string_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(interp, path);
/* should we validate mode? */
#ifdef WIN32
int error = _mkdir(cpath);
@@ -225,7 +225,7 @@
METHOD stat(STRING *path) {
struct stat info;
- char * const cpath = string_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(interp, path);
const int error = stat(cpath, &info);
string_cstring_free(cpath);
@@ -300,7 +300,7 @@
METHOD lstat(STRING *path) {
struct stat info;
- char * const cpath = string_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(interp, path);
#ifdef WIN32
const int error = stat(cpath, &info);
#else
@@ -361,8 +361,8 @@
METHOD symlink(STRING *from, STRING *to) {
#ifndef WIN32
- char * const cfrom = string_to_cstring(interp, from);
- char * const cto = string_to_cstring(interp, to);
+ char * const cfrom = Parrot_str_to_cstring(interp, from);
+ char * const cto = Parrot_str_to_cstring(interp, to);
const int error = symlink(cfrom, cto);
string_cstring_free(cfrom);
@@ -391,8 +391,8 @@
METHOD link(STRING *from, STRING *to) {
#ifndef WIN32
- char * const cfrom = string_to_cstring(interp, from);
- char * const cto = string_to_cstring(interp, to);
+ char * const cfrom = Parrot_str_to_cstring(interp, from);
+ char * const cto = Parrot_str_to_cstring(interp, to);
const int error = link(cfrom, cto);
string_cstring_free(cfrom);
@@ -447,7 +447,7 @@
METHOD chroot(STRING *path) {
#ifndef WIN32
- char * const cpath = string_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(interp, path);
const int error = chroot(cpath);
string_cstring_free(cpath);
@@ -477,7 +477,7 @@
#ifndef _MSC_VER
struct dirent *dirent;
PMC *array;
- char *cpath = string_to_cstring(interp, path);
+ char *cpath = Parrot_str_to_cstring(interp, path);
STRING *retval;
DIR *dir = opendir(cpath);
@@ -513,8 +513,8 @@
=cut
*/
METHOD rename(STRING *oldpath, STRING *newpath) {
- char * const coldpath = string_to_cstring(interp, oldpath);
- char * const cnewpath = string_to_cstring(interp, newpath);
+ char * const coldpath = Parrot_str_to_cstring(interp, oldpath);
+ char * const cnewpath = Parrot_str_to_cstring(interp, newpath);
const int ret = rename(coldpath, cnewpath);
string_cstring_free(coldpath);
Modified: branches/pdd28str_part2/src/pmc/scheduler.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/scheduler.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/scheduler.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -126,7 +126,7 @@
new_tid = ++(core_struct->max_tid);
VTABLE_set_integer_native(INTERP, task, new_tid);
- task_id_str = string_from_int(INTERP, new_tid);
+ task_id_str = Parrot_str_from_int(INTERP, new_tid);
VTABLE_set_pmc_keyed_str(INTERP, core_struct->task_list,
task_id_str, task);
@@ -201,7 +201,7 @@
VTABLE void delete_keyed_int(INTVAL key) {
Parrot_Scheduler_attributes *core_struct = PARROT_SCHEDULER(SELF);
- STRING *task_id_str = string_from_int(INTERP, key);
+ STRING *task_id_str = Parrot_str_from_int(INTERP, key);
VTABLE_delete_keyed_str(INTERP, core_struct->task_list, task_id_str);
SCHEDULER_cache_valid_CLEAR(SELF);
}
Modified: branches/pdd28str_part2/src/pmc/slice.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/slice.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/slice.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -348,7 +348,7 @@
VTABLE STRING *get_string_keyed(PMC *key) {
const INTVAL v = VTABLE_get_integer(INTERP, key);
- return string_from_int(INTERP, v);
+ return Parrot_str_from_int(INTERP, v);
}
VTABLE PMC *get_pmc_keyed(PMC *key) {
Modified: branches/pdd28str_part2/src/pmc/string.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/string.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/string.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -105,7 +105,7 @@
VTABLE INTVAL get_integer() {
STRING * const s = SELF.get_string();
- return string_to_int(INTERP, s);
+ return Parrot_str_to_int(INTERP, s);
}
/*
@@ -120,7 +120,7 @@
VTABLE FLOATVAL get_number() {
STRING * const s = SELF.get_string();
- return string_to_num(INTERP, s);
+ return Parrot_str_to_num(INTERP, s);
}
/*
@@ -183,11 +183,11 @@
*/
VTABLE void set_integer_native(INTVAL value) {
- SELF.set_string_native(string_from_int(INTERP, value));
+ SELF.set_string_native(Parrot_str_from_int(INTERP, value));
}
VTABLE void set_bool(INTVAL value) {
- SELF.set_string_native(string_from_int(INTERP, value));
+ SELF.set_string_native(Parrot_str_from_int(INTERP, value));
}
/*
@@ -201,7 +201,7 @@
*/
VTABLE void set_number_native(FLOATVAL value) {
- SELF.set_string_native(string_from_num(INTERP, value));
+ SELF.set_string_native(Parrot_str_from_num(INTERP, value));
}
@@ -218,7 +218,7 @@
VTABLE void set_string_native(STRING *value) {
/* Only allow constant PMCs to embed constant strings */
if (PObj_constant_TEST(SELF) && !PObj_constant_TEST(value)) {
- const char *copy = string_to_cstring(INTERP, value);
+ const char *copy = Parrot_str_to_cstring(INTERP, value);
value = Parrot_str_new_constant(INTERP, copy);
}
PMC_str_val(SELF) = value;
@@ -462,7 +462,7 @@
*/
VTABLE INTVAL is_equal_num(PMC *value) {
- const FLOATVAL sf = string_to_num(INTERP, VTABLE_get_string(INTERP, SELF));
+ const FLOATVAL sf = Parrot_str_to_num(INTERP, VTABLE_get_string(INTERP, SELF));
const FLOATVAL vf = VTABLE_get_number(INTERP, value);
return (INTVAL)(sf == vf);
}
@@ -512,7 +512,7 @@
*/
VTABLE INTVAL cmp_num(PMC *value) {
- const FLOATVAL sf = string_to_num(INTERP, VTABLE_get_string(INTERP, SELF));
+ const FLOATVAL sf = Parrot_str_to_num(INTERP, VTABLE_get_string(INTERP, SELF));
const FLOATVAL vf = VTABLE_get_number(INTERP, value);
if (sf < vf)
Modified: branches/pdd28str_part2/src/pmc/sub.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/sub.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/sub.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -832,7 +832,7 @@
METHOD __get_regs_used(STRING *reg) {
Parrot_sub * const sub = PMC_sub(SELF);
- char * const kind = string_to_cstring(interp, reg);
+ char * const kind = Parrot_str_to_cstring(interp, reg);
INTVAL regs_used;
/* TODO switch to canonical NiSP order
Modified: branches/pdd28str_part2/src/pmc/unmanagedstruct.pmc
==============================================================================
--- branches/pdd28str_part2/src/pmc/unmanagedstruct.pmc Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/pmc/unmanagedstruct.pmc Tue Feb 3 00:52:53 2009 (r36308)
@@ -506,7 +506,7 @@
{
if (type == enum_type_cstr) {
/* assuming 0-terminated C-string here;
- * we can't use string_to_cstring easily */
+ * we can't use Parrot_str_to_cstring easily */
char *cstr = value->strstart;
*(char **)p = cstr;
}
Modified: branches/pdd28str_part2/src/spf_render.c
==============================================================================
--- branches/pdd28str_part2/src/spf_render.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/spf_render.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -332,7 +332,7 @@
STRING *targ = Parrot_str_new_noinit(interp, enum_stringrep_one, pat_len << 1);
/* ts is used almost universally as an intermediate target;
- * tc is used as a temporary buffer by uint_to_string and
+ * tc is used as a temporary buffer by Parrot_str_from_uint and
* as a target by gen_sprintf_call.
*/
STRING *substr = NULL;
@@ -608,7 +608,7 @@
const UHUGEINTVAL theuint =
obj->getuint(interp, info.type, obj);
STRING * const ts =
- uint_to_str(interp, tc, theuint, 8, 0);
+ Parrot_str_from_uint(interp, tc, theuint, 8, 0);
STRING * const prefix = CONST_STRING(interp, "0");
/* unsigned conversion - no plus */
@@ -623,7 +623,7 @@
const UHUGEINTVAL theuint =
obj->getuint(interp, info.type, obj);
STRING * const ts =
- uint_to_str(interp, tc, theuint, 16, 0);
+ Parrot_str_from_uint(interp, tc, theuint, 16, 0);
STRING * const prefix = CONST_STRING(interp, "0x");
/* unsigned conversion - no plus */
@@ -639,7 +639,7 @@
const UHUGEINTVAL theuint =
obj->getuint(interp, info.type, obj);
STRING * const ts =
- uint_to_str(interp, tc, theuint, 16, 0);
+ Parrot_str_from_uint(interp, tc, theuint, 16, 0);
string_upcase_inplace(interp, ts);
/* unsigned conversion - no plus */
@@ -655,7 +655,7 @@
const UHUGEINTVAL theuint =
obj->getuint(interp, info.type, obj);
STRING * const ts =
- uint_to_str(interp, tc, theuint, 2, 0);
+ Parrot_str_from_uint(interp, tc, theuint, 2, 0);
/* unsigned conversion - no plus */
info.flags &= ~FLAG_PLUS;
@@ -670,7 +670,7 @@
const HUGEINTVAL theint =
obj->getint(interp, info.type, obj);
STRING * const ts =
- int_to_str(interp, tc, theint, 2);
+ Parrot_str_from_int_base(interp, tc, theint, 2);
/* unsigned conversion - no plus */
info.flags &= ~FLAG_PLUS;
@@ -702,7 +702,7 @@
ts = cstr2pstr(tc);
{
char * const tempstr =
- string_to_cstring(interp, ts);
+ Parrot_str_to_cstring(interp, ts);
#ifdef PARROT_HAS_SNPRINTF
snprintf(tc, PARROT_SPRINTF_BUFFER_SIZE,
@@ -722,7 +722,7 @@
STRING * const prefix = CONST_STRING(interp, "0x");
const void * const ptr =
obj->getptr(interp, info.type, obj);
- STRING * const ts = uint_to_str(interp, tc,
+ STRING * const ts = Parrot_str_from_uint(interp, tc,
(UHUGEINTVAL) (size_t) ptr, 16, 0);
targ = str_append_w_flags(interp, targ, &info,
@@ -760,7 +760,7 @@
/* XXX lost precision if %Hg or whatever */
{
char * const tempstr =
- string_to_cstring(interp, ts);
+ Parrot_str_to_cstring(interp, ts);
#ifdef PARROT_HAS_SNPRINTF
snprintf(tc, PARROT_SPRINTF_BUFFER_SIZE,
Modified: branches/pdd28str_part2/src/string/api.c
==============================================================================
--- branches/pdd28str_part2/src/string/api.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/string/api.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -1976,7 +1976,7 @@
/*
-=item C<INTVAL string_to_int>
+=item C<INTVAL Parrot_str_to_int>
Converts a numeric Parrot string to an integer value.
@@ -2000,9 +2000,9 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
INTVAL
-string_to_int(SHIM_INTERP, ARGIN_NULLOK(const STRING *s))
+Parrot_str_to_int(SHIM_INTERP, ARGIN_NULLOK(const STRING *s))
{
- ASSERT_ARGS(string_to_int)
+ ASSERT_ARGS(Parrot_str_to_int)
if (s == NULL)
return 0;
{
@@ -2049,7 +2049,7 @@
/*
-=item C<FLOATVAL string_to_num>
+=item C<FLOATVAL Parrot_str_to_num>
Converts a numeric Parrot STRING to a floating point number.
@@ -2060,9 +2060,9 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
FLOATVAL
-string_to_num(PARROT_INTERP, ARGIN(const STRING *s))
+Parrot_str_to_num(PARROT_INTERP, ARGIN(const STRING *s))
{
- ASSERT_ARGS(string_to_num)
+ ASSERT_ARGS(Parrot_str_to_num)
FLOATVAL f = 0.0;
char *cstr;
const char *p;
@@ -2073,7 +2073,7 @@
* XXX C99 atof interprets 0x prefix
* XXX would strtod() be better for detecting malformed input?
*/
- cstr = string_to_cstring(interp, s);
+ cstr = Parrot_str_to_cstring(interp, s);
p = cstr;
while (isspace((unsigned char)*p))
@@ -2105,7 +2105,7 @@
/*
-=item C<STRING * string_from_int>
+=item C<STRING * Parrot_str_from_int>
Returns a Parrot string representation of the specified integer value.
@@ -2117,17 +2117,17 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
STRING *
-string_from_int(PARROT_INTERP, INTVAL i)
+Parrot_str_from_int(PARROT_INTERP, INTVAL i)
{
- ASSERT_ARGS(string_from_int)
+ ASSERT_ARGS(Parrot_str_from_int)
char buf[128];
- return int_to_str(interp, buf, (HUGEINTVAL)i, 10);
+ return Parrot_str_from_int_base(interp, buf, (HUGEINTVAL)i, 10);
}
/*
-=item C<STRING * string_from_num>
+=item C<STRING * Parrot_str_from_num>
Returns a Parrot string representation of the specified floating-point value.
@@ -2139,9 +2139,9 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
STRING *
-string_from_num(PARROT_INTERP, FLOATVAL f)
+Parrot_str_from_num(PARROT_INTERP, FLOATVAL f)
{
- ASSERT_ARGS(string_from_num)
+ ASSERT_ARGS(Parrot_str_from_num)
/* Too damn hard--hand it off to Parrot_sprintf, which'll probably
use the system sprintf anyway, but has gigantic buffers that are
awfully hard to overflow. */
@@ -2151,7 +2151,7 @@
/*
-=item C<char * string_to_cstring>
+=item C<char * Parrot_str_to_cstring>
Returns a C string for the specified Parrot string. Use
C<string_cstring_free()> to free the string. Failure to do this will result in
@@ -2165,9 +2165,9 @@
PARROT_MALLOC
PARROT_CANNOT_RETURN_NULL
char *
-string_to_cstring(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
+Parrot_str_to_cstring(PARROT_INTERP, ARGIN_NULLOK(const STRING *s))
{
- ASSERT_ARGS(string_to_cstring)
+ ASSERT_ARGS(Parrot_str_to_cstring)
if (! s) {
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNEXPECTED_NULL,
"Can't convert NULL string");
@@ -2211,7 +2211,7 @@
=item C<void string_cstring_free>
-Free a string created by C<string_to_cstring()>.
+Free a string created by C<Parrot_str_to_cstring()>.
TODO - Hopefully this can go away at some point, as it's got all
sorts of leak potential otherwise.
@@ -2316,7 +2316,7 @@
/*
-=item C<size_t string_hash>
+=item C<size_t Parrot_str_to_hashval>
Returns the hash value for the specified Parrot string, caching it in
C<< s->hashval >>.
@@ -2328,9 +2328,9 @@
PARROT_EXPORT
PARROT_WARN_UNUSED_RESULT
size_t
-string_hash(PARROT_INTERP, ARGMOD_NULLOK(STRING *s))
+Parrot_str_to_hashval(PARROT_INTERP, ARGMOD_NULLOK(STRING *s))
{
- ASSERT_ARGS(string_hash)
+ ASSERT_ARGS(Parrot_str_to_hashval)
register size_t h;
const UINTVAL seed = interp->hash_seed;
@@ -2349,10 +2349,10 @@
/*
-=item C<STRING * string_escape_string>
+=item C<STRING * Parrot_str_escape>
Escapes all non-ASCII chars to backslash sequences. Control chars that
-C<string_unescape_cstring> can handle are escaped as I<\x>, as well as a double
+C<Parrot_str_unescape> can handle are escaped as I<\x>, as well as a double
quote character. Other control chars and codepoints < 0x100 are escaped as
I<\xhh>, codepoints up to 0xffff, as I<\uhhhh>, and codepoints greater than
this as I<\x{hh...hh}>.
@@ -2364,16 +2364,16 @@
PARROT_EXPORT
PARROT_CAN_RETURN_NULL
STRING *
-string_escape_string(PARROT_INTERP, ARGIN_NULLOK(const STRING *src))
+Parrot_str_escape(PARROT_INTERP, ARGIN_NULLOK(const STRING *src))
{
- ASSERT_ARGS(string_escape_string)
- return string_escape_string_delimited(interp, src, (UINTVAL) ~0);
+ ASSERT_ARGS(Parrot_str_escape)
+ return Parrot_str_escape_truncate(interp, src, (UINTVAL) ~0);
}
/*
-=item C<STRING * string_escape_string_delimited>
+=item C<STRING * Parrot_str_escape_truncate>
Escapes all non-ASCII characters in the given string with backslashed versions,
@@ -2386,10 +2386,10 @@
PARROT_EXPORT
PARROT_CAN_RETURN_NULL
STRING *
-string_escape_string_delimited(PARROT_INTERP,
+Parrot_str_escape_truncate(PARROT_INTERP,
ARGIN_NULLOK(const STRING *src), UINTVAL limit)
{
- ASSERT_ARGS(string_escape_string_delimited)
+ ASSERT_ARGS(Parrot_str_escape_truncate)
STRING *result, *hex;
UINTVAL i, len, charlen;
String_iter iter;
@@ -2501,7 +2501,7 @@
/*
-=item C<STRING * string_unescape_cstring>
+=item C<STRING * Parrot_str_unescape>
Unescapes the specified C string. These sequences are covered:
@@ -2520,10 +2520,10 @@
PARROT_EXPORT
PARROT_CANNOT_RETURN_NULL
STRING *
-string_unescape_cstring(PARROT_INTERP,
+Parrot_str_unescape(PARROT_INTERP,
ARGIN(const char *cstring), char delimiter, ARGIN_NULLOK(const char *enc_char))
{
- ASSERT_ARGS(string_unescape_cstring)
+ ASSERT_ARGS(Parrot_str_unescape)
size_t clength = strlen(cstring);
Parrot_UInt4 r;
String_iter iter;
@@ -3171,7 +3171,7 @@
/*
-=item C<STRING* uint_to_str>
+=item C<STRING* Parrot_str_from_uint>
Returns C<num> converted to a Parrot C<STRING>.
@@ -3188,10 +3188,10 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
STRING*
-uint_to_str(PARROT_INTERP, ARGOUT(char *tc), UHUGEINTVAL num,
+Parrot_str_from_uint(PARROT_INTERP, ARGOUT(char *tc), UHUGEINTVAL num,
unsigned int base, int minus)
{
- ASSERT_ARGS(uint_to_str)
+ ASSERT_ARGS(Parrot_str_from_uint)
/* the buffer must be at least as long as this */
char *p = tc + sizeof (UHUGEINTVAL)*8 + 1;
const char * const tail = p;
@@ -3217,7 +3217,7 @@
/*
-=item C<STRING * int_to_str>
+=item C<STRING * Parrot_str_from_int_base>
Returns C<num> converted to a Parrot C<STRING>.
@@ -3232,15 +3232,15 @@
PARROT_WARN_UNUSED_RESULT
PARROT_CANNOT_RETURN_NULL
STRING *
-int_to_str(PARROT_INTERP, ARGOUT(char *tc), HUGEINTVAL num, unsigned int base)
+Parrot_str_from_int_base(PARROT_INTERP, ARGOUT(char *tc), HUGEINTVAL num, unsigned int base)
{
- ASSERT_ARGS(int_to_str)
+ ASSERT_ARGS(Parrot_str_from_int_base)
const int is_neg = (num < 0);
if (is_neg)
num = -num;
- return uint_to_str(interp, tc, (UHUGEINTVAL)num, base, is_neg);
+ return Parrot_str_from_uint(interp, tc, (UHUGEINTVAL)num, base, is_neg);
}
/*
Modified: branches/pdd28str_part2/src/trace.c
==============================================================================
--- branches/pdd28str_part2/src/trace.c Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/src/trace.c Tue Feb 3 00:52:53 2009 (r36308)
@@ -110,7 +110,7 @@
Parrot_io_eprintf(debugger, "%S=PMC(%#p Str:(NULL))",
VTABLE_name(interp, pmc), pmc);
else {
- STRING* const escaped = string_escape_string_delimited(
+ STRING* const escaped = Parrot_str_escape_truncate(
interp, s, 20);
if (escaped)
Parrot_io_eprintf(debugger, "%S=PMC(%#p Str:\"%Ss\")",
@@ -185,7 +185,7 @@
case KEY_string_FLAG:
{
const STRING * const s = PMC_str_val(key);
- STRING* const escaped = string_escape_string_delimited(
+ STRING* const escaped = Parrot_str_escape_truncate(
interp, s, 20);
if (escaped)
len += Parrot_io_eprintf(debugger, "\"%Ss\"", escaped);
@@ -204,7 +204,7 @@
case KEY_string_FLAG|KEY_register_FLAG:
{
const STRING * const s = REG_STR(interp, PMC_int_val(key));
- STRING* const escaped = string_escape_string_delimited(
+ STRING* const escaped = Parrot_str_escape_truncate(
interp, s, 20);
if (escaped)
len += Parrot_io_eprintf(debugger, "S%vd=\"%Ss\"", PMC_int_val(key),
@@ -340,7 +340,7 @@
break;
case PARROT_ARG_SC:
{
- STRING* const escaped = string_escape_string_delimited(
+ STRING* const escaped = Parrot_str_escape_truncate(
interp,
PCONST(o)->u.string, 20);
if (escaped)
@@ -425,7 +425,7 @@
break;
case PARROT_ARG_S:
if (REG_STR(interp, o)) {
- STRING* const escaped = string_escape_string_delimited(
+ STRING* const escaped = Parrot_str_escape_truncate(
interp, REG_STR(interp, o), 20);
Parrot_io_eprintf(debugger, "S%vd=\"%Ss\"", o,
escaped);
Modified: branches/pdd28str_part2/tools/build/nativecall.pl
==============================================================================
--- branches/pdd28str_part2/tools/build/nativecall.pl Tue Feb 3 00:44:30 2009 (r36307)
+++ branches/pdd28str_part2/tools/build/nativecall.pl Tue Feb 3 00:52:53 2009 (r36308)
@@ -367,7 +367,7 @@
/t/ && do {
push @{$temps_ref}, "char *t_$temp_num;";
push @{$extra_preamble_ref},
- "{STRING * s= GET_NCI_S($reg_num); t_$temp_num = s ? string_to_cstring(interp, s) : (char *) NULL;}";
+ "{STRING * s= GET_NCI_S($reg_num); t_$temp_num = s ? Parrot_str_to_cstring(interp, s) : (char *) NULL;}";
push @{$extra_postamble_ref}, "do { if (t_$temp_num) string_cstring_free(t_$temp_num); } while (0);";
return "t_$temp_num";
};
@@ -379,7 +379,7 @@
/B/ && do {
push @{$temps_ref}, "char *s_$temp_num;\n char *t_$temp_num;\n void** v_$temp_num = (void **) &t_$temp_num;";
push @{$extra_preamble_ref},
- "{STRING * s= GET_NCI_S($reg_num); t_$temp_num = s ? string_to_cstring(interp, s) : (char *) NULL; s_$temp_num = t_$temp_num;}";
+ "{STRING * s= GET_NCI_S($reg_num); t_$temp_num = s ? Parrot_str_to_cstring(interp, s) : (char *) NULL; s_$temp_num = t_$temp_num;}";
push @{$extra_postamble_ref}, "do { if (s_$temp_num) string_cstring_free(s_$temp_num); } while (0);";
return "v_$temp_num";
};
@@ -604,7 +604,7 @@
* I think there may be memory issues with this but if we get to here we are
* aborting.
*/
- c = string_to_cstring(interp, message);
+ c = Parrot_str_to_cstring(interp, message);
PANIC(interp, c);
}
More information about the parrot-commits
mailing list