/[resiprocate]/branches/b-identity-0505/ApiCheck.cxx
ViewVC logotype

Contents of /branches/b-identity-0505/ApiCheck.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4598 - (show annotations) (download)
Wed May 11 22:53:07 2005 UTC (14 years, 6 months ago) by derek
File size: 4560 byte(s)
set svn:eol-style to LF
1 #include <stdlib.h>
2 #include <iostream>
3 #include <iomanip>
4
5 #include "resiprocate/ApiCheck.hxx"
6 #include "resiprocate/ApiCheckList.hxx"
7
8 namespace resip
9 {
10
11 ApiCheck::ApiCheck( ApiEntry * list, int len)
12 {
13 int bad = 0;
14
15 ApiEntry* p = list;
16 ApiEntry* q = ::anonymous_resipApiSizeList;
17 int resipListLen = sizeof(::anonymous_resipApiSizeList)/sizeof(*::anonymous_resipApiSizeList);
18
19 if (list == ::anonymous_resipApiSizeList )
20 {
21 return;
22 }
23
24 if (resipListLen != len)
25 {
26 std::cerr << "reSIProcate Type verification list lengths are different."
27 << std::endl
28 << "\tEither the library and application are radically out of date"
29 << std::endl
30 << "application length: " << len << std::endl
31 << "reSIProcate length: " << resipListLen << std::endl;
32 ++bad;
33 }
34
35 std::cerr << std::setfill(' ')
36 << std::setw(34) << "Class" << ' '
37 << std::setw(8) << "App" << ' '
38 << std::setw(8) << "Lib" << ' '
39 << std::setw(8) << "Possible Culprit Flags"
40 << std::endl;
41
42 for(int i = 0 ; i < resipListLen && i < len; ++i)
43 {
44 bool oops = false;
45 if (strcmp(p[i].name, q[i].name))
46 {
47 std::cerr << "!!! Miss match entry for : (app)"
48 << p[i].name << " vs. (resip)" << q[i].name
49 << std::endl;
50 ++bad;
51 continue;
52 }
53
54 if (p[i].sz != q[i].sz)
55 {
56 ++bad;
57 oops = true;
58 }
59 const char w = oops?'!':' ';
60
61 std::cerr << w << w << w << std::setfill(' ')
62 << std::setw(30-strlen(p[i].name)) << "resip::"
63 << p[i].name << ' '
64 << std::setw(8) << p[i].sz << ' '
65 << std::setw(8) << q[i].sz << ' '
66 << (oops?p[i].culprits:"")
67 << std::endl;
68
69
70 }
71
72 if (bad)
73 {
74 std::cerr <<"SERIOUS COMPILATION / CONFIGURATION ERRORS -- ABORTING" << std::endl;
75 abort();
76 exit(bad);
77 }
78 std::cerr << std::endl;
79 }
80
81 }
82
83 /* ====================================================================
84 * The Vovida Software License, Version 1.0
85 *
86 * Copyright (c) 2000-2005 Vovida Networks, Inc. All rights reserved.
87 *
88 * Redistribution and use in source and binary forms, with or without
89 * modification, are permitted provided that the following conditions
90 * are met:
91 *
92 * 1. Redistributions of source code must retain the above copyright
93 * notice, this list of conditions and the following disclaimer.
94 *
95 * 2. Redistributions in binary form must reproduce the above copyright
96 * notice, this list of conditions and the following disclaimer in
97 * the documentation and/or other materials provided with the
98 * distribution.
99 *
100 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
101 * and "Vovida Open Communication Application Library (VOCAL)" must
102 * not be used to endorse or promote products derived from this
103 * software without prior written permission. For written
104 * permission, please contact vocal@vovida.org.
105 *
106 * 4. Products derived from this software may not be called "VOCAL", nor
107 * may "VOCAL" appear in their name, without prior written
108 * permission of Vovida Networks, Inc.
109 *
110 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
111 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
112 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
113 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
114 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
115 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
116 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
117 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
118 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
119 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
120 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
121 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
122 * DAMAGE.
123 *
124 * ====================================================================
125 *
126 * This software consists of voluntary contributions made by Vovida
127 * Networks, Inc. and many individuals on behalf of Vovida Networks,
128 * Inc. For more information on Vovida Networks, Inc., please see
129 * <http://www.vovida.org/>.
130 *
131 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27