source: trunk/ORBit2-2.14.0/src/idl-compiler/orbit-idl-c-deps.c

Last change on this file was 92, checked in by cinc, 19 years ago

Orbit2 modified for use with NOM

File size: 1.2 KB
Line 
1/*
2 * Copyright (C) 2001 Maciej Stachowiak, Ximian Inc.
3 */
4
5#include "config.h"
6#include "orbit-idl-c-backend.h"
7
8#include <string.h>
9#include <ctype.h>
10
11static void
12output_deps (IDL_tree tree,
13 OIDL_Run_Info *rinfo,
14 OIDL_C_Info *ci)
15{
16 if (!tree)
17 return;
18
19 switch (IDL_NODE_TYPE (tree)) {
20 case IDLN_SRCFILE: {
21 char *idlfn = IDL_SRCFILE (tree).filename;
22 fprintf (ci->fh, " \\\n\t%s", idlfn);
23 break;
24 }
25
26 case IDLN_MODULE:
27 output_deps (IDL_MODULE (tree).definition_list, rinfo, ci);
28 break;
29
30 case IDLN_LIST: {
31 IDL_tree sub;
32
33 for (sub = tree; sub; sub = IDL_LIST (sub).next)
34 output_deps (IDL_LIST (sub).data, rinfo, ci);
35 break;
36 }
37
38 case IDLN_INTERFACE:
39 output_deps (IDL_INTERFACE (tree).body, rinfo, ci);
40 break;
41
42 default:
43 break;
44 }
45}
46
47void
48orbit_idl_output_c_deps (IDL_tree tree,
49 OIDL_Run_Info *rinfo,
50 OIDL_C_Info *ci)
51{
52 int i;
53
54 g_return_if_fail (ci->fh != NULL);
55
56 for (i = 0; i < OUTPUT_NUM_PASSES - 1; i++) {
57 const char *name = orbit_idl_c_filename_for_pass (
58 rinfo->input_filename, 1 << i);
59 fprintf (ci->fh, "%s ", name);
60 }
61
62 fprintf (ci->fh, ": ");
63
64 output_deps (tree, rinfo, ci);
65
66 fprintf (ci->fh, "\n");
67}
Note: See TracBrowser for help on using the repository browser.