1 /*
2 * The contents of this file are subject to the Mozilla Public
3 * License Version 1.1 (the "License"); you may not use this file
4 * except in compliance with the License. You may obtain a copy of
5 * the License at http://www.mozilla.org/MPL/
6 *
7 * Software distributed under the License is distributed on an "AS
8 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
9 * implied. See the License for the specific language governing
10 * rights and limitations under the License.
11 *
12 * The Original Code is MPEG4IP.
13 *
14 * The Initial Developer of the Original Code is Cisco Systems Inc.
15 * Portions created by Cisco Systems Inc. are
16 * Copyright (C) Cisco Systems Inc. 2000, 2001. All Rights Reserved.
17 *
18 * Contributor(s):
19 * Bill May wmay@cisco.com
20 */
21 #ifndef __UTIL_H__
22 #define __UTIL_H__
23
24 inline void* Malloc(size_t size) {
25 void* p = malloc(size);
26 if (p == NULL && size > 0) {
27 throw;
28 }
29 return p;
30 }
31
32 inline void imgcpy(
33 u_int8_t* dst, u_int8_t* src,
34 u_int16_t width, u_int16_t height, u_int16_t src_stride) {
35
36 if (width == src_stride) {
37 memcpy(dst, src, width * height);
38 } else {
39 for (u_int16_t i = 0; i < height; i++) {
40 memcpy(dst, src, width);
41 dst += width;
42 src += src_stride;
43 }
44 }
45 }
46
47 /*
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51
52 void error_message(const char *fmt, ...)
53 __attribute__((format(__printf__, 1, 2)))
54 ;
55
56 void debug_message(const char *fmt, ...)
57 __attribute__((format(__printf__, 1, 2)))
58 ;
59
60 void lib_message(int loglevel,
61 const char *lib,
62 const char *fmt,
63 va_list ap);
64
65 void message(int loglevel, const char *lib, const char *fmt, ...)
66 __attribute__((format(__printf__, 3, 4)))
67 ;
68
69 char *get_host_ip_address(void);
70
71 #ifdef __cplusplus
72 }
73 #endif
74 */
75 extern bool PrintDebugMessages;
76 #endif
77
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.