9a5c53c204f4d4c780f6e57dc88a58f7a84ea28c kent Tue Aug 6 08:50:23 2019 -0700 Adding new function - fieldedTableAddHead. diff --git src/inc/fieldedTable.h src/inc/fieldedTable.h index 1d636e8..290c789 100644 --- src/inc/fieldedTable.h +++ src/inc/fieldedTable.h @@ -24,30 +24,33 @@ struct fieldedRow *rowList; /* list of parsed out fields. */ struct fieldedRow **cursor; /* Pointer to where we add next item to list. */ int rowCount; /* Number of rows. */ boolean startsSharp; /* Whether first line starts with a # char */ }; struct fieldedTable *fieldedTableNew(char *name, char **fields, int fieldCount); /* Create a new empty fieldedTable with given name, often a file name. */ void fieldedTableFree(struct fieldedTable **pTable); /* Free up memory resources associated with table. */ struct fieldedRow *fieldedTableAdd(struct fieldedTable *table, char **row, int rowSize, int id); /* Create a new row and add it to table. Return row. */ +struct fieldedRow *fieldedTableAddHead(struct fieldedTable *table, char **row, int rowSize, int id); +/* Create a new row and add it to start of table. Return row. */ + struct fieldedTable *fieldedTableFromTabFile(char *fileName, char *url, char *requiredFields[], int requiredCount); /* Read table from tab-separated file with a #header line that defines the fields. Ensures * all requiredFields (if any) are present. The url is just used for error reporting and * should be the same as fileName for most purposes. This is used by edwSubmit though which * first copies to a local file, and we want to report errors from the url. */ void fieldedTableToTabFile(struct fieldedTable *table, char *fileName); /* Write out a fielded table back to file */ boolean fieldedTableColumnIsNumeric(struct fieldedTable *table, int fieldIx); /* Return TRUE if field has numeric values wherever non-null */ int fieldedTableMaxColChars(struct fieldedTable *table, int colIx); /* Calculate the maximum number of characters in a cell for a column */