File indexing completed on 2025-01-18 10:02:04
0001 #ifndef MAD_TABLE_H
0002 #define MAD_TABLE_H
0003
0004
0005
0006 struct int_array;
0007 struct char_p_array;
0008
0009 struct node;
0010 struct in_cmd;
0011 struct sequence;
0012 struct name_list;
0013 struct command_list;
0014
0015 struct table
0016 {
0017 char name[NAME_L],
0018 type[NAME_L];
0019 int max,
0020 curr,
0021 num_cols,
0022 org_cols,
0023 dynamic,
0024 origin;
0025 struct char_p_array* header;
0026 struct int_array* col_out;
0027 struct int_array* row_out;
0028 struct char_p_array* node_nm;
0029 struct char_p_array** l_head;
0030 struct node** p_nodes;
0031 char*** s_cols;
0032 double** d_cols;
0033 int stamp;
0034 struct name_list* columns;
0035
0036 struct sequence* org_sequ;
0037 };
0038
0039 struct table_list
0040 {
0041 char name[NAME_L];
0042 int max,
0043 curr;
0044 struct name_list* names;
0045 struct table** tables;
0046 int stamp;
0047 };
0048
0049 struct table_list_list
0050 {
0051 char name[NAME_L];
0052 int max,
0053 curr;
0054 struct table_list** table_lists;
0055 int stamp;
0056 };
0057
0058
0059
0060 struct table* make_table(const char* name, const char* type, const char* const *table_cols, const int* table_types, int rows);
0061 struct table* make_table2(char* name, char* type, char** table_cols, int* table_types, int rows);
0062 struct table* new_table(const char* name, const char* type, int rows, struct name_list* cols);
0063 struct table_list* new_table_list(int size);
0064 struct table_list_list* new_table_list_list(int size);
0065 struct table* delete_table(struct table*);
0066 void read_table(struct in_cmd*);
0067 struct table* find_table(const char* name);
0068
0069 void check_table(char* string);
0070 void check_tabindex(char* string);
0071 void check_tabstring(char* string);
0072 double table_value(void);
0073 void table_add_header(struct table*, const char* format, ...);
0074 void add_to_table_list(struct table*, struct table_list*);
0075 void add_vars_to_table(struct table*, double scale);
0076 void set_vars_from_table(struct table*);
0077 void double_table(char* table);
0078 void grow_table(struct table*);
0079 void print_table(struct table*);
0080 void make_map_table(int* map_table_max_rows);
0081 int get_table_range(const char* range, struct table*, int* rows);
0082 void out_table(const char* tname, struct table*, const char* filename);
0083 void reset_count(const char* table);
0084 void sector_out(char* sector_table_name, double* pos, double* kick, double* rmatrix, double* tmatrix);
0085 void table_range(char* table, char* range, int* rows);
0086
0087 void rename_table(struct table *tbl, const char *name );
0088 int remove_table_from_table_list(const char *name, struct table_list* tl);
0089 struct table *detach_table_from_table_list(const char *name, struct table_list* tl);
0090
0091 void augment_count(const char* table);
0092 void augmentcountonly(const char* table);
0093
0094
0095
0096
0097
0098 int table_length(const char* table);
0099 int table_exists(const char* table);
0100 int table_column_exists(const char* table, const char* name);
0101 int table_cell_exists(const char* table, const char* name, const int* row);
0102 int table_header_exists(const char* table, const char *name);
0103
0104 int double_from_table_header(const char* table, const char* name, double* val);
0105
0106 int double_from_table_row(const char* table, const char* name, const int* row, double* val);
0107 int string_from_table_row(const char* table, const char* name, const int* row, char* string);
0108
0109 int double_to_table_row (const char* table, const char* name, const int* row, const double* val);
0110 int string_to_table_row (const char* table, const char* name, const int* row, const char* string);
0111
0112 int double_to_table_curr (const char* table, const char* name, const double* val);
0113 int double_to_table_curr2(const char* table, const char* name, const double* val);
0114 int vector_to_table_curr (const char* table, const char* name, const double* vals, const int* nval);
0115 int string_to_table_curr (const char* table, const char* name, const char* string);
0116 int comment_to_table_curr(const char* table, const char* comment, const int* length);
0117 int name_to_table_curr (const char* table, int *ending);
0118
0119
0120
0121 struct column_info{
0122 void* data;
0123 int length;
0124 char datatype;
0125 char datasize;
0126 };
0127
0128 struct column_info table_get_column(char* table_name,char* column_name);
0129 struct char_p_array *table_get_header(char* table_name);
0130
0131 #endif
0132