fix compiler warnings
[asterisk/asterisk.git] / image.c
diff --git a/image.c b/image.c
index 0159043..894e660 100755 (executable)
--- a/image.c
+++ b/image.c
@@ -1,39 +1,52 @@
 /*
- * Asterisk -- A telephony toolkit for Linux.
+ * Asterisk -- An open source telephony toolkit.
  *
- * Channel Management
- * 
- * Copyright (C) 1999, Mark Spencer
+ * Copyright (C) 1999 - 2005, Digium, Inc.
+ *
+ * Mark Spencer <markster@digium.com>
  *
- * Mark Spencer <markster@linux-support.net>
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
  *
  * This program is free software, distributed under the terms of
- * the GNU General Public License
+ * the GNU General Public License Version 2. See the LICENSE file
+ * at the top of the source tree.
+ */
+
+/*! \file
+ *
+ * \brief Image Management
+ * 
  */
 
 #include <stdio.h>
 #include <stdlib.h>
-#include <pthread.h>
 #include <string.h>
 #include <sys/time.h>
 #include <sys/stat.h>
 #include <signal.h>
 #include <errno.h>
 #include <unistd.h>
-#include <asterisk/sched.h>
-#include <asterisk/options.h>
-#include <asterisk/channel.h>
-#include <asterisk/channel_pvt.h>
-#include <asterisk/logger.h>
-#include <asterisk/file.h>
-#include <asterisk/image.h>
-#include <asterisk/translate.h>
-#include <asterisk/cli.h>
+
 #include "asterisk.h"
-#include "astconf.h"
+
+ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
+
+#include "asterisk/sched.h"
+#include "asterisk/options.h"
+#include "asterisk/channel.h"
+#include "asterisk/logger.h"
+#include "asterisk/file.h"
+#include "asterisk/image.h"
+#include "asterisk/translate.h"
+#include "asterisk/cli.h"
+#include "asterisk/lock.h"
 
 static struct ast_imager *list;
-static ast_mutex_t listlock = AST_MUTEX_INITIALIZER;
+AST_MUTEX_DEFINE_STATIC(listlock);
 
 int ast_image_register(struct ast_imager *img)
 {
@@ -69,9 +82,9 @@ void ast_image_unregister(struct ast_imager *img)
 
 int ast_supports_images(struct ast_channel *chan)
 {
-       if (!chan || !chan->pvt)
+       if (!chan || !chan->tech)
                return 0;
-       if (!chan->pvt->send_image)
+       if (!chan->tech->send_image)
                return 0;
        return 1;
 }
@@ -162,10 +175,10 @@ int ast_send_image(struct ast_channel *chan, char *filename)
 {
        struct ast_frame *f;
        int res = -1;
-       if (chan->pvt->send_image) {
+       if (chan->tech->send_image) {
                f = ast_read_image(filename, chan->language, -1);
                if (f) {
-                       res = chan->pvt->send_image(chan, f);
+                       res = chan->tech->send_image(chan, f);
                        ast_frfree(f);
                }
        }