GRASS Programmer's Manual  6.4.2(2012)
segment/get.c
Go to the documentation of this file.
00001 
00015 #include <string.h>
00016 #include <grass/segment.h>
00017 
00018 
00019 /*bugfix: buf: char* vs int* -> wrong pointer arithmetics!!!. Pierre de Mouveaux - 09 april 2000 */
00020 /* int segment_get (SEGMENT *SEG, register int *buf,int row,int col) */
00021 
00022 
00041 int segment_get(SEGMENT * SEG, void *buf, int row, int col)
00042 {
00043     int index, n, i;
00044 
00045     segment_address(SEG, row, col, &n, &index);
00046     if ((i = segment_pagein(SEG, n)) < 0)
00047         return -1;
00048 
00049     memcpy(buf, &SEG->scb[i].buf[index], SEG->len);
00050 
00051     return 1;
00052 }
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines