]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
util: Tidy header includes
authorSimon Wilkinson <sxw@your-file-system.com>
Thu, 24 Mar 2011 15:26:38 +0000 (15:26 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 25 Mar 2011 00:24:48 +0000 (17:24 -0700)
Since we adopted libroken, we get a lot of header includes automatically
from roken.h. Use these, instead of including lots of things multiple
times.

Change-Id: I5e5e67b695f07bf121b0543c7f936278009eff15
Reviewed-on: http://gerrit.openafs.org/4301
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
26 files changed:
src/config/afsconfig-windows.h
src/util/assert.c
src/util/casestrcpy.c
src/util/dirpath.c
src/util/exec.c
src/util/fileutil.c
src/util/flipbase64.c
src/util/fstab.c
src/util/get_krbrlm.c
src/util/hostparse.c
src/util/hputil.c
src/util/krb5_nt.c
src/util/kreltime.c
src/util/ktime.c
src/util/netutils.c
src/util/pthread_glock.c
src/util/readdir_nt.c
src/util/secutil_nt.c
src/util/serverLog.c
src/util/snprintf.c
src/util/softsig.c
src/util/tabular_output.c
src/util/thread_pool.c
src/util/uuid.c
src/util/volparse.c
src/util/work_queue.c

index 19d905b2b56f010adaf28508b9ba3078f0d16252..507e696c6d8ff611eac86f08603926f7bbd64606 100644 (file)
 /* Define if you have the <sys/param.h> header file.  */
 #undef HAVE_SYS_PARAM_H
 
+/* Define if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
 /* Define if you have the <sys/time.h> header file.  */
 #undef HAVE_SYS_TIME_H
 
index 49834ccd0a80f23c37096507eca72d951a213df3..3ef2c798ffa60dbf8c66a8ea51eec8582e136eb1 100644 (file)
 /* ReallyAbort:  called from assert. May/85 */
 #include <afsconfig.h>
 #include <afs/param.h>
-#include <stdlib.h>
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <string.h>
 
+#include <roken.h>
 
-#include <stdio.h>
 #include "afsutil.h"
 
 #ifdef AFS_NT40_ENV
index dbcae071ea7118c5bb80e15f4fcdb73ca1093d7e..606a898d68f96a7f932bb3f243f3289b394b65a4 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
-#include <string.h>
 #include <ctype.h>
-#include <stddef.h>
-#include <stdarg.h>
 
 /* Just like strncpy but shift-case in transit and forces null termination */
 char *
index 7469b64af351aed16dfa5c09bd19a2cb526feff2..5a1a7d3e6b0054524c6a4d5f6334e24092a5f868 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
 #include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
 #include <ctype.h>
 #include <limits.h>
-#include <errno.h>
-#include <stdio.h>
+
 #include "afs_assert.h"
 #include "afsutil.h"
 #include "fileutil.h"
+
 #ifdef AFS_PTHREAD_ENV
 #include <pthread.h>
 static pthread_once_t dirInit_once = PTHREAD_ONCE_INIT;
 #endif
+
 #ifdef AFS_NT40_ENV
-#include <windows.h>
 #include <WINNT\afssw.h>
 #endif
-#ifdef AFS_DARWIN_ENV
-#include <unistd.h>
-#endif
 
 /* local vars */
 /* static storage for path strings */
index df8722e7fd1cd8dc3dfcd7d033e0f998e105a482..d2bd66c0891e3c6add2be93e215d58a5068378c9 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <stdlib.h>
+#include <roken.h>
 
 /* helper for afs_exec_alt; just constructs the string for the 'alternate'
  * program */
index 329d8f3c9ca34e2e4a0b42f14dfe8c7d67e8ddcc..509d72897259fa5127e3519f2a1a2f40d08c18d2 100644 (file)
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
+#include <roken.h>
 
-#include <afs/stds.h>
 #include <stddef.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
 
 #ifdef AFS_NT40_ENV
-#include <windows.h>
-#include <io.h>
 #include "errmap_nt.h"
 #endif
 
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <sys/types.h>
-#include <dirent.h>
-#include <sys/stat.h>
-#ifdef HAVE_FCNTL_H
-#include <fcntl.h>
-#endif
 #include "fileutil.h"
 
 
index ef1c6c99bc8f9f096f3bb04f4f24a94f7f7d6253..7498a3d09eb9685a18de379326623a04500d080f 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-
+#include <roken.h>
 
 #if defined(AFS_NAMEI_ENV)
-#include <sys/types.h>
 #include "afsutil.h"
 
 /* This version of base64 gets it right and starts converting from the low
index d89cdf0517f4183e4aef95a6ee8d97320d6a54df..439c695363e6cc74a04fd5d0cd92b27e537ce51f 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
+
 #if defined(AFS_DARWIN_ENV)
 /*
  * Reworked from FreeBSD umount
  */
 
-#include <sys/param.h>
 #include <sys/mount.h>
-
-#include <err.h>
-#include <errno.h>
 #include <fstab.h>
-#include <stdio.h>
-#include <stdlib.h>
 
 size_t
 mntinfo(struct statfs **mntbuffer)
index 1866a51292f3f58ecb9b733de7c5a4630addc242..f817b0df1a1202eabc9fe8ad883be71508870445 100644 (file)
@@ -8,9 +8,8 @@
 
 #include <roken.h>
 
-#include <stdio.h>
-#include <string.h>
 #include <ctype.h>
+
 #include "afsutil.h"
 
 /*
index 2462931cebe4791448127d1d9bd2e69ee3955e98..0079d8cf6a5035602e7c66238fec153fd4514f80 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
-#include <stdio.h>
-#include <sys/types.h>
-#include <stdlib.h>
 #ifdef AFS_NT40_ENV
-#include <winsock2.h>
 #include <direct.h>
 #else
-#include <netinet/in.h>
-#include <sys/socket.h>
-#include <arpa/inet.h>
-#include <netdb.h>
 #include <ctype.h>
 #endif
-#include <string.h>
-#include <errno.h>
-#include "afsutil.h"
 
+#include "afsutil.h"
 
 /* also parse a.b.c.d addresses */
 struct hostent *
index 50b308c9b0e43bc23d05d9adf7e6281a3ba2a32c..3e9ae038e7807cebeec9da0ee08fe13604395f17 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
 #ifdef AFS_HPUX_ENV
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/time.h>
 #include <utime.h>
 
 /* insque/remque moved to timer.c where they are used. */
index 61d6b39be8e3e776209ba734a081203a7accb5a2..ac215df425e6f19570d461916f3d8ff72b0ff53c 100644 (file)
@@ -24,7 +24,7 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
- #include <afsconfig.h>
+#include <afsconfig.h>
 #include <afs/param.h>
 
 #include <windows.h>
index 1f9470b7613ff1227479dce293050ac7fc168532..efad111dba494bedd3558a0f83f90f14ca348ce5 100644 (file)
@@ -9,17 +9,14 @@
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
+#include <roken.h>
 
-#include <afs/stds.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include "ktime.h"
-#include <time.h>
 #include <ctype.h>
-#include <string.h>
-#include "afsutil.h"
 
+#include "ktime.h"
+#include "afsutil.h"
 
 /* maximum values for relative dates */
 
index ad68aa7c1f47932eb5d6aa6c3583270185c9d023..eec1f3be959ce39b3d92a6db36c4d266b4e7611a 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
-#include <sys/types.h>
-#include <stdio.h>
-#include <time.h>
 #include <ctype.h>
-#ifdef AFS_NT40_ENV
-#include <malloc.h>
-#endif
-#include <string.h>
-#include <stdlib.h>
-#include "afsutil.h"
 
+#include "afsutil.h"
 #include "ktime.h"
 
 /* some date parsing routines */
index e922513628afe1fe315ca9e920c90752072905d3..c12aeb4133b231f53599ea6d0ded689145efada8 100644 (file)
 
 #include <afsconfig.h>
 #include <afs/param.h>
-#include <roken.h>
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
+#include <roken.h>
 #include <ctype.h>
-#if defined(AFS_NT40_ENV)
-# include <winsock2.h>
-#else
-# if defined(__FreeBSD__)
-#  include <sys/types.h>
-# endif
-# include <netinet/in.h>
-# include <sys/errno.h>
-#endif
-#include <errno.h>
 
 #include <rx/rx.h>
+#include <afs/dirpath.h>
 
 #include "afs_assert.h"
 #include "afsutil.h"
-#include <afs/dirpath.h>
 
 #define AFS_IPINVALID        0xffffffff        /* invalid IP address */
 #define AFS_IPINVALIDIGNORE  0xfffffffe        /* no input given to extractAddr */
index ba80cb412bffbc6e927b1dc04981c26c6caec491..93f9ee68cde36df753db1a6390b70311af6962a5 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
 #if defined(AFS_NT40_ENV) && defined(AFS_PTHREAD_ENV)
 #define AFS_GRMUTEX_DECLSPEC __declspec(dllexport)
 #endif
 #ifdef AFS_PTHREAD_ENV
 #include <afs/pthread_glock.h>
-#include <string.h>
 
 /*
  * Implement a pthread based recursive global lock for use in porting
index bfc09cf1c47e3c4cb9df0f4b387bd6953a0b2935..3435495cd45e49aa27a7cefe412ca7eca3eeefb7 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
-#include <errno.h>
 #include <afs/errmap_nt.h>
 #include <windows.h>
 #include <winbase.h>
 #include <dirent.h>
-#include <stdlib.h>
-#include <sys/stat.h>
 
 /* opendir() - The case insensitive version of opendir */
 DIR *
index 127cd943e21f386db382cf0340d0c93d987f08b2..83a7362d369e17cdea83858df240b4ac3542b9dd 100644 (file)
@@ -11,8 +11,6 @@
 
 #include <afs/param.h>
 #include <afsconfig.h>
-
-
 #include <afs/stds.h>
 
 #include <stddef.h>
index 1cba0949c9df00d28c5d4cadf2b6b6cbd4f23dbc..65a245642a91fe1b616aab26882a8f87278b3fd5 100644 (file)
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/stds.h>
 
-
-#include <stdio.h>
-#ifdef AFS_NT40_ENV
-#include <io.h>
-#include <time.h>
-#else
-#ifdef AFS_AIX_ENV
-#include <time.h>
-#endif
-#include <sys/param.h>
-#include <sys/time.h>
-#include <syslog.h>
-#endif
 #include <afs/procmgmt.h>      /* signal(), kill(), wait(), etc. */
 
 #include <roken.h>             /* Must come after procmgmt.h */
 
-#include <fcntl.h>
-#include <afs/stds.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
 #include "afsutil.h"
 #include "fileutil.h"
 #include <lwp.h>
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#endif
+
 #if defined(AFS_PTHREAD_ENV)
 #include <afs/afs_assert.h>
 /* can't include rx when we are libutil; it's too early */
index 200f1259315ca97ab5fa4a05ef97d445eed48037..1f79105be91a0b15dc9972ecd6b7144236ceeaca 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-
-#include <sys/types.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <stdio.h>
+#include <roken.h>
 #include <ctype.h>
-#include <string.h>
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#ifndef AFS_NT40_ENV
-#include <netinet/in.h>
-#include <netdb.h>
-#ifndef HAVE_VSYSLOG
-#include <syslog.h>
-#endif
-#else
-#include <winsock2.h>
-#endif
-#if defined(AFS_AIX32_ENV) || defined(AFS_SUN_ENV) || defined(AFS_XBSD_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SGI65_ENV)
-#include <sys/socket.h>
-#endif
 
 /* This is an enhanced version of the *printf functionality shipped
  * with Heimdal.  In addition to the standard Unix formatting types
index 6fe861ea1f8ba131b997aaf04c1af658bf219cf6..e0e6480b4bf844574a7d6c7b8b86706f936fd536 100644 (file)
 
 #include <afsconfig.h>
 #include <afs/param.h>
+#include <afs/procmgmt.h> /* Must be before roken.h */
+
+#include <roken.h>
 
-#include <afs/param.h>
 #include <assert.h>
-#include <stdlib.h>
-#include <stdio.h>
-#ifndef  AFS_NT40_ENV
-#include <signal.h>
-#include <unistd.h>
-#else
-#include <afs/procmgmt.h>
-#endif
 #include <pthread.h>
 
 #include "pthread_nosigs.h"
index b879b8da88257cb0b558f6b2330473a25a104823..7e55e8b785f1a466e7ddc2ea5eddb083fa379a9c 100644 (file)
 
 #include <afsconfig.h>
 #include <afs/param.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <sys/types.h>
-#include <time.h>
+
+#include <roken.h>
+
 #include <afs/afsutil.h>
 #include <afs/tabular_output.h>
-#include <errno.h>
 
 /* private structures */
 
index ab16080b697c3885ff0d08c9373a70b9a4b24878..eb89dfba29bde2954460e6cadaf854e4a9cedae7 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <dirent.h>
 #include <afs/afs_assert.h>
-#include <string.h>
-#include <sys/file.h>
-#include <sys/param.h>
 #include <lock.h>
-#if defined(AFS_SUN5_ENV) || defined(AFS_HPUX_ENV)
-#include <unistd.h>
-#endif
 #include <afs/afsutil.h>
 #include <lwp.h>
 #include <afs/afsint.h>
index 603961086fe4c502122a0412b83884b033327212..08cbeb9a54b7f1431cad14902284c2e6090a7fc2 100644 (file)
  */
 
 #include <afsconfig.h>
-#ifdef KERNEL
-#include "afs/param.h"
-#else
 #include <afs/param.h>
-#include <roken.h>
-#endif
 
+#ifndef KERNEL
+# include <roken.h>
+
+# ifdef AFS_NT40_ENV
+#  include <rpc.h>
+#  include <process.h>
+# else
+#  include <net/if.h>
+#  if !defined(AFS_LINUX20_ENV) && !defined(AFS_ARM_DARWIN_ENV)
+#   include <netinet/if_ether.h>
+#  endif
+# endif
 
-#ifdef KERNEL
-#include "afs/sysincludes.h"
-#include "afsincludes.h"
-#else /* KERNEL */
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#ifdef AFS_NT40_ENV
-#include <rpc.h>
-#include <winsock2.h>
-#include <process.h>
-#else
-#include <sys/file.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <sys/ioctl.h>
-#include <sys/socket.h>
-#ifndef ITIMER_REAL
-#include <sys/time.h>
-#endif /* ITIMER_REAL */
-#include <net/if.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <stdlib.h>
-#endif
-#include <sys/stat.h>
-#include <fcntl.h>
-#if !defined(AFS_NT40_ENV) && !defined(AFS_LINUX20_ENV) && !defined(AFS_ARM_DARWIN_ENV)
-#include <netinet/if_ether.h>
-#endif
 #include "afsutil.h"
-#endif /* KERNEL */
 
+#else
+# include "afs/sysincludes.h"
+# include "afsincludes.h"
+#endif
 
 typedef struct {
     char eaddr[6];             /* 6 bytes of ethernet hardware address */
index 1e161f7056a91ed3ee44a85b47b28399991a746f..c4cb1f877477a65b0c9e22d30f54ce41b89e44dd 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
-#include <string.h>
-#include <errno.h>
-#ifdef HAVE_STDLIB_H
-#include <stdlib.h>
-#endif
-
 #include <roken.h>
 
 #include "afsutil.h"
index cbda5cc0d6397435f5dd455e480521ef7d656844..e523fe1767149f439e4e3f5d1d73f20e35dd9438 100644 (file)
 #include <afsconfig.h>
 #include <afs/param.h>
 
+#include <roken.h>
+#include <sys/file.h>
 
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <dirent.h>
 #include <afs/afs_assert.h>
-#include <string.h>
-#include <sys/file.h>
-#include <sys/param.h>
 #include <lock.h>
 
 #define __AFS_WORK_QUEUE_IMPL 1