/usr/include/libexplain/program_name.h is in libexplain-dev 0.51.D001-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | /*
* libexplain - Explain errno values returned by libc functions
* Copyright (C) 2008-2010 Peter Miller
* Written by Peter Miller <pmiller@opensource.org.au>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBEXPLAIN_PROGRAM_NAME_H
#define LIBEXPLAIN_PROGRAM_NAME_H
/**
* @file
* @brief obtain the name of the program
*/
#ifdef __cplusplus
extern "C" {
#endif
/**
* The explain_program_name_get function may be used to obtain the
* command name of the process. Depending on how capable /proc is
* on your system, or, failing that, how capable lsof(1) is on your
* system, this may or may not produce a sensable result. It works
* well on Linux.
*
* @returns
* pointer to string containing the command name (no slashes) of the
* calling process.
*/
const char *explain_program_name_get(void);
/**
* The explain_program_name_set function may be used to set
* the libexplain libraries' idea of the command name of the
* calling process, setting the string to be returned by the
* explain_program_name_get function. This overrides the automatic
* behaviour, which can be quite desirable in commands that can be
* invoked with more than one name, e.g. if they are a hard link
* synoym.
*
* This also sets the option to include the program name in all of the
* error messages issued by the explain_*_or_die functions.
*
* @param name
* The name of the calling process.
*/
void explain_program_name_set(const char *name);
/**
* The explain_program_name_assemble function is used to control
* whether or not the name of the calling process is to be included in
* error messages issued by the explain_*_or_die functions. If not
* expolicitly set, is controlled by the EXPLAIN_OPTIONS environemnt
* variable, or defaults to false if not set there either.
*
* @param yesno
* non-zero (true) to have program name included,
* zero (false) to have program name excluded.
*/
void explain_program_name_assemble(int yesno);
#ifdef __cplusplus
}
#endif
#endif /* LIBEXPLAIN_PROGRAM_NAME_H */
|