Updated Spanish translation
[gtk-doc.git] / gtkdoc-scangobj.in
blobfb66b76f5022d872ed0c7423f0851cc5d3ba1682
1 #!@PERL@ -w
2 # -*- cperl -*-
4 # gtk-doc - GTK DocBook documentation generator.
5 # Copyright (C) 1998  Damon Chaplin
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 # This gets information about object hierarchies and signals
24 # by compiling a small C program. CFLAGS and LDFLAGS must be
25 # set appropriately before running this script.
28 use strict;
29 use Getopt::Long;
31 push @INC, '@PACKAGE_DATA_DIR@';
32 require "gtkdoc-common.pl";
34 # Options
36 # name of documentation module
37 my $MODULE;
38 my $TYPES_FILE;
39 my $NO_GTK_INIT;
40 my $OUTPUT_DIR;
41 my $VERBOSE;
42 my $PRINT_VERSION;
43 my $PRINT_HELP;
44 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)";
45 my $QUERY_CHILD_PROPERTIES;
47 my $CC;
48 my $LD;
49 my $CFLAGS;
50 my $LDFLAGS;
51 my $RUN;
53 # --nogtkinit is deprecated, as it is the default now anyway.
54 my %optctl = (module => \$MODULE,
55            types => \$TYPES_FILE,
56            nogtkinit => \$NO_GTK_INIT,
57            'type-init-func' => \$TYPE_INIT_FUNC,
58            'query-child-properties' => \$QUERY_CHILD_PROPERTIES,
59            'output-dir' => \$OUTPUT_DIR,
60            'cc' => \$CC,
61            'ld' => \$LD,
62            'cflags' => \$CFLAGS,
63            'ldflags' => \$LDFLAGS,
64            'run' => \$RUN,
65            'verbose' => \$VERBOSE,
66            'version' => \$PRINT_VERSION,
67            'help' => \$PRINT_HELP);
69 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");
71 if ($NO_GTK_INIT) {
72   # Do nothing. This just avoids a warning.
73   # the option is not used anymore
76 if ($PRINT_VERSION) {
77     print "@VERSION@\n";
78     exit 0;
81 if (!$MODULE) {
82     $PRINT_HELP = 1;
85 if ($PRINT_HELP) {
86     print <<EOF;
87 gtkdoc-scangobj version @VERSION@ - introspect g-objects
89 --module=MODULE_NAME          Name of the doc module being parsed
90 --types=FILE                  The name of the file to store the types in
91 --type-init-func=FUNC         The init function to call instead of g_type_init()
92 --query-child-properties=FUNC A function that returns a list of child
93                               properties for a class
94 --output-dir=DIRNAME          The directory where the results are stored
95 --cc=COMPILER                 The compiler to use
96 --ld=LINKER                   The linker to use
97 --run=RUN                     Command for running the scanner
98 --cflags=CFLAGS               Compiler flags
99 --ldflags=LDFLAGS             Linker flags
100 --verbose                     Print extra output while processing
101 --version                     Print the version of this program
102 --help                        Print this help
104     exit 0;
107 $OUTPUT_DIR = $OUTPUT_DIR ? $OUTPUT_DIR : ".";
109 $TYPES_FILE = $TYPES_FILE ? $TYPES_FILE : "$OUTPUT_DIR/$MODULE.types";
111 open (TYPES, $TYPES_FILE) || die "Cannot open $TYPES_FILE: $!\n";
112 open (OUTPUT, ">$MODULE-scan.c") || die "Cannot open $MODULE-scan.c: $!\n";
114 my $old_signals_filename = "$OUTPUT_DIR/$MODULE.signals";
115 my $new_signals_filename = "$OUTPUT_DIR/$MODULE.signals.new";
116 my $old_hierarchy_filename = "$OUTPUT_DIR/$MODULE.hierarchy";
117 my $new_hierarchy_filename = "$OUTPUT_DIR/$MODULE.hierarchy.new";
118 my $old_interfaces_filename = "$OUTPUT_DIR/$MODULE.interfaces";
119 my $new_interfaces_filename = "$OUTPUT_DIR/$MODULE.interfaces.new";
120 my $old_prerequisites_filename = "$OUTPUT_DIR/$MODULE.prerequisites";
121 my $new_prerequisites_filename = "$OUTPUT_DIR/$MODULE.prerequisites.new";
122 my $old_args_filename = "$OUTPUT_DIR/$MODULE.args";
123 my $new_args_filename = "$OUTPUT_DIR/$MODULE.args.new";
125 # generate a C program to scan the types
127 my $includes = "";
128 my $forward_decls = "";
129 my $get_types = "";
130 my $ntypes = 1;
132 for (<TYPES>) {
133     if (/^#include/) {
134         $includes .= $_;
135     } elsif (/^gnome_keyring_item_info_get_type$/) {
136         # HACK: This isn't really a GObject type so skip it.
137         next;
138     } elsif (/^%/) {
139         next;
140     } elsif (/^\s*$/) {
141         next;
142     } else {
143         chomp;
144         $get_types .= "  object_types[i++] = $_ ();\n";
145         $forward_decls .= "extern GType $_ (void);\n";
146         $ntypes++;
147     }
150 print OUTPUT <<EOT;
151 #include <string.h>
152 #include <stdlib.h>
153 #include <stdio.h>
154 #include <errno.h>
155 #include <glib-object.h>
159 if ($includes) {
160     print OUTPUT $includes;
161 } else {
162     print OUTPUT $forward_decls;
165 if ($QUERY_CHILD_PROPERTIES) {
166   print OUTPUT <<EOT;
167 extern GParamSpec** $QUERY_CHILD_PROPERTIES (gpointer class, guint *n_properties);
171 print OUTPUT <<EOT;
173 #ifdef GTK_IS_WIDGET_CLASS
174 #include <gtk/gtk.h>
175 #endif
176 static GType object_types[$ntypes];
178 static GType *
179 get_object_types (void)
181   gpointer g_object_class;
182   gint i = 0;
183   
184 ${get_types}
185   object_types[i] = G_TYPE_INVALID;
187   /* reference the GObjectClass to initialize the param spec pool
188    * potentially needed by interfaces. See http://bugs.gnome.org/571820 */
189   g_object_class = g_type_class_ref (G_TYPE_OBJECT);
191   /* Need to make sure all the types are loaded in and initialize
192    * their signals and properties.
193    */
194   for (i=0; object_types[i]; i++) {
195     if (G_TYPE_IS_CLASSED (object_types[i]))
196       g_type_class_ref (object_types[i]);
197     if (G_TYPE_IS_INTERFACE (object_types[i]))
198       g_type_default_interface_ref (object_types[i]);
199   }
201   g_type_class_unref (g_object_class);
203   return object_types;
207  * This uses GObject type functions to output signal prototypes and the object
208  * hierarchy.
209  */
211 /* The output files */
212 const gchar *signals_filename = "$new_signals_filename";
213 const gchar *hierarchy_filename = "$new_hierarchy_filename";
214 const gchar *interfaces_filename = "$new_interfaces_filename";
215 const gchar *prerequisites_filename = "$new_prerequisites_filename";
216 const gchar *args_filename = "$new_args_filename";
218 static void output_signals (void);
219 static void output_object_signals (FILE *fp,
220                                    GType object_type);
221 static void output_object_signal (FILE *fp,
222                                   const gchar *object_class_name,
223                                   guint signal_id);
224 static const gchar * get_type_name (GType type,
225                                     gboolean * is_pointer);
226 static void output_object_hierarchy (void);
227 static void output_hierarchy (FILE *fp,
228                               GType type,
229                               guint level);
231 static void output_object_interfaces (void);
232 static void output_interfaces (FILE *fp,
233                                GType type);
235 static void output_interface_prerequisites (void);
236 static void output_prerequisites (FILE *fp,
237                                   GType type);
239 static void output_args (void);
240 static void output_object_args (FILE *fp, GType object_type);
243 main (int argc, char *argv[])
245   $TYPE_INIT_FUNC;
247   get_object_types ();
249   output_signals ();
250   output_object_hierarchy ();
251   output_object_interfaces ();
252   output_interface_prerequisites ();
253   output_args ();
255   return 0;
258 static void
259 output_signals (void)
261   FILE *fp;
262   gint i;
264   fp = fopen (signals_filename, "w");
265   if (fp == NULL) {
266     g_warning ("Couldn't open output file: %s : %s", signals_filename, g_strerror(errno));
267     return;
268   }
270   for (i = 0; object_types[i]; i++)
271     output_object_signals (fp, object_types[i]);
273   fclose (fp);
276 static gint
277 compare_signals (const void *a, const void *b)
279   const guint *signal_a = a;
280   const guint *signal_b = b;
282   return strcmp (g_signal_name (*signal_a), g_signal_name (*signal_b));
285 /* This outputs all the signals of one object. */
286 static void
287 output_object_signals (FILE *fp, GType object_type)
289   const gchar *object_class_name;
290   guint *signals, n_signals;
291   guint sig;
293   if (G_TYPE_IS_INSTANTIATABLE (object_type) ||
294       G_TYPE_IS_INTERFACE (object_type)) {
296     object_class_name = g_type_name (object_type);
298     signals = g_signal_list_ids (object_type, &n_signals);
299     qsort (signals, n_signals, sizeof (guint), compare_signals);
301     for (sig = 0; sig < n_signals; sig++) {
302        output_object_signal (fp, object_class_name, signals[sig]);
303     }
304     g_free (signals);
305   }
308 /* This outputs one signal. */
309 static void
310 output_object_signal (FILE *fp,
311                       const gchar *object_name,
312                       guint signal_id)
314   GSignalQuery query_info;
315   const gchar *type_name, *ret_type, *object_arg, *arg_name;
316   gchar *pos, *object_arg_lower;
317   gboolean is_pointer;
318   gchar buffer[1024];
319   guint i, param;
320   gint param_num, widget_num, event_num, callback_num;
321   gint *arg_num;
322   gchar signal_name[128];
323   gchar flags[16];
325   /*  g_print ("Object: %s Signal: %u\\n", object_name, signal_id);*/
327   param_num = 1;
328   widget_num = event_num = callback_num = 0;
330   g_signal_query (signal_id, &query_info);
332   /* Output the signal object type and the argument name. We assume the
333    * type is a pointer - I think that is OK. We remove "Gtk" or "Gnome" and
334    * convert to lower case for the argument name. */
335   pos = buffer;
336   sprintf (pos, "%s ", object_name);
337   pos += strlen (pos);
339   /* Try to come up with a sensible variable name for the first arg
340    * It chops off 2 know prefixes :/ and makes the name lowercase
341    * It should replace lowercase -> uppercase with '_'
342    * GFileMonitor -> file_monitor
343    * GIOExtensionPoint -> extension_point
344    * GtkTreeView -> tree_view
345    * if 2nd char is upper case too
346    *   search for first lower case and go back one char
347    * else
348    *   search for next upper case
349    */
350   if (!strncmp (object_name, "Gtk", 3))
351     object_arg = object_name + 3;
352   else if (!strncmp (object_name, "Gnome", 5))
353     object_arg = object_name + 5;
354   else
355     object_arg = object_name;
357   object_arg_lower = g_ascii_strdown (object_arg, -1);
358   sprintf (pos, "*%s\\n", object_arg_lower);
359   pos += strlen (pos);
360   if (!strncmp (object_arg_lower, "widget", 6))
361     widget_num = 2;
362   g_free(object_arg_lower);
364   /* Convert signal name to use underscores rather than dashes '-'. */
365   strncpy (signal_name, query_info.signal_name, 127);
366   signal_name[127] = '\\0';
367   for (i = 0; signal_name[i]; i++) {
368     if (signal_name[i] == '-')
369       signal_name[i] = '_';
370   }
372   /* Output the signal parameters. */
373   for (param = 0; param < query_info.n_params; param++) {
374     type_name = get_type_name (query_info.param_types[param] & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer);
376     /* Most arguments to the callback are called "arg1", "arg2", etc.
377        GtkWidgets are called "widget", "widget2", ...
378        GtkCallbacks are called "callback", "callback2", ... */
379     if (!strcmp (type_name, "GtkWidget")) {
380       arg_name = "widget";
381       arg_num = &widget_num;
382     }
383     else if (!strcmp (type_name, "GtkCallback")
384              || !strcmp (type_name, "GtkCCallback")) {
385       arg_name = "callback";
386       arg_num = &callback_num;
387     }
388     else {
389       arg_name = "arg";
390       arg_num = &param_num;
391     }
392     sprintf (pos, "%s ", type_name);
393     pos += strlen (pos);
395     if (!arg_num || *arg_num == 0)
396       sprintf (pos, "%s%s\\n", is_pointer ? "*" : " ", arg_name);
397     else
398       sprintf (pos, "%s%s%i\\n", is_pointer ? "*" : " ", arg_name,
399                *arg_num);
400     pos += strlen (pos);
402     if (arg_num) {
403       if (*arg_num == 0)
404         *arg_num = 2;
405       else
406         *arg_num += 1;
407     }
408   }
410   pos = flags;
411   /* We use one-character flags for simplicity. */
412   if (query_info.signal_flags & G_SIGNAL_RUN_FIRST)
413     *pos++ = 'f';
414   if (query_info.signal_flags & G_SIGNAL_RUN_LAST)
415     *pos++ = 'l';
416   if (query_info.signal_flags & G_SIGNAL_RUN_CLEANUP)
417     *pos++ = 'c';
418   if (query_info.signal_flags & G_SIGNAL_NO_RECURSE)
419     *pos++ = 'r';
420   if (query_info.signal_flags & G_SIGNAL_DETAILED)
421     *pos++ = 'd';
422   if (query_info.signal_flags & G_SIGNAL_ACTION)
423     *pos++ = 'a';
424   if (query_info.signal_flags & G_SIGNAL_NO_HOOKS)
425     *pos++ = 'h';
426   *pos = 0;
428   /* Output the return type and function name. */
429   ret_type = get_type_name (query_info.return_type & ~G_SIGNAL_TYPE_STATIC_SCOPE, &is_pointer);
431   fprintf (fp,
432            "<SIGNAL>\\n<NAME>%s::%s</NAME>\\n<RETURNS>%s%s</RETURNS>\\n<FLAGS>%s</FLAGS>\\n%s</SIGNAL>\\n\\n",
433            object_name, query_info.signal_name, ret_type, is_pointer ? "*" : "", flags, buffer);
437 /* Returns the type name to use for a signal argument or return value, given
438    the GtkType from the signal info. It also sets is_pointer to TRUE if the
439    argument needs a '*' since it is a pointer. */
440 static const gchar *
441 get_type_name (GType type, gboolean * is_pointer)
443   const gchar *type_name;
445   *is_pointer = FALSE;
446   type_name = g_type_name (type);
448   switch (type) {
449   case G_TYPE_NONE:
450   case G_TYPE_CHAR:
451   case G_TYPE_UCHAR:
452   case G_TYPE_BOOLEAN:
453   case G_TYPE_INT:
454   case G_TYPE_UINT:
455   case G_TYPE_LONG:
456   case G_TYPE_ULONG:
457   case G_TYPE_FLOAT:
458   case G_TYPE_DOUBLE:
459   case G_TYPE_POINTER:
460     /* These all have normal C type names so they are OK. */
461     return type_name;
463   case G_TYPE_STRING:
464     /* A GtkString is really a gchar*. */
465     *is_pointer = TRUE;
466     return "gchar";
468   case G_TYPE_ENUM:
469   case G_TYPE_FLAGS:
470     /* We use a gint for both of these. Hopefully a subtype with a decent
471        name will be registered and used instead, as GTK+ does itself. */
472     return "gint";
474   case G_TYPE_BOXED:
475     /* The boxed type shouldn't be used itself, only subtypes. Though we
476        return 'gpointer' just in case. */
477     return "gpointer";
479   case G_TYPE_PARAM:
480     /* A GParam is really a GParamSpec*. */
481     *is_pointer = TRUE;
482     return "GParamSpec";
484 #if GLIB_CHECK_VERSION (2, 25, 9)
485   case G_TYPE_VARIANT:
486     *is_pointer = TRUE;
487     return "GVariant";
488 #endif
490 default:
491     break;
492   }
494   /* For all GObject subclasses we can use the class name with a "*",
495      e.g. 'GtkWidget *'. */
496   if (g_type_is_a (type, G_TYPE_OBJECT))
497     *is_pointer = TRUE;
499   /* Also catch non GObject root types */
500   if (G_TYPE_IS_CLASSED (type))
501     *is_pointer = TRUE;
503   /* All boxed subtypes will be pointers as well. */
504   /* Exception: GStrv */
505   if (g_type_is_a (type, G_TYPE_BOXED) &&
506       !g_type_is_a (type, G_TYPE_STRV))
507     *is_pointer = TRUE;
509   /* All pointer subtypes will be pointers as well. */
510   if (g_type_is_a (type, G_TYPE_POINTER))
511     *is_pointer = TRUE;
513   /* But enums are not */
514   if (g_type_is_a (type, G_TYPE_ENUM) ||
515       g_type_is_a (type, G_TYPE_FLAGS))
516     *is_pointer = FALSE;
518   return type_name;
522 /* This outputs the hierarchy of all objects which have been initialized,
523    i.e. by calling their XXX_get_type() initialization function. */
524 static void
525 output_object_hierarchy (void)
527   FILE *fp;
528   gint i,j;
529   GType root, type;
530   GType root_types[$ntypes] = { G_TYPE_INVALID, };
532   fp = fopen (hierarchy_filename, "w");
533   if (fp == NULL) {
534     g_warning ("Couldn't open output file: %s : %s", hierarchy_filename, g_strerror(errno));
535     return;
536   }
537   output_hierarchy (fp, G_TYPE_OBJECT, 0);
538   output_hierarchy (fp, G_TYPE_INTERFACE, 0);
540   for (i=0; object_types[i]; i++) {
541     root = object_types[i];
542     while ((type = g_type_parent (root))) {
543       root = type;
544     }
545     if ((root != G_TYPE_OBJECT) && (root != G_TYPE_INTERFACE)) {
546       for (j=0; root_types[j]; j++) {
547         if (root == root_types[j]) {
548           root = G_TYPE_INVALID; break;
549         }
550       }
551       if(root) {
552         root_types[j] = root;
553         output_hierarchy (fp, root, 0);
554       }
555     }
556   }
558   fclose (fp);
561 /* This is called recursively to output the hierarchy of a object. */
562 static void
563 output_hierarchy (FILE  *fp,
564                   GType  type,
565                   guint   level)
567   guint i;
568   GType *children;
569   guint n_children;
571   if (!type)
572     return;
574   for (i = 0; i < level; i++)
575     fprintf (fp, "  ");
576   fprintf (fp, "%s\\n", g_type_name (type));
578   children = g_type_children (type, &n_children);
580   for (i=0; i < n_children; i++)
581     output_hierarchy (fp, children[i], level + 1);
583   g_free (children);
586 static void output_object_interfaces (void)
588   guint i;
589   FILE *fp;
591   fp = fopen (interfaces_filename, "w");
592   if (fp == NULL) {
593     g_warning ("Couldn't open output file: %s : %s", interfaces_filename, g_strerror(errno));
594     return;
595   }
596   output_interfaces (fp, G_TYPE_OBJECT);
598   for (i = 0; object_types[i]; i++) {
599     if (!g_type_parent (object_types[i]) &&
600         (object_types[i] != G_TYPE_OBJECT) &&
601         G_TYPE_IS_INSTANTIATABLE (object_types[i])) {
602       output_interfaces (fp, object_types[i]);
603     }
604   }
605   fclose (fp);
608 static void
609 output_interfaces (FILE  *fp,
610                    GType  type)
612   guint i;
613   GType *children, *interfaces;
614   guint n_children, n_interfaces;
616   if (!type)
617     return;
619   interfaces = g_type_interfaces (type, &n_interfaces);
621   if (n_interfaces > 0) {
622     fprintf (fp, "%s", g_type_name (type));
623     for (i=0; i < n_interfaces; i++)
624         fprintf (fp, " %s", g_type_name (interfaces[i]));
625     fprintf (fp, "\\n");
626    }
627   g_free (interfaces);
629   children = g_type_children (type, &n_children);
631   for (i=0; i < n_children; i++)
632     output_interfaces (fp, children[i]);
634   g_free (children);
637 static void output_interface_prerequisites (void)
639   FILE *fp;
641   fp = fopen (prerequisites_filename, "w");
642   if (fp == NULL) {
643     g_warning ("Couldn't open output file: %s : %s", prerequisites_filename, g_strerror(errno));
644     return;
645   }
646   output_prerequisites (fp, G_TYPE_INTERFACE);
647   fclose (fp);
650 static void
651 output_prerequisites (FILE  *fp,
652                       GType  type)
654 #if GLIB_CHECK_VERSION(2,1,0)
655   guint i;
656   GType *children, *prerequisites;
657   guint n_children, n_prerequisites;
659   if (!type)
660     return;
662   prerequisites = g_type_interface_prerequisites (type, &n_prerequisites);
664   if (n_prerequisites > 0) {
665     fprintf (fp, "%s", g_type_name (type));
666     for (i=0; i < n_prerequisites; i++)
667         fprintf (fp, " %s", g_type_name (prerequisites[i]));
668     fprintf (fp, "\\n");
669    }
670   g_free (prerequisites);
672   children = g_type_children (type, &n_children);
674   for (i=0; i < n_children; i++)
675     output_prerequisites (fp, children[i]);
677   g_free (children);
678 #endif
681 static void
682 output_args (void)
684   FILE *fp;
685   gint i;
687   fp = fopen (args_filename, "w");
688   if (fp == NULL) {
689     g_warning ("Couldn't open output file: %s : %s", args_filename, g_strerror(errno));
690     return;
691   }
693   for (i = 0; object_types[i]; i++) {
694     output_object_args (fp, object_types[i]);
695   }
697   fclose (fp);
700 static gint
701 compare_param_specs (const void *a, const void *b)
703   GParamSpec *spec_a = *(GParamSpec **)a;
704   GParamSpec *spec_b = *(GParamSpec **)b;
706   return strcmp (g_param_spec_get_name (spec_a), g_param_spec_get_name (spec_b));
709 /* Its common to have unsigned properties restricted
710  * to the signed range. Therefore we make this look
711  * a bit nicer by spelling out the max constants.
712  */
714 /* Don't use "==" with floats, it might trigger a gcc warning.  */
715 #define GTKDOC_COMPARE_FLOAT(x, y) (x <= y && x >= y)
717 static gchar*
718 describe_double_constant (gdouble value)
720   gchar *desc;
722   if (GTKDOC_COMPARE_FLOAT (value, G_MAXDOUBLE))
723     desc = g_strdup ("G_MAXDOUBLE");
724   else if (GTKDOC_COMPARE_FLOAT (value, G_MINDOUBLE))
725     desc = g_strdup ("G_MINDOUBLE");
726   else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXDOUBLE))
727     desc = g_strdup ("-G_MAXDOUBLE");
728   else if (GTKDOC_COMPARE_FLOAT (value, G_MAXFLOAT))
729     desc = g_strdup ("G_MAXFLOAT");
730   else if (GTKDOC_COMPARE_FLOAT (value, G_MINFLOAT))
731     desc = g_strdup ("G_MINFLOAT");
732   else if (GTKDOC_COMPARE_FLOAT (value, -G_MAXFLOAT))
733     desc = g_strdup ("-G_MAXFLOAT");
734   else{
735     /* make sure floats are output with a decimal dot irrespective of
736     * current locale. Use formatd since we want human-readable numbers
737     * and do not need the exact same bit representation when deserialising */
738     desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE);
739     g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g", value);
740   }
742   return desc;
745 static gchar*
746 describe_signed_constant (gsize size, gint64 value)
748   gchar *desc = NULL;
750   switch (size) {
751     case 2:
752       if (sizeof (int) == 2) {
753         if (value == G_MAXINT)
754           desc = g_strdup ("G_MAXINT");
755         else if (value == G_MININT)
756           desc = g_strdup ("G_MININT");
757       }
758       break;
759     case 4:
760       if (sizeof (int) == 4) {
761         if (value == G_MAXINT)
762           desc = g_strdup ("G_MAXINT");
763         else if (value == G_MININT)
764           desc = g_strdup ("G_MININT");
765       }
766       if (value == G_MAXLONG)
767         desc = g_strdup ("G_MAXLONG");
768       else if (value == G_MINLONG)
769         desc = g_strdup ("G_MINLONG");
770       break;
771     case 8:
772       if (value == G_MAXINT64)
773         desc = g_strdup ("G_MAXINT64");
774       else if (value == G_MININT64)
775         desc = g_strdup ("G_MININT64");
776       break;
777     default:
778       break;
779   }
780   if (!desc)
781     desc = g_strdup_printf ("%" G_GINT64_FORMAT, value);
783   return desc;
786 static gchar*
787 describe_unsigned_constant (gsize size, guint64 value)
789   gchar *desc = NULL;
791   switch (size) {
792     case 2:
793       if (sizeof (int) == 2) {
794         if (value == (guint64)G_MAXINT)
795           desc = g_strdup ("G_MAXINT");
796         else if (value == G_MAXUINT)
797           desc = g_strdup ("G_MAXUINT");
798       }
799       break;
800     case 4:
801       if (sizeof (int) == 4) {
802         if (value == (guint64)G_MAXINT)
803           desc = g_strdup ("G_MAXINT");
804         else if (value == G_MAXUINT)
805           desc = g_strdup ("G_MAXUINT");
806       }
807       if (value == (guint64)G_MAXLONG)
808         desc = g_strdup ("G_MAXLONG");
809       else if (value == G_MAXULONG)
810         desc = g_strdup ("G_MAXULONG");
811       break;
812     case 8:
813       if (value == G_MAXINT64)
814         desc = g_strdup ("G_MAXINT64");
815       else if (value == G_MAXUINT64)
816         desc = g_strdup ("G_MAXUINT64");
817       break;
818     default:
819       break;
820   }
821   if (!desc)
822     desc = g_strdup_printf ("%" G_GUINT64_FORMAT, value);
824   return desc;
827 static gchar*
828 describe_type (GParamSpec *spec)
830   gchar *desc;
831   gchar *lower;
832   gchar *upper;
834   if (G_IS_PARAM_SPEC_CHAR (spec)) {
835     GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec);
837     lower = describe_signed_constant (sizeof(gchar), pspec->minimum);
838     upper = describe_signed_constant (sizeof(gchar), pspec->maximum);
839     if (pspec->minimum == G_MININT8 && pspec->maximum == G_MAXINT8)
840       desc = g_strdup ("");
841     else if (pspec->minimum == G_MININT8)
842       desc = g_strdup_printf ("<= %s", upper);
843     else if (pspec->maximum == G_MAXINT8)
844       desc = g_strdup_printf (">= %s", lower);
845     else
846       desc = g_strdup_printf ("[%s,%s]", lower, upper);
847     g_free (lower);
848     g_free (upper);
849   }
850   else if (G_IS_PARAM_SPEC_UCHAR (spec)) {
851     GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec);
853     lower = describe_unsigned_constant (sizeof(guchar), pspec->minimum);
854     upper = describe_unsigned_constant (sizeof(guchar), pspec->maximum);
855     if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT8)
856       desc = g_strdup ("");
857     else if (pspec->minimum == 0)
858       desc = g_strdup_printf ("<= %s", upper);
859     else if (pspec->maximum == G_MAXUINT8)
860       desc = g_strdup_printf (">= %s", lower);
861     else
862       desc = g_strdup_printf ("[%s,%s]", lower, upper);
863     g_free (lower);
864     g_free (upper);
865   }
866   else if (G_IS_PARAM_SPEC_INT (spec)) {
867     GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec);
869     lower = describe_signed_constant (sizeof(gint), pspec->minimum);
870     upper = describe_signed_constant (sizeof(gint), pspec->maximum);
871     if (pspec->minimum == G_MININT && pspec->maximum == G_MAXINT)
872       desc = g_strdup ("");
873     else if (pspec->minimum == G_MININT)
874       desc = g_strdup_printf ("<= %s", upper);
875     else if (pspec->maximum == G_MAXINT)
876       desc = g_strdup_printf (">= %s", lower);
877     else
878       desc = g_strdup_printf ("[%s,%s]", lower, upper);
879     g_free (lower);
880     g_free (upper);
881   }
882   else if (G_IS_PARAM_SPEC_UINT (spec)) {
883     GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec);
885     lower = describe_unsigned_constant (sizeof(guint), pspec->minimum);
886     upper = describe_unsigned_constant (sizeof(guint), pspec->maximum);
887     if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT)
888       desc = g_strdup ("");
889     else if (pspec->minimum == 0)
890       desc = g_strdup_printf ("<= %s", upper);
891     else if (pspec->maximum == G_MAXUINT)
892       desc = g_strdup_printf (">= %s", lower);
893     else
894       desc = g_strdup_printf ("[%s,%s]", lower, upper);
895     g_free (lower);
896     g_free (upper);
897   }
898   else if (G_IS_PARAM_SPEC_LONG (spec)) {
899     GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec);
901     lower = describe_signed_constant (sizeof(glong), pspec->minimum);
902     upper = describe_signed_constant (sizeof(glong), pspec->maximum);
903     if (pspec->minimum == G_MINLONG && pspec->maximum == G_MAXLONG)
904       desc = g_strdup ("");
905     else if (pspec->minimum == G_MINLONG)
906       desc = g_strdup_printf ("<= %s", upper);
907     else if (pspec->maximum == G_MAXLONG)
908       desc = g_strdup_printf (">= %s", lower);
909     else
910       desc = g_strdup_printf ("[%s,%s]", lower, upper);
911     g_free (lower);
912     g_free (upper);
913   }
914   else if (G_IS_PARAM_SPEC_ULONG (spec)) {
915     GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec);
917     lower = describe_unsigned_constant (sizeof(gulong), pspec->minimum);
918     upper = describe_unsigned_constant (sizeof(gulong), pspec->maximum);
919     if (pspec->minimum == 0 && pspec->maximum == G_MAXULONG)
920       desc = g_strdup ("");
921     else if (pspec->minimum == 0)
922       desc = g_strdup_printf ("<= %s", upper);
923     else if (pspec->maximum == G_MAXULONG)
924       desc = g_strdup_printf (">= %s", lower);
925     else
926       desc = g_strdup_printf ("[%s,%s]", lower, upper);
927     g_free (lower);
928     g_free (upper);
929   }
930   else if (G_IS_PARAM_SPEC_INT64 (spec)) {
931     GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec);
933     lower = describe_signed_constant (sizeof(gint64), pspec->minimum);
934     upper = describe_signed_constant (sizeof(gint64), pspec->maximum);
935     if (pspec->minimum == G_MININT64 && pspec->maximum == G_MAXINT64)
936       desc = g_strdup ("");
937     else if (pspec->minimum == G_MININT64)
938       desc = g_strdup_printf ("<= %s", upper);
939     else if (pspec->maximum == G_MAXINT64)
940       desc = g_strdup_printf (">= %s", lower);
941     else
942       desc = g_strdup_printf ("[%s,%s]", lower, upper);
943     g_free (lower);
944     g_free (upper);
945   }
946   else if (G_IS_PARAM_SPEC_UINT64 (spec)) {
947     GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec);
949     lower = describe_unsigned_constant (sizeof(guint64), pspec->minimum);
950     upper = describe_unsigned_constant (sizeof(guint64), pspec->maximum);
951     if (pspec->minimum == 0 && pspec->maximum == G_MAXUINT64)
952       desc = g_strdup ("");
953     else if (pspec->minimum == 0)
954       desc = g_strdup_printf ("<= %s", upper);
955     else if (pspec->maximum == G_MAXUINT64)
956       desc = g_strdup_printf (">= %s", lower);
957     else
958       desc = g_strdup_printf ("[%s,%s]", lower, upper);
959     g_free (lower);
960     g_free (upper);
961   }
962   else if (G_IS_PARAM_SPEC_FLOAT (spec)) {
963     GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec);
965     lower = describe_double_constant (pspec->minimum);
966     upper = describe_double_constant (pspec->maximum);
967     if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXFLOAT)) {
968       if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT))
969         desc = g_strdup ("");
970       else
971         desc = g_strdup_printf ("<= %s", upper);
972     }
973     else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXFLOAT))
974       desc = g_strdup_printf (">= %s", lower);
975     else
976       desc = g_strdup_printf ("[%s,%s]", lower, upper);
977     g_free (lower);
978     g_free (upper);
979   }
980   else if (G_IS_PARAM_SPEC_DOUBLE (spec)) {
981     GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec);
983     lower = describe_double_constant (pspec->minimum);
984     upper = describe_double_constant (pspec->maximum);
985     if (GTKDOC_COMPARE_FLOAT (pspec->minimum, -G_MAXDOUBLE)) {
986       if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE))
987         desc = g_strdup ("");
988       else
989         desc = g_strdup_printf ("<= %s", upper);
990     }
991     else if (GTKDOC_COMPARE_FLOAT (pspec->maximum, G_MAXDOUBLE))
992       desc = g_strdup_printf (">= %s", lower);
993     else
994       desc = g_strdup_printf ("[%s,%s]", lower, upper);
995     g_free (lower);
996     g_free (upper);
997   }
998 #if GLIB_CHECK_VERSION (2, 12, 0)
999   else if (G_IS_PARAM_SPEC_GTYPE (spec)) {
1000     GParamSpecGType *pspec = G_PARAM_SPEC_GTYPE (spec);
1001     gboolean is_pointer;
1003     desc = g_strdup (get_type_name (pspec->is_a_type, &is_pointer));
1004   }
1005 #endif
1006 #if GLIB_CHECK_VERSION (2, 25, 9)
1007   else if (G_IS_PARAM_SPEC_VARIANT (spec)) {
1008     GParamSpecVariant *pspec = G_PARAM_SPEC_VARIANT (spec);
1009     gchar *variant_type;
1011     variant_type = g_variant_type_dup_string (pspec->type);
1012     desc = g_strdup_printf ("GVariant<%s>", variant_type);
1013     g_free (variant_type);
1014   }
1015 #endif
1016   else {
1017     desc = g_strdup ("");
1018   }
1020   return desc;
1023 static gchar*
1024 describe_default (GParamSpec *spec)
1026   gchar *desc;
1028   if (G_IS_PARAM_SPEC_CHAR (spec)) {
1029     GParamSpecChar *pspec = G_PARAM_SPEC_CHAR (spec);
1031     desc = g_strdup_printf ("%d", pspec->default_value);
1032   }
1033   else if (G_IS_PARAM_SPEC_UCHAR (spec)) {
1034     GParamSpecUChar *pspec = G_PARAM_SPEC_UCHAR (spec);
1036     desc = g_strdup_printf ("%u", pspec->default_value);
1037   }
1038   else if (G_IS_PARAM_SPEC_BOOLEAN (spec)) {
1039     GParamSpecBoolean *pspec = G_PARAM_SPEC_BOOLEAN (spec);
1041     desc = g_strdup_printf ("%s", pspec->default_value ? "TRUE" : "FALSE");
1042   }
1043   else if (G_IS_PARAM_SPEC_INT (spec)) {
1044     GParamSpecInt *pspec = G_PARAM_SPEC_INT (spec);
1046     desc = g_strdup_printf ("%d", pspec->default_value);
1047   }
1048   else if (G_IS_PARAM_SPEC_UINT (spec)) {
1049     GParamSpecUInt *pspec = G_PARAM_SPEC_UINT (spec);
1051     desc = g_strdup_printf ("%u", pspec->default_value);
1052   }
1053   else if (G_IS_PARAM_SPEC_LONG (spec)) {
1054     GParamSpecLong *pspec = G_PARAM_SPEC_LONG (spec);
1056     desc = g_strdup_printf ("%ld", pspec->default_value);
1057   }
1058   else if (G_IS_PARAM_SPEC_LONG (spec)) {
1059     GParamSpecULong *pspec = G_PARAM_SPEC_ULONG (spec);
1061     desc = g_strdup_printf ("%lu", pspec->default_value);
1062   }
1063   else if (G_IS_PARAM_SPEC_INT64 (spec)) {
1064     GParamSpecInt64 *pspec = G_PARAM_SPEC_INT64 (spec);
1066     desc = g_strdup_printf ("%" G_GINT64_FORMAT, pspec->default_value);
1067   }
1068   else if (G_IS_PARAM_SPEC_UINT64 (spec))
1069     {
1070       GParamSpecUInt64 *pspec = G_PARAM_SPEC_UINT64 (spec);
1072       desc = g_strdup_printf ("%" G_GUINT64_FORMAT, pspec->default_value);
1073     }
1074   else if (G_IS_PARAM_SPEC_UNICHAR (spec)) {
1075     GParamSpecUnichar *pspec = G_PARAM_SPEC_UNICHAR (spec);
1077     if (g_unichar_isprint (pspec->default_value))
1078       desc = g_strdup_printf ("'%c'", pspec->default_value);
1079     else
1080       desc = g_strdup_printf ("%u", pspec->default_value);
1081   }
1082   else if (G_IS_PARAM_SPEC_ENUM (spec)) {
1083     GParamSpecEnum *pspec = G_PARAM_SPEC_ENUM (spec);
1085     GEnumValue *value = g_enum_get_value (pspec->enum_class, pspec->default_value);
1086     if (value)
1087       desc = g_strdup_printf ("%s", value->value_name);
1088     else
1089       desc = g_strdup_printf ("%d", pspec->default_value);
1090   }
1091   else if (G_IS_PARAM_SPEC_FLAGS (spec)) {
1092     GParamSpecFlags *pspec = G_PARAM_SPEC_FLAGS (spec);
1093     guint default_value;
1094     GString *acc;
1096     default_value = pspec->default_value;
1097     acc = g_string_new ("");
1099     while (default_value) {
1100       GFlagsValue *value = g_flags_get_first_value (pspec->flags_class, default_value);
1102       if (!value)
1103         break;
1105       if (acc->len > 0)
1106         g_string_append (acc, " | ");
1107       g_string_append (acc, value->value_name);
1109       default_value &= ~value->value;
1110     }
1112     if (default_value == 0)
1113       desc = g_string_free (acc, FALSE);
1114     else {
1115       desc = g_strdup_printf ("%d", pspec->default_value);
1116       g_string_free (acc, TRUE);
1117     }
1118   }
1119   else if (G_IS_PARAM_SPEC_FLOAT (spec)) {
1120     GParamSpecFloat *pspec = G_PARAM_SPEC_FLOAT (spec);
1122     /* make sure floats are output with a decimal dot irrespective of
1123      * current locale. Use formatd since we want human-readable numbers
1124      * and do not need the exact same bit representation when deserialising */
1125     desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE);
1126     g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g",
1127         pspec->default_value);
1128   }
1129   else if (G_IS_PARAM_SPEC_DOUBLE (spec)) {
1130     GParamSpecDouble *pspec = G_PARAM_SPEC_DOUBLE (spec);
1132     /* make sure floats are output with a decimal dot irrespective of
1133      * current locale. Use formatd since we want human-readable numbers
1134      * and do not need the exact same bit representation when deserialising */
1135     desc = g_malloc0 (G_ASCII_DTOSTR_BUF_SIZE);
1136     g_ascii_formatd (desc, G_ASCII_DTOSTR_BUF_SIZE, "%g",
1137         pspec->default_value);
1138   }
1139   else if (G_IS_PARAM_SPEC_STRING (spec)) {
1140     GParamSpecString *pspec = G_PARAM_SPEC_STRING (spec);
1142     if (pspec->default_value) {
1143       gchar *esc = g_strescape (pspec->default_value, NULL);
1144       desc = g_strdup_printf ("\\"%s\\"", esc);
1145       g_free (esc);
1146     }
1147     else
1148       desc = g_strdup_printf ("NULL");
1149   }
1150 #if GLIB_CHECK_VERSION (2, 25, 9)
1151   else if (G_IS_PARAM_SPEC_VARIANT (spec)) {
1152     GParamSpecVariant *pspec = G_PARAM_SPEC_VARIANT (spec);
1154     if (pspec->default_value)
1155       desc = g_variant_print (pspec->default_value, TRUE);
1156     else
1157       desc = g_strdup ("NULL");
1158   }
1159 #endif
1160   else {
1161     desc = g_strdup ("");
1162   }
1164   return desc;
1168 static void
1169 output_object_args (FILE *fp, GType object_type)
1171   gpointer class;
1172   const gchar *object_class_name;
1173   guint arg;
1174   gchar flags[16], *pos;
1175   GParamSpec **properties;
1176   guint n_properties;
1177   gboolean child_prop;
1178   gboolean style_prop;
1179   gboolean is_pointer;
1180   const gchar *type_name;
1181   gchar *type_desc;
1182   gchar *default_value;
1184   if (G_TYPE_IS_OBJECT (object_type)) {
1185     class = g_type_class_peek (object_type);
1186     if (!class)
1187       return;
1189     properties = g_object_class_list_properties (class, &n_properties);
1190   }
1191 #if GLIB_MAJOR_VERSION > 2 || (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION >= 3)
1192   else if (G_TYPE_IS_INTERFACE (object_type)) {
1193     class = g_type_default_interface_ref (object_type);
1195     if (!class)
1196       return;
1198     properties = g_object_interface_list_properties (class, &n_properties);
1199   }
1200 #endif
1201   else
1202     return;
1204   object_class_name = g_type_name (object_type);
1206   child_prop = FALSE;
1207   style_prop = FALSE;
1209   while (TRUE) {
1210     qsort (properties, n_properties, sizeof (GParamSpec *), compare_param_specs);
1211     for (arg = 0; arg < n_properties; arg++) {
1212       GParamSpec *spec = properties[arg];
1213       const gchar *nick, *blurb, *dot;
1215       if (spec->owner_type != object_type)
1216         continue;
1218       pos = flags;
1219       /* We use one-character flags for simplicity. */
1220       if (child_prop && !style_prop)
1221            *pos++ = 'c';
1222       if (style_prop)
1223            *pos++ = 's';
1224       if (spec->flags & G_PARAM_READABLE)
1225          *pos++ = 'r';
1226       if (spec->flags & G_PARAM_WRITABLE)
1227         *pos++ = 'w';
1228       if (spec->flags & G_PARAM_CONSTRUCT)
1229         *pos++ = 'x';
1230       if (spec->flags & G_PARAM_CONSTRUCT_ONLY)
1231         *pos++ = 'X';
1232       *pos = 0;
1234       nick = g_param_spec_get_nick (spec);
1235       blurb = g_param_spec_get_blurb (spec);
1237       dot = "";
1238       if (blurb) {
1239         int str_len = strlen (blurb);
1240         if (str_len > 0  && blurb[str_len - 1] != '.')
1241           dot = ".";
1242       }
1244       type_desc = describe_type (spec);
1245       default_value = describe_default (spec);
1246       type_name = get_type_name (spec->value_type, &is_pointer);
1247       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",
1248                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);
1249       g_free (type_desc);
1250       g_free (default_value);
1251     }
1253     g_free (properties);
1255 #ifdef GTK_IS_CONTAINER_CLASS
1256     if (!child_prop && GTK_IS_CONTAINER_CLASS (class)) {
1257       properties = gtk_container_class_list_child_properties (class, &n_properties);
1258       child_prop = TRUE;
1259       continue;
1260     }
1261 #endif
1263 #ifdef GTK_IS_CELL_AREA_CLASS
1264     if (!child_prop && GTK_IS_CELL_AREA_CLASS (class)) {
1265       properties = gtk_cell_area_class_list_cell_properties (class, &n_properties);
1266       child_prop = TRUE;
1267       continue;
1268     }
1269 #endif
1271 #ifdef GTK_IS_WIDGET_CLASS
1272 #if GTK_CHECK_VERSION(2,1,0)
1273     if (!style_prop && GTK_IS_WIDGET_CLASS (class)) {
1274       properties = gtk_widget_class_list_style_properties (GTK_WIDGET_CLASS (class), &n_properties);
1275       style_prop = TRUE;
1276       continue;
1277     }
1278 #endif
1279 #endif
1283 if ($QUERY_CHILD_PROPERTIES) {
1284   print OUTPUT <<EOT;
1285     if (!child_prop) {
1286       properties = $QUERY_CHILD_PROPERTIES (class, &n_properties);
1287       if (properties) {
1288         child_prop = TRUE;
1289         continue;
1290       }
1291    }
1296 print OUTPUT <<EOT;
1297     break;
1298   }
1302 close OUTPUT;
1304 # Compile and run our file
1306 unless ($CC) {
1307     $CC = $ENV{CC} ? $ENV{CC} : "gcc";
1309 unless ($LD) {
1310     $LD = $ENV{LD} ? $ENV{LD} : $CC;
1312 unless ($CFLAGS) {
1313     $CFLAGS = $ENV{CFLAGS} ? $ENV{CFLAGS} : "";
1315 unless ($LDFLAGS) {
1316     $LDFLAGS = $ENV{LDFLAGS} ? $ENV{LDFLAGS} : "";
1318 unless ($RUN) {
1319     $RUN = $ENV{RUN} ? $ENV{RUN} : "";
1322 my $o_file = $CC =~ /libtool/ ? "$MODULE-scan.lo" :"$MODULE-scan.o";
1324 my $stdout="";
1325 if (!defined($VERBOSE) or $VERBOSE eq "0") {
1326     $stdout=">/dev/null";
1329 # Compiling scanner
1330 my $command = "$CC $stdout $CFLAGS -c -o $o_file $MODULE-scan.c";
1331 system("($command)") == 0 or die "Compilation of scanner failed: $!\n";
1333 # Linking scanner
1334 # FIXME: Can we turn off as-needed for the docs (or better fix it?)
1335 #$command = "$LD -Wl,--no-as-needed $o_file $LDFLAGS -o $MODULE-scan@EXEEXT@";
1336 $command = "$LD $stdout $o_file $LDFLAGS -o $MODULE-scan@EXEEXT@";
1337 system("($command)") == 0 or die "Linking of scanner failed: $!\n";
1339 # Running scanner $MODULE-scan ";
1340 system("($RUN ./$MODULE-scan@EXEEXT@)") == 0 or die "Scan failed: $!\n";
1343 if (!defined($ENV{"GTK_DOC_KEEP_INTERMEDIATE"})) {
1344   unlink "./$MODULE-scan.c", "./$MODULE-scan.o", "./$MODULE-scan.lo", "./$MODULE-scan@EXEEXT@";
1347 &UpdateFileIfChanged ($old_signals_filename, $new_signals_filename, 0);
1348 &UpdateFileIfChanged ($old_hierarchy_filename, $new_hierarchy_filename, 0);
1349 &UpdateFileIfChanged ($old_interfaces_filename, $new_interfaces_filename, 0);
1350 &UpdateFileIfChanged ($old_prerequisites_filename, $new_prerequisites_filename, 0);
1351 &UpdateFileIfChanged ($old_args_filename, $new_args_filename, 0);