GRASS GIS 7 Programmer's Manual  7.5.svn(2018)-r72651
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
home.c File Reference

GIS Library - Get user's home or config directory. More...

#include <stdlib.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/glocale.h>
#include "gis_local_proto.h"
Include dependency graph for home.c:

Go to the source code of this file.

Functions

const char * G_home (void)
 Get user's home directory. More...
 
const char * G__home (void)
 Get user's home directory (internal use only) More...
 
const char * G_config_path (void)
 Get user's config path directory. More...
 

Detailed Description

GIS Library - Get user's home or config directory.

(C) 2001-2014 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
Original author CERL

Definition in file home.c.

Function Documentation

const char* G__home ( void  )

Get user's home directory (internal use only)

Returns a pointer to a string which is the full path name of the user's home directory.

Returns
pointer to string
NULL on error

Definition at line 53 of file home.c.

References G_initialize_done(), G_is_initialized(), G_store(), getenv(), and GPATH_MAX.

Referenced by G_home(), G_init_all(), and G_init_logging().

const char* G_config_path ( void  )

Get user's config path directory.

Returns a pointer to a string which is the full path name of the user's GRASS config directory in their home directory.

The path is not guaranteed to exist.

Todo:
should it be? see possible TODO below
Returns
pointer to string
NULL on error

Definition at line 98 of file home.c.

References _, CONFIG_DIR, G_fatal_error(), G_home(), G_initialize_done(), G_is_initialized(), G_mkdir(), G_store(), getenv(), GPATH_MAX, and HOST_DIRSEP.

const char* G_home ( void  )

Get user's home directory.

Returns a pointer to a string which is the full path name of the user's home directory.

Calls G_fatal_error() on failure.

Returns
pointer to string
NULL on error

Definition at line 32 of file home.c.

References _, G__home(), G_fatal_error(), and NULL.

Referenced by G_config_path().