#ifndef TYPES_DECL
#define TYPES_DECL true
#define MAXLEN_FILTER 30
#define MAXLEN_BLOCKTXT 100
#include <string.h>
// Enumeration of table ignore methods
typedef enum { Ignore, Display, Announce } ignore_type;
template <class T> class tlist; // Prototype for templated list
// Block options
struct block_opts
{
bool start_ignored; // Should the page begin in an ignored block?
char trigger_text[MAXLEN_BLOCKTXT]; // Text to trigger transition between un/ignored
};
typedef tlist<block_opts> blockoptslist; // Typedef for block options list type
// Table options
struct table_opts
{
bool ignore_range; // Should a range of table numbers be ignored?
unsigned int table_no; // Table to ignore (or start of range to ignore
unsigned int table_range_end; // End of range to ignore (if needed)
ignore_type ignore_table; // Ignore mode
};
typedef tlist<table_opts> tableoptslist; // Typedef for table options list type
// Sub-page options
struct sub_opts
{
unsigned int first_link; // First link followed in page
unsigned int last_link; // Last link followed on page
char filter[MAXLEN_FILTER]; // Subpage URL filter
tableoptslist table_options; // Linked list containing table options
blockoptslist block_options; // Block options
};
typedef tlist<sub_opts> suboptslist; // Typedef for sub options list type
// Page item
struct data_item
{
char url[100]; // URL
char category[MAX_CAT_LEVELS][50]; // Categories
tableoptslist table_options; // Tables to ignore in page
suboptslist sub_options; // Subpage filters
blockoptslist block_options; // Block options
char description[100]; // Page description
char page_id[10]; // Page ID (MUST ALWAYS be unique)
bool selected; // Has the page been chosen for download?
char filename[255]; // Filename of main page of parsed site
// Function to return concatenated list of categories for comparison
void cat_string( char* value )
{ int loop; value[0] = NULL;
for (loop = 0; loop < MAX_CAT_LEVELS; loop++)
{ strcat(value, category[loop]);
if ((loop < MAX_CAT_LEVELS-1)&&(category[loop+1][0]!=NULL))
strcat(value, ", ");
}
}
};
typedef tlist<data_item> pglist; // Typedef for pagelist list type
#endif
syntax highlighted by Code2HTML, v. 0.8.11