GRASS 8 Programmer's Manual 8.6.0dev(2026)-4bb960b182
Loading...
Searching...
No Matches
progrm_nme.c File Reference

GIS Library - Program name. More...

#include <string.h>
#include <grass/gis.h>
Include dependency graph for progrm_nme.c:

Go to the source code of this file.

Functions

const charG_program_name (void)
 Return module name.
 
const charG_original_program_name (void)
 Return original path of the executed program.
 
void G_set_program_name (const char *s)
 Set program name.
 

Detailed Description

GIS Library - Program name.

SPDX-FileCopyrightText: 2001-2014 GRASS Development Team SPDX-License-Identifier: GPL-2.0-or-later

Author
Original author CERL

Definition in file progrm_nme.c.

Function Documentation

◆ G_original_program_name()

const char * G_original_program_name ( void  )

Return original path of the executed program.

This function returns the name of the program as set by the call to G_gisinit().

Unlike G_program_name() which returns name of the module this function return original path which was used to execute the program. For standard GRASS modules, it will be the same as the result from G_program_name() function.

Returns
pointer to string with program name or full path

Definition at line 44 of file progrm_nme.c.

Referenced by recreate_command().

◆ G_program_name()

const char * G_program_name ( void  )

Return module name.

Routine returns the name of the module as set by the call to G_gisinit().

Returns
pointer to string with program name

Definition at line 26 of file progrm_nme.c.

References name.

Referenced by G__json(), G__script(), G__usage_html(), G__usage_markdown(), G__usage_rest(), G__usage_xml(), G__wps_print_process_description(), G_done_msg(), Rast_short_history(), and recreate_command().

◆ G_set_program_name()

void G_set_program_name ( const char s)

Set program name.

Program name set to name (name will be returned by G_program_name*())

Extension like .exe or .py is stripped from program name.

Parameters
sprogram name

Definition at line 59 of file progrm_nme.c.

References G_basename(), G_debug(), G_free(), G_is_dirsep(), G_store(), and name.

Referenced by G__gisinit().