~ubuntu-branches/ubuntu/vivid/grass/vivid-proposed

« back to all changes in this revision

Viewing changes to lib/gis/progrm_nme.c

  • Committer: Package Import Robot
  • Author(s): Bas Couwenberg
  • Date: 2015-02-20 23:12:08 UTC
  • mfrom: (8.2.6 experimental)
  • Revision ID: package-import@ubuntu.com-20150220231208-1u6qvqm84v430b10
Tags: 7.0.0-1~exp1
* New upstream release.
* Update python-ctypes-ternary.patch to use if/else instead of and/or.
* Drop check4dev patch, rely on upstream check.
* Add build dependency on libpq-dev to grass-dev for libpq-fe.h.
* Drop patches applied upstream, refresh remaining patches.
* Update symlinks for images switched from jpg to png.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*!
 
2
 * \file lib/gis/progrm_nme.c
 
3
 *
 
4
 * \brief GIS Library - Program name
 
5
 *
 
6
 * (C) 2001-2014 by the GRASS Development Team
 
7
 *
 
8
 * This program is free software under the GNU General Public License
 
9
 * (>=v2). Read the file COPYING that comes with GRASS for details.
 
10
 *
 
11
 * \author Original author CERL
 
12
 */
1
13
 
2
 
/**********************************************************************
3
 
 *
4
 
 *   char *
5
 
 *   G_program_name()
6
 
 *
7
 
 *   returns the current program name
8
 
 *
9
 
 **********************************************************************
10
 
 *
11
 
 *   G_set_program_name(name)
12
 
 *        char *name 
13
 
 *
14
 
 *   program name set to name (name will be returned by G_program_name
15
 
 *
16
 
 **********************************************************************/
17
14
#include <string.h>
18
15
#include <grass/gis.h>
19
16
 
20
17
static const char *name = "?";
21
18
 
22
 
 
23
19
/*!
24
 
 * \brief return module name
25
 
 *
26
 
 * Routine returns the name
27
 
 * of the module as set by the call to <i>G_gisinit.</i>
28
 
 *
29
 
 *  \param ~
30
 
 *  \return char * 
 
20
 * \brief Return module name
 
21
 *
 
22
 * Routine returns the name of the module as set by the call to
 
23
 * G_gisinit().
 
24
 *
 
25
 * \return pointer to string with program name
31
26
 */
32
 
 
33
27
const char *G_program_name(void)
34
28
{
35
29
    return name;
36
30
}
37
31
 
38
 
int G_set_program_name(const char *s)
 
32
/*!
 
33
  \brief Set program name
 
34
 
 
35
  Program name set to name (name will be returned by
 
36
  G_program_name*())
 
37
 
 
38
  Extension like .exe or .py is stripped from program name.
 
39
 
 
40
  \param s program name
 
41
*/
 
42
void G_set_program_name(const char *s)
39
43
{
40
44
    int i;
41
45
    char *temp;
47
51
            break;
48
52
        }
49
53
    }
 
54
 
 
55
    /* strip extension from program name */
50
56
    temp = G_store(s);
51
57
    G_basename(temp, "exe");
 
58
    G_basename(temp, "py");
52
59
    name = G_store(temp);
 
60
 
 
61
    G_debug(1, "G_set_program_name(): %s", name);
 
62
    
53
63
    G_free(temp);
54
 
 
55
 
    return 0;
56
64
}