CSV Util: csv.h Source File

- Main Page
- Data Structures
- Files

- File List
- Globals

# csv.h

Go to the documentation of this file.

    00001 /*
    00002
    00003 Copyright (c) 2009-2010 Thomas Dennis.
    00004
    00005 Permission is hereby granted, free of charge, to any person
    00006 obtaining a copy of this software and associated documentation
    00007 files (the "Software"), to deal in the Software without
    00008 restriction, including without limitation the rights to use,
    00009 copy, modify, merge, publish, distribute, sublicense, and/or sell
    00010 copies of the Software, and to permit persons to whom the
    00011 Software is furnished to do so, subject to the following
    00012 conditions:
    00013
    00014 The above copyright notice and this permission notice shall be
    00015 included in all copies or substantial portions of the Software.
    00016
    00017 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
    00018 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
    00019 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
    00020 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
    00021 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
    00022 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
    00023 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
    00024 OTHER DEALINGS IN THE SOFTWARE.
    00025
    00026 */
    00027
    00028 #ifndef __TGDCSV_H__
    00029 #define __TGDCSV_H__
    00030
    00038 #ifdef __cplusplus
    00039 extern "C" {
    00040 #endif
    00041
    00049 typedef struct {
    00050
    00052   long width;
    00054   long height;
    00056   char ***cell;
    00057
    00058 } CsvTable;
    00059
    00072 CsvTable *csvLoadBuffer (long len, const unsigned char *data, char cend,
    00073                                                               char qchr);
    00074
    00088 CsvTable *csvLoadFile (const char *file_name, char cend, char qchr);
    00089
    00100 CsvTable *csvCreateTable (long width, long height);
    00101
    00110 void csvFree (CsvTable *csv);
    00111
    00124 int csvSaveCSV (const CsvTable *csv, const char *fname, char cend, char qchr);
    00125
    00136 int csvSaveHTML (const CsvTable *csv, const char *file_name);
    00137
    00150 int csvEditCell (const CsvTable *csv, long x, long  y, const char *new_text);
    00151
    00163 long csvSearchCol (const CsvTable *csv, long col, const char *str);
    00164
    00165 #ifdef __cplusplus
    00166 }
    00167 #endif
    00168
    00169 #endif /* __TGDCSV_H__ */