xdrindex.c

Go to the documentation of this file.
00001 #include "dbmi.h"
00002 #include "macros.h"
00003 
00004 db__send_index(index)
00005     dbIndex *index;
00006 {
00007     int i;
00008 
00009     DB_SEND_STRING (&index->indexName);
00010     DB_SEND_STRING (&index->tableName);
00011     DB_SEND_CHAR (index->unique);
00012 
00013     DB_SEND_INT (index->numColumns);
00014 
00015     for (i = 0; i < index->numColumns; i++)
00016     {
00017         DB_SEND_STRING (&index->columnNames[i]);
00018     }
00019 
00020     return DB_OK;
00021 }
00022 
00023 db__send_index_array (list, count)
00024     dbIndex *list;
00025     int count;
00026 {
00027     int i;
00028 
00029     DB_SEND_INT (count);
00030     for (i = 0; i < count; i++)
00031     {
00032         DB_SEND_INDEX(&list[i]);
00033     }
00034     return DB_OK;
00035 }
00036 
00037 db__recv_index(index)
00038     dbIndex *index;
00039 {
00040     int i,ncols;
00041 
00042     db_init_index (index);
00043     DB_RECV_STRING (&index->indexName);
00044     DB_RECV_STRING (&index->tableName);
00045     DB_RECV_CHAR (&index->unique);
00046 
00047     DB_RECV_INT (&ncols);
00048 
00049     if (db_alloc_index_columns (index, ncols) != DB_OK)
00050         return db_get_error_code();
00051 
00052     for (i = 0; i < ncols; i++)
00053     {
00054         DB_RECV_STRING (&index->columnNames[i]);
00055     }
00056 
00057     return DB_OK;
00058 }
00059 
00060 db__recv_index_array (list, count)
00061     dbIndex **list;
00062     int *count;
00063 {
00064     int i;
00065 
00066     DB_RECV_INT (count);
00067 
00068     *list = db_alloc_index_array (*count);
00069     if (*list == NULL)
00070         return db_get_error_code();
00071 
00072     for (i = 0; i < *count; i++)
00073     {
00074         DB_RECV_INDEX (&((*list)[i]));
00075     }
00076 
00077     return DB_OK;
00078 }

Generated on Sat Jul 22 22:05:40 2006 for GRASS by  doxygen 1.4.7