Merge branch 'stable-2.0'
[bpt/guile.git] / libguile / uniform.c
index d3ecb1b..f8cd2d3 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002,2003,2004, 2005, 2006, 2009, 2010 Free Software Foundation, Inc.
+/* Copyright (C) 1995,1996,1997,1998,2000,2001,2002,2003,2004, 2005, 2006, 2009, 2010, 2013 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 License
@@ -132,6 +132,25 @@ SCM_DEFINE (scm_uniform_vector_element_type, "uniform-vector-element-type", 1, 0
 }
 #undef FUNC_NAME
 
+SCM_DEFINE (scm_uniform_vector_element_type_code,
+            "uniform-vector-element-type-code", 1, 0, 0,
+           (SCM v),
+           "Return the type of the elements in the uniform vector, @var{v},\n"
+            "as an integer code.")
+#define FUNC_NAME s_scm_uniform_vector_element_type_code
+{
+  scm_t_array_handle h;
+  SCM ret;
+
+  if (!scm_is_uniform_vector (v))
+    scm_wrong_type_arg_msg (FUNC_NAME, SCM_ARG1, v, "uniform vector");
+  scm_array_get_handle (v, &h);
+  ret = scm_from_uint16 (h.element_type);
+  scm_array_handle_release (&h);
+  return ret;
+}
+#undef FUNC_NAME
+
 SCM_DEFINE (scm_uniform_vector_element_size, "uniform-vector-element-size", 1, 0, 0,
            (SCM v),
            "Return the number of bytes allocated to each element in the\n"
@@ -193,7 +212,7 @@ SCM_DEFINE (scm_uniform_vector_to_list, "uniform-vector->list", 1, 0, 0,
 {
   if (!scm_is_uniform_vector (uvec))
     scm_wrong_type_arg_msg (FUNC_NAME, SCM_ARG1, uvec, "uniform vector");
-  return scm_generalized_vector_to_list (uvec);
+  return scm_array_to_list (uvec);
 }
 #undef FUNC_NAME