+int table_change(struct Table *table, int row, char **entry) {
+ int col;
+ if(row >= table->length) return 0;
+ for(col = 0; col < table->width; col++) {
+ if(table->contents[row][col] && !(table->flags & TABLE_FLAG_USE_POINTER))
+ free(table->contents[row][col]);
+ table->contents[row][col] = ((table->flags & TABLE_FLAG_USE_POINTER) || !entry[col] ? entry[col] : strdup(entry[col]));
+ if(table->contents[row][col])
+ table->col_flags[col] |= TABLE_FLAG_COL_CONTENTS;
+ if(entry[col] && strlen(entry[col]) > table->maxwidth[col])
+ table->maxwidth[col] = strlen(entry[col]);
+ }
+ return 1;
+}
+
+int table_change_field(struct Table *table, int row, int col, char *entry) {
+ if(row >= table->length) return 0;
+ if(col >= table->width) return 0;
+ if(table->contents[row][col] && !(table->flags & TABLE_FLAG_USE_POINTER))
+ free(table->contents[row][col]);
+ table->contents[row][col] = (((table->flags & TABLE_FLAG_USE_POINTER) || !entry) ? entry : strdup(entry));
+ if(table->contents[row][col])
+ table->col_flags[col] |= TABLE_FLAG_COL_CONTENTS;
+ if(entry && strlen(entry) > table->maxwidth[col])
+ table->maxwidth[col] = strlen(entry);
+ return 1;
+}
+