GRASS Programmer's Manual
6.4.2(2012)
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
segment/put.c
Go to the documentation of this file.
1
15
#include <string.h>
16
#include <grass/segment.h>
17
18
19
/*bugfix: buf: char* vs int* -> wrong pointer arithmetics!!!. Pierre de Mouveaux - 09 april 2000 */
20
/* int segment_put (SEGMENT *SEG,int *buf,int row,int col) */
21
22
44
int
segment_put
(SEGMENT * SEG,
const
void
*buf,
int
row,
int
col)
45
{
46
int
index, n, i;
47
48
segment_address
(SEG, row, col, &n, &index);
49
if
((i =
segment_pagein
(SEG, n)) < 0)
50
return
-1;
51
52
SEG->scb[i].dirty = 1;
53
54
memcpy(&SEG->scb[i].buf[index], buf, SEG->len);
55
56
return
1;
57
}
lib
segment
put.c
Generated on Sun Sep 9 2012 18:55:34 for GRASS Programmer's Manual by
1.8.1.2