GRASS Programmer's Manual
6.4.3(2013)-r
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Macros
Pages
xdrindex.c
Go to the documentation of this file.
1
#include <grass/dbmi.h>
2
#include "
macros.h
"
3
4
5
int
db__send_index
(dbIndex * index)
6
{
7
int
i;
8
9
DB_SEND_STRING
(&index->indexName);
10
DB_SEND_STRING
(&index->tableName);
11
DB_SEND_CHAR
(index->unique);
12
13
DB_SEND_INT
(index->numColumns);
14
15
for
(i = 0; i < index->numColumns; i++) {
16
DB_SEND_STRING
(&index->columnNames[i]);
17
}
18
19
return
DB_OK;
20
}
21
22
int
db__send_index_array
(dbIndex * list,
int
count)
23
{
24
int
i;
25
26
DB_SEND_INT
(count);
27
for
(i = 0; i < count; i++) {
28
DB_SEND_INDEX
(&list[i]);
29
}
30
return
DB_OK;
31
}
32
33
int
db__recv_index
(dbIndex * index)
34
{
35
int
i, ncols;
36
37
db_init_index
(index);
38
DB_RECV_STRING
(&index->indexName);
39
DB_RECV_STRING
(&index->tableName);
40
DB_RECV_CHAR
(&index->unique);
41
42
DB_RECV_INT
(&ncols);
43
44
if
(
db_alloc_index_columns
(index, ncols) != DB_OK)
45
return
db_get_error_code
();
46
47
for
(i = 0; i < ncols; i++) {
48
DB_RECV_STRING
(&index->columnNames[i]);
49
}
50
51
return
DB_OK;
52
}
53
54
int
db__recv_index_array
(dbIndex ** list,
int
*count)
55
{
56
int
i;
57
58
DB_RECV_INT
(count);
59
60
*list =
db_alloc_index_array
(*count);
61
if
(*list ==
NULL
)
62
return
db_get_error_code
();
63
64
for
(i = 0; i < *count; i++) {
65
DB_RECV_INDEX
(&((*list)[i]));
66
}
67
68
return
DB_OK;
69
}
lib
db
dbmi_base
xdrindex.c
Generated on Thu Sep 26 2013 09:48:08 for GRASS Programmer's Manual by
1.8.4