29 #include <grass/vask.h>
51 int V_const(
void *src,
int var_type,
int row,
int col,
int length)
53 union target targetptr;
57 if (
V__.NUM_CONST >= MAX_CONST) {
58 V_error(
"Too many constants in call to V_const");
61 if ((row < 0) || (row >= MAX_LINE)) {
62 V_error(
"Illegal row (%d) in call to V_const", row);
65 if ((col < 0) || (col > 80)) {
66 V_error(
"Illegal column (%d) in call to V_const", col);
69 if ((length < 0) || ((length + col) > 80)) {
70 V_error(
"Length out of bounds in call to V_const");
74 if ((var_type ==
's') || (var_type ==
'i') || (var_type ==
'f')
75 || (var_type ==
'l') || (var_type ==
'd')) {
76 V__.constant[
V__.NUM_CONST].targetptr = targetptr;
77 V__.constant[
V__.NUM_CONST].var_type = var_type;
78 V__.constant[
V__.NUM_CONST].row = row;
79 V__.constant[
V__.NUM_CONST].col = col;
80 V__.constant[
V__.NUM_CONST].length = length;
81 V__.constant[
V__.NUM_CONST].decimal_places =
V__.decimal_places;
87 V_error(
"Illegal variable type in call to V_const");
void V_error(const char *fmt,...)
int V_const(void *src, int var_type, int row, int col, int length)