cat/dcl/dsl: remove more sgml related files
[gtk-doc.git] / gtkdoc-scangobj.in
bloba2d91b0877a1914f624a0eb62382af3c5d3adb2b
1 #!@PERL@ -w
2 # -*- cperl -*-
4 # gtk-doc - GTK DocBook documentation generator.
5 # Copyright (C) 1998  Damon Chaplin
6 #               2007-2016  Stefan Sauer
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 # This gets information about object hierarchies and signals
25 # by compiling a small C program. CFLAGS and LDFLAGS must be
26 # set appropriately before running this script.
29 use strict;
30 use Getopt::Long;
32 push @INC, '@PACKAGE_DATA_DIR@';
33 require "gtkdoc-common.pl";
35 # Options
37 # name of documentation module
38 my $MODULE;
39 my $TYPES_FILE;
40 my $NO_GTK_INIT;
41 my $OUTPUT_DIR;
42 my $VERBOSE;
43 my $PRINT_VERSION;
44 my $PRINT_HELP;
45 my $TYPE_INIT_FUNC="#if !GLIB_CHECK_VERSION(2,35,0)\n  g_type_init();\n  #endif\n  g_type_class_ref(G_TYPE_OBJECT)";
46 my $QUERY_CHILD_PROPERTIES;
48 my $CC;
49 my $LD;
50 my $CFLAGS;
51 my $LDFLAGS;
52 my $RUN;
54 # --nogtkinit is deprecated, as it is the default now anyway.
55 my %optctl = (module => \$MODULE,
56            types => \$TYPES_FILE,
57            nogtkinit => \$NO_GTK_INIT,
58            'type-init-func' => \$TYPE_INIT_FUNC,
59            'query-child-properties' => \$QUERY_CHILD_PROPERTIES,
60            'output-dir' => \$OUTPUT_DIR,
61            'cc' => \$CC,
62            'ld' => \$LD,
63            'cflags' => \$CFLAGS,
64            'ldflags' => \$LDFLAGS,
65            'run' => \$RUN,
66            'verbose' => \$VERBOSE,
67            'version' => \$PRINT_VERSION,
68            'help' => \$PRINT_HELP);
70 GetOptions(\%optctl, "module=s", "types:s", "output-dir:s", "nogtkinit", "type-init-func:s", "query-child-properties:s", "cc:s", "ld:s", "run:s", "cflags:s", "ldflags:s", "verbose", "version", "help");
72 if ($NO_GTK_INIT) {
73   # Do nothing. This just avoids a warning.
74   # the option is not used anymore
77 if ($PRINT_VERSION) {
78     print "@VERSION@\n";
79     exit 0;
82 if (!$MODULE) {
83     $PRINT_HELP = 1;
86 if ($PRINT_HELP) {
87     print <<EOF;
88 gtkdoc-scangobj version @VERSION@ - introspect g-objects
90 --module=MODULE_NAME          Name of the doc module being parsed
91 --types=FILE                  The name of the file to store the types in
92 --type-init-func=FUNC         The init function to call instead of g_type_init()
93 --query-child-properties=FUNC A function that returns a list of child
94                               properties for a class
95 --output-dir=DIRNAME          The directory where the results are stored
96 --cc=COMPILER                 The compiler to use
97 --ld=LINKER                   The linker to use
98 --run=RUN                     Command for running the scanner
99 --cflags=CFLAGS               Compiler flags
100 --ldflags=LDFLAGS             Linker flags
101 --verbose                     Print extra output while processing
102 --version                     Print the version of this program
103 --help                        Print this help
105     exit 0;
108 $OUTPUT_DIR = $OUTPUT_DIR ? $OUTPUT_DIR : ".";
110 $TYPES_FILE = $TYPES_FILE ? $TYPES_FILE : "$OUTPUT_DIR/$MODULE.types";
112 open (TYPES, $TYPES_FILE) || die "Cannot open $TYPES_FILE: $!\n";
113 open (OUTPUT, ">$MODULE-scan.c") || die "Cannot open $MODULE-scan.c: $!\n";
115 my $old_signals_filename = "$OUTPUT_DIR/$MODULE.signals";
116 my $new_signals_filename = "$OUTPUT_DIR/$MODULE.signals.new";
117 my $old_hierarchy_filename = "$OUTPUT_DIR/$MODULE.hierarchy";
118 my $new_hierarchy_filename = "$OUTPUT_DIR/$MODULE.hierarchy.new";
119 my $old_interfaces_filename = "$OUTPUT_DIR/$MODULE.interfaces";
120 my $new_interfaces_filename = "$OUTPUT_DIR/$MODULE.interfaces.new";
121 my $old_prerequisites_filename = "$OUTPUT_DIR/$MODULE.prerequisites";
122 my $new_prerequisites_filename = "$OUTPUT_DIR/$MODULE.prerequisites.new";
123 my $old_args_filename = "$OUTPUT_DIR/$MODULE.args";
124 my $new_args_filename = "$OUTPUT_DIR/$MODULE.args.new";
126 # generate a C program to scan the types
128 my $includes = "";
129 my $forward_decls = "";
130 my $get_types = "";
131 my $ntypes = 1;
133 for (<TYPES>) {
134     if (/^#include/) {
135         $includes .= $_;
136     } elsif (/^gnome_keyring_item_info_get_type$/) {
137         # HACK: This isn't really a GObject type so skip it.
138         next;
139     } elsif (/^%/) {
140         next;
141     } elsif (/^\s*$/) {
142         next;
143     } else {
144         chomp;
145         $get_types .= "  object_types[i++] = $_ ();\n";
146         $forward_decls .= "extern GType $_ (void);\n";
147         $ntypes++;
148     }
151 print OUTPUT <<EOT;
152 #include <string.h>
153 #include <stdlib.h>
154 #include <stdio.h>
155 #include <errno.h>
156 #include <glib-object.h>
160 if ($includes) {
161     print OUTPUT $includes;
162 } else {
163     print OUTPUT $forward_decls;
166 if ($QUERY_CHILD_PROPERTIES) {
167   print OUTPUT <<EOT;
168 extern GParamSpec** $QUERY_CHILD_PROPERTIES (gpointer class, guint *n_properties);
172 print OUTPUT <<EOT;
174 #ifdef GTK_IS_WIDGET_CLASS
175 #include <gtk/gtk.h>
176 #endif
177 static GType object_types[$ntypes];
179 static GType *
180 get_object_types (void)
182   gpointer g_object_class;
183   gint i = 0;
185 ${get_types}
186   object_types[i] = G_TYPE_INVALID;
188   /* reference the GObjectClass to initialize the param spec pool
189    * potentially needed by interfaces. See http://bugs.gnome.org/571820 */
190   g_object_class = g_type_class_ref (G_TYPE_OBJECT);
192   /* Need to make sure all the types are loaded in and initialize
193    * their signals and properties.
194    */
195   for (i=0; object_types[i]; i++) {
196     if (G_TYPE_IS_CLASSED (object_types[i]))
197       g_type_class_ref (object_types[i]);
198     if (G_TYPE_IS_INTERFACE (object_types[i]))
199       g_type_default_interface_ref (object_types[i]);
200   }
202   g_type_class_unref (g_object_class);
204   return object_types;
208  * This uses GObject type functions to output signal prototypes and the object
209  * hierarchy.
210  */
212 /* The output files */
213 const gchar *signals_filename = "$new_signals_filename";
214 const gchar *hierarchy_filename = "$new_hierarchy_filename";
215 const gchar *interfaces_filename = "$new_interfaces_filename";
216 const gchar *prerequisites_filename = "$new_prerequisites_filename";
217 const gchar *args_filename = "$new_args_filename";
219 static void output_signals (void);
220 static void output_object_signals (FILE *fp,
221                                    GType object_type);
222 static void output_object_signal (FILE *fp,
223                                   const gchar *object_class_name,
224                                   guint signal_id);
225 static const gchar * get_type_name (GType type,
226                                     gboolean * is_pointer);
227 static void output_object_hierarchy (void);
228 static void output_hierarchy (FILE *fp,
229                               GType type,
230                               guint level);
232 static void output_object_interfaces (void);
233 static void output_interfaces (FILE *fp,
234                                GType type);
236 static void output_interface_prerequisites (void);
237 static void output_prerequisites (FILE *fp,
238                                   GType type);
240 static void output_args (void);
241 static void output_object_args (FILE *fp, GType object_type);
244 main (int argc, char *argv[])
246   $TYPE_INIT_FUNC;
248   get_object_types ();
250   output_signals ();
251   output_object_hierarchy ();
252   output_object_interfaces ();
253   output_interface_prerequisites ();
254   output_args ();
256   return 0;
259 static void
260 output_signals (void)
262   FILE *fp;
263   gint i;
265   fp = fopen (signals_filename, "w");
266   if (fp == NULL) {
267     g_warning ("Couldn't open output file: %s : %s", signals_filename, g_strerror(errno));
268     return;
269   }
271   for (i = 0; object_types[i]; i++)
272     output_object_signals (fp, object_types[i]);
274   fclose (fp);
277 static gint
278 compare_signals (const void *a, const void *b)
280   const guint *signal_a = a;
281   const guint *signal_b = b;
283   return strcmp (g_signal_name (*signal_a), g_signal_name (*signal_b));
286 /* This outputs all the signals of one object. */
287 static void
288 output_object_signals (FILE *fp, GType object_type)
290   const gchar *object_class_name;
291   guint *signals, n_signals;
292   guint sig;
294   if (G_TYPE_IS_INSTANTIATABLE (object_type) ||
295       G_TYPE_IS_INTERFACE (object_type)) {
297     object_class_name = g_type_name (object_type);
299     signals = g_signal_list_ids (object_type, &n_signals);
300     qsort (signals, n_signals, sizeof (guint), compare_signals);
302     for (sig = 0; sig < n_signals; sig++) {
303        output_object_signal (fp, object_class_name, signals[sig]);
304     }
305     g_free (signals);
306   }
309 /* This outputs one signal. */
310 static void
311 output_object_signal (FILE *fp,
312                       const gchar *object_name,
313                       guint signal_id)
315   GSignalQuery query_info;
316   const gchar *type_name, *ret_type, *object_arg, *arg_name;
317   gchar *pos, *object_arg_lower;
318   gboolean is_pointer;
319   gchar buffer[1024];
320   guint i, param;
321   gint param_num, widget_num, event_num, callback_num;
322   gint *arg_num;
323   gchar signal_name[128];
324   gchar flags[16];
326   /*  g_print ("Object: %s Signal: %u\\n", object_name, signal_id);*/
328   param_num = 1;
329   widget_num = event_num = callback_num = 0;
331   g_signal_query (signal_id, &query_info);
333   /* Output the signal object type and the argument name. We assume the
334    * type is a pointer - I think that is OK. We remove "Gtk" or "Gnome" and
335    * convert to lower case for the argument name. */
336   pos = buffer;
337   sprintf (pos, "%s ", object_name);
338   pos += strlen (pos);
340   /* Try to come up with a sensible variable name for the first arg
341    * It chops off 2 know prefixes :/ and makes the name lowercase
342    * It should replace lowercase -> uppercase with '_'
343    * GFileMonitor -> file_monitor
344    * GIOExtensionPoint -> extension_point
345    * GtkTreeView -> tree_view
346    * if 2nd char is upper case too
347    *   search for first lower case and go back one char
348    * else
349    *   search for next upper case
350    */
351   if (!strncmp (object_name, "Gtk", 3))
352     object_arg = object_name + 3;
353   else if (!strncmp (object_name, "Gnome", 5))
354     object_arg = object_name + 5;
355   else
356     object_arg = object_name;
358   object_arg_lower = g_ascii_strdown (object_arg, -1);
359   sprintf (pos, "*%s\\n", object_arg_lower);
360   pos += strlen (pos);
361   if (!strncmp (object_arg_lower, "widget", 6))
362     widget_num = 2;
363   g_free(object_arg_lower);
365   /* Convert signal name to use underscores rather than dashes '-'. */
366   strncpy (signal_name, query_info.signal_name, 127);
367   signal_name[127] = '\\0';
368   for (i = 0; signal_name[i]; i++) {
369     if (signal_name[i] == '-')
370       signal_name[i] = '_';
371   }
373   /* Output the signal parameters. */
374   for (param = 0; param < query_info.n_params; param++) {
375     type_name = get_type_name (query_info.param_types[param] & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer);
377     /* Most arguments to the callback are called "arg1", "arg2", etc.
378        GtkWidgets are called "widget", "widget2", ...
379        GtkCallbacks are called "callback", "callback2", ... */
380     if (!strcmp (type_name, "GtkWidget")) {
381       arg_name = "widget";
382       arg_num = &widget_num;
383     }
384     else if (!strcmp (type_name, "GtkCallback")
385              || !strcmp (type_name, "GtkCCallback")) {
386       arg_name = "callback";
387       arg_num = &callback_num;
388     }
389     else {
390       arg_name = "arg";
391       arg_num = &param_num;
392     }
393     sprintf (pos, "%s ", type_name);
394     pos += strlen (pos);
396     if (!arg_num || *arg_num == 0)
397       sprintf (pos, "%s%s\\n", is_pointer ? "*" : " ", arg_name);
398     else
399       sprintf (pos, "%s%s%i\\n", is_pointer ? "*" : " ", arg_name,
400                *arg_num);
401     pos += strlen (pos);
403     if (arg_num) {
404       if (*arg_num == 0)
405         *arg_num = 2;
406       else
407         *arg_num += 1;
408     }
409   }
411   pos = flags;
412   /* We use one-character flags for simplicity. */
413   if (query_info.signal_flags & G_SIGNAL_RUN_FIRST)
414     *pos++ = 'f';
415   if (query_info.signal_flags & G_SIGNAL_RUN_LAST)
416     *pos++ = 'l';
417   if (query_info.signal_flags & G_SIGNAL_RUN_CLEANUP)
418     *pos++ = 'c';
419   if (query_info.signal_flags & G_SIGNAL_NO_RECURSE)
420     *pos++ = 'r';
421   if (query_info.signal_flags & G_SIGNAL_DETAILED)
422     *pos++ = 'd';
423   if (query_info.signal_flags & G_SIGNAL_ACTION)
424     *pos++ = 'a';
425   if (query_info.signal_flags & G_SIGNAL_NO_HOOKS)
426     *pos++ = 'h';
427   *pos = 0;
429   /* Output the return type and function name. */
430   ret_type = get_type_name (query_info.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer);
432   fprintf (fp,
433            "<SIGNAL>\\n<NAME>%s::%s</NAME>\\n<RETURNS>%s%s</RETURNS>\\n<FLAGS>%s</FLAGS>\\n%s</SIGNAL>\\n\\n",
434            object_name, query_info.signal_name, ret_type, is_pointer ? "*" : "", flags, buffer);
438 /* Returns the type name to use for a signal argument or return value, given
439    the GtkType from the signal info. It also sets is_pointer to TRUE if the
440    argument needs a '*' since it is a pointer. */
441 static const gchar *
442 get_type_name (GType type, gboolean * is_pointer)
444   const gchar *type_name;
446   *is_pointer = FALSE;
447   type_name = g_type_name (type);
449   switch (type) {
450   case G_TYPE_NONE:
451   case G_TYPE_CHAR:
452   case G_TYPE_UCHAR:
453   case G_TYPE_BOOLEAN:
454   case G_TYPE_INT:
455   case G_TYPE_UINT:
456   case G_TYPE_LONG:
457   case G_TYPE_ULONG:
458   case G_TYPE_FLOAT:
459   case G_TYPE_DOUBLE:
460   case G_TYPE_POINTER:
461     /* These all have normal C type names so they are OK. */
462     return type_name;
464   case G_TYPE_STRING:
465     /* A GtkString is really a gchar*. */
466     *is_pointer = TRUE;
467     return "gchar";
469   case G_TYPE_ENUM:
470   case G_TYPE_FLAGS:
471     /* We use a gint for both of these. Hopefully a subtype with a decent
472        name will be registered and used instead, as GTK+ does itself. */
473     return "gint";
475   case G_TYPE_BOXED:
476     /* The boxed type shouldn't be used itself, only subtypes. Though we
477        return 'gpointer' just in case. */
478     return "gpointer";
480   case G_TYPE_PARAM:
481     /* A GParam is really a GParamSpec*. */
482     *is_pointer = TRUE;
483     return "GParamSpec";
485 #if GLIB_CHECK_VERSION (2, 25, 9)
486   case G_TYPE_VARIANT:
487     *is_pointer = TRUE;
488     return "GVariant";
489 #endif
491 default:
492     break;
493   }
495   /* For all GObject subclasses we can use the class name with a "*",
496      e.g. 'GtkWidget *'. */
497   if (g_type_is_a (type, G_TYPE_OBJECT))
498     *is_pointer = TRUE;
500   /* Also catch non GObject root types */
501   if (G_TYPE_IS_CLASSED (type))
502     *is_pointer = TRUE;
504   /* All boxed subtypes will be pointers as well. */
505   /* Exception: GStrv */
506   if (g_type_is_a (type, G_TYPE_BOXED) &&
507       !g_type_is_a (type, G_TYPE_STRV))
508     *is_pointer = TRUE;
510   /* All pointer subtypes will be pointers as well. */
511   if (g_type_is_a (type, G_TYPE_POINTER))
512     *is_pointer = TRUE;
514   /* But enums are not */
515   if (g_type_is_a (type, G_TYPE_ENUM) ||
516       g_type_is_a (type, G_TYPE_FLAGS))
517     *is_pointer = FALSE;
519   return type_name;
523 /* This outputs the hierarchy of all objects which have been initialized,
524    i.e. by calling their XXX_get_type() initialization function. */
525 static void
526 output_object_hierarchy (void)
528   FILE *fp;
529   gint i,j;
530   GType root, type;
531   GType root_types[$ntypes] = { G_TYPE_INVALID, };
533   fp = fopen (hierarchy_filename, "w");
534   if (fp == NULL) {
535     g_warning ("Couldn't open output file: %s : %s", hierarchy_filename, g_strerror(errno));
536     return;
537   }
538   output_hierarchy (fp, G_TYPE_OBJECT, 0);
539   output_hierarchy (fp, G_TYPE_INTERFACE, 0);
541   for (i=0; object_types[i]; i++) {
542     root = object_types[i];
543     while ((type = g_type_parent (root))) {
544       root = type;
545     }
546     if ((root != G_TYPE_OBJECT) && (root != G_TYPE_INTERFACE)) {
547       for (j=0; root_types[j]; j++) {
548         if (root == root_types[j]) {
549           root = G_TYPE_INVALID; break;
550         }
551       }
552       if(root) {
553         root_types[j] = root;
554         output_hierarchy (fp, root, 0);
555       }
556     }
557   }
559   fclose (fp);
562 /* This is called recursively to output the hierarchy of a object. */
563 static void
564 output_hierarchy (FILE  *fp,
565                   GType  type,
566                   guint   level)
568   guint i;
569   GType *children;
570   guint n_children;
572   if (!type)
573     return;
575   for (i = 0; i < level; i++)
576     fprintf (fp, "  ");
577   fprintf (fp, "%s\\n", g_type_name (type));
579   children = g_type_children (type, &n_children);
581   for (i=0; i < n_children; i++)
582     output_hierarchy (fp, children[i], level + 1);
584   g_free (children);
587 static void output_object_interfaces (void)
589   guint i;
590   FILE *fp;
592   fp = fopen (interfaces_filename, "w");
593   if (fp == NULL) {
594     g_warning ("Couldn't open output file: %s : %s", interfaces_filename, g_strerror(errno));
595     return;
596   }
597   output_interfaces (fp, G_TYPE_OBJECT);
599   for (i = 0; object_types[i]; i++) {
600     if (!g_type_parent (object_types[i]) &&
601         (object_types[i] != G_TYPE_OBJECT) &&
602         G_TYPE_IS_INSTANTIATABLE (object_types[i])) {
603       output_interfaces (fp, object_types[i]);
604     }
605   }
606   fclose (fp);
609 static void
610 output_interfaces (FILE  *fp,
611                    GType  type)
613   guint i;
614   GType *children, *interfaces;
615   guint n_children, n_interfaces;
617   if (!type)
618     return;
620   interfaces = g_type_interfaces (type, &n_interfaces);
622   if (n_interfaces > 0) {
623     fprintf (fp, "%s", g_type_name (type));
624     for (i=0; i < n_interfaces; i++)
625         fprintf (fp, " %s", g_type_name (interfaces[i]));
626     fprintf (fp, "\\n");
627    }
628   g_free (interfaces);
630   children = g_type_children (type, &n_children);
632   for (i=0; i < n_children; i++)
633     output_interfaces (fp, children[i]);
635   g_free (children);
638 static void output_interface_prerequisites (void)
640   FILE *fp;
642   fp = fopen (prerequisites_filename, "w");
643   if (fp == NULL) {
644     g_warning ("Couldn't open output file: %s : %s", prerequisites_filename, g_strerror(errno));
645     return;
646   }
647   output_prerequisites (fp, G_TYPE_INTERFACE);
648   fclose (fp);
651 static void
652 output_prerequisites (FILE  *fp,
653                       GType  type)
655 #if GLIB_CHECK_VERSION(2,1,0)
656   guint i;
657   GType *children, *prerequisites;
658   guint n_children, n_prerequisites;
660   if (!type)
661     return;
663   prerequisites = g_type_interface_prerequisites (type, &n_prerequisites);
665   if (n_prerequisites > 0) {
666     fprintf (fp, "%s", g_type_name (type));
667     for (i=0; i < n_prerequisites; i++)
668         fprintf (fp, " %s", g_type_name (prerequisites[i]));
669     fprintf (fp, "\\n");
670    }
671   g_free (prerequisites);
673   children = g_type_children (type, &n_children);
675   for (i=0; i < n_children; i++)
676     output_prerequisites (fp, children[i]);
678   g_free (children);
679 #endif
682 static void
683 output_args (void)
685   FILE *fp;
686   gint i;
688   fp = fopen (args_filename, "w");
689   if (fp == NULL) {
690     g_warning ("Couldn't open output file: %s : %s", args_filename, g_strerror(errno));
691     return;
692   }
694   for (i = 0; object_types[i]; i++) {
695     output_object_args (fp, object_types[i]);
696   }
698   fclose (fp);
701 static gint
702 compare_param_specs (const void *a, const void *b)
704   GParamSpec *spec_a = *(GParamSpec **)a;
705   GParamSpec *spec_b = *(GParamSpec **)b;
707   return strcmp (g_param_spec_get_name (spec_a), g_param_spec_get_name (spec_b));
710 /* Its common to have unsigned properties restricted
711  * to the signed range. Therefore we make this look
712  * a bit nicer by spelling out the max constants.
713  */
715 /* Don't use "==" with floats, it might trigger a gcc warning.  */
716 #define GTKDOC_COMPARE_FLOAT(x, y) (x <= y && x >= y)
718 static gchar*
719 describe_double_constant (gdouble value)
721   gchar *desc;
723   if (GTKDOC_COMPARE_FLOAT (value, G_MAXDOUBLE))
724     desc = g_strdup ("G_MAXDOUBLE");
725   else if (GTKDOC_COMPARE_FLOAT (value, G_MINDOUBLE))
726     desc = g_strdup ("G_MINDOUBLE");
727   else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXDOUBLE))
728     desc = g_strdup ("-G_MAXDOUBLE");
729   else if (GTKDOC_COMPARE_FLOAT (value, G_MAXFLOAT))
730     desc = g_strdup ("G_MAXFLOAT");
731   else if (GTKDOC_COMPARE_FLOAT (value, G_MINFLOAT))
732     desc = g_strdup ("G_MINFLOAT");
733   else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXFLOAT))
734     desc = g_strdup ("-G_MAXFLOAT");
735   else{
736     /* make sure floats are output with a decimal dot irrespective of
737     * current locale. Use formatd since we want human-readable numbers
738     * and do not need the exact same bit representation when deserialising */
739     desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE);
740     g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", value);
741   }
743   return desc;
746 static gchar*
747 describe_signed_constant (gsize size, gint64 value)
749   gchar *desc = NULL;
751   switch (size) {
752     case 2:
753       if (sizeof (int) == 2) {
754         if (value == G_MAXINT)
755           desc = g_strdup ("G_MAXINT");
756         else if (value == G_MININT)
757           desc = g_strdup ("G_MININT");
758       }
759       break;
760     case 4:
761       if (sizeof (int) == 4) {
762         if (value == G_MAXINT)
763           desc = g_strdup ("G_MAXINT");
764         else if (value == G_MININT)
765           desc = g_strdup ("G_MININT");
766       }
767       if (value == G_MAXLONG)
768         desc = g_strdup ("G_MAXLONG");
769       else if (value == G_MINLONG)
770         desc = g_strdup ("G_MINLONG");
771       break;
772     case 8:
773       if (value == G_MAXINT64)
774         desc = g_strdup ("G_MAXINT64");
775       else if (value == G_MININT64)
776         desc = g_strdup ("G_MININT64");
777       break;
778     default:
779       break;
780   }
781   if (!desc)
782     desc = g_strdup_printf ("%" G_GINT64_FORMAT, value);
784   return desc;
787 static gchar*
788 describe_unsigned_constant (gsize size, guint64 value)
790   gchar *desc = NULL;
792   switch (size) {
793     case 2:
794       if (sizeof (int) == 2) {
795         if (value == (guint64)G_MAXINT)
796           desc = g_strdup ("G_MAXINT");
797         else if (value == G_MAXUINT)
798           desc = g_strdup ("G_MAXUINT");
799       }
800       break;
801     case 4:
802       if (sizeof (int) == 4) {
803         if (value == (guint64)G_MAXINT)
804           desc = g_strdup ("G_MAXINT");
805         else if (value == G_MAXUINT)
806           desc = g_strdup ("G_MAXUINT");
807       }
808       if (value == (guint64)G_MAXLONG)
809         desc = g_strdup ("G_MAXLONG");
810       else if (value == G_MAXULONG)
811         desc = g_strdup ("G_MAXULONG");
812       break;
813     case 8:
814       if (value == G_MAXINT64)
815         desc = g_strdup ("G_MAXINT64");
816       else if (value == G_MAXUINT64)
817         desc = g_strdup ("G_MAXUINT64");
818       break;
819     default:
820       break;
821   }
822   if (!desc)
823     desc = g_strdup_printf ("%" G_GUINT64_FORMAT, value);
825   return desc;
828 static gchar*
829 describe_type (GParamSpec *spec)
831   gchar *desc;
832   gchar *lower;
833   gchar *upper;
835   if (G_IS_PARAM_SPEC_CHAR (spec)) {
836     GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec);
838     lower = describe_signed_constant (sizeof(gchar), pspec->minimum);
839     upper = describe_signed_constant (sizeof(gchar), pspec->maximum);
840     if (pspec->minimum == G_MININT8 && pspec->maximum == G_MAXINT8)
841       desc = g_strdup ("");
842     else if (pspec->minimum == G_MININT8)
843       desc = g_strdup_printf ("<= %s", upper);
844     else if (pspec->maximum == G_MAXINT8)
845       desc = g_strdup_printf (">= %s", lower);
846     else
847       desc = g_strdup_printf ("[%s,%s]", lower, upper);
848     g_free (lower);
849     g_free (upper);
850   }
851   else if (G_IS_PARAM_SPEC_UCHAR (spec)) {
852     GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec);
854     lower = describe_unsigned_constant (sizeof(guchar), pspec->minimum);
855     upper = describe_unsigned_constant (sizeof(guchar), pspec->maximum);
856     if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT8)
857       desc = g_strdup ("");
858     else if (pspec->minimum == 0)
859       desc = g_strdup_printf ("<= %s", upper);
860     else if (pspec->maximum == G_MAXUINT8)
861       desc = g_strdup_printf (">= %s", lower);
862     else
863       desc = g_strdup_printf ("[%s,%s]", lower, upper);
864     g_free (lower);
865     g_free (upper);
866   }
867   else if (G_IS_PARAM_SPEC_INT (spec)) {
868     GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec);
870     lower = describe_signed_constant (sizeof(gint), pspec->minimum);
871     upper = describe_signed_constant (sizeof(gint), pspec->maximum);
872     if (pspec->minimum == G_MININT && pspec->maximum == G_MAXINT)
873       desc = g_strdup ("");
874     else if (pspec->minimum == G_MININT)
875       desc = g_strdup_printf ("<= %s", upper);
876     else if (pspec->maximum == G_MAXINT)
877       desc = g_strdup_printf (">= %s", lower);
878     else
879       desc = g_strdup_printf ("[%s,%s]", lower, upper);
880     g_free (lower);
881     g_free (upper);
882   }
883   else if (G_IS_PARAM_SPEC_UINT (spec)) {
884     GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec);
886     lower = describe_unsigned_constant (sizeof(guint), pspec->minimum);
887     upper = describe_unsigned_constant (sizeof(guint), pspec->maximum);
888     if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT)
889       desc = g_strdup ("");
890     else if (pspec->minimum == 0)
891       desc = g_strdup_printf ("<= %s", upper);
892     else if (pspec->maximum == G_MAXUINT)
893       desc = g_strdup_printf (">= %s", lower);
894     else
895       desc = g_strdup_printf ("[%s,%s]", lower, upper);
896     g_free (lower);
897     g_free (upper);
898   }
899   else if (G_IS_PARAM_SPEC_LONG (spec)) {
900     GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec);
902     lower = describe_signed_constant (sizeof(glong), pspec->minimum);
903     upper = describe_signed_constant (sizeof(glong), pspec->maximum);
904     if (pspec->minimum == G_MINLONG && pspec->maximum == G_MAXLONG)
905       desc = g_strdup ("");
906     else if (pspec->minimum == G_MINLONG)
907       desc = g_strdup_printf ("<= %s", upper);
908     else if (pspec->maximum == G_MAXLONG)
909       desc = g_strdup_printf (">= %s", lower);
910     else
911       desc = g_strdup_printf ("[%s,%s]", lower, upper);
912     g_free (lower);
913     g_free (upper);
914   }
915   else if (G_IS_PARAM_SPEC_ULONG (spec)) {
916     GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec);
918     lower = describe_unsigned_constant (sizeof(gulong), pspec->minimum);
919     upper = describe_unsigned_constant (sizeof(gulong), pspec->maximum);
920     if (pspec->minimum == 0 && pspec->maximum == G_MAXULONG)
921       desc = g_strdup ("");
922     else if (pspec->minimum == 0)
923       desc = g_strdup_printf ("<= %s", upper);
924     else if (pspec->maximum == G_MAXULONG)
925       desc = g_strdup_printf (">= %s", lower);
926     else
927       desc = g_strdup_printf ("[%s,%s]", lower, upper);
928     g_free (lower);
929     g_free (upper);
930   }
931   else if (G_IS_PARAM_SPEC_INT64 (spec)) {
932     GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec);
934     lower = describe_signed_constant (sizeof(gint64), pspec->minimum);
935     upper = describe_signed_constant (sizeof(gint64), pspec->maximum);
936     if (pspec->minimum == G_MININT64 && pspec->maximum == G_MAXINT64)
937       desc = g_strdup ("");
938     else if (pspec->minimum == G_MININT64)
939       desc = g_strdup_printf ("<= %s", upper);
940     else if (pspec->maximum == G_MAXINT64)
941       desc = g_strdup_printf (">= %s", lower);
942     else
943       desc = g_strdup_printf ("[%s,%s]", lower, upper);
944     g_free (lower);
945     g_free (upper);
946   }
947   else if (G_IS_PARAM_SPEC_UINT64 (spec)) {
948     GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec);
950     lower = describe_unsigned_constant (sizeof(guint64), pspec->minimum);
951     upper = describe_unsigned_constant (sizeof(guint64), pspec->maximum);
952     if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT64)
953       desc = g_strdup ("");
954     else if (pspec->minimum == 0)
955       desc = g_strdup_printf ("<= %s", upper);
956     else if (pspec->maximum == G_MAXUINT64)
957       desc = g_strdup_printf (">= %s", lower);
958     else
959       desc = g_strdup_printf ("[%s,%s]", lower, upper);
960     g_free (lower);
961     g_free (upper);
962   }
963   else if (G_IS_PARAM_SPEC_FLOAT (spec)) {
964     GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec);
966     lower = describe_double_constant (pspec->minimum);
967     upper = describe_double_constant (pspec->maximum);
968     if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXFLOAT)) {
969       if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT))
970         desc = g_strdup ("");
971       else
972         desc = g_strdup_printf ("<= %s", upper);
973     }
974     else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT))
975       desc = g_strdup_printf (">= %s", lower);
976     else
977       desc = g_strdup_printf ("[%s,%s]", lower, upper);
978     g_free (lower);
979     g_free (upper);
980   }
981   else if (G_IS_PARAM_SPEC_DOUBLE (spec)) {
982     GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec);
984     lower = describe_double_constant (pspec->minimum);
985     upper = describe_double_constant (pspec->maximum);
986     if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXDOUBLE)) {
987       if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE))
988         desc = g_strdup ("");
989       else
990         desc = g_strdup_printf ("<= %s", upper);
991     }
992     else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE))
993       desc = g_strdup_printf (">= %s", lower);
994     else
995       desc = g_strdup_printf ("[%s,%s]", lower, upper);
996     g_free (lower);
997     g_free (upper);
998   }
999 #if GLIB_CHECK_VERSION (2, 12, 0)
1000   else if (G_IS_PARAM_SPEC_GTYPE (spec)) {
1001     GParamSpecGType *pspec = G_PARAM_SPEC_GTYPE (spec);
1002     gboolean is_pointer;
1004     desc = g_strdup (get_type_name (pspec->is_a_type, &is_pointer));
1005   }
1006 #endif
1007 #if GLIB_CHECK_VERSION (2, 25, 9)
1008   else if (G_IS_PARAM_SPEC_VARIANT (spec)) {
1009     GParamSpecVariant *pspec = G_PARAM_SPEC_VARIANT (spec);
1010     gchar *variant_type;
1012     variant_type = g_variant_type_dup_string (pspec->type);
1013     desc = g_strdup_printf ("GVariant<%s>", variant_type);
1014     g_free (variant_type);
1015   }
1016 #endif
1017   else {
1018     desc = g_strdup ("");
1019   }
1021   return desc;
1024 static gchar*
1025 describe_default (GParamSpec *spec)
1027   gchar *desc;
1029   if (G_IS_PARAM_SPEC_CHAR (spec)) {
1030     GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec);
1032     desc = g_strdup_printf ("%d", pspec->default_value);
1033   }
1034   else if (G_IS_PARAM_SPEC_UCHAR (spec)) {
1035     GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec);
1037     desc = g_strdup_printf ("%u", pspec->default_value);
1038   }
1039   else if (G_IS_PARAM_SPEC_BOOLEAN (spec)) {
1040     GParamSpecBoolean *pspec = G_PARAM_SPEC_BOOLEAN (spec);
1042     desc = g_strdup_printf ("%s", pspec->default_value ? "TRUE" : "FALSE");
1043   }
1044   else if (G_IS_PARAM_SPEC_INT (spec)) {
1045     GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec);
1047     desc = g_strdup_printf ("%d", pspec->default_value);
1048   }
1049   else if (G_IS_PARAM_SPEC_UINT (spec)) {
1050     GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec);
1052     desc = g_strdup_printf ("%u", pspec->default_value);
1053   }
1054   else if (G_IS_PARAM_SPEC_LONG (spec)) {
1055     GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec);
1057     desc = g_strdup_printf ("%ld", pspec->default_value);
1058   }
1059   else if (G_IS_PARAM_SPEC_LONG (spec)) {
1060     GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec);
1062     desc = g_strdup_printf ("%lu", pspec->default_value);
1063   }
1064   else if (G_IS_PARAM_SPEC_INT64 (spec)) {
1065     GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec);
1067     desc = g_strdup_printf ("%" G_GINT64_FORMAT, pspec->default_value);
1068   }
1069   else if (G_IS_PARAM_SPEC_UINT64 (spec))
1070     {
1071       GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec);
1073       desc = g_strdup_printf ("%" G_GUINT64_FORMAT, pspec->default_value);
1074     }
1075   else if (G_IS_PARAM_SPEC_UNICHAR (spec)) {
1076     GParamSpecUnichar *pspec = G_PARAM_SPEC_UNICHAR (spec);
1078     if (g_unichar_isprint (pspec->default_value))
1079       desc = g_strdup_printf ("'%c'", pspec->default_value);
1080     else
1081       desc = g_strdup_printf ("%u", pspec->default_value);
1082   }
1083   else if (G_IS_PARAM_SPEC_ENUM (spec)) {
1084     GParamSpecEnum *pspec = G_PARAM_SPEC_ENUM (spec);
1086     GEnumValue *value = g_enum_get_value (pspec->enum_class, pspec->default_value);
1087     if (value)
1088       desc = g_strdup_printf ("%s", value->value_name);
1089     else
1090       desc = g_strdup_printf ("%d", pspec->default_value);
1091   }
1092   else if (G_IS_PARAM_SPEC_FLAGS (spec)) {
1093     GParamSpecFlags *pspec = G_PARAM_SPEC_FLAGS (spec);
1094     guint default_value;
1095     GString *acc;
1097     default_value = pspec->default_value;
1098     acc = g_string_new ("");
1100     while (default_value) {
1101       GFlagsValue *value = g_flags_get_first_value (pspec->flags_class, default_value);
1103       if (!value)
1104         break;
1106       if (acc->len > 0)
1107         g_string_append (acc, " | ");
1108       g_string_append (acc, value->value_name);
1110       default_value &= ~value->value;
1111     }
1113     if (default_value == 0)
1114       desc = g_string_free (acc, FALSE);
1115     else {
1116       desc = g_strdup_printf ("%d", pspec->default_value);
1117       g_string_free (acc, TRUE);
1118     }
1119   }
1120   else if (G_IS_PARAM_SPEC_FLOAT (spec)) {
1121     GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec);
1123     /* make sure floats are output with a decimal dot irrespective of
1124      * current locale. Use formatd since we want human-readable numbers
1125      * and do not need the exact same bit representation when deserialising */
1126     desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE);
1127     g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g",
1128         pspec->default_value);
1129   }
1130   else if (G_IS_PARAM_SPEC_DOUBLE (spec)) {
1131     GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec);
1133     /* make sure floats are output with a decimal dot irrespective of
1134      * current locale. Use formatd since we want human-readable numbers
1135      * and do not need the exact same bit representation when deserialising */
1136     desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE);
1137     g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g",
1138         pspec->default_value);
1139   }
1140   else if (G_IS_PARAM_SPEC_STRING (spec)) {
1141     GParamSpecString *pspec = G_PARAM_SPEC_STRING (spec);
1143     if (pspec->default_value) {
1144       gchar *esc = g_strescape (pspec->default_value, NULL);
1145       desc = g_strdup_printf ("\\"%s\\"", esc);
1146       g_free (esc);
1147     }
1148     else
1149       desc = g_strdup_printf ("NULL");
1150   }
1151 #if GLIB_CHECK_VERSION (2, 25, 9)
1152   else if (G_IS_PARAM_SPEC_VARIANT (spec)) {
1153     GParamSpecVariant *pspec = G_PARAM_SPEC_VARIANT (spec);
1155     if (pspec->default_value)
1156       desc = g_variant_print (pspec->default_value, TRUE);
1157     else
1158       desc = g_strdup ("NULL");
1159   }
1160 #endif
1161   else {
1162     desc = g_strdup ("");
1163   }
1165   return desc;
1169 static void
1170 output_object_args (FILE *fp, GType object_type)
1172   gpointer class;
1173   const gchar *object_class_name;
1174   guint arg;
1175   gchar flags[16], *pos;
1176   GParamSpec **properties;
1177   guint n_properties;
1178   gboolean child_prop;
1179   gboolean style_prop;
1180   gboolean is_pointer;
1181   const gchar *type_name;
1182   gchar *type_desc;
1183   gchar *default_value;
1185   if (G_TYPE_IS_OBJECT (object_type)) {
1186     class = g_type_class_peek (object_type);
1187     if (!class)
1188       return;
1190     properties = g_object_class_list_properties (class, &n_properties);
1191   }
1192 #if GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 3)
1193   else if (G_TYPE_IS_INTERFACE (object_type)) {
1194     class = g_type_default_interface_ref (object_type);
1196     if (!class)
1197       return;
1199     properties = g_object_interface_list_properties (class, &n_properties);
1200   }
1201 #endif
1202   else
1203     return;
1205   object_class_name = g_type_name (object_type);
1207   child_prop = FALSE;
1208   style_prop = FALSE;
1210   while (TRUE) {
1211     qsort (properties, n_properties, sizeof (GParamSpec *), compare_param_specs);
1212     for (arg = 0; arg < n_properties; arg++) {
1213       GParamSpec *spec = properties[arg];
1214       const gchar *nick, *blurb, *dot;
1216       if (spec->owner_type != object_type)
1217         continue;
1219       pos = flags;
1220       /* We use one-character flags for simplicity. */
1221       if (child_prop && !style_prop)
1222            *pos++ = 'c';
1223       if (style_prop)
1224            *pos++ = 's';
1225       if (spec->flags & G_PARAM_READABLE)
1226          *pos++ = 'r';
1227       if (spec->flags & G_PARAM_WRITABLE)
1228         *pos++ = 'w';
1229       if (spec->flags & G_PARAM_CONSTRUCT)
1230         *pos++ = 'x';
1231       if (spec->flags & G_PARAM_CONSTRUCT_ONLY)
1232         *pos++ = 'X';
1233       *pos = 0;
1235       nick = g_param_spec_get_nick (spec);
1236       blurb = g_param_spec_get_blurb (spec);
1238       dot = "";
1239       if (blurb) {
1240         int str_len = strlen (blurb);
1241         if (str_len > 0  && blurb[str_len - 1] != '.')
1242           dot = ".";
1243       }
1245       type_desc = describe_type (spec);
1246       default_value = describe_default (spec);
1247       type_name = get_type_name (spec->value_type, &is_pointer);
1248       fprintf (fp, "<ARG>\\n<NAME>%s::%s</NAME>\\n<TYPE>%s%s</TYPE>\\n<RANGE>%s</RANGE>\\n<FLAGS>%s</FLAGS>\\n<NICK>%s</NICK>\\n<BLURB>%s%s</BLURB>\\n<DEFAULT>%s</DEFAULT>\\n</ARG>\\n\\n",
1249                object_class_name, g_param_spec_get_name (spec), type_name, is_pointer ? "*" : "", type_desc, flags, nick ? nick : "(null)", blurb ? blurb : "(null)", dot, default_value);
1250       g_free (type_desc);
1251       g_free (default_value);
1252     }
1254     g_free (properties);
1256 #ifdef GTK_IS_CONTAINER_CLASS
1257     if (!child_prop && GTK_IS_CONTAINER_CLASS (class)) {
1258       properties = gtk_container_class_list_child_properties (class, &n_properties);
1259       child_prop = TRUE;
1260       continue;
1261     }
1262 #endif
1264 #ifdef GTK_IS_CELL_AREA_CLASS
1265     if (!child_prop && GTK_IS_CELL_AREA_CLASS (class)) {
1266       properties = gtk_cell_area_class_list_cell_properties (class, &n_properties);
1267       child_prop = TRUE;
1268       continue;
1269     }
1270 #endif
1272 #ifdef GTK_IS_WIDGET_CLASS
1273 #if GTK_CHECK_VERSION(2,1,0) && !GTK_CHECK_VERSION(3,89,2)
1274     if (!style_prop && GTK_IS_WIDGET_CLASS (class)) {
1275       properties = gtk_widget_class_list_style_properties (GTK_WIDGET_CLASS (class), &n_properties);
1276       style_prop = TRUE;
1277       continue;
1278     }
1279 #endif
1280 #endif
1284 if ($QUERY_CHILD_PROPERTIES) {
1285   print OUTPUT <<EOT;
1286     if (!child_prop) {
1287       properties = $QUERY_CHILD_PROPERTIES (class, &n_properties);
1288       if (properties) {
1289         child_prop = TRUE;
1290         continue;
1291       }
1292    }
1297 print OUTPUT <<EOT;
1298     break;
1299   }
1303 close OUTPUT;
1305 # Compile and run our file
1307 unless ($CC) {
1308     $CC = $ENV{CC} ? $ENV{CC} : "gcc";
1310 unless ($LD) {
1311     $LD = $ENV{LD} ? $ENV{LD} : $CC;
1313 unless ($CFLAGS) {
1314     $CFLAGS = $ENV{CFLAGS} ? $ENV{CFLAGS} : "";
1316 unless ($LDFLAGS) {
1317     $LDFLAGS = $ENV{LDFLAGS} ? $ENV{LDFLAGS} : "";
1319 unless ($RUN) {
1320     $RUN = $ENV{RUN} ? $ENV{RUN} : "";
1323 my $o_file = $CC =~ /libtool/ ? "$MODULE-scan.lo" :"$MODULE-scan.o";
1325 my $stdout="";
1326 if (!defined($VERBOSE) or $VERBOSE eq "0") {
1327     $stdout=">/dev/null";
1330 # Compiling scanner
1331 my $command = "$CC $stdout $CFLAGS -c -o $o_file $MODULE-scan.c";
1332 system("($command)") == 0 or die "Compilation of scanner failed: $!\n";
1334 # Linking scanner
1335 # FIXME: Can we turn off as-needed for the docs (or better fix it?)
1336 #$command = "$LD -Wl,--no-as-needed $o_file $LDFLAGS -o $MODULE-scan@EXEEXT@";
1337 $command = "$LD $stdout $o_file $LDFLAGS -o $MODULE-scan@EXEEXT@";
1338 system("($command)") == 0 or die "Linking of scanner failed: $!\n";
1340 # Running scanner $MODULE-scan ";
1341 system("($RUN ./$MODULE-scan@EXEEXT@)") == 0 or die "Scan failed: $!\n";
1344 if (!defined($ENV{"GTK_DOC_KEEP_INTERMEDIATE"})) {
1345   unlink "./$MODULE-scan.c", "./$MODULE-scan.o", "./$MODULE-scan.lo", "./$MODULE-scan@EXEEXT@";
1348 &UpdateFileIfChanged ($old_signals_filename, $new_signals_filename, 0);
1349 &UpdateFileIfChanged ($old_hierarchy_filename, $new_hierarchy_filename, 0);
1350 &UpdateFileIfChanged ($old_interfaces_filename, $new_interfaces_filename, 0);
1351 &UpdateFileIfChanged ($old_prerequisites_filename, $new_prerequisites_filename, 0);
1352 &UpdateFileIfChanged ($old_args_filename, $new_args_filename, 0);