ask.c File Reference

#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <grass/gis.h>
#include <grass/glocale.h>

Include dependency graph for ask.c:

Go to the source code of this file.

Defines

#define OLD   0
#define NEW   1
#define PRJ   2
#define ANY   3
#define ANY_NW   4
#define OLD_FILE   5
#define NEW_FILE   6

Functions

char * G_ask_new (char *prompt, char *name, char *element, char *desc)
 prompt for new database file
char * G_ask_new_ext (char *prompt, char *name, char *element, char *desc, char *option, int(*lister)())
char * G_ask_old (char *prompt, char *name, char *element, char *desc)
 prompt for existing database file
char * G_ask_old_ext (char *prompt, char *name, char *element, char *desc, char *option, int(*lister)())
char * G_ask_any (char *prompt, char *name, char *element, char *desc, int warn)
 prompt for any valid file name
char * G_ask_any_ext (char *prompt, char *name, char *element, char *desc, int warn, char *option, int(*lister)())
char * G_ask_in_mapset (char *prompt, char *name, char *element, char *desc)
 prompt for existing database file
char * G_ask_in_mapset_ext (char *prompt, char *name, char *element, char *desc, char *option, int(*lister)())
char * G_ask_new_file (char *prompt, char *name, char *element, char *desc)
 prompt for new file
char * G_ask_old_file (char *prompt, char *name, char *element, char *desc)
 prompt for existing file
int G_set_ask_return_msg (char *msg)
 set Hit RETURN msg
char * G_get_ask_return_msg ()
 get Hit RETURN msg


Define Documentation

#define ANY   3

Definition at line 101 of file ask.c.

Referenced by G_ask_any(), and G_ask_any_ext().

#define ANY_NW   4

Definition at line 102 of file ask.c.

Referenced by G_ask_any(), and G_ask_any_ext().

#define NEW   1

Definition at line 99 of file ask.c.

Referenced by G_ask_new(), and G_ask_new_ext().

#define NEW_FILE   6

Definition at line 104 of file ask.c.

Referenced by G_ask_new_file().

#define OLD   0

Definition at line 98 of file ask.c.

Referenced by G_ask_old(), and G_ask_old_ext().

#define OLD_FILE   5

Definition at line 103 of file ask.c.

Referenced by G_ask_old_file().

#define PRJ   2

Definition at line 100 of file ask.c.

Referenced by G_ask_in_mapset(), and G_ask_in_mapset_ext().


Function Documentation

char* G_ask_any ( char *  prompt,
char *  name,
char *  element,
char *  desc,
int  warn 
)

prompt for any valid file name

The user is asked to enter any leg al file name. If warn is 1 and the file chosen exists in the current mapset, then the user is asked if it is ok to overwrite the file. If warn is 0, then any leg al name is accepted and no warning is issued to the user if the file exists.

Parameters:
prompt 
name 
element 
label 
warn 
Returns:
char *

Definition at line 190 of file ask.c.

References ANY, ANY_NW, and NULL.

Referenced by G_ask_vector_any().

char* G_ask_any_ext ( char *  prompt,
char *  name,
char *  element,
char *  desc,
int  warn,
char *  option,
int(*)()  lister 
)

Definition at line 196 of file ask.c.

References ANY, and ANY_NW.

Referenced by G_ask_cell_any().

char* G_ask_in_mapset ( char *  prompt,
char *  name,
char *  element,
char *  desc 
)

prompt for existing database file

The user is asked to enter the name of an file which exists in the current mapset. Note. The file chosen by the user may or may not exist in other mapsets. This routine does not look in other mapsets, since the assumption is that name will be used to modify a file. GRASS only permits users to modify files in the current mapset.

Parameters:
prompt 
name 
element 
label 
Returns:
char *

Definition at line 221 of file ask.c.

References NULL, and PRJ.

Referenced by G_ask_vector_in_mapset().

char* G_ask_in_mapset_ext ( char *  prompt,
char *  name,
char *  element,
char *  desc,
char *  option,
int(*)()  lister 
)

Definition at line 228 of file ask.c.

References PRJ.

Referenced by G_ask_cell_in_mapset().

char* G_ask_new ( char *  prompt,
char *  name,
char *  element,
char *  desc 
)

prompt for new database file

The user is asked to enter the name of a new file which does not exist in the current mapset. Note. The file chosen by the user may exist in other mapsets. This routine does not look in other mapsets, since the assumption is that name will be used to create a new file. New files are always created in the current mapset.

Parameters:
prompt 
name 
element 
desc 
Returns:
char *

Definition at line 130 of file ask.c.

References NEW, and NULL.

Referenced by G_ask_vector_new().

char* G_ask_new_ext ( char *  prompt,
char *  name,
char *  element,
char *  desc,
char *  option,
int(*)()  lister 
)

Definition at line 136 of file ask.c.

References NEW.

Referenced by G_ask_cell_new().

char* G_ask_new_file ( char *  prompt,
char *  name,
char *  element,
char *  desc 
)

prompt for new file

The user is asked to enter the name of an file which doesn't exist.

Parameters:
prompt 
name 
element 
label 
Returns:
char *

Definition at line 248 of file ask.c.

References NEW_FILE, and NULL.

char* G_ask_old ( char *  prompt,
char *  name,
char *  element,
char *  desc 
)

prompt for existing database file

The user is asked to enter the name of an existing database file. Note. This routine looks for the file in the current mapset as well as other mapsets. The mapsets that are searched are determined from the user's mapset search path. See Mapset_Search_Path for some more details about the search path.

Parameters:
prompt 
name 
element 
label 
Returns:
char *

Definition at line 160 of file ask.c.

References NULL, and OLD.

Referenced by G_ask_vector_old().

char* G_ask_old_ext ( char *  prompt,
char *  name,
char *  element,
char *  desc,
char *  option,
int(*)()  lister 
)

Definition at line 166 of file ask.c.

References OLD.

Referenced by G_ask_cell_old().

char* G_ask_old_file ( char *  prompt,
char *  name,
char *  element,
char *  desc 
)

prompt for existing file

The user is asked to enter the name of an file which exists.

Parameters:
prompt 
name 
element 
label 
Returns:
char *

Definition at line 283 of file ask.c.

References NULL, and OLD_FILE.

char* G_get_ask_return_msg (  ) 

get Hit RETURN msg

The current msg (as set by G_set_ask_return_msg) is returned.

Parameters:
void 
Returns:
char *

Definition at line 336 of file ask.c.

References NULL.

int G_set_ask_return_msg ( char *  msg  ) 

set Hit RETURN msg

The "Hit RETURN to cancel request" part of the prompt in the prompting routines described above, is modified to "Hit RETURN <b>msg.</b>"

Parameters:
msg 
Returns:
int

Definition at line 316 of file ask.c.

References G_free(), and G_store().


Generated on Sun Apr 6 17:32:15 2008 for GRASS by  doxygen 1.5.5