Commit 3b6bb3ea authored by Almer S. Tigelaar's avatar Almer S. Tigelaar Committed by Almer S. Tigelaar
Browse files

Burn useless comments. (stf_parse_options_csv_set_separators): Change

2001-06-04  Almer S. Tigelaar  <almer@gnome.org>

	* src/stf-parse.[ch] : Burn useless comments.
	(stf_parse_options_csv_set_separators): Change interface.
	(stf_parse_csv_is_separator): Adjust for interface change.
	(stf_parse_options_new): Burn modified and old splitpositions.
	(stf_parse_options_set_type): Constify.
	(stf_parse_options_set_line_terminator): Idem.
	(stf_parse_options_set_lines_to_parse): Idem.
	(stf_parse_options_set_trim_spaces): Idem.
	(stf_parse_options_csv_set_customfieldseparator): Burn.
	(stf_parse_options_csv_set_stringindicator): Constify.
	(stf_parse_options_csv_set_indicator_2x_is_single): Idem.
	(stf_parse_options_csv_set_duplicates): Idem.
	(stf_parse_options_fixed_splitpositions_add): Idem.
	(stf_parse_csv_cell): Cosmetic changes and adjust for
	change to stf_parse_csv_is_separator, plus use GList.
	(stf_parse_fixed_cell): Cosmetic changes.
	(stf_parse_fixed_line): Idem and use GList.
	(stf_parse_general): Optimize loop and use GList's.
	(stf_parse_get_rowcount): Cosmetic changes.
	(stf_parse_get_colcount): Idem.
	(stf_parse_get_longest_row_width): Idem and fix.
	(stf_parse_get_colwidth): Idem and fix.
	(stf_parse_convert_to_unix): Rewrite.
	(stf_parse_is_valid_data): Idem and constify.
	(stf_parse_options_fixed_autodiscover): Constify.
	(stf_parse_sheet): Rewrite.
	(stf_parse_region): Idem.

	* src/gui-clipboard.c (x_selection_to_cell_region):
	Constify return variable from stf_parse_is_valid_data.

2001-06-04  Almer S. Tigelaar  <almer@gnome.org>

	* dialog-stf-csv-page.c (csv_page_global_change): Cope for
	changes to csv_set_separators and stf_parse_general.

	* dialog-stf-format-page.c (format_page_update_preview): Idem.

	* dialog-stf-fixed-page.c (fixed_page_update_preview): Idem.

	* dialog-stf-preview.[ch] (stf_preview_render_row): Idem.
	(stf_preview_format_recalc_colwidths): Idem.
	(stf_preview_format_line): Idem.
	(stf_preview_render): Idem.
parent 3975cb1c
2001-06-04 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.[ch] : Burn useless comments.
(stf_parse_options_csv_set_separators): Change interface.
(stf_parse_csv_is_separator): Adjust for interface change.
(stf_parse_options_new): Burn modified and old splitpositions.
(stf_parse_options_set_type): Constify.
(stf_parse_options_set_line_terminator): Idem.
(stf_parse_options_set_lines_to_parse): Idem.
(stf_parse_options_set_trim_spaces): Idem.
(stf_parse_options_csv_set_customfieldseparator): Burn.
(stf_parse_options_csv_set_stringindicator): Constify.
(stf_parse_options_csv_set_indicator_2x_is_single): Idem.
(stf_parse_options_csv_set_duplicates): Idem.
(stf_parse_options_fixed_splitpositions_add): Idem.
(stf_parse_csv_cell): Cosmetic changes and adjust for
change to stf_parse_csv_is_separator, plus use GList.
(stf_parse_fixed_cell): Cosmetic changes.
(stf_parse_fixed_line): Idem and use GList.
(stf_parse_general): Optimize loop and use GList's.
(stf_parse_get_rowcount): Cosmetic changes.
(stf_parse_get_colcount): Idem.
(stf_parse_get_longest_row_width): Idem and fix.
(stf_parse_get_colwidth): Idem and fix.
(stf_parse_convert_to_unix): Rewrite.
(stf_parse_is_valid_data): Idem and constify.
(stf_parse_options_fixed_autodiscover): Constify.
(stf_parse_sheet): Rewrite.
(stf_parse_region): Idem.
* src/gui-clipboard.c (x_selection_to_cell_region):
Constify return variable from stf_parse_is_valid_data.
2001-06-04 Zbigniew Chyla <cyba@gnome.pl>
Displaying a question dialog if the user wants to export workbook
......
2001-06-04 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.[ch] : Burn useless comments.
(stf_parse_options_csv_set_separators): Change interface.
(stf_parse_csv_is_separator): Adjust for interface change.
(stf_parse_options_new): Burn modified and old splitpositions.
(stf_parse_options_set_type): Constify.
(stf_parse_options_set_line_terminator): Idem.
(stf_parse_options_set_lines_to_parse): Idem.
(stf_parse_options_set_trim_spaces): Idem.
(stf_parse_options_csv_set_customfieldseparator): Burn.
(stf_parse_options_csv_set_stringindicator): Constify.
(stf_parse_options_csv_set_indicator_2x_is_single): Idem.
(stf_parse_options_csv_set_duplicates): Idem.
(stf_parse_options_fixed_splitpositions_add): Idem.
(stf_parse_csv_cell): Cosmetic changes and adjust for
change to stf_parse_csv_is_separator, plus use GList.
(stf_parse_fixed_cell): Cosmetic changes.
(stf_parse_fixed_line): Idem and use GList.
(stf_parse_general): Optimize loop and use GList's.
(stf_parse_get_rowcount): Cosmetic changes.
(stf_parse_get_colcount): Idem.
(stf_parse_get_longest_row_width): Idem and fix.
(stf_parse_get_colwidth): Idem and fix.
(stf_parse_convert_to_unix): Rewrite.
(stf_parse_is_valid_data): Idem and constify.
(stf_parse_options_fixed_autodiscover): Constify.
(stf_parse_sheet): Rewrite.
(stf_parse_region): Idem.
* src/gui-clipboard.c (x_selection_to_cell_region):
Constify return variable from stf_parse_is_valid_data.
2001-06-04 Zbigniew Chyla <cyba@gnome.pl>
Displaying a question dialog if the user wants to export workbook
......
2001-06-04 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.[ch] : Burn useless comments.
(stf_parse_options_csv_set_separators): Change interface.
(stf_parse_csv_is_separator): Adjust for interface change.
(stf_parse_options_new): Burn modified and old splitpositions.
(stf_parse_options_set_type): Constify.
(stf_parse_options_set_line_terminator): Idem.
(stf_parse_options_set_lines_to_parse): Idem.
(stf_parse_options_set_trim_spaces): Idem.
(stf_parse_options_csv_set_customfieldseparator): Burn.
(stf_parse_options_csv_set_stringindicator): Constify.
(stf_parse_options_csv_set_indicator_2x_is_single): Idem.
(stf_parse_options_csv_set_duplicates): Idem.
(stf_parse_options_fixed_splitpositions_add): Idem.
(stf_parse_csv_cell): Cosmetic changes and adjust for
change to stf_parse_csv_is_separator, plus use GList.
(stf_parse_fixed_cell): Cosmetic changes.
(stf_parse_fixed_line): Idem and use GList.
(stf_parse_general): Optimize loop and use GList's.
(stf_parse_get_rowcount): Cosmetic changes.
(stf_parse_get_colcount): Idem.
(stf_parse_get_longest_row_width): Idem and fix.
(stf_parse_get_colwidth): Idem and fix.
(stf_parse_convert_to_unix): Rewrite.
(stf_parse_is_valid_data): Idem and constify.
(stf_parse_options_fixed_autodiscover): Constify.
(stf_parse_sheet): Rewrite.
(stf_parse_region): Idem.
* src/gui-clipboard.c (x_selection_to_cell_region):
Constify return variable from stf_parse_is_valid_data.
2001-06-04 Zbigniew Chyla <cyba@gnome.pl>
Displaying a question dialog if the user wants to export workbook
......
2001-06-04 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.[ch] : Burn useless comments.
(stf_parse_options_csv_set_separators): Change interface.
(stf_parse_csv_is_separator): Adjust for interface change.
(stf_parse_options_new): Burn modified and old splitpositions.
(stf_parse_options_set_type): Constify.
(stf_parse_options_set_line_terminator): Idem.
(stf_parse_options_set_lines_to_parse): Idem.
(stf_parse_options_set_trim_spaces): Idem.
(stf_parse_options_csv_set_customfieldseparator): Burn.
(stf_parse_options_csv_set_stringindicator): Constify.
(stf_parse_options_csv_set_indicator_2x_is_single): Idem.
(stf_parse_options_csv_set_duplicates): Idem.
(stf_parse_options_fixed_splitpositions_add): Idem.
(stf_parse_csv_cell): Cosmetic changes and adjust for
change to stf_parse_csv_is_separator, plus use GList.
(stf_parse_fixed_cell): Cosmetic changes.
(stf_parse_fixed_line): Idem and use GList.
(stf_parse_general): Optimize loop and use GList's.
(stf_parse_get_rowcount): Cosmetic changes.
(stf_parse_get_colcount): Idem.
(stf_parse_get_longest_row_width): Idem and fix.
(stf_parse_get_colwidth): Idem and fix.
(stf_parse_convert_to_unix): Rewrite.
(stf_parse_is_valid_data): Idem and constify.
(stf_parse_options_fixed_autodiscover): Constify.
(stf_parse_sheet): Rewrite.
(stf_parse_region): Idem.
* src/gui-clipboard.c (x_selection_to_cell_region):
Constify return variable from stf_parse_is_valid_data.
2001-06-04 Zbigniew Chyla <cyba@gnome.pl>
Displaying a question dialog if the user wants to export workbook
......
2001-06-04 Almer S. Tigelaar <almer@gnome.org>
* src/stf-parse.[ch] : Burn useless comments.
(stf_parse_options_csv_set_separators): Change interface.
(stf_parse_csv_is_separator): Adjust for interface change.
(stf_parse_options_new): Burn modified and old splitpositions.
(stf_parse_options_set_type): Constify.
(stf_parse_options_set_line_terminator): Idem.
(stf_parse_options_set_lines_to_parse): Idem.
(stf_parse_options_set_trim_spaces): Idem.
(stf_parse_options_csv_set_customfieldseparator): Burn.
(stf_parse_options_csv_set_stringindicator): Constify.
(stf_parse_options_csv_set_indicator_2x_is_single): Idem.
(stf_parse_options_csv_set_duplicates): Idem.
(stf_parse_options_fixed_splitpositions_add): Idem.
(stf_parse_csv_cell): Cosmetic changes and adjust for
change to stf_parse_csv_is_separator, plus use GList.
(stf_parse_fixed_cell): Cosmetic changes.
(stf_parse_fixed_line): Idem and use GList.
(stf_parse_general): Optimize loop and use GList's.
(stf_parse_get_rowcount): Cosmetic changes.
(stf_parse_get_colcount): Idem.
(stf_parse_get_longest_row_width): Idem and fix.
(stf_parse_get_colwidth): Idem and fix.
(stf_parse_convert_to_unix): Rewrite.
(stf_parse_is_valid_data): Idem and constify.
(stf_parse_options_fixed_autodiscover): Constify.
(stf_parse_sheet): Rewrite.
(stf_parse_region): Idem.
* src/gui-clipboard.c (x_selection_to_cell_region):
Constify return variable from stf_parse_is_valid_data.
2001-06-04 Zbigniew Chyla <cyba@gnome.pl>
Displaying a question dialog if the user wants to export workbook
......
2001-06-04 Almer S. Tigelaar <almer@gnome.org>
* dialog-stf-csv-page.c (csv_page_global_change): Cope for
changes to csv_set_separators and stf_parse_general.
* dialog-stf-format-page.c (format_page_update_preview): Idem.
* dialog-stf-fixed-page.c (fixed_page_update_preview): Idem.
* dialog-stf-preview.[ch] (stf_preview_render_row): Idem.
(stf_preview_format_recalc_colwidths): Idem.
(stf_preview_format_line): Idem.
(stf_preview_render): Idem.
2001-06-02 Jody Goldberg <jgoldberg@home.com>
* dialog-stf-preview.c (stf_preview_format_line) : don't leak colour ref
......
......@@ -27,33 +27,51 @@ csv_page_global_change (GtkWidget *widget, DruidPageData_t *data)
{
CsvInfo_t *info = data->csv_info;
StfParseOptions_t *parseoptions = info->csv_run_parseoptions;
GSList *list;
GList *list;
GSList *sepstr;
GString *sepc = g_string_new ("");
char *textfieldtext;
gboolean customvalid = FALSE;
int i;
sepstr = NULL;
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_custom))) {
char *csvcustomtext = gtk_editable_get_chars (GTK_EDITABLE (info->csv_customseparator), 0, -1);
if (strcmp (csvcustomtext, "") != 0) {
stf_parse_options_csv_set_customfieldseparator (parseoptions, csvcustomtext);
customvalid = TRUE;
}
g_free (csvcustomtext);
if (strcmp (csvcustomtext, "") != 0)
sepstr = g_slist_append (sepstr, csvcustomtext);
else
g_free (csvcustomtext);
}
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_tab)))
g_string_append_c (sepc, '\t');
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_colon)))
g_string_append_c (sepc, ':');
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_comma)))
g_string_append_c (sepc, ',');
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_space)))
g_string_append_c (sepc, ' ');
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_semicolon)))
g_string_append_c (sepc, ';');
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_pipe)))
g_string_append_c (sepc, '|');
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_slash)))
g_string_append_c (sepc, '/');
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_hyphen)))
g_string_append_c (sepc, '-');
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_bang)))
g_string_append_c (sepc, '!');
stf_parse_options_csv_set_separators (parseoptions,
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_tab)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_colon)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_comma)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_space)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_semicolon)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_pipe)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_slash)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_hyphen)),
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->csv_bang)),
customvalid);
strcmp (sepc->str, "") == 0 ? NULL : sepc->str,
sepstr);
g_string_free (sepc, TRUE);
if (sepstr) {
GSList *l;
for (l = sepstr; l != NULL; l = l->next)
g_free ((char *) l->data);
g_slist_free (sepstr);
}
textfieldtext = gtk_editable_get_chars (GTK_EDITABLE (info->csv_textfield), 0, -1);
stf_parse_options_csv_set_stringindicator (parseoptions, textfieldtext[0]);
......
......@@ -81,7 +81,7 @@ fixed_page_update_preview (DruidPageData_t *pagedata)
{
FixedInfo_t *info = pagedata->fixed_info;
StfParseOptions_t *parseoptions = pagedata->fixed_info->fixed_run_parseoptions;
GSList *list;
GList *list;
char *t[2];
int i, temp;
......
......@@ -26,7 +26,7 @@ static void
format_page_update_preview (DruidPageData_t *pagedata)
{
FormatInfo_t *info = pagedata->format_info;
GSList *list;
GList *list;
GSList *iterator;
stf_preview_colformats_clear (info->format_run_renderdata);
......
......@@ -15,11 +15,11 @@
* this takes a GSList as argument which on its turns also contains GSLists
* which hold strings, so :
*
* GSList (Main)
* GList (Main)
* |
* |--- GSList (Sub) --> Contains strings as GSList->Data
* |--- GList (Sub) --> Contains strings as GList->Data
* |
* |--- GSList (Sub) --> Contains strings as GSList->Data
* |--- GList (Sub) --> Contains strings as GList->Data
*
*/
#include <config.h>
......@@ -280,9 +280,9 @@ stf_preview_draw_grid (RenderData_t *renderdata, int rowcount, int colcount)
* returns : the bottom position of the row
**/
static double
stf_preview_render_row (RenderData_t *renderdata, double rowy, GSList *row, int colcount)
stf_preview_render_row (RenderData_t *renderdata, double rowy, GList *row, int colcount)
{
GSList *iterator = row;
GList *iterator = row;
double xpos = 0.0;
double textwidth = 0;
int col = 0;
......@@ -340,7 +340,7 @@ stf_preview_render_row (RenderData_t *renderdata, double rowy, GSList *row, int
xpos += CELL_HPAD;
iterator = g_slist_next (iterator);
iterator = g_list_next (iterator);
}
return rowy + CELL_VPAD + renderdata->charheight;
......@@ -361,10 +361,10 @@ stf_preview_render_row (RenderData_t *renderdata, double rowy, GSList *row, int
* returns : nothing. (swaps renderdata->temp and renderdata->colwidths);
**/
static void
stf_preview_format_recalc_colwidths (RenderData_t *renderdata, GSList *data, int colcount)
stf_preview_format_recalc_colwidths (RenderData_t *renderdata, GList *data, int colcount)
{
GArray *newwidths;
GSList *iterator;
GList *iterator;
gint i;
gint *widths = g_alloca ((colcount + 1) * sizeof (gint));
......@@ -374,7 +374,7 @@ stf_preview_format_recalc_colwidths (RenderData_t *renderdata, GSList *data, int
iterator = data;
while (iterator) {
GSList *subiterator = iterator->data;
GList *subiterator = iterator->data;
int col;
for (col = 0; col <= colcount; col++) {
......@@ -382,7 +382,7 @@ stf_preview_format_recalc_colwidths (RenderData_t *renderdata, GSList *data, int
if (!subiterator || !subiterator->data) {
subiterator = g_slist_next (subiterator);
subiterator = g_list_next (subiterator);
continue;
}
......@@ -392,10 +392,10 @@ stf_preview_format_recalc_colwidths (RenderData_t *renderdata, GSList *data, int
if (width > widths[col])
widths[col] = width;
subiterator = g_slist_next (subiterator);
subiterator = g_list_next (subiterator);
}
iterator = g_slist_next (iterator);
iterator = g_list_next (iterator);
}
newwidths = g_array_new (FALSE, FALSE, sizeof (int));
......@@ -425,10 +425,10 @@ stf_preview_format_recalc_colwidths (RenderData_t *renderdata, GSList *data, int
* returns : nothing
**/
static void
stf_preview_format_line (RenderData_t *renderdata, GSList *data, int colcount)
stf_preview_format_line (RenderData_t *renderdata, GList *data, int colcount)
{
int col;
GSList *iterator = data;
GList *iterator = data;
for (col = 0; col <= colcount; col++) {
Value *value;
......@@ -436,7 +436,7 @@ stf_preview_format_line (RenderData_t *renderdata, GSList *data, int colcount)
char *celltext;
if (!iterator || !iterator->data) {
iterator = g_slist_next (iterator);
iterator = g_list_next (iterator);
continue;
}
......@@ -454,7 +454,7 @@ stf_preview_format_line (RenderData_t *renderdata, GSList *data, int colcount)
g_free (iterator->data);
iterator->data = celltext;
iterator = g_slist_next (iterator);
iterator = g_list_next (iterator);
}
}
......@@ -470,11 +470,11 @@ stf_preview_format_line (RenderData_t *renderdata, GSList *data, int colcount)
* returns : nothing
**/
void
stf_preview_render (RenderData_t *renderdata, GSList *list, int rowcount, int colcount)
stf_preview_render (RenderData_t *renderdata, GList *list, int rowcount, int colcount)
{
GnomeCanvasRect *centerrect;
GSList *iterator;
GSList *captions;
GList *iterator;
GList *captions;
GArray *dummy;
int i;
double ypos = 0.0;
......@@ -510,7 +510,7 @@ stf_preview_render (RenderData_t *renderdata, GSList *list, int rowcount, int co
for (i = 0; i <= colcount; i++) {
char *text = g_strdup_printf (_(COLUMN_CAPTION), i);
captions = g_slist_append (captions, text);
captions = g_list_append (captions, text);
}
ypos = stf_preview_render_row (renderdata, ypos, captions, colcount);
......@@ -525,7 +525,7 @@ stf_preview_render (RenderData_t *renderdata, GSList *list, int rowcount, int co
ypos = stf_preview_render_row (renderdata, ypos, iterator->data, colcount);
}
iterator = g_slist_next (iterator);
iterator = g_list_next (iterator);
i++;
}
......@@ -547,9 +547,9 @@ stf_preview_render (RenderData_t *renderdata, GSList *list, int rowcount, int co
iterator = captions;
while (iterator) {
g_free (iterator->data);
iterator = g_slist_next (iterator);
iterator = g_list_next (iterator);
}
g_slist_free (captions);
g_list_free (captions);
/* Swap the actual column widths with the set columnwidths */
if (renderdata->formatted) {
......@@ -561,16 +561,16 @@ stf_preview_render (RenderData_t *renderdata, GSList *list, int rowcount, int co
/* Free all the data */
iterator = list;
while (iterator) {
GSList *subiterator = iterator->data;
GList *subiterator = iterator->data;
while (subiterator) {
g_free ((char *) subiterator->data);
subiterator = g_slist_next (subiterator);
subiterator = g_list_next (subiterator);
}
g_slist_free (subiterator);
iterator = g_slist_next (iterator);
g_list_free (subiterator);
iterator = g_list_next (iterator);
}
g_slist_free (list);
g_list_free (list);
}
/******************************************************************************************************************
......
......@@ -44,7 +44,7 @@ typedef struct {
} RenderData_t;
/* This will actually draw the stuff on screen */
void stf_preview_render (RenderData_t *renderdata, GSList *list, int rowcount, int colcount);
void stf_preview_render (RenderData_t *renderdata, GList *list, int rowcount, int colcount);
/* These are for creation/deletion */
RenderData_t* stf_preview_new (GnomeCanvas *canvas, gboolean formatted);
......
......@@ -40,7 +40,7 @@ x_selection_to_cell_region (WorkbookControlGUI *wbcg, const char *src, int len)
DialogStfResult_t *dialogresult;
CellRegion *cr = NULL;
unsigned char *data;
unsigned char *c;
unsigned char const *c;
data = g_new (unsigned char, len + 1);
memcpy (data, src, len);
......
This diff is collapsed.
......@@ -7,19 +7,6 @@
#include "sheet.h"
#include "cell.h"
typedef enum {
TEXT_SEPARATOR_TAB = 1 << 0,
TEXT_SEPARATOR_COLON = 1 << 1,
TEXT_SEPARATOR_COMMA = 1 << 2,
TEXT_SEPARATOR_SPACE = 1 << 3,
TEXT_SEPARATOR_SEMICOLON = 1 << 4,
TEXT_SEPARATOR_PIPE = 1 << 5,
TEXT_SEPARATOR_SLASH = 1 << 6,
TEXT_SEPARATOR_HYPHEN = 1 << 7,
TEXT_SEPARATOR_BANG = 1 << 8,
TEXT_SEPARATOR_CUSTOM = 1 << 9
} StfTextSeparator_t;
typedef enum {
PARSE_TYPE_NOTSET = 1 << 0,
PARSE_TYPE_CSV = 1 << 1,
......@@ -39,8 +26,10 @@ typedef struct {
StfTrimType_t trim_spaces; /* Trim spaces in fields ? */
/* CSV related */
StfTextSeparator_t separators; /* Text separator(s) */
char *customfieldseparator; /* Custom text separator */
struct {
GSList *str;
char *chr;
} sep;
char stringindicator; /* String indicator */
gboolean indicator_2x_is_single;/* 2 quote chars are a single non-terminating quote */
gboolean duplicates; /* See two text separator's as one? */
......@@ -50,10 +39,6 @@ typedef struct {
int rowcount; /* Number of rows parsed */
int colcount; /* Number of columns parsed */
/* Related to modification determination */
GArray *oldsplitpositions; /* Splitpositions before before_modification was called */
gboolean modificationmode; /* If TRUE we are in modification determination mode */
} StfParseOptions_t;
/* CREATION/DESTRUCTION of stf options struct */
......@@ -63,44 +48,55 @@ void stf_parse_options_free (StfParseO
/* MANIPULATION of stf options struct */
void stf_parse_options_set_type (StfParseOptions_t *parseoptions, StfParseType_t parsetype);
void stf_parse_options_set_line_terminator (StfParseOptions_t *parseoptions, char terminator);
void stf_parse_options_set_lines_to_parse (StfParseOptions_t *parseoptions, int lines);
void stf_parse_options_set_trim_spaces (StfParseOptions_t *parseoptions, StfTrimType_t trim_spaces);
void stf_parse_options_set_type (StfParseOptions_t *parseoptions,
StfParseType_t const parsetype);
void stf_parse_options_set_line_terminator (StfParseOptions_t *parseoptions,
char const terminator);
void stf_parse_options_set_lines_to_parse (StfParseOptions_t *parseoptions,
int const lines);
void stf_parse_options_set_trim_spaces (StfParseOptions_t *parseoptions,
StfTrimType_t const trim_spaces);
void stf_parse_options_csv_set_separators (StfParseOptions_t *parseoptions,
gboolean tab, gboolean colon,
gboolean comma, gboolean space,
gboolean semicolon, gboolean pipe,
gboolean slash, gboolean hyphen,
gboolean bang, gboolean custom);
void stf_parse_options_csv_set_customfieldseparator (StfParseOptions_t *parseoptions, const char *customfieldseparator);
void stf_parse_options_csv_set_stringindicator (StfParseOptions_t *parseoptions, char stringindicator);
void stf_parse_options_csv_set_indicator_2x_is_single (StfParseOptions_t *parseoptions, gboolean indic_2x);
void stf_parse_options_csv_set_duplicates (StfParseOptions_t *parseoptions, gboolean duplicates);
char const *character, GSList const *string);
void stf_parse_options_csv_set_stringindicator (StfParseOptions_t *parseoptions,
char const stringindicator);
void stf_parse_options_csv_set_indicator_2x_is_single (StfParseOptions_t *parseoptions,
gboolean const indic_2x);
void stf_parse_options_csv_set_duplicates (StfParseOptions_t *parseoptions,
gboolean const duplicates);
void stf_parse_options_fixed_splitpositions_clear (StfParseOptions_t *parseoptions);
void stf_parse_options_fixed_splitpositions_add (StfParseOptions_t *parseoptions, int position);
void stf_parse_options_fixed_splitpositions_add (StfParseOptions_t *parseoptions,
int const position);
/* USING the stf structs to actually do some parsing, these are the lower-level functions and utility functions */
GSList *stf_parse_general (StfParseOptions_t *parseoptions, const char *data);
GList *stf_parse_general (StfParseOptions_t *parseoptions,
char const *data);
int stf_parse_get_rowcount (StfParseOptions_t *parseoptions, const char *data);
int stf_parse_get_colcount (StfParseOptions_t *parseoptions, const char *data);
int stf_parse_get_rowcount (StfParseOptions_t *parseoptions,
char const *data);
int stf_parse_get_colcount (StfParseOptions_t *parseoptions,
char const *data);
int stf_parse_get_longest_row_width (StfParseOptions_t *parseoptions, const char *data);
int stf_parse_get_longest_row_width (StfParseOptions_t *parseoptions,
const char *data);
int stf_parse_get_colwidth (StfParseOptions_t *parseoptions, const char *data, int index);
int stf_parse_get_colwidth (StfParseOptions_t *parseoptions,
const char *data, int const index);
gboolean stf_parse_convert_to_unix (char *data);
char *stf_parse_is_valid_data (char *data);
char const *stf_parse_is_valid_data (char const *data);
void stf_parse_options_fixed_autodiscover (StfParseOptions_t *parseoptions, int data_lines, const char *data);
void stf_parse_options_fixed_autodiscover (StfParseOptions_t *parseoptions,
int const data_lines, char const *data);
/* Higher level functions, can be used for directly parsing into an application specific data container */
Sheet *stf_parse_sheet (StfParseOptions_t *parseoptions, const char *data, Sheet *sheet);
Sheet *stf_parse_sheet (StfParseOptions_t *parseoptions,
char const *data, Sheet *sheet);
CellRegion *stf_parse_region (StfParseOptions_t *parseoptions, const char *data);
CellRegion *stf_parse_region (StfParseOptions_t *parseoptions,
char const *data);
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment