--- psiconv/trunk/lib/psiconv/data.h 2001/01/17 12:04:12 95 +++ psiconv/trunk/lib/psiconv/data.h 2001/01/31 00:35:06 102 @@ -34,6 +34,7 @@ extern "C" { #endif /* __cplusplus */ +typedef double psiconv_float_t; typedef enum psiconv_file_type { psiconv_unknown_file, @@ -405,6 +406,24 @@ psiconv_cliparts sections; } *psiconv_clipart_f; +typedef struct psiconv_sheet_ref_s +{ + psiconv_s16 offset; + psiconv_bool_t absolute; +} psiconv_sheet_ref_t; + +typedef struct psiconv_sheet_cell_reference_s +{ + psiconv_sheet_ref_t row; + psiconv_sheet_ref_t column; +} psiconv_sheet_cell_reference_t; + +typedef struct psiconv_sheet_cell_block_s +{ + psiconv_sheet_cell_reference_t first; + psiconv_sheet_cell_reference_t last; +} psiconv_sheet_cell_block_t; + typedef struct psiconv_sheet_status_section_s { psiconv_bool_t show_graph; @@ -420,9 +439,159 @@ psiconv_triple_t show_vertical_scrollbar; } *psiconv_sheet_status_section; +typedef enum psiconv_formula_type +{ + psiconv_formula_unknown, + psiconv_formula_op_lt, + psiconv_formula_op_le, + psiconv_formula_op_gt, + psiconv_formula_op_ge, + psiconv_formula_op_ne, + psiconv_formula_op_eq, + psiconv_formula_op_add, + psiconv_formula_op_sub, + psiconv_formula_op_mul, + psiconv_formula_op_div, + psiconv_formula_op_pow, + psiconv_formula_op_pos, + psiconv_formula_op_neg, + psiconv_formula_op_con, + psiconv_formula_op_bra, + psiconv_formula_mark_eof, + psiconv_formula_dat_float, + psiconv_formula_dat_int, + psiconv_formula_dat_var, + psiconv_formula_dat_string, + psiconv_formula_dat_cellref, + psiconv_formula_dat_cellblock, + psiconv_formula_dat_vcellblock, + psiconv_formula_mark_opsep, + psiconv_formula_mark_opend, + psiconv_formula_fun_false, + psiconv_formula_fun_if, + psiconv_formula_fun_true, + psiconv_formula_fun_cell, + psiconv_formula_fun_errortype, + psiconv_formula_fun_isblank, + psiconv_formula_fun_iserr, + psiconv_formula_fun_iserror, + psiconv_formula_fun_islogical, + psiconv_formula_fun_isna, + psiconv_formula_fun_isnontext, + psiconv_formula_fun_isnumber, + psiconv_formula_fun_istext, + psiconv_formula_fun_n, + psiconv_formula_fun_type, + psiconv_formula_fun_address, + psiconv_formula_fun_column, + psiconv_formula_fun_columns, + psiconv_formula_fun_hlookup, + psiconv_formula_fun_index, + psiconv_formula_fun_indirect, + psiconv_formula_fun_lookup, + psiconv_formula_fun_offset, + psiconv_formula_fun_row, + psiconv_formula_fun_rows, + psiconv_formula_fun_vlookup, + psiconv_formula_fun_char, + psiconv_formula_fun_code, + psiconv_formula_fun_exact, + psiconv_formula_fun_find, + psiconv_formula_fun_left, + psiconv_formula_fun_len, + psiconv_formula_fun_lower, + psiconv_formula_fun_mid, + psiconv_formula_fun_proper, + psiconv_formula_fun_replace, + psiconv_formula_fun_rept, + psiconv_formula_fun_right, + psiconv_formula_fun_string, + psiconv_formula_fun_t, + psiconv_formula_fun_trim, + psiconv_formula_fun_upper, + psiconv_formula_fun_value, + psiconv_formula_fun_date, + psiconv_formula_fun_datevalue, + psiconv_formula_fun_day, + psiconv_formula_fun_hour, + psiconv_formula_fun_minute, + psiconv_formula_fun_month, + psiconv_formula_fun_now, + psiconv_formula_fun_second, + psiconv_formula_fun_today, + psiconv_formula_fun_time, + psiconv_formula_fun_timevalue, + psiconv_formula_fun_year, + psiconv_formula_fun_abs, + psiconv_formula_fun_acos, + psiconv_formula_fun_asin, + psiconv_formula_fun_atan, + psiconv_formula_fun_atan2, + psiconv_formula_fun_cos, + psiconv_formula_fun_degrees, + psiconv_formula_fun_exp, + psiconv_formula_fun_fact, + psiconv_formula_fun_int, + psiconv_formula_fun_ln, + psiconv_formula_fun_log10, + psiconv_formula_fun_mod, + psiconv_formula_fun_pi, + psiconv_formula_fun_radians, + psiconv_formula_fun_rand, + psiconv_formula_fun_round, + psiconv_formula_fun_sign, + psiconv_formula_fun_sin, + psiconv_formula_fun_sqrt, + psiconv_formula_fun_sumproduct, + psiconv_formula_fun_tan, + psiconv_formula_fun_trunc, + psiconv_formula_fun_cterm, + psiconv_formula_fun_ddb, + psiconv_formula_fun_fv, + psiconv_formula_fun_irr, + psiconv_formula_fun_npv, + psiconv_formula_fun_pmt, + psiconv_formula_fun_pv, + psiconv_formula_fun_rate, + psiconv_formula_fun_sln, + psiconv_formula_fun_syd, + psiconv_formula_fun_term, + psiconv_formula_fun_combin, + psiconv_formula_fun_permut, + psiconv_formula_vfn_average, + psiconv_formula_vfn_choose, + psiconv_formula_vfn_count, + psiconv_formula_vfn_counta, + psiconv_formula_vfn_countblank, + psiconv_formula_vfn_max, + psiconv_formula_vfn_min, + psiconv_formula_vfn_product, + psiconv_formula_vfn_stdevp, + psiconv_formula_vfn_stdev, + psiconv_formula_vfn_sum, + psiconv_formula_vfn_sumsq, + psiconv_formula_vfn_varp, + psiconv_formula_vfn_var +} psiconv_formula_type_t; + +typedef psiconv_list psiconv_formula_list; /* Of struct psiconv_formula_s */ + +typedef struct psiconv_formula_s +{ + psiconv_formula_type_t type; + union { + psiconv_u32 dat_int; + double dat_float; + char *dat_string; + psiconv_sheet_cell_reference_t dat_cellref; + psiconv_sheet_cell_block_t dat_cellblock; + psiconv_formula_list fun_operands; + } data; +} *psiconv_formula; + typedef struct psiconv_sheet_workbook_section_s { - int dummy; + psiconv_formula_list formulas; } *psiconv_sheet_workbook_section; typedef struct psiconv_sheet_f_s @@ -506,8 +675,8 @@ extern void psiconv_free_word_style(psiconv_word_style style); extern void psiconv_free_word_styles_section (psiconv_word_styles_section styles); -extern void psiconv_free_sheet_status_section - (psiconv_sheet_status_section section); +extern void psiconv_free_formula(psiconv_formula formula); +extern void psiconv_free_formula_list(psiconv_formula_list list); extern void psiconv_free_sheet_status_section (psiconv_sheet_status_section section); extern void psiconv_free_sheet_f(psiconv_sheet_f file);