phase 1 of header include cleanup (bug #4067)
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 22 Apr 2005 13:11:34 +0000 (13:11 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 22 Apr 2005 13:11:34 +0000 (13:11 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5498 65c4cc65-6c06-0410-ace0-fbb531ad65f3

33 files changed:
acl.c
app.c
ast_expr.y
asterisk.c
astmm.c
autoservice.c
callerid.c
cdr.c
channel.c
cli.c
config.c
config_old.c
db.c
dlfcn.c
dsp.c
file.c
frame.c
fskmodem.c
image.c
indications.c
io.c
jitterbuf.c
loader.c
logger.c
md5.c
muted.c
pbx.c
say.c
strcompat.c
tdd.c
term.c
translate.c
utils.c

diff --git a/acl.c b/acl.c
index 5e697bd..47edeb0 100755 (executable)
--- a/acl.c
+++ b/acl.c
 #include <signal.h>
 #include <errno.h>
 #include <unistd.h>
-#include "asterisk/acl.h"
-#include "asterisk/logger.h"
-#include "asterisk/channel.h"
-#include "asterisk/options.h"
-#include "asterisk/utils.h"
-#include "asterisk/lock.h"
-#include "asterisk/srv.h"
 #include <arpa/inet.h>
 #include <sys/socket.h>
 #include <netdb.h>
 #include <netinet/in_systm.h>
 #include <netinet/ip.h>
 #include <sys/ioctl.h>
+
 #if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
 #include <fcntl.h>
 #include <net/route.h>
-
-AST_MUTEX_DEFINE_STATIC(routeseq_lock);
 #endif
 
 #if defined (SOLARIS)
 #include <sys/sockio.h>
 #endif
 
+#include "asterisk/acl.h"
+#include "asterisk/logger.h"
+#include "asterisk/channel.h"
+#include "asterisk/options.h"
+#include "asterisk/utils.h"
+#include "asterisk/lock.h"
+#include "asterisk/srv.h"
+
+#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__)
+AST_MUTEX_DEFINE_STATIC(routeseq_lock);
+#endif
+
 struct ast_netsock {
        ASTOBJ_COMPONENTS(struct ast_netsock);
        struct sockaddr_in bindaddr;
diff --git a/app.c b/app.c
index 6920b96..f119f99 100755 (executable)
--- a/app.c
+++ b/app.c
@@ -22,6 +22,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <regex.h>
+
 #include "asterisk/channel.h"
 #include "asterisk/pbx.h"
 #include "asterisk/file.h"
index de07a0c..e117914 100755 (executable)
@@ -21,6 +21,7 @@
 #include <errno.h>
 #include <regex.h>
 #include <limits.h>
+
 #include "asterisk/ast_expr.h"
 #include "asterisk/logger.h"
 
index 589ec44..f7d9b56 100755 (executable)
 
 #include <unistd.h>
 #include <stdlib.h>
+#include <sys/resource.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <signal.h>
+#include <sched.h>
+#include <sys/socket.h>
+#include <sys/un.h>
+#include <sys/wait.h>
+#include <string.h>
+#include <errno.h>
+#include <ctype.h>
+#include <sys/resource.h>
+#include <grp.h>
+#include <pwd.h>
+#include <sys/stat.h>
+
+#if  defined(__FreeBSD__) || defined( __NetBSD__ ) || defined(SOLARIS)
+#include <netdb.h>
+#endif
+
 #include "asterisk/logger.h"
 #include "asterisk/options.h"
 #include "asterisk/cli.h"
 #include "asterisk/lock.h"
 #include "asterisk/utils.h"
 #include "asterisk/file.h"
-#include <sys/resource.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <signal.h>
-#include <sched.h>
 #include "asterisk/io.h"
 #include "asterisk/lock.h"
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/wait.h>
-#include <string.h>
-#include <errno.h>
-#include <ctype.h>
 #include "editline/histedit.h"
 #include "asterisk.h"
 #include "asterisk/config.h"
-#include <sys/resource.h>
-#include <grp.h>
-#include <pwd.h>
-#include <sys/stat.h>
-
-#if  defined(__FreeBSD__) || defined( __NetBSD__ ) || defined(SOLARIS)
-#include <netdb.h>
-#endif
 
 #ifndef AF_LOCAL
 #define AF_LOCAL AF_UNIX
diff --git a/astmm.c b/astmm.c
index e2e3fb4..be165eb 100755 (executable)
--- a/astmm.c
+++ b/astmm.c
@@ -19,6 +19,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <time.h>
+
 #include "asterisk/cli.h"
 #include "asterisk/logger.h"
 #include "asterisk/options.h"
index 0d9d1b2..25c9ae8 100755 (executable)
@@ -19,6 +19,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <math.h>                      /* For PI */
+
 #include "asterisk/pbx.h"
 #include "asterisk/frame.h"
 #include "asterisk/sched.h"
index 9e5c787..430f3ce 100755 (executable)
@@ -21,6 +21,7 @@
 #include <unistd.h>
 #include <math.h>
 #include <ctype.h>
+
 #include "asterisk/ulaw.h"
 #include "asterisk/alaw.h"
 #include "asterisk/frame.h"
diff --git a/cdr.c b/cdr.c
index beffcb3..51c40db 100755 (executable)
--- a/cdr.c
+++ b/cdr.c
  *
  */
 
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+
 #include "asterisk/lock.h"
 #include "asterisk/channel.h"
 #include "asterisk/cdr.h"
@@ -22,9 +26,6 @@
 #include "asterisk/causes.h"
 #include "asterisk/options.h"
 #include "asterisk/utils.h"
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
 
 int ast_default_amaflags = AST_CDR_DOCUMENTATION;
 char ast_default_accountcode[20] = "";
index 5192811..9d6007c 100755 (executable)
--- a/channel.c
+++ b/channel.c
 #include <errno.h>
 #include <unistd.h>
 #include <math.h>                      /* For PI */
+
+#ifdef ZAPTEL_OPTIMIZATIONS
+#include <sys/ioctl.h>
+#ifdef __linux__
+#include <linux/zaptel.h>
+#else
+#include <zaptel.h>
+#endif /* __linux__ */
+#ifndef ZT_TIMERPING
+#error "You need newer zaptel!  Please cvs update zaptel"
+#endif
+#endif
+
 #include "asterisk/pbx.h"
 #include "asterisk/frame.h"
 #include "asterisk/sched.h"
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
 #include "asterisk/transcap.h"
-#ifdef ZAPTEL_OPTIMIZATIONS
-#include <sys/ioctl.h>
-#ifdef __linux__
-#include <linux/zaptel.h>
-#else
-#include <zaptel.h>
-#endif /* __linux__ */
-#ifndef ZT_TIMERPING
-#error "You need newer zaptel!  Please cvs update zaptel"
-#endif
-#endif
 #include "asterisk.h"
 
 /* uncomment if you have problems with 'monitoring' synchronized files */
diff --git a/cli.c b/cli.c
index e11e0fa..eceef43 100755 (executable)
--- a/cli.c
+++ b/cli.c
 
 #include <unistd.h>
 #include <stdlib.h>
+#include <sys/signal.h>
+#include <stdio.h>
+#include <signal.h>
+#include <string.h>
+#include <ctype.h>
+
 #include "asterisk/logger.h"
 #include "asterisk/options.h"
 #include "asterisk/cli.h"
 #include "asterisk/manager.h"
 #include "asterisk/utils.h"
 #include "asterisk/lock.h"
-#include <sys/signal.h>
-#include <stdio.h>
-#include <signal.h>
-#include <string.h>
-#include <ctype.h>
 /* For rl_filename_completion */
 #include "editline/readline/readline.h"
 /* For module directory */
index a4673cb..b38dc54 100755 (executable)
--- a/config.c
+++ b/config.c
@@ -24,6 +24,7 @@
 #endif
 # include <glob.h>
 #endif
+
 #include "asterisk/config.h"
 #include "asterisk/cli.h"
 #include "asterisk/lock.h"
index c2d8cdf..1c8a912 100755 (executable)
@@ -16,6 +16,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+
 #include "asterisk/config.h"
 #include "asterisk/logger.h"
 
diff --git a/db.c b/db.c
index aa3fd04..063d298 100755 (executable)
--- a/db.c
+++ b/db.c
@@ -23,6 +23,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <dirent.h>
+
 #include "asterisk/channel.h"
 #include "asterisk/file.h"
 #include "asterisk/app.h"
diff --git a/dlfcn.c b/dlfcn.c
index 0fae635..cc6fe40 100755 (executable)
--- a/dlfcn.c
+++ b/dlfcn.c
@@ -47,6 +47,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #ifndef __BSD_VISIBLE
 #define __BSD_VISIBLE 1
 #endif
+
 #include "asterisk/dlfcn-compat.h"
 
 #ifndef dl_restrict
diff --git a/dsp.c b/dsp.c
index 0395865..33917e5 100755 (executable)
--- a/dsp.c
+++ b/dsp.c
 */
 
 #include <sys/types.h>
-#include "asterisk/frame.h"
-#include "asterisk/channel.h"
-#include "asterisk/logger.h"
-#include "asterisk/dsp.h"
-#include "asterisk/ulaw.h"
-#include "asterisk/alaw.h"
 #include <stdlib.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
 #include <stdio.h>
 
+#include "asterisk/frame.h"
+#include "asterisk/channel.h"
+#include "asterisk/logger.h"
+#include "asterisk/dsp.h"
+#include "asterisk/ulaw.h"
+#include "asterisk/alaw.h"
+
 /* Number of goertzels for progress detect */
 #define GSAMP_SIZE_NA 183                      /* North America - 350, 440, 480, 620, 950, 1400, 1800 Hz */
 #define GSAMP_SIZE_CR 188                      /* Costa Rica, Brazil - Only care about 425 Hz */
diff --git a/file.c b/file.c
index 6b85b99..876177a 100755 (executable)
--- a/file.c
+++ b/file.c
  */
 
 #include <sys/types.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <fcntl.h>
+#include <dirent.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+
 #include "asterisk/frame.h"
 #include "asterisk/file.h"
 #include "asterisk/cli.h"
 #include "asterisk/utils.h"
 #include "asterisk/lock.h"
 #include "asterisk/app.h"
-#include <errno.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <sys/types.h>
-#include <sys/stat.h>
 #include "asterisk.h"
 #include "astconf.h"
 
diff --git a/frame.c b/frame.c
index 75179c1..41932f8 100755 (executable)
--- a/frame.c
+++ b/frame.c
  * the GNU General Public License
  */
 
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <errno.h>
+#include <stdio.h>
+
 #include "asterisk/lock.h"
 #include "asterisk/frame.h"
 #include "asterisk/logger.h"
 #include "asterisk/cli.h"
 #include "asterisk/term.h"
 #include "asterisk/utils.h"
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
-#include <stdio.h>
 #include "asterisk.h"
 
 #ifdef TRACE_FRAMES
index 76cc7b1..3086edc 100755 (executable)
  *
  */
 
-#include "asterisk/fskmodem.h"
-
 #include <stdio.h>
 
+#include "asterisk/fskmodem.h"
+
 #define NBW    2
 #define BWLIST {75,800}
 #define        NF      6
diff --git a/image.c b/image.c
index a169f74..7fa2141 100755 (executable)
--- a/image.c
+++ b/image.c
@@ -19,6 +19,7 @@
 #include <signal.h>
 #include <errno.h>
 #include <unistd.h>
+
 #include "asterisk/sched.h"
 #include "asterisk/options.h"
 #include "asterisk/channel.h"
index 0f93e45..4867fd4 100755 (executable)
@@ -20,6 +20,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <math.h>                      /* For PI */
+
 #include "asterisk/indications.h"
 #include "asterisk/frame.h"
 #include "asterisk/options.h"
diff --git a/io.c b/io.c
index 8b915d2..f04277c 100755 (executable)
--- a/io.c
+++ b/io.c
@@ -17,6 +17,7 @@
 #include <termios.h>
 #include <string.h> /* for memset */
 #include <sys/ioctl.h>
+
 #include "asterisk/io.h"
 #include "asterisk/logger.h"
 
index a7668e1..365ec44 100755 (executable)
  * Copyright on this file is disclaimed to Digium for inclusion in Asterisk
  */
 
-#include "jitterbuf.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 
+#include "jitterbuf.h"
+
 /* define these here, just for ancient compiler systems */
 #define JB_LONGMAX 2147483647L
 #define JB_LONGMIN (-JB_LONGMAX - 1L)
index 44945e7..5799374 100755 (executable)
--- a/loader.c
+++ b/loader.c
@@ -16,6 +16,7 @@
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
+
 #include "asterisk/module.h"
 #include "asterisk/options.h"
 #include "asterisk/config.h"
index 15d60d9..b1c7b0a 100755 (executable)
--- a/logger.c
+++ b/logger.c
 #include <stdio.h>
 #include <unistd.h>
 #include <time.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/stat.h>
+
+#define SYSLOG_NAMES /* so we can map syslog facilities names to their numeric values,
+                       from <syslog.h> which is included by logger.h */
+#include <syslog.h>
+
 #include "asterisk/lock.h"
 #include "asterisk/options.h"
 #include "asterisk/channel.h"
 #include "asterisk/cli.h"
 #include "asterisk/utils.h"
 #include "asterisk/manager.h"
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/stat.h>
 #include "asterisk.h"
 #include "astconf.h"
 
-#define SYSLOG_NAMES /* so we can map syslog facilities names to their numeric values,
-                       from <syslog.h> which is included by logger.h */
-#include <syslog.h>
 static int syslog_level_map[] = {
        LOG_DEBUG,
        LOG_INFO,    /* arbitrary equivalent of LOG_EVENT */
diff --git a/md5.c b/md5.c
index a206971..b0b5d39 100755 (executable)
--- a/md5.c
+++ b/md5.c
@@ -18,6 +18,7 @@
  * will fill a supplied 16-byte array with the digest.
  */
 #include <string.h>            /* for memcpy() */
+
 #include "asterisk/endian.h"
 #include "asterisk/md5.h"
 
diff --git a/muted.c b/muted.c
index 28f3e04..b04f77a 100755 (executable)
--- a/muted.c
+++ b/muted.c
@@ -10,6 +10,7 @@
  * Distributed under the terms of the GNU General Public License version 2.0 
  *
  */
+
 #include <linux/soundcard.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/pbx.c b/pbx.c
index 2d1c429..9a358de 100755 (executable)
--- a/pbx.c
+++ b/pbx.c
 
 #include <sys/types.h>
 #include <regex.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <setjmp.h>
+#include <ctype.h>
+#include <errno.h>
+#include <time.h>
+#include <sys/time.h>
+
 #include "asterisk/lock.h"
 #include "asterisk/cli.h"
 #include "asterisk/pbx.h"
 #include "asterisk/causes.h"
 #include "asterisk/musiconhold.h"
 #include "asterisk/app.h"
-#include <string.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <setjmp.h>
-#include <ctype.h>
-#include <errno.h>
-#include <time.h>
-#include <sys/time.h>
 #include "asterisk.h"
 
 /*
diff --git a/say.c b/say.c
index 9160952..59d4344 100755 (executable)
--- a/say.c
+++ b/say.c
 #include <time.h>
 #include <ctype.h>
 #include <math.h>
+
+#ifdef SOLARIS
+#include <iso/limits_iso.h>
+#endif
+
 #include "asterisk/file.h"
 #include "asterisk/channel.h"
 #include "asterisk/logger.h"
 #include "asterisk.h"
 #include <stdio.h>
 
-#ifdef SOLARIS
-#include <iso/limits_iso.h>
-#endif
-
-
 /* Forward declaration */
 static int wait_file(struct ast_channel *chan, const char *ints, const char *file, const char *lang);
 
index b8f9f0e..1814dcd 100755 (executable)
@@ -2,8 +2,9 @@
 
 #include <sys/types.h>
 #include <stdio.h>
+
 #ifdef SOLARIS
-#include <solaris-compat/compat.h>
+#include "solaris-compat/compat.h"
 #endif
 
 char* strsep(char** str, const char* delims)
diff --git a/tdd.c b/tdd.c
index e7c64ac..fb2da9e 100755 (executable)
--- a/tdd.c
+++ b/tdd.c
 #include <unistd.h>
 #include <math.h>
 #include <ctype.h>
+
 #include "asterisk/ulaw.h"
 #include "asterisk/tdd.h"
 #include "asterisk/logger.h"
 #include "asterisk/fskmodem.h"
 #include "ecdisa.h"
 
-
 struct tdd_state {
        fsk_data fskd;
        char rawdata[256];
diff --git a/term.c b/term.c
index 0cef17e..5bdfe28 100755 (executable)
--- a/term.c
+++ b/term.c
@@ -21,6 +21,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
+
 #include "asterisk/term.h"
 #include "asterisk/options.h"
 #include "asterisk/lock.h"
index 97ece83..492ebb8 100755 (executable)
  * the GNU General Public License
  */
 
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+
 #include "asterisk/lock.h"
 #include "asterisk/channel.h"
 #include "asterisk/logger.h"
 #include "asterisk/sched.h"
 #include "asterisk/cli.h"
 #include "asterisk/term.h"
-#include <sys/socket.h>
-#include <sys/time.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
 
 #define MAX_RECALC 200 /* max sample recalc */
 
diff --git a/utils.c b/utils.c
index 4ae07f8..742b487 100755 (executable)
--- a/utils.c
+++ b/utils.c
@@ -22,6 +22,7 @@
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
+
 #include "asterisk/lock.h"
 #include "asterisk/utils.h"
 #include "asterisk/io.h"