GRASS GIS 8 Programmer's Manual 8.3.2(2024)-exported
Loading...
Searching...
No Matches
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.
 
const char * G__home (void)
 Get user's home directory (internal use only)
 
const char * G_config_path (void)
 Get user's config path directory.
 

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

◆ G__home()

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(), and G_store().

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

◆ G_config_path()

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 G_fatal_error(), G_home(), G_initialize_done(), G_is_initialized(), G_mkdir(), and G_store().

◆ G_home()

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().