TinkeCell API  1.0.0
C/Python/Octave/Ruby API
C:/Users/Deepak/Projects/TinkerCell/trunk/API/TC_structs.h
00001 #ifndef TINKERCELL_CSTRUCTS_H
00002 #define TINKERCELL_CSTRUCTS_H
00003 
00004 #ifndef BEGIN_C_DECLS
00005 #ifdef __cplusplus
00006 #        define BEGIN_C_DECLS extern "C" {
00007 #        define END_C_DECLS }
00008 #   else
00009 #        define BEGIN_C_DECLS
00010 #        define END_C_DECLS
00011 #endif
00012 #endif
00013 
00014 # ifndef TCAPIEXPORT
00015 #  if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
00016 #    if defined(STATIC_LINKED)
00017 #          define TCAPIEXPORT
00018 #    else
00019 #   if defined(TC_EXPORTS) || defined(tinkercellapi_EXPORTS)
00020 #              if defined(USE_STDCALL)
00021 #                   define TCAPIEXPORT __stdcall __declspec(dllexport)
00022 #              else
00023 #                   define TCAPIEXPORT __declspec(dllexport)
00024 #              endif
00025 #          else
00026 #              define TCAPIEXPORT
00027 #          endif
00028 #     endif
00029 #  else
00030 #    if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
00031 #      define TCAPIEXPORT __attribute__ ((visibility("default")))
00032 #    else
00033 #      define TCAPIEXPORT
00034 #    endif
00035 #  endif
00036 # endif //TCAPIEXPORT
00037 
00038 BEGIN_C_DECLS
00039 
00041 typedef struct
00042 {
00043         int length;
00044         char ** strings;
00045 } tc_strings;
00046 
00047 
00049 typedef struct
00050 {
00051         int length;
00052         long* items;
00053 } tc_items;
00054 
00055 
00057 typedef struct
00058 {
00059         int rows, cols;
00060         double * values;
00061         tc_strings rownames;
00062         tc_strings colnames;
00063 } tc_matrix;
00064 
00065 
00067 typedef struct
00068 {
00069         int rows, cols;
00070         char ** strings;
00071         tc_strings rownames;
00072         tc_strings colnames;
00073 } tc_table;
00074 
00081 TCAPIEXPORT tc_matrix tc_createMatrix(int rows, int cols);
00082 
00089 TCAPIEXPORT tc_table tc_createTable(int rows, int cols);
00090 
00096 TCAPIEXPORT tc_strings tc_createStringsArray(int len);
00097 
00103 TCAPIEXPORT tc_items tc_createItemsArray(int len);
00104 
00112 TCAPIEXPORT double tc_getMatrixValue(tc_matrix M, int i, int j);
00113 
00121 TCAPIEXPORT void tc_setMatrixValue(tc_matrix M, int i, int j, double d);
00122 
00129 TCAPIEXPORT const char * tc_getRowName(tc_matrix M, int i);
00130 
00137 TCAPIEXPORT void tc_setRowName(tc_matrix M, int i, const char * s);
00138 
00145 TCAPIEXPORT const char * tc_getColumnName(tc_matrix M, int j);
00146 
00153 TCAPIEXPORT void tc_setColumnName(tc_matrix M, int j, const char * s);
00154 
00162 TCAPIEXPORT const char* tc_getTableValue(tc_table S, int i, int j);
00163 
00171 TCAPIEXPORT void tc_setTableValue(tc_table S, int i, int j, const char * s);
00172 
00179 TCAPIEXPORT const char* tc_getString(tc_strings S, int i);
00180 
00187 TCAPIEXPORT void tc_setString(tc_strings S, int i, const char * c);
00188 
00195 TCAPIEXPORT long tc_getItem(tc_items A, int i);
00196 
00203 TCAPIEXPORT void tc_setItem(tc_items A, int i, long o);
00204 
00211 TCAPIEXPORT int tc_getStringIndex(tc_strings A, const char * s);
00212 
00219 TCAPIEXPORT int tc_getRowIndex(tc_matrix, const char * s);
00220 
00227 TCAPIEXPORT int tc_getColumnIndex(tc_matrix, const char * s);
00228 
00233 TCAPIEXPORT void tc_deleteMatrix(tc_matrix M);
00234 
00239 TCAPIEXPORT void tc_deleteTable(tc_table M);
00240 
00245 TCAPIEXPORT void tc_deleteItemsArray(tc_items A);
00246 
00251 TCAPIEXPORT void tc_deleteStringsArray(tc_strings C);
00252 
00259 TCAPIEXPORT tc_matrix tc_appendColumns(tc_matrix A, tc_matrix B);
00260 
00267 TCAPIEXPORT tc_matrix tc_appendRows(tc_matrix A, tc_matrix B);
00268 
00274 TCAPIEXPORT tc_matrix tc_transpose(tc_matrix A);
00275 
00281 TCAPIEXPORT void tc_printMatrixToFile(const char* file, tc_matrix M);
00282 
00288 TCAPIEXPORT void tc_printOutMatrix(tc_matrix M);
00289 
00295 TCAPIEXPORT void tc_printTableToFile(const char* file, tc_table M);
00296 
00301 TCAPIEXPORT void tc_printOutTable(tc_table M);
00302 
00303 END_C_DECLS
00304 #endif
00305 
 All Data Structures