diff options
author | Mike Frysinger <vapier@gentoo.org> | 2014-01-10 10:07:39 -0500 |
---|---|---|
committer | Andreas Gruenbacher <agruen@linbit.com> | 2014-01-13 13:18:39 +0100 |
commit | 602dbcb26e9591922ca94f5b326694a2309fff18 (patch) | |
tree | e17c77bb1fcff3b43bdfd16d706931fec8993540 | |
parent | c93b43c22331c3000ce15452943daa9bec77436c (diff) | |
download | acl-602dbcb26e9591922ca94f5b326694a2309fff18.tar.gz |
move gettext logic into misc.h
This lets us autogenerate config.h using autoheader rather than
hand maintain it.
-rw-r--r-- | chacl/chacl.c | 4 | ||||
-rw-r--r-- | getfacl/getfacl.c | 5 | ||||
-rw-r--r-- | include/config.h.in | 10 | ||||
-rw-r--r-- | include/misc.h | 17 | ||||
-rw-r--r-- | libacl/perm_copy.h | 2 | ||||
-rw-r--r-- | setfacl/do_set.c | 3 | ||||
-rw-r--r-- | setfacl/setfacl.c | 5 |
7 files changed, 27 insertions, 19 deletions
diff --git a/chacl/chacl.c b/chacl/chacl.c index 854a620..525a7ff 100644 --- a/chacl/chacl.c +++ b/chacl/chacl.c @@ -17,6 +17,7 @@ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include "config.h" #include <stdlib.h> #include <string.h> #include <unistd.h> @@ -29,8 +30,7 @@ #include <sys/stat.h> #include <sys/acl.h> #include <acl/libacl.h> -#include <locale.h> -#include "config.h" +#include "misc.h" static int acl_delete_file (const char * path, acl_type_t type); static int list_acl(char *file); diff --git a/getfacl/getfacl.c b/getfacl/getfacl.c index f8eaf25..22cc1c7 100644 --- a/getfacl/getfacl.c +++ b/getfacl/getfacl.c @@ -21,6 +21,7 @@ USA. */ +#include "config.h" #include <stdio.h> #include <errno.h> #include <sys/acl.h> @@ -34,11 +35,9 @@ #include <dirent.h> #include <libgen.h> #include <getopt.h> -#include <locale.h> -#include "config.h" +#include "misc.h" #include "user_group.h" #include "walk_tree.h" -#include "misc.h" #define POSIXLY_CORRECT_STR "POSIXLY_CORRECT" diff --git a/include/config.h.in b/include/config.h.in index 6787b6e..6a720ac 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -39,16 +39,6 @@ /* Define if you want gettext (I18N) support */ #undef ENABLE_GETTEXT -#ifdef ENABLE_GETTEXT -# include <libintl.h> -# define _(x) gettext(x) -#else -# define _(x) (x) -# define textdomain(d) do { } while (0) -# define bindtextdomain(d,dir) do { } while (0) -#endif -#include <locale.h> - /* On GNU/kFreeBSD, ENODATA is not defined in the system headers */ #include <errno.h> #ifndef ENODATA diff --git a/include/misc.h b/include/misc.h index 0c5fdcc..a4fa70e 100644 --- a/include/misc.h +++ b/include/misc.h @@ -15,9 +15,26 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ +#ifndef __MISC_H +#define __MISC_H + +#include <stdio.h> + extern int high_water_alloc(void **buf, size_t *bufsize, size_t newsize); extern const char *quote(const char *str, const char *quote_chars); extern char *unquote(char *str); extern char *next_line(FILE *file); + +#ifdef ENABLE_NLS +# include <libintl.h> +# define _(x) gettext(x) +#else +# define _(x) (x) +# define textdomain(d) do { } while (0) +# define bindtextdomain(d,dir) do { } while (0) +#endif +#include <locale.h> + +#endif diff --git a/libacl/perm_copy.h b/libacl/perm_copy.h index 87b1566..350ae6a 100644 --- a/libacl/perm_copy.h +++ b/libacl/perm_copy.h @@ -35,3 +35,5 @@ #define HAVE_ACL_GET_TAG_TYPE 1 #define HAVE_ACL_SET_FD 1 #define HAVE_ACL_SET_FILE 1 + +#include "misc.h" diff --git a/setfacl/do_set.c b/setfacl/do_set.c index 3e7e982..60da837 100644 --- a/setfacl/do_set.c +++ b/setfacl/do_set.c @@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "config.h" #include <stdio.h> #include <errno.h> #include <sys/acl.h> @@ -33,10 +34,10 @@ #include <unistd.h> #include <dirent.h> #include <ftw.h> +#include "misc.h" #include "sequence.h" #include "do_set.h" #include "parse.h" -#include "config.h" #include "walk_tree.h" diff --git a/setfacl/setfacl.c b/setfacl/setfacl.c index 81062a6..f6135b7 100644 --- a/setfacl/setfacl.c +++ b/setfacl/setfacl.c @@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "config.h" #include <limits.h> #include <stdio.h> #include <string.h> @@ -29,13 +30,11 @@ #include <dirent.h> #include <libgen.h> #include <getopt.h> -#include <locale.h> -#include "config.h" +#include "misc.h" #include "sequence.h" #include "parse.h" #include "do_set.h" #include "walk_tree.h" -#include "misc.h" #define POSIXLY_CORRECT_STR "POSIXLY_CORRECT" |