From 611e4dc522736f2339e1fb359701ef5eb949f224 Mon Sep 17 00:00:00 2001
From: Christopher O'Neill <code@chrisoneill.co.uk>
Date: Thu, 13 Jan 2011 20:00:18 +0000
Subject: [PATCH] Replaced SvPV(... , PV_na) with SvPV_nolen(...)

---
 src/plugins/scripts/perl/weechat-perl-api.c |  694 +++++++++++++-------------
 1 files changed, 347 insertions(+), 347 deletions(-)

diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c
index c652aab..a6f1284 100644
--- a/src/plugins/scripts/perl/weechat-perl-api.c
+++ b/src/plugins/scripts/perl/weechat-perl-api.c
@@ -91,13 +91,13 @@ XS (XS_weechat_api_register)
         PERL_RETURN_ERROR;
     }
     
-    name = SvPV (ST (0), PL_na);
-    author = SvPV (ST (1), PL_na);
-    version = SvPV (ST (2), PL_na);
-    license = SvPV (ST (3), PL_na);
-    description = SvPV (ST (4), PL_na);
-    shutdown_func = SvPV (ST (5), PL_na);
-    charset = SvPV (ST (6), PL_na);
+    name = SvPV_nolen (ST (0));
+    author = SvPV_nolen (ST (1));
+    version = SvPV_nolen (ST (2));
+    license = SvPV_nolen (ST (3));
+    description = SvPV_nolen (ST (4));
+    shutdown_func = SvPV_nolen (ST (5));
+    charset = SvPV_nolen (ST (6));
     
     if (script_search (weechat_perl_plugin, perl_scripts, name))
     {
@@ -160,7 +160,7 @@ XS (XS_weechat_api_plugin_get_name)
         PERL_RETURN_EMPTY;
     }
     
-    result = weechat_plugin_get_name (script_str2ptr (SvPV (ST (0), PL_na))); /* plugin */
+    result = weechat_plugin_get_name (script_str2ptr (SvPV_nolen (ST (0)))); /* plugin */
     
     PERL_RETURN_STRING(result);
 }
@@ -189,7 +189,7 @@ XS (XS_weechat_api_charset_set)
     }
     
     script_api_charset_set (perl_current_script,
-                            SvPV (ST (0), PL_na)); /* charset */
+                            SvPV_nolen (ST (0))); /* charset */
     
     PERL_RETURN_OK;
 }
@@ -218,8 +218,8 @@ XS (XS_weechat_api_iconv_to_internal)
         PERL_RETURN_EMPTY;
     }
     
-    charset = SvPV (ST (0), PL_na);
-    string = SvPV (ST (1), PL_na);
+    charset = SvPV_nolen (ST (0));
+    string = SvPV_nolen (ST (1));
     
     result = weechat_iconv_to_internal (charset, string);
     
@@ -251,8 +251,8 @@ XS (XS_weechat_api_iconv_from_internal)
         PERL_RETURN_EMPTY;
     }
     
-    charset = SvPV (ST (0), PL_na);
-    string = SvPV (ST (1), PL_na);
+    charset = SvPV_nolen (ST (0));
+    string = SvPV_nolen (ST (1));
     
     result = weechat_iconv_from_internal (charset, string);
     
@@ -283,7 +283,7 @@ XS (XS_weechat_api_gettext)
         PERL_RETURN_EMPTY;
     }
     
-    result = weechat_gettext (SvPV (ST (0), PL_na)); /* string */
+    result = weechat_gettext (SvPV_nolen (ST (0))); /* string */
     
     PERL_RETURN_STRING(result);
 }
@@ -313,8 +313,8 @@ XS (XS_weechat_api_ngettext)
         PERL_RETURN_EMPTY;
     }
     
-    single = SvPV (ST (0), PL_na);
-    plural = SvPV (ST (1), PL_na);
+    single = SvPV_nolen (ST (0));
+    plural = SvPV_nolen (ST (1));
     
     result = weechat_ngettext (single, plural,
                                SvIV (ST (2))); /* count */
@@ -348,8 +348,8 @@ XS (XS_weechat_api_string_match)
         PERL_RETURN_INT(0);
     }
     
-    value = weechat_string_match (SvPV (ST (0), PL_na), /* string */
-                                  SvPV (ST (1), PL_na), /* mask */
+    value = weechat_string_match (SvPV_nolen (ST (0)), /* string */
+                                  SvPV_nolen (ST (1)), /* mask */
                                   SvIV (ST (2))); /* case_sensitive */
     
     PERL_RETURN_INT(value);
@@ -381,8 +381,8 @@ XS (XS_weechat_api_string_has_highlight)
         PERL_RETURN_INT(0);
     }
     
-    value = weechat_string_has_highlight (SvPV (ST (0), PL_na), /* string */
-                                          SvPV (ST (1), PL_na)); /* highlight_words */
+    value = weechat_string_has_highlight (SvPV_nolen (ST (0)), /* string */
+                                          SvPV_nolen (ST (1))); /* highlight_words */
     
     PERL_RETURN_INT(value);
 }
@@ -414,8 +414,8 @@ XS (XS_weechat_api_string_has_highlight_regex)
         PERL_RETURN_INT(0);
     }
     
-    value = weechat_string_has_highlight_regex (SvPV (ST (0), PL_na), /* string */
-                                                SvPV (ST (1), PL_na)); /* regex */
+    value = weechat_string_has_highlight_regex (SvPV_nolen (ST (0)), /* string */
+                                                SvPV_nolen (ST (1))); /* regex */
     
     PERL_RETURN_INT(value);
 }
@@ -446,7 +446,7 @@ XS (XS_weechat_api_string_mask_to_regex)
         PERL_RETURN_EMPTY;
     }
     
-    result = weechat_string_mask_to_regex (SvPV (ST (0), PL_na)); /* mask */
+    result = weechat_string_mask_to_regex (SvPV_nolen (ST (0))); /* mask */
     
     PERL_RETURN_STRING_FREE(result);
 }
@@ -475,8 +475,8 @@ XS (XS_weechat_api_string_remove_color)
         PERL_RETURN_EMPTY;
     }
     
-    string = SvPV (ST (0), PL_na);
-    replacement = SvPV (ST (1), PL_na);
+    string = SvPV_nolen (ST (0));
+    replacement = SvPV_nolen (ST (1));
     
     result = weechat_string_remove_color (string, replacement);
     
@@ -508,7 +508,7 @@ XS (XS_weechat_api_string_is_command_char)
         PERL_RETURN_INT(0);
     }
     
-    value = weechat_string_is_command_char (SvPV (ST (0), PL_na)); /* string */
+    value = weechat_string_is_command_char (SvPV_nolen (ST (0))); /* string */
     
     PERL_RETURN_INT(value);
 }
@@ -538,7 +538,7 @@ XS (XS_weechat_api_string_input_for_buffer)
         PERL_RETURN_EMPTY;
     }
     
-    result = weechat_string_input_for_buffer (SvPV (ST (0), PL_na)); /* string */
+    result = weechat_string_input_for_buffer (SvPV_nolen (ST (0))); /* string */
     
     PERL_RETURN_STRING(result);
 }
@@ -566,7 +566,7 @@ XS (XS_weechat_api_mkdir_home)
         PERL_RETURN_ERROR;
     }
     
-    if (weechat_mkdir_home (SvPV (ST (0), PL_na), /* directory */
+    if (weechat_mkdir_home (SvPV_nolen (ST (0)), /* directory */
                             SvIV (ST (1)))) /* mode */
         PERL_RETURN_OK;
     
@@ -596,7 +596,7 @@ XS (XS_weechat_api_mkdir)
         PERL_RETURN_ERROR;
     }
     
-    if (weechat_mkdir (SvPV (ST (0), PL_na), /* directory */
+    if (weechat_mkdir (SvPV_nolen (ST (0)), /* directory */
                        SvIV (ST (1)))) /* mode */
         PERL_RETURN_OK;
     
@@ -627,7 +627,7 @@ XS (XS_weechat_api_mkdir_parents)
         PERL_RETURN_ERROR;
     }
     
-    if (weechat_mkdir_parents (SvPV (ST (0), PL_na), /* directory */
+    if (weechat_mkdir_parents (SvPV_nolen (ST (0)), /* directory */
                                SvIV (ST (1)))) /* mode */
         PERL_RETURN_OK;
     
@@ -682,10 +682,10 @@ XS (XS_weechat_api_list_add)
         PERL_RETURN_EMPTY;
     }
     
-    weelist = SvPV (ST (0), PL_na);
-    data = SvPV (ST (1), PL_na);
-    where = SvPV (ST (2), PL_na);
-    user_data = SvPV (ST (3), PL_na);
+    weelist = SvPV_nolen (ST (0));
+    data = SvPV_nolen (ST (1));
+    where = SvPV_nolen (ST (2));
+    user_data = SvPV_nolen (ST (3));
     
     result = script_ptr2str (weechat_list_add (script_str2ptr (weelist),
                                                data,
@@ -719,8 +719,8 @@ XS (XS_weechat_api_list_search)
         PERL_RETURN_EMPTY;
     }
     
-    weelist = SvPV (ST (0), PL_na);
-    data = SvPV (ST (1), PL_na);
+    weelist = SvPV_nolen (ST (0));
+    data = SvPV_nolen (ST (1));
     
     result = script_ptr2str (weechat_list_search (script_str2ptr (weelist),
                                                   data));
@@ -753,8 +753,8 @@ XS (XS_weechat_api_list_search_pos)
         PERL_RETURN_INT(-1);
     }
     
-    weelist = SvPV (ST (0), PL_na);
-    data = SvPV (ST (1), PL_na);
+    weelist = SvPV_nolen (ST (0));
+    data = SvPV_nolen (ST (1));
     
     pos = weechat_list_search_pos (script_str2ptr (weelist), data);
     
@@ -785,8 +785,8 @@ XS (XS_weechat_api_list_casesearch)
         PERL_RETURN_EMPTY;
     }
     
-    weelist = SvPV (ST (0), PL_na);
-    data = SvPV (ST (1), PL_na);
+    weelist = SvPV_nolen (ST (0));
+    data = SvPV_nolen (ST (1));
     
     result = script_ptr2str (weechat_list_casesearch (script_str2ptr (weelist),
                                                       data));
@@ -820,8 +820,8 @@ XS (XS_weechat_api_list_casesearch_pos)
         PERL_RETURN_INT(-1);
     }
     
-    weelist = SvPV (ST (0), PL_na);
-    data = SvPV (ST (1), PL_na);
+    weelist = SvPV_nolen (ST (0));
+    data = SvPV_nolen (ST (1));
     
     pos = weechat_list_casesearch_pos (script_str2ptr (weelist), data);
     
@@ -852,7 +852,7 @@ XS (XS_weechat_api_list_get)
         PERL_RETURN_EMPTY;
     }
     
-    result = script_ptr2str (weechat_list_get (script_str2ptr (SvPV (ST (0), PL_na)), /* weelist */
+    result = script_ptr2str (weechat_list_get (script_str2ptr (SvPV_nolen (ST (0))), /* weelist */
                                                SvIV (ST (1)))); /* position */
     
     PERL_RETURN_STRING_FREE(result);
@@ -882,8 +882,8 @@ XS (XS_weechat_api_list_set)
         PERL_RETURN_ERROR;
     }
     
-    item = SvPV (ST (0), PL_na);
-    new_value = SvPV (ST (1), PL_na);
+    item = SvPV_nolen (ST (0));
+    new_value = SvPV_nolen (ST (1));
     
     weechat_list_set (script_str2ptr (item), new_value);
     
@@ -914,7 +914,7 @@ XS (XS_weechat_api_list_next)
         PERL_RETURN_EMPTY;
     }
     
-    result = script_ptr2str (weechat_list_next (script_str2ptr (SvPV (ST (0), PL_na)))); /* item */
+    result = script_ptr2str (weechat_list_next (script_str2ptr (SvPV_nolen (ST (0))))); /* item */
     
     PERL_RETURN_STRING_FREE(result);
 }
@@ -943,7 +943,7 @@ XS (XS_weechat_api_list_prev)
         PERL_RETURN_EMPTY;
     }
     
-    result = script_ptr2str (weechat_list_prev (script_str2ptr (SvPV (ST (0), PL_na)))); /* item */
+    result = script_ptr2str (weechat_list_prev (script_str2ptr (SvPV_nolen (ST (0))))); /* item */
     
     PERL_RETURN_STRING_FREE(result);
 }
@@ -972,7 +972,7 @@ XS (XS_weechat_api_list_string)
         PERL_RETURN_EMPTY;
     }
     
-    result = weechat_list_string (script_str2ptr (SvPV (ST (0), PL_na))); /* item */
+    result = weechat_list_string (script_str2ptr (SvPV_nolen (ST (0)))); /* item */
     
     PERL_RETURN_STRING(result);
 }
@@ -1001,7 +1001,7 @@ XS (XS_weechat_api_list_size)
         PERL_RETURN_INT(0);
     }
     
-    size = weechat_list_size (script_str2ptr (SvPV (ST (0), PL_na))); /* weelist */
+    size = weechat_list_size (script_str2ptr (SvPV_nolen (ST (0)))); /* weelist */
     
     PERL_RETURN_INT(size);
 }
@@ -1030,8 +1030,8 @@ XS (XS_weechat_api_list_remove)
         PERL_RETURN_ERROR;
     }
     
-    weelist = SvPV (ST (0), PL_na);
-    item = SvPV (ST (1), PL_na);
+    weelist = SvPV_nolen (ST (0));
+    item = SvPV_nolen (ST (1));
     
     weechat_list_remove (script_str2ptr (weelist), script_str2ptr (item));
     
@@ -1061,7 +1061,7 @@ XS (XS_weechat_api_list_remove_all)
         PERL_RETURN_ERROR;
     }
     
-    weechat_list_remove_all (script_str2ptr (SvPV (ST (0), PL_na))); /* weelist */
+    weechat_list_remove_all (script_str2ptr (SvPV_nolen (ST (0)))); /* weelist */
     
     PERL_RETURN_OK;
 }
@@ -1089,7 +1089,7 @@ XS (XS_weechat_api_list_free)
         PERL_RETURN_ERROR;
     }
     
-    weechat_list_free (script_str2ptr (SvPV (ST (0), PL_na))); /* weelist */
+    weechat_list_free (script_str2ptr (SvPV_nolen (ST (0)))); /* weelist */
     
     PERL_RETURN_OK;
 }
@@ -1159,9 +1159,9 @@ XS (XS_weechat_api_config_new)
         PERL_RETURN_EMPTY;
     }
     
-    name = SvPV (ST (0), PL_na);
-    function = SvPV (ST (1), PL_na);
-    data = SvPV (ST (2), PL_na);
+    name = SvPV_nolen (ST (0));
+    function = SvPV_nolen (ST (1));
+    data = SvPV_nolen (ST (2));
     
     result = script_ptr2str (script_api_config_new (weechat_perl_plugin,
                                                     perl_current_script,
@@ -1435,18 +1435,18 @@ XS (XS_weechat_api_config_new_section)
         PERL_RETURN_EMPTY;
     }
     
-    cfg_file = SvPV (ST (0), PL_na);
-    name = SvPV (ST (1), PL_na);
-    function_read = SvPV (ST (4), PL_na);
-    data_read = SvPV (ST (5), PL_na);
-    function_write = SvPV (ST (6), PL_na);
-    data_write = SvPV (ST (7), PL_na);
-    function_write_default = SvPV (ST (8), PL_na);
-    data_write_default = SvPV (ST (9), PL_na);
-    function_create_option = SvPV (ST (10), PL_na);
-    data_create_option = SvPV (ST (11), PL_na);
-    function_delete_option = SvPV (ST (12), PL_na);
-    data_delete_option = SvPV (ST (13), PL_na);
+    cfg_file = SvPV_nolen (ST (0));
+    name = SvPV_nolen (ST (1));
+    function_read = SvPV_nolen (ST (4));
+    data_read = SvPV_nolen (ST (5));
+    function_write = SvPV_nolen (ST (6));
+    data_write = SvPV_nolen (ST (7));
+    function_write_default = SvPV_nolen (ST (8));
+    data_write_default = SvPV_nolen (ST (9));
+    function_create_option = SvPV_nolen (ST (10));
+    data_create_option = SvPV_nolen (ST (11));
+    function_delete_option = SvPV_nolen (ST (12));
+    data_delete_option = SvPV_nolen (ST (13));
     
     result = script_ptr2str (script_api_config_new_section (weechat_perl_plugin,
                                                             perl_current_script,
@@ -1497,8 +1497,8 @@ XS (XS_weechat_api_config_search_section)
         PERL_RETURN_EMPTY;
     }
     
-    config_file = SvPV (ST (0), PL_na);
-    section_name = SvPV (ST (1), PL_na);
+    config_file = SvPV_nolen (ST (0));
+    section_name = SvPV_nolen (ST (1));
     
     result = script_ptr2str (weechat_config_search_section (script_str2ptr (config_file),
                                                             section_name));
@@ -1643,20 +1643,20 @@ XS (XS_weechat_api_config_new_option)
         PERL_RETURN_EMPTY;
     }
     
-    config_file = SvPV (ST (0), PL_na);
-    section = SvPV (ST (1), PL_na);
-    name = SvPV (ST (2), PL_na);
-    type = SvPV (ST (3), PL_na);
-    description = SvPV (ST (4), PL_na);
-    string_values = SvPV (ST (5), PL_na);
-    default_value = SvPV (ST (8), PL_na);
-    value = SvPV (ST (9), PL_na);
-    function_check_value = SvPV (ST (11), PL_na);
-    data_check_value = SvPV (ST (12), PL_na);
-    function_change = SvPV (ST (13), PL_na);
-    data_change = SvPV (ST (14), PL_na);
-    function_delete = SvPV (ST (15), PL_na);
-    data_delete = SvPV (ST (16), PL_na);
+    config_file = SvPV_nolen (ST (0));
+    section = SvPV_nolen (ST (1));
+    name = SvPV_nolen (ST (2));
+    type = SvPV_nolen (ST (3));
+    description = SvPV_nolen (ST (4));
+    string_values = SvPV_nolen (ST (5));
+    default_value = SvPV_nolen (ST (8));
+    value = SvPV_nolen (ST (9));
+    function_check_value = SvPV_nolen (ST (11));
+    data_check_value = SvPV_nolen (ST (12));
+    function_change = SvPV_nolen (ST (13));
+    data_change = SvPV_nolen (ST (14));
+    function_delete = SvPV_nolen (ST (15));
+    data_delete = SvPV_nolen (ST (16));
     
     result = script_ptr2str (script_api_config_new_option (weechat_perl_plugin,
                                                            perl_current_script,
@@ -1708,9 +1708,9 @@ XS (XS_weechat_api_config_search_option)
         PERL_RETURN_EMPTY;
     }
     
-    config_file = SvPV (ST (0), PL_na);
-    section = SvPV (ST (1), PL_na);
-    option_name = SvPV (ST (2), PL_na);
+    config_file = SvPV_nolen (ST (0));
+    section = SvPV_nolen (ST (1));
+    option_name = SvPV_nolen (ST (2));
     
     result = script_ptr2str (weechat_config_search_option (script_str2ptr (config_file),
                                                            script_str2ptr (section),
@@ -1743,7 +1743,7 @@ XS (XS_weechat_api_config_string_to_boolean)
         PERL_RETURN_INT(0);
     }
     
-    value = weechat_config_string_to_boolean (SvPV (ST (0), PL_na)); /* text */
+    value = weechat_config_string_to_boolean (SvPV_nolen (ST (0))); /* text */
     
     PERL_RETURN_INT(value);
 }
@@ -1773,7 +1773,7 @@ XS (XS_weechat_api_config_option_reset)
         PERL_RETURN_INT(0);
     }
     
-    option = SvPV (ST (0), PL_na);
+    option = SvPV_nolen (ST (0));
     
     rc = weechat_config_option_reset (script_str2ptr (option),
                                       SvIV (ST (1))); /* run_callback */
@@ -1806,8 +1806,8 @@ XS (XS_weechat_api_config_option_set)
         PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR);
     }
     
-    option = SvPV (ST (0), PL_na);
-    new_value = SvPV (ST (1), PL_na);
+    option = SvPV_nolen (ST (0));
+    new_value = SvPV_nolen (ST (1));
     
     rc = weechat_config_option_set (script_str2ptr (option),
                                     new_value,
@@ -1841,7 +1841,7 @@ XS (XS_weechat_api_config_option_set_null)
         PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR);
     }
     
-    option = SvPV (ST (0), PL_na);
+    option = SvPV_nolen (ST (0));
     
     rc = weechat_config_option_set_null (script_str2ptr (option),
                                          SvIV (ST (1))); /* run_callback */
@@ -1874,7 +1874,7 @@ XS (XS_weechat_api_config_option_unset)
         PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR);
     }
     
-    option = SvPV (ST (0), PL_na);
+    option = SvPV_nolen (ST (0));
     
     rc = weechat_config_option_unset (script_str2ptr (option));
     
@@ -1905,8 +1905,8 @@ XS (XS_weechat_api_config_option_rename)
         PERL_RETURN_ERROR;
     }
     
-    option = SvPV (ST (0), PL_na);
-    new_name = SvPV (ST (1), PL_na);
+    option = SvPV_nolen (ST (0));
+    new_name = SvPV_nolen (ST (1));
     
     weechat_config_option_rename (script_str2ptr (option),
                                   new_name);
@@ -1938,7 +1938,7 @@ XS (XS_weechat_api_config_option_is_null)
         PERL_RETURN_INT(1);
     }
     
-    value = weechat_config_option_is_null (script_str2ptr (SvPV (ST (0), PL_na))); /* option */
+    value = weechat_config_option_is_null (script_str2ptr (SvPV_nolen (ST (0)))); /* option */
     
     PERL_RETURN_INT(value);
 }
@@ -1968,7 +1968,7 @@ XS (XS_weechat_api_config_option_default_is_null)
         PERL_RETURN_INT(1);
     }
     
-    value = weechat_config_option_default_is_null (script_str2ptr (SvPV (ST (0), PL_na))); /* option */
+    value = weechat_config_option_default_is_null (script_str2ptr (SvPV_nolen (ST (0)))); /* option */
     
     PERL_RETURN_INT(value);
 }
@@ -1997,7 +1997,7 @@ XS (XS_weechat_api_config_boolean)
         PERL_RETURN_INT(0);
     }
     
-    value = weechat_config_boolean (script_str2ptr (SvPV (ST (0), PL_na))); /* option */
+    value = weechat_config_boolean (script_str2ptr (SvPV_nolen (ST (0)))); /* option */
     
     PERL_RETURN_INT(value);
 }
@@ -2026,7 +2026,7 @@ XS (XS_weechat_api_config_boolean_default)
         PERL_RETURN_INT(0);
     }
     
-    value = weechat_config_boolean_default (script_str2ptr (SvPV (ST (0), PL_na))); /* option */
+    value = weechat_config_boolean_default (script_str2ptr (SvPV_nolen (ST (0)))); /* option */
     
     PERL_RETURN_INT(value);
 }
@@ -2055,7 +2055,7 @@ XS (XS_weechat_api_config_integer)
         PERL_RETURN_INT(0);
     }
     
-    value = weechat_config_integer (script_str2ptr (SvPV (ST (0), PL_na))); /* option */
+    value = weechat_config_integer (script_str2ptr (SvPV_nolen (ST (0)))); /* option */
     
     PERL_RETURN_INT(value);
 }
@@ -2084,7 +2084,7 @@ XS (XS_weechat_api_config_integer_default)
         PERL_RETURN_INT(0);
     }
     
-    value = weechat_config_integer_default (script_str2ptr (SvPV (ST (0), PL_na))); /* option */
+    value = weechat_config_integer_default (script_str2ptr (SvPV_nolen (ST (0)))); /* option */
     
     PERL_RETURN_INT(value);
 }
@@ -2113,7 +2113,7 @@ XS (XS_weechat_api_config_string)
         PERL_RETURN_EMPTY;
     }
     
-    result = weechat_config_string (script_str2ptr (SvPV (ST (0), PL_na))); /* option */
+    result = weechat_config_string (script_str2ptr (SvPV_nolen (ST (0)))); /* option */
     
     PERL_RETURN_STRING(result);
 }
@@ -2142,7 +2142,7 @@ XS (XS_weechat_api_config_string_default)
         PERL_RETURN_EMPTY;
     }
     
-    result = weechat_config_string_default (script_str2ptr (SvPV (ST (0), PL_na))); /* option */
+    result = weechat_config_string_default (script_str2ptr (SvPV_nolen (ST (0)))); /* option */
     
     PERL_RETURN_STRING(result);
 }
@@ -2171,7 +2171,7 @@ XS (XS_weechat_api_config_color)
         PERL_RETURN_INT(0);
     }
     
-    result = weechat_config_color (script_str2ptr (SvPV (ST (0), PL_na))); /* option */
+    result = weechat_config_color (script_str2ptr (SvPV_nolen (ST (0)))); /* option */
     
     PERL_RETURN_STRING(result);
 }
@@ -2200,7 +2200,7 @@ XS (XS_weechat_api_config_color_default)
         PERL_RETURN_INT(0);
     }
     
-    result = weechat_config_color_default (script_str2ptr (SvPV (ST (0), PL_na))); /* option */
+    result = weechat_config_color_default (script_str2ptr (SvPV_nolen (ST (0)))); /* option */
     
     PERL_RETURN_STRING(result);
 }
@@ -2229,8 +2229,8 @@ XS (XS_weechat_api_config_write_option)
         PERL_RETURN_ERROR;
     }
     
-    config_file = SvPV (ST (0), PL_na);
-    option = SvPV (ST (1), PL_na);
+    config_file = SvPV_nolen (ST (0));
+    option = SvPV_nolen (ST (1));
     
     weechat_config_write_option (script_str2ptr (config_file),
                                  script_str2ptr (option));
@@ -2262,9 +2262,9 @@ XS (XS_weechat_api_config_write_line)
         PERL_RETURN_ERROR;
     }
     
-    config_file = SvPV (ST (0), PL_na);
-    option_name = SvPV (ST (1), PL_na);
-    value = SvPV (ST (2), PL_na);
+    config_file = SvPV_nolen (ST (0));
+    option_name = SvPV_nolen (ST (1));
+    value = SvPV_nolen (ST (2));
     
     weechat_config_write_line (script_str2ptr (config_file), option_name,
                                "%s", value);
@@ -2296,7 +2296,7 @@ XS (XS_weechat_api_config_write)
         PERL_RETURN_INT(-1);
     }
     
-    rc = weechat_config_write (script_str2ptr (SvPV (ST (0), PL_na))); /* config_file */
+    rc = weechat_config_write (script_str2ptr (SvPV_nolen (ST (0)))); /* config_file */
     
     PERL_RETURN_INT(rc);
 }
@@ -2325,7 +2325,7 @@ XS (XS_weechat_api_config_read)
         PERL_RETURN_INT(-1);
     }
     
-    rc = weechat_config_read (script_str2ptr (SvPV (ST (0), PL_na))); /* config_file */
+    rc = weechat_config_read (script_str2ptr (SvPV_nolen (ST (0)))); /* config_file */
     
     PERL_RETURN_INT(rc);
 }
@@ -2354,7 +2354,7 @@ XS (XS_weechat_api_config_reload)
         PERL_RETURN_INT(-1);
     }
     
-    rc = weechat_config_reload (script_str2ptr (SvPV (ST (0), PL_na))); /* config_file */
+    rc = weechat_config_reload (script_str2ptr (SvPV_nolen (ST (0)))); /* config_file */
     
     PERL_RETURN_INT(rc);
 }
@@ -2384,7 +2384,7 @@ XS (XS_weechat_api_config_option_free)
     
     script_api_config_option_free (weechat_perl_plugin,
                                    perl_current_script,
-                                   script_str2ptr (SvPV (ST (0), PL_na))); /* option */
+                                   script_str2ptr (SvPV_nolen (ST (0)))); /* option */
     
     PERL_RETURN_OK;
 }
@@ -2415,7 +2415,7 @@ XS (XS_weechat_api_config_section_free_options)
     
     script_api_config_section_free_options (weechat_perl_plugin,
                                             perl_current_script,
-                                            script_str2ptr (SvPV (ST (0), PL_na))); /* section */
+                                            script_str2ptr (SvPV_nolen (ST (0)))); /* section */
     
     PERL_RETURN_OK;
 }
@@ -2445,7 +2445,7 @@ XS (XS_weechat_api_config_section_free)
     
     script_api_config_section_free (weechat_perl_plugin,
                                     perl_current_script,
-                                    script_str2ptr (SvPV (ST (0), PL_na))); /* section */
+                                    script_str2ptr (SvPV_nolen (ST (0)))); /* section */
     
     PERL_RETURN_OK;
 }
@@ -2475,7 +2475,7 @@ XS (XS_weechat_api_config_free)
     
     script_api_config_free (weechat_perl_plugin,
                             perl_current_script,
-                            script_str2ptr (SvPV (ST (0), PL_na))); /* config_file */
+                            script_str2ptr (SvPV_nolen (ST (0)))); /* config_file */
     
     PERL_RETURN_OK;
 }
@@ -2504,7 +2504,7 @@ XS (XS_weechat_api_config_get)
         PERL_RETURN_EMPTY;
     }
     
-    result = script_ptr2str (weechat_config_get (SvPV (ST (0), PL_na)));
+    result = script_ptr2str (weechat_config_get (SvPV_nolen (ST (0))));
     
     PERL_RETURN_STRING_FREE(result);
 }
@@ -2535,7 +2535,7 @@ XS (XS_weechat_api_config_get_plugin)
     
     result = script_api_config_get_plugin (weechat_perl_plugin,
                                            perl_current_script,
-                                           SvPV (ST (0), PL_na));
+                                           SvPV_nolen (ST (0)));
     
     PERL_RETURN_STRING(result);
 }
@@ -2565,7 +2565,7 @@ XS (XS_weechat_api_config_is_set_plugin)
         PERL_RETURN_INT(0);
     }
     
-    option = SvPV (ST (0), PL_na);
+    option = SvPV_nolen (ST (0));
     
     rc = script_api_config_is_set_plugin (weechat_perl_plugin,
                                           perl_current_script,
@@ -2599,8 +2599,8 @@ XS (XS_weechat_api_config_set_plugin)
         PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_SET_ERROR);
     }
     
-    option = SvPV (ST (0), PL_na);
-    value = SvPV (ST (1), PL_na);
+    option = SvPV_nolen (ST (0));
+    value = SvPV_nolen (ST (1));
     
     rc = script_api_config_set_plugin (weechat_perl_plugin,
                                        perl_current_script,
@@ -2635,7 +2635,7 @@ XS (XS_weechat_api_config_unset_plugin)
         PERL_RETURN_INT(WEECHAT_CONFIG_OPTION_UNSET_ERROR);
     }
     
-    option = SvPV (ST (0), PL_na);
+    option = SvPV_nolen (ST (0));
     
     rc = script_api_config_unset_plugin (weechat_perl_plugin,
                                          perl_current_script,
@@ -2662,7 +2662,7 @@ XS (XS_weechat_api_prefix)
         PERL_RETURN_EMPTY;
     }
     
-    result = weechat_prefix (SvPV (ST (0), PL_na)); /* prefix */
+    result = weechat_prefix (SvPV_nolen (ST (0))); /* prefix */
     
     PERL_RETURN_STRING(result);
 }
@@ -2685,7 +2685,7 @@ XS (XS_weechat_api_color)
         PERL_RETURN_EMPTY;
     }
     
-    result = weechat_color (SvPV (ST (0), PL_na)); /* color */
+    result = weechat_color (SvPV_nolen (ST (0))); /* color */
     
     PERL_RETURN_STRING(result);
 }
@@ -2708,8 +2708,8 @@ XS (XS_weechat_api_print)
         PERL_RETURN_ERROR;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    message = SvPV (ST (1), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    message = SvPV_nolen (ST (1));
     
     script_api_printf (weechat_perl_plugin,
                        perl_current_script,
@@ -2744,9 +2744,9 @@ XS (XS_weechat_api_print_date_tags)
         PERL_RETURN_ERROR;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    tags = SvPV (ST (2), PL_na);
-    message = SvPV (ST (3), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    tags = SvPV_nolen (ST (2));
+    message = SvPV_nolen (ST (3));
     
     script_api_printf_date_tags (weechat_perl_plugin,
                                  perl_current_script,
@@ -2782,8 +2782,8 @@ XS (XS_weechat_api_print_y)
         PERL_RETURN_ERROR;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    message = SvPV (ST (2), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    message = SvPV_nolen (ST (2));
     
     script_api_printf_y (weechat_perl_plugin,
                          perl_current_script,
@@ -2819,7 +2819,7 @@ XS (XS_weechat_api_log_print)
     
     script_api_log_printf (weechat_perl_plugin,
                            perl_current_script,
-                           "%s", SvPV (ST (0), PL_na)); /* message */
+                           "%s", SvPV_nolen (ST (0))); /* message */
     
     PERL_RETURN_OK;
 }
@@ -2894,13 +2894,13 @@ XS (XS_weechat_api_hook_command)
         PERL_RETURN_EMPTY;
     }
     
-    command = SvPV (ST (0), PL_na);
-    description = SvPV (ST (1), PL_na);
-    args = SvPV (ST (2), PL_na);
-    args_description = SvPV (ST (3), PL_na);
-    completion = SvPV (ST (4), PL_na);
-    function = SvPV (ST (5), PL_na);
-    data = SvPV (ST (6), PL_na);
+    command = SvPV_nolen (ST (0));
+    description = SvPV_nolen (ST (1));
+    args = SvPV_nolen (ST (2));
+    args_description = SvPV_nolen (ST (3));
+    completion = SvPV_nolen (ST (4));
+    function = SvPV_nolen (ST (5));
+    data = SvPV_nolen (ST (6));
     
     result = script_ptr2str (script_api_hook_command (weechat_perl_plugin,
                                                       perl_current_script,
@@ -2982,9 +2982,9 @@ XS (XS_weechat_api_hook_command_run)
         PERL_RETURN_EMPTY;
     }
     
-    command = SvPV (ST (0), PL_na);
-    function = SvPV (ST (1), PL_na);
-    data = SvPV (ST (2), PL_na);
+    command = SvPV_nolen (ST (0));
+    function = SvPV_nolen (ST (1));
+    data = SvPV_nolen (ST (2));
     
     result = script_ptr2str (script_api_hook_command_run (weechat_perl_plugin,
                                                           perl_current_script,
@@ -3067,8 +3067,8 @@ XS (XS_weechat_api_hook_timer)
                                                     SvIV (ST (1)), /* align_second */
                                                     SvIV (ST (2)), /* max_calls */
                                                     &weechat_perl_api_hook_timer_cb,
-                                                    SvPV (ST (3), PL_na), /* perl function */
-                                                    SvPV (ST (4), PL_na))); /* data */
+                                                    SvPV_nolen (ST (3)), /* perl function */
+                                                    SvPV_nolen (ST (4)))); /* data */
     
     PERL_RETURN_STRING_FREE(result);
 }
@@ -3144,8 +3144,8 @@ XS (XS_weechat_api_hook_fd)
                                                  SvIV (ST (2)), /* write */
                                                  SvIV (ST (3)), /* exception */
                                                  &weechat_perl_api_hook_fd_cb,
-                                                 SvPV (ST (4), PL_na), /* perl function */
-                                                 SvPV (ST (5), PL_na))); /* data */
+                                                 SvPV_nolen (ST (4)), /* perl function */
+                                                 SvPV_nolen (ST (5)))); /* data */
     
     PERL_RETURN_STRING_FREE(result);
 }
@@ -3219,9 +3219,9 @@ XS (XS_weechat_api_hook_process)
         PERL_RETURN_EMPTY;
     }
     
-    command = SvPV (ST (0), PL_na);
-    function = SvPV (ST (2), PL_na);
-    data = SvPV (ST (3), PL_na);
+    command = SvPV_nolen (ST (0));
+    function = SvPV_nolen (ST (2));
+    data = SvPV_nolen (ST (3));
     
     result = script_ptr2str (script_api_hook_process (weechat_perl_plugin,
                                                       perl_current_script,
@@ -3304,11 +3304,11 @@ XS (XS_weechat_api_hook_connect)
         PERL_RETURN_EMPTY;
     }
     
-    proxy = SvPV (ST (0), PL_na);
-    address = SvPV (ST (1), PL_na);
-    local_hostname = SvPV (ST (5), PL_na);
-    function = SvPV (ST (6), PL_na);
-    data = SvPV (ST (7), PL_na);
+    proxy = SvPV_nolen (ST (0));
+    address = SvPV_nolen (ST (1));
+    local_hostname = SvPV_nolen (ST (5));
+    function = SvPV_nolen (ST (6));
+    data = SvPV_nolen (ST (7));
     
     result = script_ptr2str (script_api_hook_connect (weechat_perl_plugin,
                                                       perl_current_script,
@@ -3416,11 +3416,11 @@ XS (XS_weechat_api_hook_print)
         PERL_RETURN_EMPTY;
     }
  
-    buffer = SvPV (ST (0), PL_na);
-    tags = SvPV (ST (1), PL_na);
-    message = SvPV (ST (2), PL_na);
-    function = SvPV (ST (4), PL_na);
-    data = SvPV (ST (5), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    tags = SvPV_nolen (ST (1));
+    message = SvPV_nolen (ST (2));
+    function = SvPV_nolen (ST (4));
+    data = SvPV_nolen (ST (5));
     
     result = script_ptr2str (script_api_hook_print (weechat_perl_plugin,
                                                     perl_current_script,
@@ -3519,9 +3519,9 @@ XS (XS_weechat_api_hook_signal)
         PERL_RETURN_EMPTY;
     }
     
-    signal = SvPV (ST (0), PL_na);
-    function = SvPV (ST (1), PL_na);
-    data = SvPV (ST (2), PL_na);
+    signal = SvPV_nolen (ST (0));
+    function = SvPV_nolen (ST (1));
+    data = SvPV_nolen (ST (2));
     
     result = script_ptr2str (script_api_hook_signal (weechat_perl_plugin,
                                                      perl_current_script,
@@ -3558,13 +3558,13 @@ XS (XS_weechat_api_hook_signal_send)
         PERL_RETURN_ERROR;
     }
     
-    signal = SvPV (ST (0), PL_na);
-    type_data = SvPV (ST (1), PL_na);
+    signal = SvPV_nolen (ST (0));
+    type_data = SvPV_nolen (ST (1));
     if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_STRING) == 0)
     {
         weechat_hook_signal_send (signal,
                                   type_data,
-                                  SvPV (ST (2), PL_na)); /* signal_data */
+                                  SvPV_nolen (ST (2))); /* signal_data */
         PERL_RETURN_OK;
     }
     else if (strcmp (type_data, WEECHAT_HOOK_SIGNAL_INT) == 0)
@@ -3579,7 +3579,7 @@ XS (XS_weechat_api_hook_signal_send)
     {
         weechat_hook_signal_send (signal,
                                   type_data,
-                                  script_str2ptr (SvPV (ST (2), PL_na))); /* signal_data */
+                                  script_str2ptr (SvPV_nolen (ST (2)))); /* signal_data */
         PERL_RETURN_OK;
     }
     
@@ -3650,9 +3650,9 @@ XS (XS_weechat_api_hook_hsignal)
         PERL_RETURN_EMPTY;
     }
     
-    signal = SvPV (ST (0), PL_na);
-    function = SvPV (ST (1), PL_na);
-    data = SvPV (ST (2), PL_na);
+    signal = SvPV_nolen (ST (0));
+    function = SvPV_nolen (ST (1));
+    data = SvPV_nolen (ST (2));
     
     result = script_ptr2str (script_api_hook_hsignal (weechat_perl_plugin,
                                                       perl_current_script,
@@ -3689,7 +3689,7 @@ XS (XS_weechat_api_hook_hsignal_send)
         PERL_RETURN_ERROR;
     }
     
-    signal = SvPV (ST (0), PL_na);
+    signal = SvPV_nolen (ST (0));
     hashtable = weechat_perl_hash_to_hashtable (ST (1),
                                                 WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
     
@@ -3764,9 +3764,9 @@ XS (XS_weechat_api_hook_config)
         PERL_RETURN_EMPTY;
     }
     
-    option = SvPV (ST (0), PL_na);
-    function = SvPV (ST (1), PL_na);
-    data = SvPV (ST (2), PL_na);
+    option = SvPV_nolen (ST (0));
+    function = SvPV_nolen (ST (1));
+    data = SvPV_nolen (ST (2));
     
     result = script_ptr2str (script_api_hook_config (weechat_perl_plugin,
                                                      perl_current_script,
@@ -3848,10 +3848,10 @@ XS (XS_weechat_api_hook_completion)
         PERL_RETURN_EMPTY;
     }
     
-    completion = SvPV (ST (0), PL_na);
-    description = SvPV (ST (1), PL_na);
-    function = SvPV (ST (2), PL_na);
-    data = SvPV (ST (3), PL_na);
+    completion = SvPV_nolen (ST (0));
+    description = SvPV_nolen (ST (1));
+    function = SvPV_nolen (ST (2));
+    data = SvPV_nolen (ST (3));
     
     result = script_ptr2str (script_api_hook_completion (weechat_perl_plugin,
                                                          perl_current_script,
@@ -3888,9 +3888,9 @@ XS (XS_weechat_api_hook_completion_list_add)
         PERL_RETURN_ERROR;
     }
     
-    completion = SvPV (ST (0), PL_na);
-    word = SvPV (ST (1), PL_na);
-    where = SvPV (ST (3), PL_na);
+    completion = SvPV_nolen (ST (0));
+    word = SvPV_nolen (ST (1));
+    where = SvPV_nolen (ST (3));
     
     weechat_hook_completion_list_add (script_str2ptr (completion),
                                       word,
@@ -3954,9 +3954,9 @@ XS (XS_weechat_api_hook_modifier)
         PERL_RETURN_EMPTY;
     }
     
-    modifier = SvPV (ST (0), PL_na);
-    function = SvPV (ST (1), PL_na);
-    data = SvPV (ST (2), PL_na);
+    modifier = SvPV_nolen (ST (0));
+    function = SvPV_nolen (ST (1));
+    data = SvPV_nolen (ST (2));
     
     result = script_ptr2str (script_api_hook_modifier (weechat_perl_plugin,
                                                        perl_current_script,
@@ -3992,9 +3992,9 @@ XS (XS_weechat_api_hook_modifier_exec)
         PERL_RETURN_EMPTY;
     }
     
-    modifier = SvPV (ST (0), PL_na);
-    modifier_data = SvPV (ST (1), PL_na);
-    string = SvPV (ST (2), PL_na);
+    modifier = SvPV_nolen (ST (0));
+    modifier_data = SvPV_nolen (ST (1));
+    string = SvPV_nolen (ST (2));
     
     result = weechat_hook_modifier_exec (modifier, modifier_data, string);
     
@@ -4054,11 +4054,11 @@ XS (XS_weechat_api_hook_info)
         PERL_RETURN_EMPTY;
     }
     
-    info_name = SvPV (ST (0), PL_na);
-    description = SvPV (ST (1), PL_na);
-    args_description = SvPV (ST (2), PL_na);
-    function = SvPV (ST (3), PL_na);
-    data = SvPV (ST (4), PL_na);
+    info_name = SvPV_nolen (ST (0));
+    description = SvPV_nolen (ST (1));
+    args_description = SvPV_nolen (ST (2));
+    function = SvPV_nolen (ST (3));
+    data = SvPV_nolen (ST (4));
     
     result = script_ptr2str (script_api_hook_info (weechat_perl_plugin,
                                                    perl_current_script,
@@ -4126,12 +4126,12 @@ XS (XS_weechat_api_hook_info_hashtable)
         PERL_RETURN_EMPTY;
     }
     
-    info_name = SvPV (ST (0), PL_na);
-    description = SvPV (ST (1), PL_na);
-    args_description = SvPV (ST (2), PL_na);
-    output_description = SvPV (ST (3), PL_na);
-    function = SvPV (ST (4), PL_na);
-    data = SvPV (ST (5), PL_na);
+    info_name = SvPV_nolen (ST (0));
+    description = SvPV_nolen (ST (1));
+    args_description = SvPV_nolen (ST (2));
+    output_description = SvPV_nolen (ST (3));
+    function = SvPV_nolen (ST (4));
+    data = SvPV_nolen (ST (5));
     
     result = script_ptr2str (script_api_hook_info_hashtable (weechat_perl_plugin,
                                                              perl_current_script,
@@ -4207,12 +4207,12 @@ XS (XS_weechat_api_hook_infolist)
         PERL_RETURN_EMPTY;
     }
     
-    infolist_name = SvPV (ST (0), PL_na);
-    description = SvPV (ST (1), PL_na);
-    pointer_description = SvPV (ST (2), PL_na);
-    args_description = SvPV (ST (3), PL_na);
-    function = SvPV (ST (4), PL_na);
-    data = SvPV (ST (5), PL_na);
+    infolist_name = SvPV_nolen (ST (0));
+    description = SvPV_nolen (ST (1));
+    pointer_description = SvPV_nolen (ST (2));
+    args_description = SvPV_nolen (ST (3));
+    function = SvPV_nolen (ST (4));
+    data = SvPV_nolen (ST (5));
     
     result = script_ptr2str (script_api_hook_infolist (weechat_perl_plugin,
                                                        perl_current_script,
@@ -4252,7 +4252,7 @@ XS (XS_weechat_api_unhook)
     
     script_api_unhook (weechat_perl_plugin,
                        perl_current_script,
-                       script_str2ptr (SvPV (ST (0), PL_na))); /* hook */
+                       script_str2ptr (SvPV_nolen (ST (0)))); /* hook */
     
     PERL_RETURN_OK;
 }
@@ -4385,11 +4385,11 @@ XS (XS_weechat_api_buffer_new)
         PERL_RETURN_EMPTY;
     }
     
-    name = SvPV (ST (0), PL_na);
-    function_input = SvPV (ST (1), PL_na);
-    data_input = SvPV (ST (2), PL_na);
-    function_close = SvPV (ST (3), PL_na);
-    data_close = SvPV (ST (4), PL_na);
+    name = SvPV_nolen (ST (0));
+    function_input = SvPV_nolen (ST (1));
+    data_input = SvPV_nolen (ST (2));
+    function_close = SvPV_nolen (ST (3));
+    data_close = SvPV_nolen (ST (4));
     
     result = script_ptr2str (script_api_buffer_new (weechat_perl_plugin,
                                                     perl_current_script,
@@ -4428,8 +4428,8 @@ XS (XS_weechat_api_buffer_search)
         PERL_RETURN_EMPTY;
     }
     
-    plugin = SvPV (ST (0), PL_na);
-    name = SvPV (ST (1), PL_na);
+    plugin = SvPV_nolen (ST (0));
+    name = SvPV_nolen (ST (1));
     
     result = script_ptr2str (weechat_buffer_search (plugin, name));
     
@@ -4507,7 +4507,7 @@ XS (XS_weechat_api_buffer_clear)
         PERL_RETURN_ERROR;
     }
     
-    weechat_buffer_clear (script_str2ptr (SvPV (ST (0), PL_na))); /* buffer */
+    weechat_buffer_clear (script_str2ptr (SvPV_nolen (ST (0)))); /* buffer */
     
     PERL_RETURN_OK;
 }
@@ -4537,7 +4537,7 @@ XS (XS_weechat_api_buffer_close)
     
     script_api_buffer_close (weechat_perl_plugin,
                              perl_current_script,
-                             script_str2ptr (SvPV (ST (0), PL_na))); /* buffer */
+                             script_str2ptr (SvPV_nolen (ST (0)))); /* buffer */
     
     PERL_RETURN_OK;
 }
@@ -4565,8 +4565,8 @@ XS (XS_weechat_api_buffer_merge)
         PERL_RETURN_ERROR;
     }
     
-    weechat_buffer_merge (script_str2ptr (SvPV (ST (0), PL_na)), /* buffer */
-                          script_str2ptr (SvPV (ST (1), PL_na))); /* target_buffer */
+    weechat_buffer_merge (script_str2ptr (SvPV_nolen (ST (0))), /* buffer */
+                          script_str2ptr (SvPV_nolen (ST (1)))); /* target_buffer */
     
     PERL_RETURN_OK;
 }
@@ -4594,7 +4594,7 @@ XS (XS_weechat_api_buffer_unmerge)
         PERL_RETURN_ERROR;
     }
     
-    weechat_buffer_unmerge (script_str2ptr (SvPV (ST (0), PL_na)), /* buffer */
+    weechat_buffer_unmerge (script_str2ptr (SvPV_nolen (ST (0))), /* buffer */
                             SvIV (ST (1))); /* number */
     
     PERL_RETURN_OK;
@@ -4625,8 +4625,8 @@ XS (XS_weechat_api_buffer_get_integer)
         PERL_RETURN_INT(-1);
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    property = SvPV (ST (1), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    property = SvPV_nolen (ST (1));
     
     value = weechat_buffer_get_integer (script_str2ptr (buffer), property);
     
@@ -4658,8 +4658,8 @@ XS (XS_weechat_api_buffer_get_string)
         PERL_RETURN_EMPTY;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    property = SvPV (ST (1), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    property = SvPV_nolen (ST (1));
     
     result = weechat_buffer_get_string (script_str2ptr (buffer), property);
     
@@ -4690,8 +4690,8 @@ XS (XS_weechat_api_buffer_get_pointer)
         PERL_RETURN_EMPTY;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    property = SvPV (ST (1), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    property = SvPV_nolen (ST (1));
     
     result = script_ptr2str (weechat_buffer_get_pointer (script_str2ptr (buffer),
                                                          property));
@@ -4723,9 +4723,9 @@ XS (XS_weechat_api_buffer_set)
         PERL_RETURN_ERROR;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    property = SvPV (ST (1), PL_na);
-    value = SvPV (ST (2), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    property = SvPV_nolen (ST (1));
+    value = SvPV_nolen (ST (2));
     
     weechat_buffer_set (script_str2ptr (buffer), property, value);
     
@@ -4757,8 +4757,8 @@ XS (XS_weechat_api_buffer_string_replace_local_var)
         PERL_RETURN_ERROR;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    string = SvPV (ST (1), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    string = SvPV_nolen (ST (1));
     
     result = weechat_buffer_string_replace_local_var (script_str2ptr (buffer), string);
     
@@ -4814,8 +4814,8 @@ XS (XS_weechat_api_window_get_integer)
         PERL_RETURN_INT(-1);
     }
     
-    window = SvPV (ST (0), PL_na);
-    property = SvPV (ST (1), PL_na);
+    window = SvPV_nolen (ST (0));
+    property = SvPV_nolen (ST (1));
     
     value = weechat_window_get_integer (script_str2ptr (window), property);
     
@@ -4847,8 +4847,8 @@ XS (XS_weechat_api_window_get_string)
         PERL_RETURN_EMPTY;
     }
     
-    window = SvPV (ST (0), PL_na);
-    property = SvPV (ST (1), PL_na);
+    window = SvPV_nolen (ST (0));
+    property = SvPV_nolen (ST (1));
     
     result = weechat_window_get_string (script_str2ptr (window), property);
     
@@ -4879,8 +4879,8 @@ XS (XS_weechat_api_window_get_pointer)
         PERL_RETURN_EMPTY;
     }
     
-    window = SvPV (ST (0), PL_na);
-    property = SvPV (ST (1), PL_na);
+    window = SvPV_nolen (ST (0));
+    property = SvPV_nolen (ST (1));
     
     result = script_ptr2str (weechat_window_get_pointer (script_str2ptr (window),
                                                          property));
@@ -4911,7 +4911,7 @@ XS (XS_weechat_api_window_set_title)
         PERL_RETURN_ERROR;
     }
     
-    weechat_window_set_title (SvPV (ST (0), PL_na)); /* title */
+    weechat_window_set_title (SvPV_nolen (ST (0))); /* title */
     
     PERL_RETURN_OK;
 }
@@ -4940,10 +4940,10 @@ XS (XS_weechat_api_nicklist_add_group)
         PERL_RETURN_EMPTY;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    parent_group = SvPV (ST (1), PL_na);
-    name = SvPV (ST (2), PL_na);
-    color = SvPV (ST (3), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    parent_group = SvPV_nolen (ST (1));
+    name = SvPV_nolen (ST (2));
+    color = SvPV_nolen (ST (3));
     
     result = script_ptr2str (weechat_nicklist_add_group (script_str2ptr (buffer),
                                                          script_str2ptr (parent_group),
@@ -4978,9 +4978,9 @@ XS (XS_weechat_api_nicklist_search_group)
         PERL_RETURN_EMPTY;
     }
 
-    buffer = SvPV (ST (0), PL_na);
-    from_group = SvPV (ST (1), PL_na);
-    name = SvPV (ST (2), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    from_group = SvPV_nolen (ST (1));
+    name = SvPV_nolen (ST (2));
     
     result = script_ptr2str (weechat_nicklist_search_group (script_str2ptr (buffer),
                                                             script_str2ptr (from_group),
@@ -5013,12 +5013,12 @@ XS (XS_weechat_api_nicklist_add_nick)
         PERL_RETURN_EMPTY;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    group = SvPV (ST (1), PL_na);
-    name = SvPV (ST (2), PL_na);
-    color = SvPV (ST (3), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    group = SvPV_nolen (ST (1));
+    name = SvPV_nolen (ST (2));
+    color = SvPV_nolen (ST (3));
     prefix = SvPV(ST (4), PL_na);
-    prefix_color = SvPV (ST (5), PL_na);
+    prefix_color = SvPV_nolen (ST (5));
     
     result = script_ptr2str (weechat_nicklist_add_nick (script_str2ptr (buffer),
                                                         script_str2ptr (group),
@@ -5055,9 +5055,9 @@ XS (XS_weechat_api_nicklist_search_nick)
         PERL_RETURN_EMPTY;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    from_group = SvPV (ST (1), PL_na);
-    name = SvPV (ST (2), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    from_group = SvPV_nolen (ST (1));
+    name = SvPV_nolen (ST (2));
     
     result = script_ptr2str (weechat_nicklist_search_nick (script_str2ptr (buffer),
                                                            script_str2ptr (from_group),
@@ -5090,8 +5090,8 @@ XS (XS_weechat_api_nicklist_remove_group)
         PERL_RETURN_ERROR;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    group = SvPV (ST (1), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    group = SvPV_nolen (ST (1));
     
     weechat_nicklist_remove_group (script_str2ptr (buffer),
                                    script_str2ptr (group));
@@ -5123,8 +5123,8 @@ XS (XS_weechat_api_nicklist_remove_nick)
         PERL_RETURN_ERROR;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    nick = SvPV (ST (1), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    nick = SvPV_nolen (ST (1));
     
     weechat_nicklist_remove_nick (script_str2ptr (buffer),
                                   script_str2ptr (nick));
@@ -5155,7 +5155,7 @@ XS (XS_weechat_api_nicklist_remove_all)
         PERL_RETURN_ERROR;
     }
     
-    weechat_nicklist_remove_all (script_str2ptr (SvPV (ST (0), PL_na))); /* buffer */
+    weechat_nicklist_remove_all (script_str2ptr (SvPV_nolen (ST (0)))); /* buffer */
     
     PERL_RETURN_OK;
 }
@@ -5185,9 +5185,9 @@ XS (XS_weechat_api_nicklist_group_get_integer)
         PERL_RETURN_INT(-1);
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    group = SvPV (ST (1), PL_na);
-    property = SvPV (ST (2), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    group = SvPV_nolen (ST (1));
+    property = SvPV_nolen (ST (2));
     
     value = weechat_nicklist_group_get_integer (script_str2ptr (buffer),
                                                 script_str2ptr (group),
@@ -5221,9 +5221,9 @@ XS (XS_weechat_api_nicklist_group_get_string)
         PERL_RETURN_EMPTY;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    group = SvPV (ST (1), PL_na);
-    property = SvPV (ST (2), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    group = SvPV_nolen (ST (1));
+    property = SvPV_nolen (ST (2));
     
     result = weechat_nicklist_group_get_string (script_str2ptr (buffer),
                                                 script_str2ptr (group),
@@ -5256,9 +5256,9 @@ XS (XS_weechat_api_nicklist_group_get_pointer)
         PERL_RETURN_EMPTY;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    group = SvPV (ST (1), PL_na);
-    property = SvPV (ST (2), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    group = SvPV_nolen (ST (1));
+    property = SvPV_nolen (ST (2));
     
     result = script_ptr2str (weechat_nicklist_group_get_pointer (script_str2ptr (buffer),
                                                                  script_str2ptr (group),
@@ -5291,10 +5291,10 @@ XS (XS_weechat_api_nicklist_group_set)
         PERL_RETURN_ERROR;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    group = SvPV (ST (1), PL_na);
-    property = SvPV (ST (2), PL_na);
-    value = SvPV (ST (3), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    group = SvPV_nolen (ST (1));
+    property = SvPV_nolen (ST (2));
+    value = SvPV_nolen (ST (3));
     
     weechat_nicklist_group_set (script_str2ptr (buffer),
                                 script_str2ptr (group),
@@ -5329,9 +5329,9 @@ XS (XS_weechat_api_nicklist_nick_get_integer)
         PERL_RETURN_INT(-1);
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    nick = SvPV (ST (1), PL_na);
-    property = SvPV (ST (2), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    nick = SvPV_nolen (ST (1));
+    property = SvPV_nolen (ST (2));
     
     value = weechat_nicklist_nick_get_integer (script_str2ptr (buffer),
                                                script_str2ptr (nick),
@@ -5365,9 +5365,9 @@ XS (XS_weechat_api_nicklist_nick_get_string)
         PERL_RETURN_EMPTY;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    nick = SvPV (ST (1), PL_na);
-    property = SvPV (ST (2), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    nick = SvPV_nolen (ST (1));
+    property = SvPV_nolen (ST (2));
     
     result = weechat_nicklist_nick_get_string (script_str2ptr (buffer),
                                                script_str2ptr (nick),
@@ -5400,9 +5400,9 @@ XS (XS_weechat_api_nicklist_nick_get_pointer)
         PERL_RETURN_EMPTY;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    nick = SvPV (ST (1), PL_na);
-    property = SvPV (ST (2), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    nick = SvPV_nolen (ST (1));
+    property = SvPV_nolen (ST (2));
     
     result = script_ptr2str (weechat_nicklist_nick_get_pointer (script_str2ptr (buffer),
                                                                 script_str2ptr (nick),
@@ -5435,10 +5435,10 @@ XS (XS_weechat_api_nicklist_nick_set)
         PERL_RETURN_ERROR;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    nick = SvPV (ST (1), PL_na);
-    property = SvPV (ST (2), PL_na);
-    value = SvPV (ST (3), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    nick = SvPV_nolen (ST (1));
+    property = SvPV_nolen (ST (2));
+    value = SvPV_nolen (ST (3));
     
     weechat_nicklist_nick_set (script_str2ptr (buffer),
                                script_str2ptr (nick),
@@ -5472,7 +5472,7 @@ XS (XS_weechat_api_bar_item_search)
         PERL_RETURN_EMPTY;
     }
     
-    result = script_ptr2str (weechat_bar_item_search (SvPV (ST (0), PL_na))); /* name */
+    result = script_ptr2str (weechat_bar_item_search (SvPV_nolen (ST (0)))); /* name */
     
     PERL_RETURN_STRING_FREE(result);
 }
@@ -5537,9 +5537,9 @@ XS (XS_weechat_api_bar_item_new)
         PERL_RETURN_EMPTY;
     }
     
-    name = SvPV (ST (0), PL_na);
-    function = SvPV (ST (1), PL_na);
-    data = SvPV (ST (2), PL_na);
+    name = SvPV_nolen (ST (0));
+    function = SvPV_nolen (ST (1));
+    data = SvPV_nolen (ST (2));
     
     result = script_ptr2str (script_api_bar_item_new (weechat_perl_plugin,
                                                       perl_current_script,
@@ -5574,7 +5574,7 @@ XS (XS_weechat_api_bar_item_update)
         PERL_RETURN_ERROR;
     }
     
-    weechat_bar_item_update (SvPV (ST (0), PL_na)); /* name */
+    weechat_bar_item_update (SvPV_nolen (ST (0))); /* name */
     
     PERL_RETURN_OK;
 }
@@ -5604,7 +5604,7 @@ XS (XS_weechat_api_bar_item_remove)
     
     script_api_bar_item_remove (weechat_perl_plugin,
                                 perl_current_script,
-                                script_str2ptr (SvPV (ST (0), PL_na))); /* item */
+                                script_str2ptr (SvPV_nolen (ST (0)))); /* item */
     
     PERL_RETURN_OK;
 }
@@ -5633,7 +5633,7 @@ XS (XS_weechat_api_bar_search)
         PERL_RETURN_EMPTY;
     }
     
-    result = script_ptr2str (weechat_bar_search (SvPV (ST (0), PL_na))); /* name */
+    result = script_ptr2str (weechat_bar_search (SvPV_nolen (ST (0)))); /* name */
     
     PERL_RETURN_STRING_FREE(result);
 }
@@ -5664,21 +5664,21 @@ XS (XS_weechat_api_bar_new)
         PERL_RETURN_EMPTY;
     }
     
-    name = SvPV (ST (0), PL_na);
-    hidden = SvPV (ST (1), PL_na);
-    priority = SvPV (ST (2), PL_na);
-    type = SvPV (ST (3), PL_na);
-    conditions = SvPV (ST (4), PL_na);
-    position = SvPV (ST (5), PL_na);
-    filling_top_bottom = SvPV (ST (6), PL_na);
-    filling_left_right = SvPV (ST (7), PL_na);
-    size = SvPV (ST (8), PL_na);
-    size_max = SvPV (ST (9), PL_na);
-    color_fg = SvPV (ST (10), PL_na);
-    color_delim = SvPV (ST (11), PL_na);
-    color_bg = SvPV (ST (12), PL_na);
-    separator = SvPV (ST (13), PL_na);
-    bar_items = SvPV (ST (14), PL_na);
+    name = SvPV_nolen (ST (0));
+    hidden = SvPV_nolen (ST (1));
+    priority = SvPV_nolen (ST (2));
+    type = SvPV_nolen (ST (3));
+    conditions = SvPV_nolen (ST (4));
+    position = SvPV_nolen (ST (5));
+    filling_top_bottom = SvPV_nolen (ST (6));
+    filling_left_right = SvPV_nolen (ST (7));
+    size = SvPV_nolen (ST (8));
+    size_max = SvPV_nolen (ST (9));
+    color_fg = SvPV_nolen (ST (10));
+    color_delim = SvPV_nolen (ST (11));
+    color_bg = SvPV_nolen (ST (12));
+    separator = SvPV_nolen (ST (13));
+    bar_items = SvPV_nolen (ST (14));
     
     result = script_ptr2str (weechat_bar_new (name,
                                               hidden,
@@ -5723,9 +5723,9 @@ XS (XS_weechat_api_bar_set)
         PERL_RETURN_ERROR;
     }
     
-    bar = SvPV (ST (0), PL_na);
-    property = SvPV (ST (1), PL_na);
-    value = SvPV (ST (2), PL_na);
+    bar = SvPV_nolen (ST (0));
+    property = SvPV_nolen (ST (1));
+    value = SvPV_nolen (ST (2));
     
     weechat_bar_set (script_str2ptr (bar), property, value);
     
@@ -5755,7 +5755,7 @@ XS (XS_weechat_api_bar_update)
         PERL_RETURN_ERROR;
     }
     
-    weechat_bar_update (SvPV (ST (0), PL_na)); /* name */
+    weechat_bar_update (SvPV_nolen (ST (0))); /* name */
     
     PERL_RETURN_OK;
 }
@@ -5783,7 +5783,7 @@ XS (XS_weechat_api_bar_remove)
         PERL_RETURN_ERROR;
     }
     
-    weechat_bar_remove (script_str2ptr (SvPV (ST (0), PL_na))); /* bar */
+    weechat_bar_remove (script_str2ptr (SvPV_nolen (ST (0)))); /* bar */
     
     PERL_RETURN_OK;
 }
@@ -5812,8 +5812,8 @@ XS (XS_weechat_api_command)
         PERL_RETURN_ERROR;
     }
     
-    buffer = SvPV (ST (0), PL_na);
-    command = SvPV (ST (1), PL_na);
+    buffer = SvPV_nolen (ST (0));
+    command = SvPV_nolen (ST (1));
     
     script_api_command (weechat_perl_plugin,
                         perl_current_script,
@@ -5848,8 +5848,8 @@ XS (XS_weechat_api_info_get)
         PERL_RETURN_EMPTY;
     }
     
-    info_name = SvPV (ST (0), PL_na);
-    arguments = SvPV (ST (1), PL_na);
+    info_name = SvPV_nolen (ST (0));
+    arguments = SvPV_nolen (ST (1));
     
     result = weechat_info_get (info_name, arguments);
     
@@ -5882,7 +5882,7 @@ XS (XS_weechat_api_info_get_hashtable)
         PERL_RETURN_EMPTY;
     }
     
-    info_name = SvPV (ST (0), PL_na);
+    info_name = SvPV_nolen (ST (0));
     hashtable = weechat_perl_hash_to_hashtable (ST (1),
                                                 WEECHAT_SCRIPT_HASHTABLE_DEFAULT_SIZE);
     
@@ -5945,7 +5945,7 @@ XS (XS_weechat_api_infolist_new_item)
         PERL_RETURN_EMPTY;
     }
     
-    infolist = SvPV (ST (0), PL_na);
+    infolist = SvPV_nolen (ST (0));
     
     result = script_ptr2str (weechat_infolist_new_item (script_str2ptr (infolist)));
     
@@ -5976,8 +5976,8 @@ XS (XS_weechat_api_infolist_new_var_integer)
         PERL_RETURN_EMPTY;
     }
     
-    infolist = SvPV (ST (0), PL_na);
-    name = SvPV (ST (1), PL_na);
+    infolist = SvPV_nolen (ST (0));
+    name = SvPV_nolen (ST (1));
     
     result = script_ptr2str (weechat_infolist_new_var_integer (script_str2ptr (infolist),
                                                                name,
@@ -6010,9 +6010,9 @@ XS (XS_weechat_api_infolist_new_var_string)
         PERL_RETURN_EMPTY;
     }
     
-    infolist = SvPV (ST (0), PL_na);
-    name = SvPV (ST (1), PL_na);
-    value = SvPV (ST (2), PL_na);
+    infolist = SvPV_nolen (ST (0));
+    name = SvPV_nolen (ST (1));
+    value = SvPV_nolen (ST (2));
     
     result = script_ptr2str (weechat_infolist_new_var_string (script_str2ptr (infolist),
                                                               name,
@@ -6045,9 +6045,9 @@ XS (XS_weechat_api_infolist_new_var_pointer)
         PERL_RETURN_EMPTY;
     }
     
-    infolist = SvPV (ST (0), PL_na);
-    name = SvPV (ST (1), PL_na);
-    value = SvPV (ST (2), PL_na);
+    infolist = SvPV_nolen (ST (0));
+    name = SvPV_nolen (ST (1));
+    value = SvPV_nolen (ST (2));
     
     result = script_ptr2str (weechat_infolist_new_var_pointer (script_str2ptr (infolist),
                                                                name,
@@ -6080,8 +6080,8 @@ XS (XS_weechat_api_infolist_new_var_time)
         PERL_RETURN_EMPTY;
     }
     
-    infolist = SvPV (ST (0), PL_na);
-    name = SvPV (ST (1), PL_na);
+    infolist = SvPV_nolen (ST (0));
+    name = SvPV_nolen (ST (1));
     
     result = script_ptr2str (weechat_infolist_new_var_time (script_str2ptr (infolist),
                                                             name,
@@ -6114,9 +6114,9 @@ XS (XS_weechat_api_infolist_get)
         PERL_RETURN_EMPTY;
     }
     
-    name = SvPV (ST (0), PL_na);
-    pointer = SvPV (ST (1), PL_na);
-    arguments = SvPV (ST (2), PL_na);
+    name = SvPV_nolen (ST (0));
+    pointer = SvPV_nolen (ST (1));
+    arguments = SvPV_nolen (ST (2));
     
     result = script_ptr2str (weechat_infolist_get (name,
                                                    script_str2ptr (pointer),
@@ -6149,7 +6149,7 @@ XS (XS_weechat_api_infolist_next)
         PERL_RETURN_INT(0);
     }
     
-    value = weechat_infolist_next (script_str2ptr (SvPV (ST (0), PL_na))); /* infolist */
+    value = weechat_infolist_next (script_str2ptr (SvPV_nolen (ST (0)))); /* infolist */
     
     PERL_RETURN_INT(value);
 }
@@ -6178,7 +6178,7 @@ XS (XS_weechat_api_infolist_prev)
         PERL_RETURN_INT(0);
     }
     
-    value = weechat_infolist_prev (script_str2ptr (SvPV (ST (0), PL_na))); /* infolist */
+    value = weechat_infolist_prev (script_str2ptr (SvPV_nolen (ST (0)))); /* infolist */
     
     PERL_RETURN_INT(value);
 }
@@ -6207,7 +6207,7 @@ XS (XS_weechat_api_infolist_reset_item_cursor)
         PERL_RETURN_ERROR;
     }
     
-    weechat_infolist_reset_item_cursor (script_str2ptr (SvPV (ST (0), PL_na))); /* infolist */
+    weechat_infolist_reset_item_cursor (script_str2ptr (SvPV_nolen (ST (0)))); /* infolist */
     
     PERL_RETURN_OK;
 }
@@ -6236,7 +6236,7 @@ XS (XS_weechat_api_infolist_fields)
         PERL_RETURN_EMPTY;
     }
     
-    result = weechat_infolist_fields (script_str2ptr (SvPV (ST (0), PL_na))); /* infolist */
+    result = weechat_infolist_fields (script_str2ptr (SvPV_nolen (ST (0)))); /* infolist */
     
     PERL_RETURN_STRING(result);
 }
@@ -6266,8 +6266,8 @@ XS (XS_weechat_api_infolist_integer)
         PERL_RETURN_INT(0);
     }
     
-    infolist = SvPV (ST (0), PL_na);
-    variable = SvPV (ST (1), PL_na);
+    infolist = SvPV_nolen (ST (0));
+    variable = SvPV_nolen (ST (1));
     
     value = weechat_infolist_integer (script_str2ptr (infolist), variable);
     
@@ -6299,8 +6299,8 @@ XS (XS_weechat_api_infolist_string)
         PERL_RETURN_EMPTY;
     }
     
-    infolist = SvPV (ST (0), PL_na);
-    variable = SvPV (ST (1), PL_na);
+    infolist = SvPV_nolen (ST (0));
+    variable = SvPV_nolen (ST (1));
     
     result = weechat_infolist_string (script_str2ptr (infolist), variable);
     
@@ -6332,8 +6332,8 @@ XS (XS_weechat_api_infolist_pointer)
         PERL_RETURN_EMPTY;
     }
     
-    infolist = SvPV (ST (0), PL_na);
-    variable = SvPV (ST (1), PL_na);
+    infolist = SvPV_nolen (ST (0));
+    variable = SvPV_nolen (ST (1));
     
     result = script_ptr2str (weechat_infolist_pointer (script_str2ptr (infolist), variable));
     
@@ -6365,8 +6365,8 @@ XS (XS_weechat_api_infolist_time)
         PERL_RETURN_EMPTY;
     }
     
-    infolist = SvPV (ST (0), PL_na);
-    variable = SvPV (ST (1), PL_na);
+    infolist = SvPV_nolen (ST (0));
+    variable = SvPV_nolen (ST (1));
     time = weechat_infolist_time (script_str2ptr (infolist), variable);
     strftime (timebuffer, sizeof (timebuffer), "%F %T", localtime (&time));
     result = strdup (timebuffer);
@@ -6397,7 +6397,7 @@ XS (XS_weechat_api_infolist_free)
         PERL_RETURN_ERROR;
     }
     
-    weechat_infolist_free (script_str2ptr (SvPV (ST (0), PL_na))); /* infolist */
+    weechat_infolist_free (script_str2ptr (SvPV_nolen (ST (0)))); /* infolist */
     
     PERL_RETURN_OK;
 }
@@ -6426,7 +6426,7 @@ XS (XS_weechat_api_upgrade_new)
         PERL_RETURN_EMPTY;
     }
     
-    filename = SvPV (ST (0), PL_na);
+    filename = SvPV_nolen (ST (0));
     
     result = script_ptr2str (weechat_upgrade_new (filename,
                                                   SvIV (ST (1)))); /* write */
@@ -6459,8 +6459,8 @@ XS (XS_weechat_api_upgrade_write_object)
         PERL_RETURN_INT(0);
     }
 
-    upgrade_file = SvPV (ST (0), PL_na);
-    infolist = SvPV (ST (2), PL_na);
+    upgrade_file = SvPV_nolen (ST (0));
+    infolist = SvPV_nolen (ST (2));
     
     rc = weechat_upgrade_write_object (script_str2ptr (upgrade_file),
                                        SvIV (ST (1)), /* object_id */
@@ -6543,9 +6543,9 @@ XS (XS_weechat_api_upgrade_read)
         PERL_RETURN_INT(0);
     }
     
-    upgrade_file = SvPV (ST (0), PL_na);
-    function = SvPV (ST (1), PL_na);
-    data = SvPV (ST (2), PL_na);
+    upgrade_file = SvPV_nolen (ST (0));
+    function = SvPV_nolen (ST (1));
+    data = SvPV_nolen (ST (2));
     
     rc = script_api_upgrade_read (weechat_perl_plugin,
                                   perl_current_script,
@@ -6581,7 +6581,7 @@ XS (XS_weechat_api_upgrade_close)
         PERL_RETURN_ERROR;
     }
     
-    upgrade_file = SvPV (ST (0), PL_na);
+    upgrade_file = SvPV_nolen (ST (0));
     
     weechat_upgrade_close (script_str2ptr (upgrade_file));
     
-- 
1.7.3.5

