[GRASS5] g51 Vect_set/get_header
Eric G. Miller
egm2 at jps.net
Tue Apr 30 10:43:57 EDT 2002
On Tue, Apr 30, 2002 at 11:22:00AM +0200, Radim Blazek wrote:
> On Tuesday 30 April 2002 04:06 am, Eric G. Miller wrote:
> > Though, I'm not sure what wrong with just having a bunch of functions
> > to get/set things and then hide the details of the Map_info struct
> > via a typedef. Then:
> > /* Vect.h */
> > /* Error codes */
> > #define VERR_NONE 0x0000
> > #define VERR_EMEM 0x0001
> > #define VERR_EINVAL 0x0002
> > #define VERR_ERANGE 0x0004
> > /* ... */
> > typedef struct Map_info * Map_info_ptr;
> > int Vect_log_errors (FILE *, int, const char *);
> > int Vect_open_old (Map_info_ptr *, const char *, const char *);
> > int Vect_close (Map_info_ptr *);
> > int Vect_get_num_lines(Map_info_ptr);
> > const char * Vect_get_organization(Map_info_ptr);
> > int Vect_set_organization(Map_info_ptr, const char *);
> > ...
> Sorry, I don't understand much purpose of Vect_log_errors(), should be new
> function? Which errors should log?
I didn't think it out much. Basically, if we used an error code
reporting mechanism where the errors could be OR'ed together, then
one might want a convenient function to report each. Don't pay much
attention to it...
> Another question: in grass50 are some functions (public - called by modules)
> named Vect_* some V1_* and some for level 2 V2_*. But for example
> Vect_get_area/isle_points() doesn't start V2_ and works only on level 2.
> Should be this keept in 5.1, or should all non internal functions start
> Vect_*? I prefer the later. In that case we have to rename:
I agree here. Should be enough information in the Map_info structure
for these functions to either dispatch the appropriate function or
signal an error.
Eric G. Miller <egm2 at jps.net>
More information about the grass-dev