~ubuntu-branches/ubuntu/karmic/fweb/karmic

« back to all changes in this revision

Viewing changes to Web/sfile.hweb

  • Committer: Bazaar Package Importer
  • Author(s): Yann Dirson
  • Date: 2002-01-04 23:20:22 UTC
  • Revision ID: james.westby@ubuntu.com-20020104232022-330ad4iyzpvb5bm4
Tags: upstream-1.62
ImportĀ upstreamĀ versionĀ 1.62

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@z --- sfile.hweb ---
 
2
 
 
3
FWEB version 1.62 (September 25, 1998)
 
4
 
 
5
Based on version 0.5 of S. Levy's CWEB [copyright (C) 1987 Princeton University]
 
6
 
 
7
@x-----------------------------------------------------------------------------
 
8
 
 
9
@ Now we deal with the possibility that we will be including files from
 
10
other than the current directory. Line commands may change the apparent
 
11
directory, so an include intended to be from the current directory may not
 
12
succeed. Here we'll code in the actual \FWEB\ directory structure, defining
 
13
two macros |VFILE| and |SFILE| to generate a file name from the top-level
 
14
directory or a specific subdirectory, respectively. In doing this, we use
 
15
the environmental built-in macro |_HOME|.  We construct the file name in Unix
 
16
format, even for~VMS. We do this in a special way so that we can then
 
17
use the |$TRANSLIT| built-in in two different ways depending on whether
 
18
we're on the VAX or a Unix system. 
 
19
 
 
20
@m VFILE(name) #name
 
21
@m SFILE(name) #name
 
22
 
 
23
@#if 0
 
24
 
 
25
@#ifndef FWEB_HOME
 
26
        @m FWEB_HOME _HOME/fweb/v1 /* E.g., \.{/u/krommes/fweb/v1}. */
 
27
@#endif
 
28
 
 
29
@#ifndef SDIR /* One might override this from the command line or ini file. */
 
30
 
 
31
/* \.{Machine-dependent}: Specify location of the bootstrap code. */ 
 
32
        @#if ANSI
 
33
                @m SDIR FWEB_HOME/unix/ansi
 
34
        @#elif APOLLO
 
35
                @m SDIR FWEB_HOME/unix/apollo
 
36
        @#elif IBMPC
 
37
                @m SDIR FWEB_HOME/pc
 
38
        @#elif DSU
 
39
                @m SDIR FWEB_HOME/unix/dsu
 
40
        @#elif MAC
 
41
                @m SDIR FWEB_HOME/unix/mac
 
42
        @#elif MISC
 
43
                @m SDIR FWEB_HOME/misc
 
44
        @#elif SGI
 
45
                @m SDIR FWEB_HOME/unix/sgi
 
46
        @#elif SUN
 
47
                @m SDIR FWEB_HOME/unix/sun
 
48
        @#elif VAX 
 
49
                @m SDIR FWEB_HOME/vax
 
50
        @#else
 
51
                @m SDIR . /* Current directory. */
 
52
        @#endif /* Bootstrap locations. */
 
53
 
 
54
@#endif /* |SDIR| */
 
55
 
 
56
@#ifdef VFILE
 
57
        @m VFILE(name) FL_NM_FMT(FWEB_HOME,#!name) /* File in top-level
 
58
directory. */ 
 
59
@#else
 
60
        @m VFILE(name) #name
 
61
@#endif /* |VFILE| */
 
62
 
 
63
@#ifdef SFILE
 
64
        @m SFILE(name) FL_NM_FMT(SDIR,#!name) /* File in specific
 
65
subdirectory. */ 
 
66
@#else
 
67
        @m SFILE(name) #name
 
68
@#endif /* |SFILE| */
 
69
 
 
70
@m FL_NM_FMT(sub,name) FL_NM_FMT0(sub>#!name)
 
71
 
 
72
/* \.{Machine-dependent}: Translate file-name formats. */
 
73
@#if VAX 
 
74
        @m FL_NM_FMT0(name) $STRING($TRANSLIT(#name,"/>]",".]")) /* \.] is
 
75
deleted. */ 
 
76
@#elif IBMPC
 
77
        @m FL_NM_FMT0(name) $STRING($TRANSLIT(#name,">","\\")) /* The PC is
 
78
                perverse, using backslashes. */
 
79
@#else
 
80
        @m FL_NM_FMT0(name) $STRING($TRANSLIT(#name,">","/")) /* Standard Unix,
 
81
                with forward slashes. */
 
82
@#endif /* File-name format translations. */
 
83
 
 
84
/* \.{Machine-dependent}: The |SYS_PATH| macro is used for such things as
 
85
\.{sys/types.h} that have slashes in them. */
 
86
@#if IBMPC
 
87
        @m SYS_PATH(name) <$TRANSLIT(#name,"/","\\")>
 
88
@#else
 
89
        @m SYS_PATH(name) <#!name>
 
90
@#endif /* |IBMPC| */
 
91
 
 
92
@#endif