Added support for filenames up to 256 characters.

This commit is contained in:
slidedraw 2002-04-08 21:11:26 +00:00
parent 043348c3ab
commit d530b69de7
2 changed files with 82 additions and 81 deletions

View File

@ -27,86 +27,8 @@
#include "tuneable.h"
#include "xlhtml.h"
static char SectionName[2][12] = /* The section of the Excel Stream where the workbooks are kept */
{
"/Workbook", /*!< Excel 97 & 2000 */
"/Book" /*!< Everything else ? */
};
typedef struct /*!< This encapsulates the Unicode String */
{
U8 uni; /*!< Unicode String: 0==ASCII/8859-1, 1==windows-1252, 2==utf-8 */
U8 *str; /*!< Characters of string */
U16 len; /*!< Length of string */
U8 *fmt_run; /*!< formatting run, short pairs: offset, index to font */
U8 crun_cnt; /*!< The count of format runs */
}uni_string;
typedef struct /*!< This is everything we need for a cell */
{
U16 xfmt; /*!< The high bit will tell us which version 0 =< 2; 1 == 2+ */
U16 type; /*!< This will record the record type that generated the cell */
U16 spanned; /*!< If 1 don't output */
uni_string ustr; /*!< The cell's displayed contents */
U16 rowspan; /*!< rows to span */
U16 colspan; /*!< columns to span */
uni_string h_link; /*!< If a hyperlinked cell, this is the link*/
}cell;
typedef struct /*!< This encapsulates some information about each worksheet */
{
U32 first_row;
S32 biggest_row;
U32 max_rows;
U16 first_col;
S16 biggest_col;
U16 max_cols;
uni_string ws_title;
cell **c_array;
U16 spanned;
}work_sheet;
typedef struct /*!< This is everything we need to know about fonts */
{
U16 size;
U16 attr;
U16 c_idx;
U16 bold;
U16 super;
U8 underline;
uni_string name;
}font_attr;
typedef struct
{
uni_string *name;
U16 cnt;
}fnt_cnt;
typedef struct /*!< This covers the Extended Format records */
{
U16 fnt_idx;
U16 fmt_idx;
U16 gen;
U16 align;
U16 indent;
U16 b_style;
U16 b_l_color;
U32 b_t_color;
U16 cell_color;
}xf_attr;
typedef struct /*!< HTML Attribute */
{
int fflag; /*!< Font Flag */
int bflag; /*!< Bold Flag */
int iflag; /*!< Itallic Flag */
int sflag; /*!< Strike thru flag */
int uflag; /*!< Underline flag */
int sbflag; /*!< Subscript */
int spflag; /*!< Superscript */
}html_attr;
static int numCustomColors = 0;
@ -251,7 +173,7 @@ static void add_xf_array(U16 fnt_idx, U16 fmt_idx, U16 gen, U16 align,
/* Global data */
static char filename[128];
static char filename[256];
static int file_version = 0;
static U32 next_string=0;
static unsigned int next_font=0, next_ws_title=0, next_xf=0;
@ -345,8 +267,8 @@ int main (int argc, char **argv)
}
else
{
strncpy(filename, argv[argc-1], 124);
filename[124] = 0;
strncpy(filename, argv[argc-1], 252);
filename[252] = 0;
for (i=1; i<(argc-1); i++)
{
if (strcmp(argv[i], "-nc") == 0)

View File

@ -42,3 +42,82 @@ U16 HARD_MAX_ROWS = HARD_MAX_ROWS_97;
#define GLOBAL_UMASK (2)
#endif
typedef struct /*!< This encapsulates the Unicode String */
{
U8 uni; /*!< Unicode String: 0==ASCII/8859-1, 1==windows-1252, 2==utf-8 */
U8 *str; /*!< Characters of string */
U16 len; /*!< Length of string */
U8 *fmt_run; /*!< formatting run, short pairs: offset, index to font */
U8 crun_cnt; /*!< The count of format runs */
}uni_string;
typedef struct /*!< This is everything we need for a cell */
{
U16 xfmt; /*!< The high bit will tell us which version 0 =< 2; 1 == 2+ */
U16 type; /*!< This will record the record type that generated the cell */
U16 spanned; /*!< If 1 don't output */
uni_string ustr; /*!< The cell's displayed contents */
U16 rowspan; /*!< rows to span */
U16 colspan; /*!< columns to span */
uni_string h_link; /*!< If a hyperlinked cell, this is the link*/
}cell;
typedef struct /*!< This encapsulates some information about each worksheet */
{
U32 first_row;
S32 biggest_row;
U32 max_rows;
U16 first_col;
S16 biggest_col;
U16 max_cols;
uni_string ws_title;
cell **c_array;
U16 spanned;
}work_sheet;
typedef struct /*!< This is everything we need to know about fonts */
{
U16 size;
U16 attr;
U16 c_idx;
U16 bold;
U16 super;
U8 underline;
uni_string name;
}font_attr;
typedef struct
{
uni_string *name;
U16 cnt;
}fnt_cnt;
typedef struct /*!< This covers the Extended Format records */
{
U16 fnt_idx;
U16 fmt_idx;
U16 gen;
U16 align;
U16 indent;
U16 b_style;
U16 b_l_color;
U32 b_t_color;
U16 cell_color;
}xf_attr;
typedef struct /*!< HTML Attribute */
{
int fflag; /*!< Font Flag */
int bflag; /*!< Bold Flag */
int iflag; /*!< Itallic Flag */
int sflag; /*!< Strike thru flag */
int uflag; /*!< Underline flag */
int sbflag; /*!< Subscript */
int spflag; /*!< Superscript */
}html_attr;
static char SectionName[2][12] = /* The section of the Excel Stream where the workbooks are kept */
{
"/Workbook", /*!< Excel 97 & 2000 */
"/Book" /*!< Everything else ? */
};