GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
hist.c File Reference

Vector library - history manipulation. More...

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <grass/Vect.h>
Include dependency graph for hist.c:

Go to the source code of this file.

Functions

int Vect_hist_command (struct Map_info *Map)
 Write command info to history file. More...
 
int Vect_hist_write (struct Map_info *Map, const char *str)
 Write string to history file. More...
 
char * Vect_hist_read (char *s, int size, struct Map_info *Map)
 Reads one line from history file without newline character. More...
 
void Vect_hist_rewind (struct Map_info *Map)
 Rewind history file. More...
 
int Vect_hist_copy (struct Map_info *In, struct Map_info *Out)
 Copy history from one map to another. More...
 

Detailed Description

Vector library - history manipulation.

Higher level functions for reading/writing/manipulating vectors.

(C) 2001-2008 by the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Radim Blazek
Date
2001-2008

Definition in file hist.c.

Function Documentation

int Vect_hist_command ( struct Map_info *  Map)

Write command info to history file.

Parameters
Mapvector map
Returns
0 OK
-1 error

Definition at line 33 of file hist.c.

References buf, forms::cmd, G_date(), G_debug(), G_gisdbase(), G_location(), G_mapset(), G_recreate_command(), G_whoami(), sprintf(), and Vect_hist_write().

int Vect_hist_copy ( struct Map_info *  In,
struct Map_info *  Out 
)

Copy history from one map to another.

Parameters
Ininput vector map
Outoutput vector map
Returns
0 OK
-1 error

Definition at line 125 of file hist.c.

References buf, G_debug(), NULL, and Vect_hist_write().

char* Vect_hist_read ( char *  s,
int  size,
struct Map_info *  Map 
)

Reads one line from history file without newline character.

Parameters
sbuffer, allocated space must be size+1
sizemaximum number of character
Mapvector map
Returns
return s on success
NULL on error
EOF end of file

Definition at line 84 of file hist.c.

References G_debug(), G_getl2(), NULL, and dialogs::s.

void Vect_hist_rewind ( struct Map_info *  Map)

Rewind history file.

Parameters
Mapvector map
Returns
void

Definition at line 108 of file hist.c.

References G_debug(), and NULL.

int Vect_hist_write ( struct Map_info *  Map,
const char *  str 
)

Write string to history file.

Parameters
Mapvector map
strstring to write
Returns
the number of characters printed

Definition at line 62 of file hist.c.

References G_debug().

Referenced by Vect__open_old(), Vect_hist_command(), and Vect_hist_copy().