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.
8 * ----------------------------------------------------------------------------- */
10 char cvsroot_util_c[] = "$Id: util.c 9632 2007-01-03 20:58:19Z beazley $";
15 /* -----------------------------------------------------------------------------
16 * Swig_cparse_replace_descriptor()
18 * Replaces type descriptor string $descriptor() with the SWIG type descriptor
20 * ----------------------------------------------------------------------------- */
22 void Swig_cparse_replace_descriptor(String *s) {
28 while ((c = strstr(Char(s), "$descriptor("))) {
45 arg = NewString(tmp + 12);
46 t = Swig_cparse_type(arg);
54 mangle = SwigType_manglestr(t);
55 descriptor = NewStringf("SWIGTYPE%s", mangle);
60 Replace(s, tmp, descriptor, DOH_REPLACE_ANY);
65 Swig_error(Getfile(s), Getline(s), "Bad $descriptor() macro.\n");
71 /* -----------------------------------------------------------------------------
72 * cparse_normalize_void()
74 * This function is used to replace arguments of the form (void) with empty
76 * ----------------------------------------------------------------------------- */
78 void cparse_normalize_void(Node *n) {
79 String *decl = Getattr(n, "decl");
80 Parm *parms = Getattr(n, "parms");
82 if (SwigType_isfunction(decl)) {
83 if ((ParmList_len(parms) == 1) && (SwigType_type(Getattr(parms, "type")) == T_VOID)) {
84 Replaceall(decl, "f(void).", "f().");