]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Update after gnulib changed.
authorBruno Haible <bruno@clisp.org>
Thu, 2 Jan 2025 13:12:12 +0000 (14:12 +0100)
committerBruno Haible <bruno@clisp.org>
Thu, 2 Jan 2025 13:12:12 +0000 (14:12 +0100)
* gettext-runtime/src/envsubst.c (subst_from_stdin): Use sd_ function prefix
instead of string_desc_ function prefix.
* gettext-tools/src/its.c (set_doc_encoding_utf8, _its_is_valid_simple_gen_xml,
is_valid_xhtml_element, is_valid_html_element, is_no_end_html_element):
Likewise.
* gettext-tools/src/msgl-ascii.c (is_ascii_string_desc): Likewise.
* gettext-tools/src/msgl-iconv.c (convert_string_desc_directly): Likewise.
* gettext-tools/src/read-desktop.c (desktop_lex): Likewise.
* gettext-tools/src/x-awk.c (phase2_getc, phase3_get): Likewise.
* gettext-tools/src/x-c.c (phase5_get): Likewise.
* gettext-tools/src/x-perl.c (get_here_document, extract_quotelike_pass1,
extract_quotelike_pass1_utf8, extract_quotelike, extract_triple_quotelike,
extract_quotelike_pass3, extract_variable, interpolate_keywords, x_perl_prelex):
Likewise.
* gettext-tools/src/x-php.c (phase4_get): Likewise.
* gettext-tools/src/x-rst.c (parse_integer): Likewise.
* gettext-tools/src/x-ycp.c (phase2_getc, phase5_get): Likewise.
* gettext-tools/src/xg-encoding.c (string_desc_from_current_source_encoding):
Likewise.

12 files changed:
gettext-runtime/src/envsubst.c
gettext-tools/src/its.c
gettext-tools/src/msgl-ascii.c
gettext-tools/src/msgl-iconv.c
gettext-tools/src/read-desktop.c
gettext-tools/src/x-awk.c
gettext-tools/src/x-c.c
gettext-tools/src/x-perl.c
gettext-tools/src/x-php.c
gettext-tools/src/x-rst.c
gettext-tools/src/x-ycp.c
gettext-tools/src/xg-encoding.c

index e5d1f070d89913dfb4867036b101855197f96dd7..2d6e30d4a761616d32a52b3ac652f46d9aa891c4 100644 (file)
@@ -1,5 +1,5 @@
 /* Substitution of environment variables in shell format strings.
-   Copyright (C) 2003-2024 Free Software Foundation, Inc.
+   Copyright (C) 2003-2025 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software: you can redistribute it and/or modify
@@ -549,7 +549,7 @@ subst_from_stdin ()
                   putchar ('$');
                   if (opening_brace)
                     putchar ('{');
-                  string_desc_fwrite (stdout, sb_contents (&buffer));
+                  sd_fwrite (stdout, sb_contents (&buffer));
                   if (closing_brace)
                     putchar ('}');
                 }
index 3f28f885127b1fd70419e679f6b07032a2c0f19f..8990aee5a7fb7dd3d57ed7e2d42a6a17fcc6e0ef 100644 (file)
@@ -1,5 +1,5 @@
 /* Internationalization Tag Set (ITS) handling
-   Copyright (C) 2015-2024 Free Software Foundation, Inc.
+   Copyright (C) 2015-2025 Free Software Foundation, Inc.
 
    This file was written by Daiki Ueno <ueno@gnu.org>, 2015.
 
@@ -2242,9 +2242,9 @@ set_doc_encoding_utf8 (xmlDoc *doc)
       doc->encoding = BAD_CAST xstrdup ("UTF-8");
       return true;
     }
-  string_desc_t enc = string_desc_from_c ((char *) doc->encoding);
-  if (string_desc_c_casecmp (enc, string_desc_from_c ("UTF-8")) == 0
-      || string_desc_c_casecmp (enc, string_desc_from_c ("UTF8")) == 0)
+  string_desc_t enc = sd_from_c ((char *) doc->encoding);
+  if (sd_c_casecmp (enc, sd_from_c ("UTF-8")) == 0
+      || sd_c_casecmp (enc, sd_from_c ("UTF8")) == 0)
     return true;
   /* The document's encoding is not UTF-8.  Conversion would be expensive.  */
   return false;
@@ -2340,9 +2340,8 @@ _its_is_valid_simple_gen_xml (const char *contents,
           if (add_to_node != NULL && !slash_before_tag)
             {
               string_desc_t name =
-                string_desc_new_addr (name_end - name_start,
-                                      (char *) name_start);
-              char *name_c = xstring_desc_c (name);
+                sd_new_addr (name_end - name_start, (char *) name_start);
+              char *name_c = xsd_c (name);
               if (ignore_case)
                 {
                   /* Convert the name to lower case.  */
@@ -2433,13 +2432,13 @@ _its_is_valid_simple_gen_xml (const char *contents,
                   if (add_to_node != NULL)
                     {
                       string_desc_t attr_name =
-                        string_desc_new_addr (attr_name_end - attr_name_start,
-                                              (char *) attr_name_start);
+                        sd_new_addr (attr_name_end - attr_name_start,
+                                     (char *) attr_name_start);
                       string_desc_t attr_value =
-                        string_desc_new_addr (attr_value_end - attr_value_start,
-                                              (char *) attr_value_start);
-                      char *attr_name_c = xstring_desc_c (attr_name);
-                      char *attr_value_c = xstring_desc_c (attr_value);
+                        sd_new_addr (attr_value_end - attr_value_start,
+                                     (char *) attr_value_start);
+                      char *attr_name_c = xsd_c (attr_name);
+                      char *attr_value_c = xsd_c (attr_value);
                       xmlAttr *attr =
                         xmlNewProp (current_node, BAD_CAST attr_name_c,
                                     BAD_CAST attr_value_c);
@@ -2475,7 +2474,7 @@ _its_is_valid_simple_gen_xml (const char *contents,
           /* Seen a complete <...> element start/end.  */
           /* Verify that the tag is allowed.  */
           string_desc_t tag =
-            string_desc_new_addr (name_end - name_start, (char *) name_start);
+            sd_new_addr (name_end - name_start, (char *) name_start);
           if (!(valid_element == NULL || valid_element (tag)))
             return false;
           if (slash_after_tag || (no_end_element != NULL && no_end_element (tag)))
@@ -2499,7 +2498,7 @@ _its_is_valid_simple_gen_xml (const char *contents,
               if (open_elements_count == 0)
                 /* The end of an element without a corresponding start.  */
                 return false;
-              if ((ignore_case ? string_desc_c_casecmp : string_desc_cmp)
+              if ((ignore_case ? sd_c_casecmp : sd_cmp)
                   (open_elements[open_elements_count - 1], tag)
                   != 0)
                 return false;
@@ -2666,7 +2665,7 @@ is_valid_xhtml_element (string_desc_t tag)
       /* Invariant:
          If tag occurs in the table, it is at an index >= lo, < hi.  */
       size_t i = (lo + hi) / 2; /* >= lo, < hi */
-      int cmp = string_desc_cmp (tag, string_desc_from_c (allowed[i]));
+      int cmp = sd_cmp (tag, sd_from_c (allowed[i]));
       if (cmp == 0)
         return true;
       if (cmp < 0)
@@ -2764,7 +2763,7 @@ is_valid_html_element (string_desc_t tag)
       /* Invariant:
          If tag occurs in the table, it is at an index >= lo, < hi.  */
       size_t i = (lo + hi) / 2; /* >= lo, < hi */
-      int cmp = string_desc_cmp (tag, string_desc_from_c (allowed[i]));
+      int cmp = sd_cmp (tag, sd_from_c (allowed[i]));
       if (cmp == 0)
         return true;
       if (cmp < 0)
@@ -2781,8 +2780,8 @@ is_no_end_html_element (string_desc_t tag)
   /* Specification:
      https://html.spec.whatwg.org/
      Search for "Tag omission in text/html: No end tag."  */
-  return string_desc_cmp (tag, string_desc_from_c ("br")) == 0
-         || string_desc_cmp (tag, string_desc_from_c ("hr")) == 0;
+  return sd_cmp (tag, sd_from_c ("br")) == 0
+         || sd_cmp (tag, sd_from_c ("hr")) == 0;
 }
 
 /* Returns true if the argument is a piece of simple well-formed HTML
index 07bcd74ad3db9db5871d2ef1b559b301eab09ab2..9b21d047c938c6cf805af18561f91721666661a6 100644 (file)
@@ -1,5 +1,5 @@
 /* Message list test for ASCII character set.
-   Copyright (C) 2001-2024 Free Software Foundation, Inc.
+   Copyright (C) 2001-2025 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -41,10 +41,10 @@ is_ascii_string (const char *string)
 bool
 is_ascii_string_desc (string_desc_t string)
 {
-  size_t len = string_desc_length (string);
+  size_t len = sd_length (string);
   size_t i;
   for (i = 0; i < len; i++)
-    if (!c_isascii ((unsigned char) string_desc_char_at (string, i)))
+    if (!c_isascii ((unsigned char) sd_char_at (string, i)))
       return false;
   return true;
 }
index 4223c993558047a94e2307e0d18418464fc8972d..178940465ba13ce51131fc88f0cab2e0d15f0c5f 100644 (file)
@@ -1,5 +1,5 @@
 /* Message list charset and locale charset handling.
-   Copyright (C) 2001-2024 Free Software Foundation, Inc.
+   Copyright (C) 2001-2025 Free Software Foundation, Inc.
    Written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
    This program is free software: you can redistribute it and/or modify
@@ -102,13 +102,13 @@ convert_string_desc_directly (iconv_t cd, string_desc_t string,
   char *result = NULL;
   size_t resultlen = 0;
 
-  if (xmem_cd_iconv (string_desc_data (string), string_desc_length (string),
+  if (xmem_cd_iconv (sd_data (string), sd_length (string),
                      cd, &result, &resultlen) == 0)
-    return string_desc_new_addr (resultlen, result);
+    return sd_new_addr (resultlen, result);
 
   conversion_error (context, textmode_xerror_handler);
   /* NOTREACHED */
-  return string_desc_new_empty ();
+  return sd_new_empty ();
 }
 
 static char *
index 8bfa01aed9de2523c5140ba72b78df1ed9c4face..477fae15739e7ee5fb368fa0c2e07bdcaedb4ebc 100644 (file)
@@ -1,5 +1,5 @@
 /* Reading Desktop Entry files.
-   Copyright (C) 1995-2024 Free Software Foundation, Inc.
+   Copyright (C) 1995-2025 Free Software Foundation, Inc.
    This file was written by Daiki Ueno <ueno@gnu.org>.
 
    This program is free software: you can redistribute it and/or modify
@@ -333,7 +333,7 @@ desktop_lex (token_ty *tp)
                     /* Finish the key part and start the locale part.  */
                     APPEND (0);
                     found_locale = true;
-                    locale_start = string_desc_length (sb_contents (&buffer));
+                    locale_start = sd_length (sb_contents (&buffer));
 
                     for (;;)
                       {
@@ -406,7 +406,7 @@ desktop_lex (token_ty *tp)
               }
 
             size_t before_value_lineno = pos.line_number;
-            value_start = string_desc_length (sb_contents (&buffer));
+            value_start = sd_length (sb_contents (&buffer));
             for (;;)
               {
                 c = phase2_getc ();
index 58aa34c4b9a726e075abdfa610c3314d8c9ef387..23790951b99018f22f1a90ec6a0b2a9de866a20b 100644 (file)
@@ -1,5 +1,5 @@
 /* xgettext awk backend.
-   Copyright (C) 2002-2024 Free Software Foundation, Inc.
+   Copyright (C) 2002-2025 Free Software Foundation, Inc.
 
    This file was written by Bruno Haible <haible@clisp.cons.org>, 2002.
 
@@ -186,7 +186,7 @@ phase2_getc ()
           if (c == '\n' || c == EOF)
             break;
           /* We skip all leading white space, but not EOLs.  */
-          if (!(string_desc_length (sb_contents (&buffer)) == 0
+          if (!(sd_length (sb_contents (&buffer)) == 0
                 && (c == ' ' || c == '\t')))
             sb_xappend1 (&buffer, c);
         }
@@ -464,8 +464,8 @@ phase3_get (token_ty *tp)
                   default:
                     {
                       string_desc_t contents = sb_contents (&buffer);
-                      if (string_desc_length (contents) == 1
-                          && string_desc_char_at (contents, 0) == '_'
+                      if (sd_length (contents) == 1
+                          && sd_char_at (contents, 0) == '_'
                           && c == '"')
                         {
                           sb_free (&buffer);
index ae065e9136cf7fe23043eb2bdb53298002df321b..68030f51ab5f54005af413cada5df0dad129f123 100644 (file)
@@ -1,5 +1,5 @@
 /* xgettext C/C++/ObjectiveC backend.
-   Copyright (C) 1995-2024 Free Software Foundation, Inc.
+   Copyright (C) 1995-2025 Free Software Foundation, Inc.
 
    This file was written by Peter Miller <millerp@canb.auug.org.au>
 
@@ -1345,8 +1345,8 @@ phase5_get (token_ty *tp)
               case '"':
                 {
                   string_desc_t contents = sb_contents (&buffer);
-                  const char *buf = string_desc_data (contents);
-                  size_t buflen = string_desc_length (contents);
+                  const char *buf = sd_data (contents);
+                  size_t buflen = sd_length (contents);
 
                   /* Recognize C11 / C++11 string literals.
                      See (for C) ISO 9899:2011 section 6.4.5
@@ -1464,8 +1464,8 @@ phase5_get (token_ty *tp)
 
                               /* Update the state.  */
                               string_desc_t raw_contents = sb_contents (&buffer);
-                              const char *raw_buf = string_desc_data (raw_contents);
-                              size_t raw_buflen = string_desc_length (raw_contents);
+                              const char *raw_buf = sd_data (raw_contents);
+                              size_t raw_buflen = sd_length (raw_contents);
                               if (c == (state < raw_buflen ? raw_buf[state] : '"'))
                                 {
                                   if (state < raw_buflen)
@@ -1650,11 +1650,10 @@ phase5_get (token_ty *tp)
                        can be part of a number token.  It's called a "digit
                        separator".  See ISO C 23 Â§ 6.4.4.1 and Â§ 6.4.4.2.  */
                     string_desc_t contents = sb_contents (&buffer);
-                    if (string_desc_length (contents) > 0)
+                    if (sd_length (contents) > 0)
                       {
                         char prev =
-                          string_desc_char_at (contents,
-                                               string_desc_length (contents) - 1);
+                          sd_char_at (contents, sd_length (contents) - 1);
                         if ((prev >= '0' && prev <= '9')
                             || (prev >= 'A' && prev <= 'F')
                             || (prev >= 'a' && prev <= 'f'))
index 4fab5a2181233da670882e1dce27c00e1b3f2886..60c25efd69e2fe162632f0874fc10557225439a8 100644 (file)
@@ -1,5 +1,5 @@
 /* xgettext Perl backend.
-   Copyright (C) 2002-2024 Free Software Foundation, Inc.
+   Copyright (C) 2002-2025 Free Software Foundation, Inc.
 
    This file was written by Guido Flohr <guido@imperia.net>, 2002-2010.
 
@@ -507,7 +507,7 @@ get_here_document (struct perl_extractor *xp, const char *delimiter)
         my_linebuf[read_bytes - 1] = '\n';
 
       /* Append this line to the accumulator.  */
-      sb_xappend_desc (&buffer, string_desc_new_addr (read_bytes, my_linebuf));
+      sb_xappend_desc (&buffer, sd_new_addr (read_bytes, my_linebuf));
     }
 
   /* Done accumulating the here document.  */
@@ -782,7 +782,7 @@ extract_quotelike_pass1 (struct perl_extractor *xp, int delim)
         {
           string_desc_t inner = extract_quotelike_pass1 (xp, delim);
           sb_xappend_desc (&buffer, inner);
-          string_desc_free (inner);
+          sd_free (inner);
         }
       else if (c == '\\')
         {
@@ -820,8 +820,8 @@ extract_quotelike_pass1_utf8 (struct perl_extractor *xp, int delim)
     string_desc_from_current_source_encoding (string, lc_string,
                                               logical_file_name,
                                               xp->line_number);
-  if (string_desc_data (utf8_string) != string_desc_data (string))
-    string_desc_free (string);
+  if (sd_data (utf8_string) != sd_data (string))
+    sd_free (string);
   return utf8_string;
 }
 
@@ -913,14 +913,14 @@ static void
 extract_quotelike (struct perl_extractor *xp, token_ty *tp, int delim)
 {
   string_desc_t string = extract_quotelike_pass1_utf8 (xp, delim);
-  size_t len = string_desc_length (string);
+  size_t len = sd_length (string);
 
   tp->type = token_type_string;
   /* Take the string without the delimiters at the start and at the end.  */
   if (!(len >= 2))
     abort ();
-  tp->string = string_desc_c (string_desc_substring (string, 1, len - 1));
-  string_desc_free (string);
+  tp->string = sd_c (sd_substring (string, 1, len - 1));
+  sd_free (string);
   tp->comment = add_reference (savable_comment);
 }
 
@@ -939,7 +939,7 @@ extract_triple_quotelike (struct perl_extractor *xp, token_ty *tp, int delim,
   string = extract_quotelike_pass1_utf8 (xp, delim);
   if (interpolate)
     interpolate_keywords (xp, string, xp->line_number);
-  string_desc_free (string);
+  sd_free (string);
 
   if (delim == '(' || delim == '<' || delim == '{' || delim == '[')
     {
@@ -956,7 +956,7 @@ extract_triple_quotelike (struct perl_extractor *xp, token_ty *tp, int delim,
   string = extract_quotelike_pass1_utf8 (xp, delim);
   if (interpolate)
     interpolate_keywords (xp, string, xp->line_number);
-  string_desc_free (string);
+  sd_free (string);
 }
 
 /* Perform pass 3 of quotelike extraction (interpolation).
@@ -1089,8 +1089,7 @@ extract_quotelike_pass3 (struct perl_extractor *xp, token_ty *tp)
                 int length =
                   u8_uctomb ((unsigned char *) tmpbuf, oct_number, 2);
                 if (length > 0)
-                  sb_xappend_desc (&buffer,
-                                   string_desc_new_addr (length, tmpbuf));
+                  sb_xappend_desc (&buffer, sd_new_addr (length, tmpbuf));
               }
               continue;
             case 'x':
@@ -1139,8 +1138,7 @@ extract_quotelike_pass3 (struct perl_extractor *xp, token_ty *tp)
                 int length =
                   u8_uctomb ((unsigned char *) tmpbuf, hex_number, 6);
                 if (length > 0)
-                  sb_xappend_desc (&buffer,
-                                   string_desc_new_addr (length, tmpbuf));
+                  sb_xappend_desc (&buffer, sd_new_addr (length, tmpbuf));
               }
               continue;
             case 'c':
@@ -1178,7 +1176,7 @@ extract_quotelike_pass3 (struct perl_extractor *xp, token_ty *tp)
                             u8_uctomb ((unsigned char *) tmpbuf, unicode, 6);
                           if (length > 0)
                             sb_xappend_desc (&buffer,
-                                             string_desc_new_addr (length, tmpbuf));
+                                             sd_new_addr (length, tmpbuf));
                         }
 
                       free (name);
@@ -1378,12 +1376,12 @@ extract_variable (struct perl_extractor *xp, token_ty *tp, int first)
     /* Hash references are treated in a special way, when looking for
        our keywords.  */
     string_desc_t contents = sb_contents (&buffer);
-    if (string_desc_char_at (contents, 0) == '$')
+    if (sd_char_at (contents, 0) == '$')
       {
-        if (string_desc_length (contents) == 1)
+        if (sd_length (contents) == 1)
           maybe_hash_value = true;
-        else if (string_desc_length (contents) == 2
-                 && string_desc_char_at (contents, 1) == '$')
+        else if (sd_length (contents) == 2
+                 && sd_char_at (contents, 1) == '$')
           {
             if (!(c == '{'
                   || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z')
@@ -1756,7 +1754,7 @@ interpolate_keywords (struct perl_extractor *xp, string_desc_t string,
   state = initial;
   region = null_context_region ();
 
-  length = string_desc_length (string);
+  length = sd_length (string);
   index = 0;
 
   token.type = token_type_string;
@@ -1773,7 +1771,7 @@ interpolate_keywords (struct perl_extractor *xp, string_desc_t string,
     {
       void *keyword_value;
 
-      c = string_desc_char_at (string, index++);
+      c = sd_char_at (string, index++);
       if (state == initial)
         buffer.length = 0;
 
@@ -1792,7 +1790,7 @@ interpolate_keywords (struct perl_extractor *xp, string_desc_t string,
                   sb_free (&buffer);
                   return;
                 }
-              c = string_desc_char_at (string, index++);
+              c = sd_char_at (string, index++);
               break;
             case '$':
               sb_xappend1 (&buffer, '$');
@@ -1849,8 +1847,8 @@ interpolate_keywords (struct perl_extractor *xp, string_desc_t string,
               {
                 string_desc_t contents = sb_contents (&buffer);
                 if (hash_find_entry (&keywords,
-                                     string_desc_data (contents),
-                                     string_desc_length (contents),
+                                     sd_data (contents),
+                                     sd_length (contents),
                                      &keyword_value)
                     == 0)
                   {
@@ -1858,8 +1856,8 @@ interpolate_keywords (struct perl_extractor *xp, string_desc_t string,
                       flag_context_list_iterator (
                         flag_context_list_table_lookup (
                           flag_context_list_table,
-                          string_desc_data (contents),
-                          string_desc_length (contents)));
+                          sd_data (contents),
+                          sd_length (contents)));
                     region =
                       inheriting_region (null_context_region (),
                                          flag_context_list_iterator_advance (
@@ -1878,10 +1876,10 @@ interpolate_keywords (struct perl_extractor *xp, string_desc_t string,
               {
                 string_desc_t contents = sb_contents (&buffer);
                 if (!maybe_hash_deref)
-                  string_desc_set_char_at (contents, 0, '%');
+                  sd_set_char_at (contents, 0, '%');
                 if (hash_find_entry (&keywords,
-                                     string_desc_data (contents),
-                                     string_desc_length (contents),
+                                     sd_data (contents),
+                                     sd_length (contents),
                                      &keyword_value)
                     == 0)
                   {
@@ -1889,8 +1887,8 @@ interpolate_keywords (struct perl_extractor *xp, string_desc_t string,
                       flag_context_list_iterator (
                         flag_context_list_table_lookup (
                           flag_context_list_table,
-                          string_desc_data (contents),
-                          string_desc_length (contents)));
+                          sd_data (contents),
+                          sd_length (contents)));
                     region =
                       inheriting_region (null_context_region (),
                                          flag_context_list_iterator_advance (
@@ -1962,7 +1960,7 @@ interpolate_keywords (struct perl_extractor *xp, string_desc_t string,
                 }
               else
                 {
-                  c = string_desc_char_at (string, index++);
+                  c = sd_char_at (string, index++);
                   if (c == '\"')
                     {
                       sb_xappend1 (&buffer, c);
@@ -1994,7 +1992,7 @@ interpolate_keywords (struct perl_extractor *xp, string_desc_t string,
                 }
               else
                 {
-                  c = string_desc_char_at (string, index++);
+                  c = sd_char_at (string, index++);
                   if (c == '\'')
                     {
                       sb_xappend1 (&buffer, c);
@@ -2091,7 +2089,7 @@ interpolate_keywords (struct perl_extractor *xp, string_desc_t string,
                 }
               else
                 {
-                  c = string_desc_char_at (string, index++);
+                  c = sd_char_at (string, index++);
                   if (c == '\"')
                     {
                       sb_xappend1 (&buffer, c);
@@ -2122,7 +2120,7 @@ interpolate_keywords (struct perl_extractor *xp, string_desc_t string,
                 }
               else
                 {
-                  c = string_desc_char_at (string, index++);
+                  c = sd_char_at (string, index++);
                   if (c == '\'')
                     {
                       sb_xappend1 (&buffer, c);
@@ -2479,7 +2477,7 @@ x_perl_prelex (struct perl_extractor *xp, token_ty *tp)
                 extract_quotelike (xp, tp, delim);
                 sb_free (&buffer);
                 if (delim != '\'')
-                  interpolate_keywords (xp, string_desc_from_c (tp->string),
+                  interpolate_keywords (xp, sd_from_c (tp->string),
                                         xp->line_number);
                 free (tp->string);
                 drop_reference (tp->comment);
@@ -2535,7 +2533,7 @@ x_perl_prelex (struct perl_extractor *xp, token_ty *tp)
                   case 'x':
                     tp->type = token_type_string;
                     tp->sub_type = string_type_qq;
-                    interpolate_keywords (xp, string_desc_from_c (tp->string),
+                    interpolate_keywords (xp, sd_from_c (tp->string),
                                           xp->line_number);
                     break;
                   case 'r':
@@ -2575,14 +2573,14 @@ x_perl_prelex (struct perl_extractor *xp, token_ty *tp)
         case '"':
           extract_quotelike (xp, tp, c);
           tp->sub_type = string_type_qq;
-          interpolate_keywords (xp, string_desc_from_c (tp->string),
+          interpolate_keywords (xp, sd_from_c (tp->string),
                                 xp->line_number);
           return;
 
         case '`':
           extract_quotelike (xp, tp, c);
           tp->sub_type = string_type_qq;
-          interpolate_keywords (xp, string_desc_from_c (tp->string),
+          interpolate_keywords (xp, sd_from_c (tp->string),
                                 xp->line_number);
           return;
 
@@ -2680,7 +2678,7 @@ x_perl_prelex (struct perl_extractor *xp, token_ty *tp)
                   tp->type = token_type_string;
                   tp->sub_type = string_type_qq;
                   tp->line_number = xp->line_number + 1;
-                  interpolate_keywords (xp, string_desc_from_c (tp->string),
+                  interpolate_keywords (xp, sd_from_c (tp->string),
                                         tp->line_number);
                   return;
                 }
@@ -2714,7 +2712,7 @@ x_perl_prelex (struct perl_extractor *xp, token_ty *tp)
                       tp->sub_type = string_type_qq;
                       tp->comment = add_reference (savable_comment);
                       tp->line_number = xp->line_number + 1;
-                      interpolate_keywords (xp, string_desc_from_c (tp->string),
+                      interpolate_keywords (xp, sd_from_c (tp->string),
                                             tp->line_number);
                       return;
                     }
@@ -2756,7 +2754,7 @@ x_perl_prelex (struct perl_extractor *xp, token_ty *tp)
           if (prefer_regexp_over_division (tp->last_type))
             {
               extract_quotelike (xp, tp, c);
-              interpolate_keywords (xp, string_desc_from_c (tp->string),
+              interpolate_keywords (xp, sd_from_c (tp->string),
                                     xp->line_number);
               free (tp->string);
               drop_reference (tp->comment);
index 231480f0d46cf5a465ffe0e34b854bf200ee1184..6a6797f86253f0e88e890b5d7a8cc39951337493 100644 (file)
@@ -1,5 +1,5 @@
 /* xgettext PHP backend.
-   Copyright (C) 2001-2024 Free Software Foundation, Inc.
+   Copyright (C) 2001-2025 Free Software Foundation, Inc.
 
    This file was written by Bruno Haible <bruno@clisp.org>, 2002.
 
@@ -1320,14 +1320,14 @@ phase4_get (struct php_extractor *xp, token_ty *tp)
                     bool heredoc = true;
                     string_desc_t label = sb_contents (&buffer);
                     size_t label_start = 0;
-                    size_t label_end = string_desc_length (label);
+                    size_t label_end = sd_length (label);
                     if (label_end >= 2
-                        && ((string_desc_char_at (label, label_start) == '\''
-                             && string_desc_char_at (label, label_end - 1) == '\'')
-                            || (string_desc_char_at (label, label_start) == '"'
-                                && string_desc_char_at (label, label_end - 1) == '"')))
+                        && ((sd_char_at (label, label_start) == '\''
+                             && sd_char_at (label, label_end - 1) == '\'')
+                            || (sd_char_at (label, label_start) == '"'
+                                && sd_char_at (label, label_end - 1) == '"')))
                       {
-                        heredoc = (string_desc_char_at (label, label_start) == '"');
+                        heredoc = (sd_char_at (label, label_start) == '"');
                         label_start++;
                         label_end--;
                       }
@@ -1368,7 +1368,7 @@ phase4_get (struct php_extractor *xp, token_ty *tp)
                           }
                         else if (in_label_pos >= 0
                                  && in_label_pos < label_end - label_start
-                                 && c == string_desc_char_at (label, label_start + in_label_pos))
+                                 && c == sd_char_at (label, label_start + in_label_pos))
                           {
                             in_label_pos++;
                           }
index b93be2f32c000483bc80314589c7507926deadea..10b958060ce93aab74682ce60b793a8052d9c4d3 100644 (file)
@@ -1,5 +1,5 @@
 /* xgettext RST/RSJ backend.
-   Copyright (C) 2001-2024 Free Software Foundation, Inc.
+   Copyright (C) 2001-2025 Free Software Foundation, Inc.
 
    This file was written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
@@ -357,7 +357,7 @@ parse_integer ()
       c = phase1_getc ();
     }
   phase1_ungetc (c);
-  return (string_desc_length (sb_contents (&buffer)) == 0 ? pr_none : pr_parsed);
+  return (sd_length (sb_contents (&buffer)) == 0 ? pr_none : pr_parsed);
 }
 
 static struct mixed_string_buffer stringbuf;
index 37edd49a25834e39c6daf9ede8c1f79603c2df35..25a1336e57fb171bc29708ef6deca5f5793e4790 100644 (file)
@@ -1,5 +1,5 @@
 /* xgettext YCP backend.
-   Copyright (C) 2001-2024 Free Software Foundation, Inc.
+   Copyright (C) 2001-2025 Free Software Foundation, Inc.
 
    This file was written by Bruno Haible <haible@clisp.cons.org>, 2001.
 
@@ -162,7 +162,7 @@ phase2_getc ()
               if (c == '\n' || c == EOF)
                 break;
               /* We skip all leading white space, but not EOLs.  */
-              if (!(string_desc_length (sb_contents (&buffer)) == 0
+              if (!(sd_length (sb_contents (&buffer)) == 0
                     && (c == ' ' || c == '\t')))
                 sb_xappend1 (&buffer, c);
             }
@@ -200,7 +200,7 @@ phase2_getc ()
                     break;
                   }
                 /* We skip all leading white space, but not EOLs.  */
-                if (string_desc_length (sb_contents (&buffer)) == 0
+                if (sd_length (sb_contents (&buffer)) == 0
                     && (c == ' ' || c == '\t'))
                   continue;
                 sb_xappend1 (&buffer, c);
@@ -257,7 +257,7 @@ phase2_getc ()
                 if (c == '\n' || c == EOF)
                   break;
                 /* We skip all leading white space, but not EOLs.  */
-                if (!(string_desc_length (sb_contents (&buffer)) == 0
+                if (!(sd_length (sb_contents (&buffer)) == 0
                       && (c == ' ' || c == '\t')))
                   sb_xappend1 (&buffer, c);
               }
@@ -474,8 +474,8 @@ phase5_get (token_ty *tp)
                   default:
                     {
                       string_desc_t contents = sb_contents (&buffer);
-                      if (string_desc_length (contents) == 1
-                          && string_desc_char_at (contents, 0) == '_'
+                      if (sd_length (contents) == 1
+                          && sd_char_at (contents, 0) == '_'
                           && c == '(')
                         {
                           sb_free (&buffer);
index 714a4922a73b69155d1a024ef60fdbdb680e318c..148d8b38257e9713bf46a2f57ee295d61a0b54a7 100644 (file)
@@ -1,5 +1,5 @@
 /* Keeping track of the encoding of strings to be extracted.
-   Copyright (C) 2001-2023 Free Software Foundation, Inc.
+   Copyright (C) 2001-2025 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -220,8 +220,7 @@ string_desc_from_current_source_encoding (string_desc_t string,
     }
   else if (xgettext_current_source_encoding == po_charset_utf8)
     {
-      if (u8_check ((const uint8_t *) string_desc_data (string),
-                    string_desc_length (string))
+      if (u8_check ((const uint8_t *) sd_data (string), sd_length (string))
           != NULL)
         {
           multiline_error (xstrdup (""),