summaryrefslogtreecommitdiff
path: root/support/emacs-modes/fweave.ch
blob: 23482dcec6868af4d00a314a9e15ac1e9c117068 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
@x
@ This is the third phase.

@a 
SRTN phase_three(VOID) 
{
if (no_xref) 
	{
  finish_line();
  out_str("\\vfill\\end"); @+ finish_line();
	}
else 
	{
  phase=3; printf("\nWriting the index...");

  if (change_exists) 
		{
	    finish_line(); @<Tell about changed modules@>;
		  }

  finish_line(); 
out_str(w_style.indx.preamble); @+ finish_line();
@.\\Winx@>

  @<Do the first pass of sorting@>;
  @<Sort and output the index@>;
  out_str(w_style.indx.postamble); @+ finish_line();
@.\\Wfin@>

@<Print the command line, etc.@>;
  @<Output all the module names@>;
  out_str("\\Wcon"); @+ finish_line();
@.\\Wcon@>
	}

printf("Done.");
check_complete(); /* Was all of the change file used? */
}
@y
@ This is the third phase.
 
@a 
SRTN phase_three(VOID) 

{
if (no_xref) {
  finish_line();
  out_str("\\vfill\\end"); @+ finish_line();
	}
else 
	{
  phase=3; printf("\nWriting the index...");
  finish_line();
  out_str("\\input INDEX"); finish_line(); finish_line();
  out_str("\\input MODULE_NAMES"); finish_line();
  out_str("\\bigskip");
  @<Print the command line, etc.@>;
  out_str("\\Wcon"); @+ finish_line();
@.\\Wcon@>

  fclose(tex_file);
  if ((tex_file=fopen("INDEX.tex","w"))==NULL)
    fatal("! Cannot open ouput file ","INDEX.tex");

  if (change_exists) {
    @<Tell about changed modules@>;
    finish_line();  finish_line(); }

  out_str(w_style.indx.preamble); @+ finish_line();
@.\\Winx@>

  @<Do the first pass of sorting@>;
  @<Sort and output the index@>;
  out_str(w_style.indx.postamble); @+ finish_line();
@.\\Wfin@>

  fclose(tex_file);
  if ((tex_file=fopen("MODULE_NAMES.tex","w"))==NULL)
    fatal("! Cannot open ouput file ","MODULE_NAMES.tex");

  @<Output all the module names@>;

  fclose(tex_file); }

printf("Done. aTm 1.00");
check_complete(); /* Was all of the change file used? */
}
@z