/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1985-2011 AT&T Intellectual Property *
* and is licensed under the *
* Common Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* David Korn <dgk@research.att.com> *
* Phong Vo <kpv@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* Glenn Fowler
* AT&T Research
*
* generate mode features
*/
#include "limits.h"
#include <modecanon.h>
int
main()
{
int n;
int idperm;
int idtype;
#ifndef S_ITYPE
#ifdef S_IFMT
printf("#define S_ITYPE(m) ((m)&S_IFMT)\n");
#else
printf("#define S_ITYPE(m) ((m)&~S_IPERM)\n");
#endif
#endif
#ifdef S_ISBLK
#else
#ifdef S_IFBLK
printf("#define S_ISBLK(m) (S_ITYPE(m)==S_IFBLK)\n");
#else
printf("#define S_ISBLK(m) 0\n");
#endif
#endif
#ifdef S_ISCHR
#else
#ifdef S_IFCHR
printf("#define S_ISCHR(m) (S_ITYPE(m)==S_IFCHR)\n");
#else
printf("#define S_ISCHR(m) 0\n");
#endif
#endif
#ifdef S_ISCTG
#else
#ifdef S_IFCTG
printf("#define S_ISCTG(m) (S_ITYPE(m)==S_IFCTG)\n");
#endif
#endif
#ifdef S_ISDIR
#else
#ifdef S_IFDIR
printf("#define S_ISDIR(m) (S_ITYPE(m)==S_IFDIR)\n");
#else
printf("#define S_ISDIR(m) 0\n");
#endif
#endif
#ifdef S_ISFIFO
#else
#ifdef S_IFIFO
printf("#define S_ISFIFO(m) (S_ITYPE(m)==S_IFIFO)\n");
#else
printf("#define S_ISFIFO(m) 0\n");
#endif
#endif
#ifdef S_ISLNK
#else
#ifdef S_IFLNK
printf("#define S_ISLNK(m) (S_ITYPE(m)==S_IFLNK)\n");
#else
printf("#define S_ISLNK(m) 0\n");
#endif
#endif
#ifdef S_ISREG
#else
#ifdef S_IFREG
printf("#define S_ISREG(m) (S_ITYPE(m)==S_IFREG)\n");
#else
printf("#define S_ISREG(m) 0\n");
#endif
#endif
#ifdef S_ISSOCK
#else
#ifdef S_IFSOCK
printf("#define S_ISSOCK(m) (S_ITYPE(m)==S_IFSOCK)\n");
#endif
#endif
printf("\n");
#ifndef S_IPERM
printf("#define S_IPERM (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO)\n");
#endif
#ifndef S_ISUID
#else
#endif
#ifndef S_ISGID
#else
#endif
#ifndef S_ISVTX
#else
#endif
#ifndef S_IRUSR
#else
#endif
#ifndef S_IWUSR
#else
#endif
#ifndef S_IXUSR
#else
#endif
#ifndef S_IRGRP
#else
#endif
#ifndef S_IWGRP
#else
#endif
#ifndef S_IXGRP
#else
#endif
#ifndef S_IROTH
#else
#endif
#ifndef S_IWOTH
#else
#endif
#ifndef S_IXOTH
#else
#endif
#ifndef S_IRWXU
printf("#define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR)\n");
#endif
#ifndef S_IRWXG
printf("#define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP)\n");
#endif
#ifndef S_IRWXO
printf("#define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH)\n");
#endif
printf("\n");
printf("\n");
#ifdef BUFFERSIZE
n = BUFFERSIZE;
#else
#ifdef MAXBSIZE
n = MAXBSIZE;
#else
#ifdef SBUFSIZE
n = SBUFSIZE;
#else
#ifdef BUFSIZ
n = BUFSIZ;
#else
if (sizeof(char*) > 4) n = 8192;
else if (sizeof(char*) < 4) n = 512;
else n = 4096;
#endif
#endif
#endif
#endif
printf("#define BUFFERSIZE %u\n", n);
printf("\n");
return 0;
}