[goffice] more API documentation work.



commit 100e1918864c7438dc1799ec5d9e52ecf79718b4
Author: Jean Brefort <jean brefort normalesup org>
Date:   Thu Sep 17 12:14:31 2009 +0200

    more API documentation work.

 docs/reference/goffice-0.8-sections.txt |  301 +++++++++++++++++++++++++++++--
 docs/reference/goffice-docs.sgml        |    3 +
 goffice/canvas/goc-item.c               |   11 +-
 goffice/graph/gog-chart-map.c           |    2 +-
 goffice/math/go-cspline.c               |   20 +-
 goffice/math/go-cspline.h               |   34 ++--
 goffice/utils/go-string.c               |   12 +-
 7 files changed, 332 insertions(+), 51 deletions(-)
---
diff --git a/docs/reference/goffice-0.8-sections.txt b/docs/reference/goffice-0.8-sections.txt
index 1d49b66..b8fdf99 100644
--- a/docs/reference/goffice-0.8-sections.txt
+++ b/docs/reference/goffice-0.8-sections.txt
@@ -747,6 +747,39 @@ gog_axis_map_is_inverted
 ### GUI utilities
 
 <SECTION>
+<FILE>goffice-gtk</FILE>
+<TITLE>Goffice GTK related utilities</TITLE>
+go_gtk_editable_enters
+go_gtk_builder_new
+go_gtk_builder_signal_connect
+go_gtk_builder_signal_connect_swapped
+go_gtk_builder_get_widget
+go_gtk_builder_combo_box_init_text
+go_gtk_builder_group_value
+go_pango_measure_string
+go_gtk_dialog_run
+go_gtk_dialog_add_button
+go_gtk_notice_dialog
+go_gtk_notice_nonmodal_dialog
+go_gtk_query_yes_no
+go_gtk_button_new_with_stock
+go_gtk_widget_disable_focus
+go_gtk_window_set_transient
+go_gtk_help_button_init
+go_gtk_nonmodal_dialog
+go_gtk_file_sel_dialog
+go_gtk_select_image
+go_gui_get_image_save_info
+go_gtk_url_is_writeable
+go_atk_setup_label
+go_dialog_guess_alternative_button_order
+go_widget_set_tooltip_text
+go_tool_item_set_tooltip_text
+go_menu_position_below
+go_gtk_url_show
+</SECTION>
+
+<SECTION>
 <FILE>go-combo-box</FILE>
 <TITLE>GOComboBox</TITLE>
 GOComboBox
@@ -1057,6 +1090,7 @@ go_gradient_selector_set_colors
 <SECTION>
 <FILE>go-color-selector</FILE>
 <TITLE>GOColorSelector</TITLE>
+GOColorPalette
 go_color_palette_get_current_color
 go_color_palette_get_type
 go_color_palette_make_menu
@@ -1072,6 +1106,21 @@ go_color_selector_set_allow_alpha
 go_color_selector_set_color
 </SECTION>
 
+<SECTION>
+<FILE>go-calendar-button</FILE>
+<TITLE>GOCalendarButton</TITLE>
+GOCalendarButton
+go_calendar_button_new
+go_calendar_button_get_calendar
+go_calendar_button_set_date
+go_calendar_button_get_date
+<SUBSECTION Standard>
+GO_CALENDAR_BUTTON
+GO_IS_CALENDAR_BUTTON
+GO_TYPE_CALENDAR_BUTTON
+go_calendar_button_get_type
+</SECTION>
+
 ###############################################################################
 
 ### Mathematics
@@ -1160,6 +1209,48 @@ go_complex_zero_pl
 </SECTION>
 
 <SECTION>
+<FILE>go-cspline</FILE>
+<TITLE>GOCSpline</TITLE>
+GOCSpline
+GOCSplineType
+go_cspline_init
+go_cspline_destroy
+go_cspline_get_value
+go_cspline_get_deriv
+go_cspline_get_values
+go_cspline_get_derivs
+go_cspline_get_integrals
+<SUBSECTION Private>
+GOCSplinel
+go_cspline_initl
+go_cspline_destroyl
+</SECTION>
+
+<SECTION>
+<FILE>go-distribution</FILE>
+GODistributionType
+go_distribution_type_to_string
+go_distribution_type_from_string
+GODistribution
+go_distribution_new
+go_distribution_get_distribution_type
+go_distribution_get_distribution_name
+go_distribution_get_density
+go_distribution_get_cumulative
+go_distribution_get_ppf
+go_distribution_get_hazard
+go_distribution_get_cumulative_hazard
+go_distribution_get_survival
+go_distribution_get_inverse_survival
+go_distribution_scale
+<SUBSECTION Standard>
+GO_DISTRIBUTION
+GO_IS_DISTRIBUTION
+GO_TYPE_DISTRIBUTION
+go_distribution_get_type
+</SECTION>
+
+<SECTION>
 <FILE>go-range</FILE>
 <TITLE>GORange</TITLE>
 go_range_sum
@@ -1222,15 +1313,6 @@ go_regression_stat_destroyl
 go_regression_stat_tl
 </SECTION>
 
-<SECTION>
-<FILE>go-bezier</FILE>
-<TITLE>GOBezierSpline</TITLE>
-GOBezierSpline
-go_bezier_spline_init
-go_bezier_spline_destroy
-go_bezier_spline_to_path
-</SECTION>
-
 ###############################################################################
 
 ### Utilities
@@ -1241,6 +1323,7 @@ go_bezier_spline_to_path
 <INCLUDE>goffice/graph/go-geometry.h</INCLUDE>
 GO_GEOMETRY_ANGLE_TOLERANCE
 GOGeometrySide
+GODirection
 GOGeometryRotationType
 GOGeometryOBR
 GOGeometryAABR
@@ -1271,6 +1354,15 @@ go_locale_get_time_format
 </SECTION>
 
 <SECTION>
+<FILE>go-bezier</FILE>
+<TITLE>GOBezierSpline</TITLE>
+GOBezierSpline
+go_bezier_spline_init
+go_bezier_spline_destroy
+go_bezier_spline_to_path
+</SECTION>
+
+<SECTION>
 <FILE>go-image</FILE>
 GOImageFormat
 GOImageFormatInfo
@@ -1732,8 +1824,15 @@ go_styled_object_get_type
 </SECTION>
 
 <SECTION>
+<FILE>goffice-app</FILE>
+<SUBSECTION Private>
+GOApp
+</SECTION>
+
+<SECTION>
 <FILE>go-doc-control</FILE>
 <TITLE>GODocControl</TITLE>
+GODocControl
 GO_TYPE_DOC_CONTROL
 GO_DOC_CONTROL
 GO_IS_DOC_CONTROL
@@ -1751,6 +1850,7 @@ GO_DOC_CONTROL_GET_CLASS
 GO_TYPE_DOC
 GO_DOC
 GO_IS_DOC
+GODoc
 go_doc_get_type
 go_doc_new_from_input
 go_doc_new_from_uri
@@ -1786,6 +1886,7 @@ GO_DOC_GET_CLASS
 <FILE>go-component</FILE>
 <TITLE>GOComponent</TITLE>
 GOComponent
+GOComponentClass
 GO_TYPE_COMPONENT
 GO_COMPONENT
 GO_IS_COMPONENT
@@ -1826,6 +1927,7 @@ go_components_support_clipboard
 GO_TYPE_CMD_CONTEXT
 GO_CMD_CONTEXT
 GO_IS_CMD_CONTEXT
+GOCmdContext
 go_cmd_context_get_type
 go_cmd_context_error
 go_cmd_context_get_password
@@ -1848,10 +1950,70 @@ go_cmd_context_progress_message_set
 </SECTION>
 
 <SECTION>
+<FILE>error-info</FILE>
+<TITLE>GOErrorInfo</TITLE>
+GOErrorInfo
+GOSeverity
+go_error_info_new_str
+go_error_info_new_printf
+go_error_info_new_vprintf
+go_error_info_new_str_with_details
+go_error_info_new_str_with_details_list
+go_error_info_new_from_error_list
+go_error_info_new_from_errno
+go_error_info_add_details
+go_error_info_add_details_list
+go_error_info_free
+go_error_info_print
+go_error_info_peek_message
+go_error_info_peek_details
+go_error_info_peek_severity
+GO_INIT_RET_ERROR_INFO
+</SECTION>
+
+<SECTION>
+<FILE>io-context</FILE>
+<TITLE>GOIOContext</TITLE>
+GOIOContext
+GOIOContextClass
+go_io_context_new
+go_io_error_unknown
+go_io_error_info_set
+go_io_error_string
+go_io_error_push
+go_io_error_clear
+go_io_error_display
+go_io_error_occurred
+go_io_warning_occurred
+go_io_progress_message
+go_io_progress_update
+go_io_progress_range_push
+go_io_progress_range_pop
+go_io_count_progress_set
+go_io_count_progress_update
+go_io_value_progress_set
+go_io_value_progress_update
+go_io_progress_unset
+go_io_context_set_num_files
+go_io_context_processing_file
+go_io_warning
+go_io_warning_varargs
+go_io_warning_unknown_font
+go_io_warning_unknown_function
+go_io_warning_unsupported_feature
+<SUBSECTION Standard>
+GO_IO_CONTEXT
+GO_IS_IO_CONTEXT
+GO_TYPE_IO_CONTEXT
+go_io_context_get_type
+</SECTION>
+
+<SECTION>
 <FILE>go-plugin</FILE>
 GO_TYPE_PLUGIN
 GO_PLUGIN
 GO_IS_PLUGIN
+GOPlugin
 go_plugin_init
 go_plugin_shutdown
 go_plugin_get_type
@@ -1896,6 +2058,7 @@ GO_PLUGIN_LOADER
 GO_IS_PLUGIN_LOADER
 GO_PLUGIN_LOADER_CLASS
 GO_IS_PLUGIN_LOADER_CLASS
+GOPluginLoader
 go_plugin_loader_get_type
 go_plugin_loader_set_attributes
 go_plugin_loader_get_plugin
@@ -1927,6 +2090,7 @@ go_plugin_loader_module_register_version
 GO_TYPE_PLUGIN_SERVICE
 GO_PLUGIN_SERVICE
 GO_IS_PLUGIN_SERVICE
+GOPluginService
 go_plugin_service_get_type
 GO_TYPE_PLUGIN_SERVICE_GENERAL
 GO_PLUGIN_SERVICE_GENERAL
@@ -1981,11 +2145,44 @@ GO_PLUGIN_SERVICE_GET_CLASS
 GO_PLUGIN_SERVICE_GOBJECT_LOADER_CLASS
 GO_PLUGIN_SERVICE_GOBJECT_LOADER_GET_CLASS
 </SECTION>
+<SECTION>
+<FILE>go-conf</FILE>
+GOConfNode
+go_conf_get_node
+go_conf_free_node
+go_conf_get_short_desc
+go_conf_get_long_desc
+go_conf_node_get_key_type
+go_conf_get_value_as_str
+go_conf_get_bool
+go_conf_get_int
+go_conf_get_double
+go_conf_get_string
+go_conf_get_str_list
+go_conf_get_enum_as_str
+go_conf_load_bool
+go_conf_load_int
+go_conf_load_double
+go_conf_load_string
+go_conf_load_str_list
+go_conf_load_enum
+go_conf_set_bool
+go_conf_set_int
+go_conf_set_double
+go_conf_set_string
+go_conf_set_str_list
+go_conf_set_enum
+go_conf_sync
+GOConfMonitorFunc
+go_conf_remove_monitor
+go_conf_add_monitor
+</SECTION>
 
 <SECTION>
 <FILE>go-data</FILE>
 <TITLE>GOData</TITLE>
 GOData
+GODataClass
 <SUBSECTION>
 go_data_dup
 go_data_eq
@@ -2022,6 +2219,7 @@ GODataFlags
 <FILE>go-data-scalar</FILE>
 <TITLE>GODataScalar</TITLE>
 GODataScalar
+GODataScalarClass
 <SUBSECTION>
 go_data_scalar_get_value
 go_data_scalar_get_str
@@ -2037,6 +2235,7 @@ go_data_scalar_get_type
 <FILE>go-data-vector</FILE>
 <TITLE>GODataVector</TITLE>
 GODataVector
+GODataVectorClass
 <SUBSECTION>
 go_data_vector_get_len
 go_data_vector_get_values
@@ -2058,6 +2257,8 @@ go_data_vector_get_type
 <FILE>go-data-matrix</FILE>
 <TITLE>GODataMatrix</TITLE>
 GODataMatrix
+GODataMatrixClass
+GODataMatrixSize
 go_data_matrix_get_size
 go_data_matrix_get_values
 go_data_matrix_get_value
@@ -2073,6 +2274,44 @@ go_data_matrix_get_type
 
 
 <SECTION>
+<FILE>go-data-simple</FILE>
+GODataScalarVal
+go_data_scalar_val_new
+GO_TYPE_DATA_SCALAR_STR
+GO_DATA_SCALAR_STR
+GO_IS_DATA_SCALAR_STR
+GODataScalarStr
+go_data_scalar_str_get_type
+go_data_scalar_str_new
+go_data_scalar_str_set_str
+GO_TYPE_DATA_VECTOR_VAL
+GO_DATA_VECTOR_VAL
+GO_IS_DATA_VECTOR_VAL
+GODataVectorVal
+go_data_vector_val_get_type
+go_data_vector_val_new
+GO_TYPE_DATA_VECTOR_STR
+GO_DATA_VECTOR_STR
+GO_IS_DATA_VECTOR_STR
+GODataVectorStr
+go_data_vector_str_get_type
+go_data_vector_str_new
+go_data_vector_str_set_translate_func
+go_data_vector_str_set_translation_domain
+GO_TYPE_DATA_MATRIX_VAL
+GO_DATA_MATRIX_VAL
+GO_IS_DATA_MATRIX_VAL
+GODataMatrixVal
+go_data_matrix_val_get_type
+go_data_matrix_val_new
+<SUBSECTION Standard>
+GO_DATA_SCALAR_VAL
+GO_IS_DATA_SCALAR_VAL
+GO_TYPE_DATA_SCALAR_VAL
+go_data_scalar_val_get_type
+</SECTION>
+
+<SECTION>
 <FILE>go-url</FILE>
 <TITLE>GOUrl</TITLE>
 go_url_check_extension
@@ -2103,20 +2342,49 @@ go_undo_undo_with_data
 <SECTION>
 <FILE>go-file</FILE>
 <TITLE>GOFile</TITLE>
-go_file_access
+GOFilePermissions
+GOFileProbeLevel
+GODotDot
+go_filename_simplify
+go_url_simplify
+go_filename_from_uri
+go_filename_to_uri
+go_url_resolve_relative
+go_url_make_relative
+go_shell_arg_to_uri
+go_basename_from_uri
+go_dirname_from_uri
+go_shell_argv_to_glib_encoding
+go_shell_argv_to_glib_encoding_free
+go_file_open
 go_file_create
+go_file_split_urls
+go_file_get_owner_name
+go_file_get_group_name
+go_get_file_permissions
+go_set_file_permissions
 go_file_get_date_accessed
-go_file_get_date_changed
 go_file_get_date_modified
-go_file_get_group_name
-go_file_get_owner_name
-go_file_open
-go_file_split_urls
+go_file_get_date_changed
+go_file_access
+go_url_decode
+go_url_encode
+go_url_show
+go_url_check_extension
+go_get_mime_type
+go_get_mime_type_for_data
+go_mime_type_get_description
+<SUBSECTION Private>
+F_OK
+X_OK
+W_OK
+R_OK
 </SECTION>
 
 <SECTION>
 <FILE>go-file-opener</FILE>
 <TITLE>GOFileOpener</TITLE>
+GOFileOpener
 go_file_opener_can_probe
 go_file_opener_for_id
 go_file_opener_get_description
@@ -2137,6 +2405,7 @@ go_file_opener_unregister
 <SECTION>
 <FILE>go-file-saver</FILE>
 <TITLE>GOFileSaver</TITLE>
+GOFileSaver
 go_file_saver_for_file_name
 go_file_saver_for_id
 go_file_saver_for_mime_type
@@ -2238,6 +2507,7 @@ GocGroup
 goc_group_new
 goc_group_add_child
 goc_group_remove_child
+goc_group_clear
 goc_group_adjust_bounds
 goc_group_adjust_coords
 goc_group_cairo_transform
@@ -2254,6 +2524,7 @@ goc_group_get_type
 GocItem
 GocItemClass
 goc_item_new
+goc_item_destroy
 goc_item_set
 goc_item_distance
 goc_item_draw
diff --git a/docs/reference/goffice-docs.sgml b/docs/reference/goffice-docs.sgml
index bef4ea8..6c16610 100644
--- a/docs/reference/goffice-docs.sgml
+++ b/docs/reference/goffice-docs.sgml
@@ -132,6 +132,8 @@
 			<title>Mathematical functions</title>
 			<xi:include href="xml/go-math.xml"/>
 			<xi:include href="xml/go-complex.xml"/>
+			<xi:include href="xml/go-cspline.xml"/>
+			<xi:include href="xml/go-distribution.xml"/>
 			<xi:include href="xml/go-fft.xml"/>
 			<xi:include href="xml/go-range.xml"/>
 			<xi:include href="xml/go-regression.xml"/>
@@ -209,4 +211,5 @@
 <xi:include href="xml/goffice-utils.xml"/>
 <xi:include href="xml/go-marshalers.xml"/>
 <xi:include href="xml/win32-stub.xml"/>
+<xi:include href="go-calendar-button.xml"/>
 -->
diff --git a/goffice/canvas/goc-item.c b/goffice/canvas/goc-item.c
index c5b886d..a499f0e 100644
--- a/goffice/canvas/goc-item.c
+++ b/goffice/canvas/goc-item.c
@@ -35,9 +35,14 @@ enum {
 /**
  * GocItemClass:
  * @base: the parent class
- * @distance:
- * @draw:
- * @draw_region:
+ * @distance: returns the distance between the item and the point defined by
+ * @x and @y. When the distance is larger than a few pixels, the result is not
+ * relevant, so an approximate value or even G_MAXDOUBLE might be returned.
+ * @draw: draws the item to the cairo context.
+ * @draw_region: draws the item in the region defined by @x0, @y0, @x1 and @y1.
+ * Should return TRUE when successfull. If FALSE is returned, @draw will be
+ * called. There is no need to implement both methods for an item. Large items
+ * should implement @draw_region.
  * @move:
  * @update_bounds:
  * @parent_changed:
diff --git a/goffice/graph/gog-chart-map.c b/goffice/graph/gog-chart-map.c
index 0a4f9ff..2b8e7a8 100644
--- a/goffice/graph/gog-chart-map.c
+++ b/goffice/graph/gog-chart-map.c
@@ -322,7 +322,7 @@ make_path_cspline (GogChartMap *map,
 	int i, n_valid_points = 0;
 	double *uu, *vv, u, v;
 	double p0 = 0., p1 = 0.; /* clamped derivatives */
-	struct GOCSpline *spline;
+	GOCSpline *spline;
 
 	path = go_path_new ();
 	if (n_points < 1 || !go_range_increasing (x, n_points))
diff --git a/goffice/math/go-cspline.c b/goffice/math/go-cspline.c
index 20c661e..96c9924 100644
--- a/goffice/math/go-cspline.c
+++ b/goffice/math/go-cspline.c
@@ -67,15 +67,15 @@
  * where a[i-1], b[i-1], c[i-1], x[i-1] and y[i-1] are the corresponding
  * members of the new structure.
  *
- * Returns: a newly created struct GOCSpline instance which should be
+ * Returns: a newly created GOCSpline instance which should be
  * destroyed by a call to go_bezier_spline_destroy.
  */
-struct SUFFIX(GOCSpline) *
+SUFFIX(GOCSpline) *
 SUFFIX(go_cspline_init) (DOUBLE const *x, DOUBLE const *y, int n,
 			 unsigned limits, DOUBLE c0, DOUBLE cn)
 {
 	DOUBLE *d1, *d2, *d3, *d4, h;
-	struct SUFFIX(GOCSpline) *sp;
+	SUFFIX(GOCSpline) *sp;
 	double dx1 = 0., dy1 = 0., dx2 = 0., dy2 = 0., dxn1 = 0., dxn2 = 0.;
 	int nm1, nm2, i, j, first, last;
 
@@ -83,7 +83,7 @@ SUFFIX(go_cspline_init) (DOUBLE const *x, DOUBLE const *y, int n,
 	if (limits >= GO_CSPLINE_MAX || !SUFFIX(go_range_increasing) (x, n) || n < 3)
 		return NULL;
 	nm1 = n - 1;
-	sp = g_new0 (struct SUFFIX(GOCSpline), 1);
+	sp = g_new0 (SUFFIX(GOCSpline), 1);
 	sp->n = n;
 	sp->x = x;
 	sp->y = y;
@@ -199,7 +199,7 @@ SUFFIX(go_cspline_init) (DOUBLE const *x, DOUBLE const *y, int n,
  *
  * Frees the spline structure when done.
  */
-void SUFFIX(go_cspline_destroy) (struct SUFFIX(GOCSpline) *sp)
+void SUFFIX(go_cspline_destroy) (SUFFIX(GOCSpline) *sp)
 {
 	g_return_if_fail (sp);
 	g_free (sp->a);
@@ -217,7 +217,7 @@ void SUFFIX(go_cspline_destroy) (struct SUFFIX(GOCSpline) *sp)
  *
  * Returns: the interpolated value for x, or 0 if an error occurred.
  */
-DOUBLE SUFFIX(go_cspline_get_value) (struct SUFFIX(GOCSpline) *sp, DOUBLE x)
+DOUBLE SUFFIX(go_cspline_get_value) (SUFFIX(GOCSpline) const *sp, DOUBLE x)
 {
 	DOUBLE dx;
 	int n, j, k;
@@ -255,7 +255,7 @@ DOUBLE SUFFIX(go_cspline_get_value) (struct SUFFIX(GOCSpline) *sp, DOUBLE x)
  *
  * Returns: the interpolated derivative at x, or 0 if an error occurred.
  */
-DOUBLE SUFFIX(go_cspline_get_deriv) (struct SUFFIX(GOCSpline) *sp, DOUBLE x)
+DOUBLE SUFFIX(go_cspline_get_deriv) (SUFFIX(GOCSpline) const *sp, DOUBLE x)
 {
 	DOUBLE dx;
 	int n, j, k;
@@ -297,7 +297,7 @@ DOUBLE SUFFIX(go_cspline_get_deriv) (struct SUFFIX(GOCSpline) *sp, DOUBLE x)
  * be destroyed by a call to g_free when not anymore needed, or NULL if
  * an error occurred.
  */
-DOUBLE *SUFFIX(go_cspline_get_values) (struct SUFFIX(GOCSpline) *sp, DOUBLE const *x, int n)
+DOUBLE *SUFFIX(go_cspline_get_values) (SUFFIX(GOCSpline) const *sp, DOUBLE const *x, int n)
 {
 	DOUBLE *res, dx;
 	int i, j, k, jmax;
@@ -331,7 +331,7 @@ DOUBLE *SUFFIX(go_cspline_get_values) (struct SUFFIX(GOCSpline) *sp, DOUBLE cons
  * should be destroyed by a call to g_free when not anymore needed, or NULL if
  * an error occurred.
  */
-DOUBLE *SUFFIX(go_cspline_get_derivs) (struct SUFFIX(GOCSpline) *sp, DOUBLE const *x, int n)
+DOUBLE *SUFFIX(go_cspline_get_derivs) (SUFFIX(GOCSpline) const *sp, DOUBLE const *x, int n)
 {
 	DOUBLE *res, dx;
 	int i, j, k, jmax;
@@ -365,7 +365,7 @@ DOUBLE *SUFFIX(go_cspline_get_derivs) (struct SUFFIX(GOCSpline) *sp, DOUBLE cons
  * between two consecutive values stored in x. which should be destroyed by
  * a call to g_free when not anymore needed, or NULL if  an error occurred.
  */
-DOUBLE *SUFFIX(go_cspline_get_integrals) (struct SUFFIX(GOCSpline) *sp, DOUBLE const *x, int n)
+DOUBLE *SUFFIX(go_cspline_get_integrals) (SUFFIX(GOCSpline) const *sp, DOUBLE const *x, int n)
 {
 	DOUBLE *res, start, end, sum;
 	int i, j, k, jmax;
diff --git a/goffice/math/go-cspline.h b/goffice/math/go-cspline.h
index c443884..79361c8 100644
--- a/goffice/math/go-cspline.h
+++ b/goffice/math/go-cspline.h
@@ -25,7 +25,8 @@
 
 G_BEGIN_DECLS
 
-struct GOCSpline {
+typedef struct _GOCSpline GOCSpline;
+struct _GOCSpline {
 	double const *x, *y;
 	double *a, *b, *c;
 	int n;
@@ -39,30 +40,31 @@ typedef enum {
 	GO_CSPLINE_MAX
 } GOCSplineType;
 
-struct GOCSpline *go_cspline_init (double const *x, double const *y, int n,
+GOCSpline *go_cspline_init (double const *x, double const *y, int n,
 				   unsigned limits, double c0, double cn);
-void go_cspline_destroy (struct GOCSpline *sp);
-double go_cspline_get_value (struct GOCSpline *sp, double x);
-double go_cspline_get_deriv (struct GOCSpline *sp, double x);
-double *go_cspline_get_values (struct GOCSpline *sp, double const *x, int n);
-double *go_cspline_get_derivs (struct GOCSpline *sp, double const *x, int n);
-double *go_cspline_get_integrals (struct GOCSpline *sp, double const *x, int n);
+void go_cspline_destroy (GOCSpline *sp);
+double go_cspline_get_value (GOCSpline const *sp, double x);
+double go_cspline_get_deriv (GOCSpline const *sp, double x);
+double *go_cspline_get_values (GOCSpline const *sp, double const *x, int n);
+double *go_cspline_get_derivs (GOCSpline const *sp, double const *x, int n);
+double *go_cspline_get_integrals (GOCSpline const *sp, double const *x, int n);
 
 #ifdef GOFFICE_WITH_LONG_DOUBLE
-struct GOCSplinel {
+typedef struct _GOCSplinel GOCSplinel;
+struct _GOCSplinel {
 	long double const *x, *y;
 	long double *a, *b, *c;
 	int n;
 };
 
-struct GOCSplinel *go_cspline_initl (long double const *x, long double const *y, int n,
+GOCSplinel *go_cspline_initl (long double const *x, long double const *y, int n,
 				     unsigned limits, long double a0, long double a1);
-void go_cspline_destroyl (struct GOCSplinel *sp);
-long double go_cspline_get_valuel (struct GOCSplinel *sp, long double x);
-long double go_cspline_get_derivl (struct GOCSplinel *sp, long double x);
-long double *go_cspline_get_valuesl (struct GOCSplinel *sp, long double const *x, int n);
-long double *go_cspline_get_derivsl (struct GOCSplinel *sp, long double const *x, int n);
-long double *go_cspline_get_integralsl (struct GOCSplinel *sp, long double const *x, int n);
+void go_cspline_destroyl (GOCSplinel *sp);
+long double go_cspline_get_valuel (GOCSplinel const *sp, long double x);
+long double go_cspline_get_derivl (GOCSplinel const *sp, long double x);
+long double *go_cspline_get_valuesl (GOCSplinel const *sp, long double const *x, int n);
+long double *go_cspline_get_derivsl (GOCSplinel const *sp, long double const *x, int n);
+long double *go_cspline_get_integralsl (GOCSplinel const *sp, long double const *x, int n);
 #endif
 
 G_END_DECLS
diff --git a/goffice/utils/go-string.c b/goffice/utils/go-string.c
index 37b9d18..16b5ec9 100644
--- a/goffice/utils/go-string.c
+++ b/goffice/utils/go-string.c
@@ -194,17 +194,17 @@ go_string_new_nocopy (char *str)
 
 /**
  * go_string_new_rich :
- * @str :
- * @len : < 0 will call strlen
+ * @str : string.
+ * @byte_len : < 0 will call strlen.
  * @copy : %TRUE @str should be copied when adding to the string table.
- * @markup : optionally %NULL list, GOString steals the ref
+ * @markup : optionally %NULL list, GOString steals the ref.
  * @phonetic : optionally %NULL list of phonetic extensions, GOString steals the ref.
  *
  * Returns: a string.
  **/
 GOString *
 go_string_new_rich (char const *str,
-		    int len,
+		    int byte_len,
 		    gboolean copy,
 		    PangoAttrList *markup,
 		    GOStringPhonetic *phonetic)
@@ -224,13 +224,13 @@ go_string_new_rich (char const *str,
 	rich = g_slice_new (GOStringRichImpl);
 	rich->base.base.str	= str;
 	rich->base.hash		= g_str_hash (str);
-	rich->base.flags		= ((len > 0) ? (guint32) len : strlen (str)) | GO_STRING_IS_RICH;
+	rich->base.flags	= ((byte_len > 0) ? (guint32) byte_len : strlen (str)) | GO_STRING_IS_RICH;
 	rich->base.ref_count	= 1;
 	rich->markup		= markup;
 	rich->phonetic		= phonetic;
 	base = g_hash_table_lookup (go_strings_base, rich);
 	if (NULL == base) {
-		if (copy) rich->base.base.str = g_strndup (str, len);
+		if (copy) rich->base.base.str = g_strndup (str, byte_len);
 		g_hash_table_insert (go_strings_base, rich, rich);
 	} else {
 		go_string_ref (&base->base);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]