xref: /dflybsd-src/contrib/grep/lib/getprogname.h (revision 91b9ed38d3db6a8a8ac5b66da1d43e6e331e259a)
1*09d4459fSDaniel Fojt /* Program name management.
2*09d4459fSDaniel Fojt    Copyright (C) 2016-2020 Free Software Foundation, Inc.
3*09d4459fSDaniel Fojt 
4*09d4459fSDaniel Fojt    This program is free software: you can redistribute it and/or modify
5*09d4459fSDaniel Fojt    it under the terms of the GNU General Public License as published by
6*09d4459fSDaniel Fojt    the Free Software Foundation; either version 3 of the License, or
7*09d4459fSDaniel Fojt    (at your option) any later version.
8*09d4459fSDaniel Fojt 
9*09d4459fSDaniel Fojt    This program is distributed in the hope that it will be useful,
10*09d4459fSDaniel Fojt    but WITHOUT ANY WARRANTY; without even the implied warranty of
11*09d4459fSDaniel Fojt    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12*09d4459fSDaniel Fojt    GNU General Public License for more details.
13*09d4459fSDaniel Fojt 
14*09d4459fSDaniel Fojt    You should have received a copy of the GNU General Public License
15*09d4459fSDaniel Fojt    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
16*09d4459fSDaniel Fojt 
17*09d4459fSDaniel Fojt #ifndef _GL_GETPROGNAME_H
18*09d4459fSDaniel Fojt #define _GL_GETPROGNAME_H
19*09d4459fSDaniel Fojt 
20*09d4459fSDaniel Fojt #include <stdlib.h>
21*09d4459fSDaniel Fojt 
22*09d4459fSDaniel Fojt #ifdef __cplusplus
23*09d4459fSDaniel Fojt extern "C" {
24*09d4459fSDaniel Fojt #endif
25*09d4459fSDaniel Fojt 
26*09d4459fSDaniel Fojt /* Return the base name of the executing program.
27*09d4459fSDaniel Fojt    On native Windows this will usually end in ".exe" or ".EXE". */
28*09d4459fSDaniel Fojt #ifndef HAVE_GETPROGNAME
29*09d4459fSDaniel Fojt extern char const *getprogname (void)
30*09d4459fSDaniel Fojt # ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
31*09d4459fSDaniel Fojt   _GL_ATTRIBUTE_PURE
32*09d4459fSDaniel Fojt # endif
33*09d4459fSDaniel Fojt   ;
34*09d4459fSDaniel Fojt #endif
35*09d4459fSDaniel Fojt 
36*09d4459fSDaniel Fojt #ifdef __cplusplus
37*09d4459fSDaniel Fojt }
38*09d4459fSDaniel Fojt #endif
39*09d4459fSDaniel Fojt 
40*09d4459fSDaniel Fojt #endif
41