(take_uvec): Make BASE pointer non-const.
[bpt/guile.git] / libguile / strings.h
index edd6093..a2ec51a 100644 (file)
@@ -3,7 +3,7 @@
 #ifndef SCM_STRINGS_H
 #define SCM_STRINGS_H
 
-/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2004 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,2000,2001, 2004, 2005 Free Software Foundation, Inc.
  *
  * This library is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -17,7 +17,7 @@
  *
  * You should have received a copy of the GNU Lesser General Public
  * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
 \f
 
    Legacy interface
 
-   - SCM_STRINGP returns false for sh-strings.
+   - SCM_STRINGP is just scm_is_string.
 
    - SCM_STRING_CHARS uses scm_i_string_writable_chars and immediately
      calls scm_i_stop_writing, hoping for the best.  SCM_STRING_LENGTH
-     is the same as scm_i_string_length.  SCM_STRINGP will only return
-     true for strings that are null-terminated when accessed with
-     SCM_STRING_CHARS.
+     is the same as scm_i_string_length.  SCM_STRING_CHARS will throw
+     an error for for strings that are not null-terminated.
 */
 
 SCM_API SCM scm_string_p (SCM x);
@@ -84,6 +83,7 @@ SCM_API SCM scm_string_length (SCM str);
 SCM_API SCM scm_string_ref (SCM str, SCM k);
 SCM_API SCM scm_string_set_x (SCM str, SCM k, SCM chr);
 SCM_API SCM scm_substring (SCM str, SCM start, SCM end);
+SCM_API SCM scm_substring_read_only (SCM str, SCM start, SCM end);
 SCM_API SCM scm_substring_shared (SCM str, SCM start, SCM end);
 SCM_API SCM scm_substring_copy (SCM str, SCM start, SCM end);
 SCM_API SCM scm_string_append (SCM args);
@@ -93,6 +93,7 @@ SCM_API size_t scm_c_string_length (SCM str);
 SCM_API SCM scm_c_string_ref (SCM str, size_t pos);
 SCM_API void scm_c_string_set_x (SCM str, size_t pos, SCM chr);
 SCM_API SCM scm_c_substring (SCM str, size_t start, size_t end);
+SCM_API SCM scm_c_substring_read_only (SCM str, size_t start, size_t end);
 SCM_API SCM scm_c_substring_shared (SCM str, size_t start, size_t end);
 SCM_API SCM scm_c_substring_copy (SCM str, size_t start, size_t end);
 
@@ -111,6 +112,7 @@ SCM_API SCM scm_makfromstrs (int argc, char **argv);
 
 SCM_API SCM scm_i_make_string (size_t len, char **datap);
 SCM_API SCM scm_i_substring (SCM str, size_t start, size_t end);
+SCM_API SCM scm_i_substring_read_only (SCM str, size_t start, size_t end);
 SCM_API SCM scm_i_substring_shared (SCM str, size_t start, size_t end);
 SCM_API SCM scm_i_substring_copy (SCM str, size_t start, size_t end);
 SCM_API size_t scm_i_string_length (SCM str);
@@ -147,10 +149,14 @@ SCM_API void scm_i_get_substring_spec (size_t len,
 
 #if SCM_ENABLE_DEPRECATED
 
-SCM_API int SCM_STRINGP (SCM obj);
-SCM_API char *SCM_STRING_CHARS (SCM str);
-SCM_API size_t SCM_STRING_LENGTH (SCM str);
-#define SCM_STRING_UCHARS ((unsigned char *)SCM_STRING_CHARS (str))
+SCM_API int scm_i_deprecated_stringp (SCM obj);
+SCM_API char *scm_i_deprecated_string_chars (SCM str);
+SCM_API size_t scm_i_deprecated_string_length (SCM str);
+
+#define SCM_STRINGP(x)       scm_i_deprecated_stringp(x)
+#define SCM_STRING_CHARS(x)  scm_i_deprecated_string_chars(x)
+#define SCM_STRING_LENGTH(x) scm_i_deprecated_string_length(x)
+#define SCM_STRING_UCHARS(str) ((unsigned char *)SCM_STRING_CHARS (str))
 
 #endif