OSDN Git Service

update.
[putex/putex.git] / src / texsourc / c-namemx.h
1 /* c-name_max.h: define NAME_MAX, the maximum length of a single
2    component in a pathname.
3
4    Copyright 1992 Karl Berry
5    Copyright 2007 TeX Users Group
6    Copyright 2014 Clerk Ma
7
8    This program is free software; you can redistribute it and/or modify
9    it under the terms of the GNU General Public License as published by
10    the Free Software Foundation; either version 2 of the License, or
11    (at your option) any later version.
12
13    This program is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    General Public License for more details.
17
18    You should have received a copy of the GNU General Public License
19    along with this program; if not, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21    02110-1301 USA.  */
22
23 #ifndef C_NAME_MAX_H
24 #define C_NAME_MAX_H
25
26 #include "c-limits.h"
27
28 #ifdef _POSIX_VERSION
29   #ifndef NAME_MAX
30     #define NAME_MAX pathconf ("/", _PC_NAME_MAX)
31   #endif
32 #endif /* not _POSIX_VERSION */
33
34 /* Most likely the system will truncate filenames if it is not POSIX,
35    and so we can use the BSD value here.  */
36 #ifndef _POSIX_NAME_MAX
37   #define _POSIX_NAME_MAX 255
38 #endif
39
40 #ifndef NAME_MAX
41   #define NAME_MAX _POSIX_NAME_MAX
42 #endif
43
44 #endif /* not C_NAME_MAX_H */