PageRenderTime 18ms CodeModel.GetById 14ms app.highlight 3ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/Root-branch-php-utl/SWIG/Source/Swig/warn.c

#
C | 40 lines | 16 code | 10 blank | 14 comment | 2 complexity | 192fd7cb569ae90910398b9a4afa7b29 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
 1/* ----------------------------------------------------------------------------- 
 2 * See the LICENSE file for information on copyright, usage and redistribution
 3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
 4 *
 5 * warn.c
 6 *
 7 * SWIG warning framework.  This was added to warn developers about 
 8 * deprecated APIs and other features.
 9 * ----------------------------------------------------------------------------- */
10
11char cvsroot_warn_c[] = "$Header$";
12
13#include "swig.h"
14
15static Hash *warnings = 0;
16
17/* -----------------------------------------------------------------------------
18 * Swig_warn()
19 * 
20 * Issue a warning
21 * ----------------------------------------------------------------------------- */
22
23void
24Swig_warn(const char *filename, int line, const char *msg) {
25  String *key;
26  if (!warnings) {
27    warnings = NewHash();
28  }
29  key = NewStringf("%s:%d", filename,line);
30  if (!Getattr(warnings,key)) {
31    Printf(stderr,"swig-dev warning:%s:%d:%s\n", filename, line, msg);
32    Setattr(warnings,key,key);
33  }
34  Delete(key);
35}
36
37	
38		
39
40