home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume19 / shape / part10 < prev    next >
Encoding:
Internet Message Format  |  1989-05-31  |  56.9 KB

  1. Subject:  v19i023:  A software configuration management system, Part10/33
  2. Newsgroups: comp.sources.unix
  3. Sender: sources
  4. Approved: rsalz@uunet.UU.NET
  5.  
  6. Submitted-by: Axel Mahler <unido!coma!axel>
  7. Posting-number: Volume 19, Issue 23
  8. Archive-name: shape/part10
  9.  
  10.  
  11.  
  12. #! /bin/sh
  13. # This is a shell archive.  Remove anything before this line, then unpack
  14. # it by saving it into a file and typing "sh file".  To overwrite existing
  15. # files, type "sh file -c".  You can also feed this as standard input via
  16. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  17. # will see the following message at the end:
  18. #        "End of archive 10 (of 33)."
  19. # Contents:  man/man1/vl.1 man/man1/vlog.1 src/afs/lcs.cdlt.c
  20. #   src/shape/Makefile src/shape/std.c src/vc/vadm_promote.c
  21. # Wrapped by rsalz@papaya.bbn.com on Thu Jun  1 19:26:59 1989
  22. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  23. if test -f 'man/man1/vl.1' -a "${1}" != "-c" ; then 
  24.   echo shar: Will not clobber existing file \"'man/man1/vl.1'\"
  25. else
  26. echo shar: Extracting \"'man/man1/vl.1'\" \(8434 characters\)
  27. sed "s/^X//" >'man/man1/vl.1' <<'END_OF_FILE'
  28. X...
  29. X... Copyright (C) 1989, 1990 W. Koch, A. Lampen, A. Mahler, W. Obst,
  30. X...  and U. Pralle
  31. X... 
  32. X... This software is published on an as-is basis. There is ABSOLUTELY NO
  33. X... WARRANTY for any part of this software to work correctly or as described
  34. X... in the manuals. We do not accept any liability for any kind of damage
  35. X... caused by use of this software, such as loss of data, time, money, or 
  36. X... effort.
  37. X... 
  38. X... Permission is granted to use, copy, modify, or distribute any part of
  39. X... this software as long as this is done without asking for charge, and
  40. X... provided that this copyright notice is retained as part of the source
  41. X... files. You may charge a distribution fee for the physical act of
  42. X... transferring a copy, and you may at your option offer warranty
  43. X... protection in exchange for a fee.
  44. X... 
  45. X... Direct questions to: Tech. Univ. Berlin
  46. X...              Wilfried Koch
  47. X...              Sekr. FR 5-6 
  48. X...              Franklinstr. 28/29
  49. X...              D-1000 Berlin 10, West Germany
  50. X... 
  51. X...              Tel: +49-30-314-22972
  52. X...              E-mail: shape@coma.uucp or shape@db0tui62.bitnet
  53. X... 
  54. X...
  55. X... $Header: vl.1[1.3] Thu Feb 23 18:14:41 1989 axel@coma published $
  56. X... 
  57. X... Log for /u/shape/dist-tape/src/vc/vl.1[1.2]
  58. X...     Thu Feb 23 18:14:41 1989 axel@coma published $
  59. X...  --- empty log message ---
  60. X...  vl.1[1.3] Thu Feb 23 18:14:41 1989 axel@coma published $
  61. X...  --- empty log message ---
  62. X...
  63. X.TH VL 1 vl \n(dy.\n(mo.\n(yr
  64. X.SH NAME
  65. Xvl \- list version information
  66. X.SH SYNOPSIS
  67. X.IP \fBvl\fR
  68. X[\ \fB\-AbghHlLSuU\fR\ ]\ [\ \fB\-V\ \fI<version>\fR\ ]
  69. X[\ \fB\-author\ \fI<userid>\fR\ ]\ [\ \fB\-owner\ \fI<userid>\fR\ ]
  70. X.br
  71. X[\ \fB\-u:\fI <udaspec>\fR\ ]\ [\ \fB\-version\fR\ ]\ [\ files \.\|.\ ]
  72. X.IP \fBvlog\fR
  73. X[\ \fB\-V\ \fI <version>\fR\ ] files \.\|.
  74. X.SH DESCRIPTION
  75. X.PP
  76. X\fBVl\fR prints various informations about an AFS object base.
  77. XWhile its main operation is to list the contents of an object base
  78. Xin a manner similar to ls(1), \fBvl\fR knows about many options 
  79. Xthat extract additional information about individual object histories
  80. Xor the entire object base.
  81. X.PP
  82. XIf \fBvl\fR is invoked without any options or filenames, it simply 
  83. Xprints the contents of the object base, including files (\fIbusy versions\fR)
  84. Xand directories in the current directory. Version objects in
  85. Xthe object base are represented as filenames with a bracketed
  86. X\fIversion identification extension\fR. 
  87. XGenerally, \fBvl\fR tries to give the illusion,
  88. Xas were all the versions in the object base regular files in the current
  89. Xdirectory. While busy versions \- which are regular files \- may be 
  90. Xmanipulated by all commands and tools that operate on files, version
  91. Xobjects can only be manipulated by special tools that operate 
  92. Xon the object base. The tools that operate on the object base, however,
  93. Xcan also access regular files because these are also part of the object base
  94. X(see: Lampen/Mahler, \(lqAn Object Base for Attributed Software Objects\(rq, 
  95. XProceedings of the EUUG Fall '88 Conference, Lisbon).
  96. X.PP
  97. XIf filenames are given as arguments to \fBvl\fR, similarly to ls(1)
  98. Xonly information about these object histories will be printed.
  99. XObject names may also be given in \fIbound version notation\fR,
  100. Xi.e. a notation that identifies a particular version of an object (e.g.
  101. X\fCmkattr.c[2.4]\fR). It is also possible to use a previously assigned
  102. X\fIsymbolic name\fR rather than a numerical 
  103. Xversion identification (e.g. \fCmkattr.c[tools-V4R3]\fR). Make sure
  104. Xto escape the bracket-symbols as these usually have meaning to the
  105. Xshell.
  106. X.PP
  107. XThe program \fBvlog\fR prints the log-entry for specified objects.
  108. XLog-entries usually describe the reason for a particular change
  109. Xto the design object that led to the creation of the specified
  110. Xrevision(s).
  111. X.PP
  112. XThe following options that may be supplied to \fBvl\fR determine the
  113. Xamount of information that will be printed about objects in the 
  114. Xobject base.
  115. X.IP \fB\-l\fR \w'\fB\-owner\ \fI<userid>++\fR'u
  116. XList in long format, giving mode, version state, owner, size in bytes,
  117. Xthe save date, and version identification. 
  118. XFor busy versions
  119. Xthe date field will contain the time of last modification rather than
  120. Xthe save date. The \fIstatus\fR of a version is
  121. Xprinted as: \fBb\fR for \fBbusy\fR, \fBs\fR for \fBsave\fR, \fBp\fR for
  122. X\fBproposed\fR, \fBP\fR for \fBpublished\fR and \fBf\fR for \fBfrozen\fR.
  123. XEach entry of the resulting list is printed on one line.
  124. X.IP \fB\-g\fR
  125. XInclude the group of the version in long output.
  126. X.IP \fB\-a\fR
  127. XList also hidden files (i.e. files with a name beginning with a '\.').
  128. X.IP \fB\-b\fR
  129. XList also objects that are stored in the binary pool.
  130. X.IP \fB\-q\fR
  131. XPrint no information, just set the exit status. This option is useful 
  132. Xto test for the existence of a particular (set of) objects in the 
  133. Xobject base.
  134. X.IP \fB\-h\fR
  135. XPrint brief instructions about how to use this program. 
  136. X.IP \fB\-s\fI\ <state>\fR
  137. XPrint only information about objects that have the specified \fIstate\fR.
  138. XThe state is specified as a single letter (s = save, p = proposed,
  139. XP = published, a = accessed, f = frozen). The letter denoting the state
  140. Xmay be followed by a '+' character, specifying all objects that have
  141. Xthe given or a higher state.
  142. X.IP \fB\-author\fI\ <userid>\fR
  143. XPrint only information about objects that have the specified \fIauthor\fR.
  144. XAuthor may be any valid user id on the current host or in the local
  145. Xnetwork. \fIUserid\fR may be specified either as \fIname\fR or 
  146. X\fIname@host\fR. In case the host part is omitted, the local
  147. Xhost will be assumed.
  148. X.IP \fB\-owner\fI\ <userid>\fR
  149. XPrint only information about objects that have the specified \fIowner\fR.
  150. XOwner may be any valid user id on the current host or in the local
  151. Xnetwork. \fIUserid\fR may be specified either as \fIname\fR or 
  152. X\fIname@host\fR. In case the host part is omitted, the local
  153. Xhost will be assumed.
  154. X.IP \fB\-n\ \fI<sym-name>\fR
  155. XPrint only information about objects having the specified \fIsymbolic name\fR
  156. Xassigned to them. Assignment of symbolic names is often used to mark
  157. Xobject revisions that are part of the same configuration. If \- for
  158. Xexample \- all components of a configuration are marked with the symbolic
  159. Xname \fCtoolpack_V4R3\fR (could be done by \fBshape\fR or 
  160. Xmake(1), using \fBsave\fR or \fBvadm\fR), it will be easy to find these 
  161. Xobjects later by issuing the command:
  162. X.RS
  163. X.DS
  164. X\fCvl -n toolpack_V4R3\fR
  165. X.DE
  166. X.RE
  167. X.IP \fB\-u\fR
  168. XList user defined attributes (\fBuda\fR). Only objects that actually
  169. Xhave user defined attributes will be printed.
  170. X.IP \fB\-U\fR
  171. XLike \fB\-u\fR, but print also the values of user defined attributes.
  172. X.IP \fB\-u:udaspec\fR
  173. XPrint only information about objects that have the specified user
  174. Xdefined attribute(s) with the given values. The command:
  175. X.RS
  176. X.DS
  177. X\fCvl -u:foo=bar,crack=uli\fR
  178. X.DE
  179. Xwould print only those objects, that have the attributes \(lqfoo\(rq and
  180. X\(lqcrack\(rq with the given values.
  181. XIf this option is given as \fB\-ux\fR, also \fIhidden attributes\fR that are
  182. Xused by the version control system and the \fBshape\fR program are
  183. Xprinted.
  184. X.RE
  185. X.IP \fB\-V\ \fI<version>\fR
  186. XPrint only information about the objects determined by \fIversion\fR. 
  187. X\fIVersion\fR can be of the form
  188. X\fIgeneration.revision\fR (e.g. \fC\-V1.19\fR) or \fIgeneration.\fR (e.g.
  189. X\fC\-V2.\fR
  190. Xlists all versions with generation number = 2), or \fI.revision\fR (e.g. 
  191. X\fC\-V.3\fR lists all versions with revision number = 3).
  192. X.IP \fB\-L\fR
  193. XPrint the \fIlogentry\fR for the specified objects. The logentry usually
  194. Xdescibes the nature of a particular change that led to the creation
  195. Xof a new version. See also \fBvlog\fR.
  196. X.IP \fB\-H[\fB+\fR]
  197. XPrint a continuous log-history for the specified objects, beginning
  198. Xat revision 1.0. If a version number is specified by \fB\-V\fR the
  199. Xlog-history is printed from the first revision up to the specified
  200. Xversion. If the option letter \fB\-H\fR is immediately followed by
  201. X\fB+\fR, the log-history is printed from the specified version (-V)
  202. Xup to the last saved version.
  203. X.IP \fB\-version\fR
  204. XPrint the version identification of this program.
  205. X.SH SEE ALSO
  206. Xsave(1), retrv(1), rsrv(1), sbmt(1), shape(1), vadm(1), 
  207. Xaf_intro(3), af_archive(5)
  208. X.SH BUGS
  209. XThe program has difficulties to handle options with optional arguments
  210. Xproperly. Options that have optional arguments should be set at the
  211. Xend of a command line.
  212. X.PP
  213. XThe \fB\-H\fR option does not work.
  214. X.SH AUTHOR
  215. XUli Pralle
  216. X.br
  217. XTechnical University Berlin
  218. X.sp
  219. X\fIUUCP:\fR        uli@coma.uucp (unido!coma!uli)
  220. X.br
  221. X\fIBITNET:\fR    uli@db0tui62
  222. END_OF_FILE
  223. if test 8434 -ne `wc -c <'man/man1/vl.1'`; then
  224.     echo shar: \"'man/man1/vl.1'\" unpacked with wrong size!
  225. fi
  226. # end of 'man/man1/vl.1'
  227. fi
  228. if test -f 'man/man1/vlog.1' -a "${1}" != "-c" ; then 
  229.   echo shar: Will not clobber existing file \"'man/man1/vlog.1'\"
  230. else
  231. echo shar: Extracting \"'man/man1/vlog.1'\" \(8434 characters\)
  232. sed "s/^X//" >'man/man1/vlog.1' <<'END_OF_FILE'
  233. X...
  234. X... Copyright (C) 1989, 1990 W. Koch, A. Lampen, A. Mahler, W. Obst,
  235. X...  and U. Pralle
  236. X... 
  237. X... This software is published on an as-is basis. There is ABSOLUTELY NO
  238. X... WARRANTY for any part of this software to work correctly or as described
  239. X... in the manuals. We do not accept any liability for any kind of damage
  240. X... caused by use of this software, such as loss of data, time, money, or 
  241. X... effort.
  242. X... 
  243. X... Permission is granted to use, copy, modify, or distribute any part of
  244. X... this software as long as this is done without asking for charge, and
  245. X... provided that this copyright notice is retained as part of the source
  246. X... files. You may charge a distribution fee for the physical act of
  247. X... transferring a copy, and you may at your option offer warranty
  248. X... protection in exchange for a fee.
  249. X... 
  250. X... Direct questions to: Tech. Univ. Berlin
  251. X...              Wilfried Koch
  252. X...              Sekr. FR 5-6 
  253. X...              Franklinstr. 28/29
  254. X...              D-1000 Berlin 10, West Germany
  255. X... 
  256. X...              Tel: +49-30-314-22972
  257. X...              E-mail: shape@coma.uucp or shape@db0tui62.bitnet
  258. X... 
  259. X...
  260. X... $Header: vl.1[1.3] Thu Feb 23 18:14:41 1989 axel@coma published $
  261. X... 
  262. X... Log for /u/shape/dist-tape/src/vc/vl.1[1.2]
  263. X...     Thu Feb 23 18:14:41 1989 axel@coma published $
  264. X...  --- empty log message ---
  265. X...  vl.1[1.3] Thu Feb 23 18:14:41 1989 axel@coma published $
  266. X...  --- empty log message ---
  267. X...
  268. X.TH VL 1 vl \n(dy.\n(mo.\n(yr
  269. X.SH NAME
  270. Xvl \- list version information
  271. X.SH SYNOPSIS
  272. X.IP \fBvl\fR
  273. X[\ \fB\-AbghHlLSuU\fR\ ]\ [\ \fB\-V\ \fI<version>\fR\ ]
  274. X[\ \fB\-author\ \fI<userid>\fR\ ]\ [\ \fB\-owner\ \fI<userid>\fR\ ]
  275. X.br
  276. X[\ \fB\-u:\fI <udaspec>\fR\ ]\ [\ \fB\-version\fR\ ]\ [\ files \.\|.\ ]
  277. X.IP \fBvlog\fR
  278. X[\ \fB\-V\ \fI <version>\fR\ ] files \.\|.
  279. X.SH DESCRIPTION
  280. X.PP
  281. X\fBVl\fR prints various informations about an AFS object base.
  282. XWhile its main operation is to list the contents of an object base
  283. Xin a manner similar to ls(1), \fBvl\fR knows about many options 
  284. Xthat extract additional information about individual object histories
  285. Xor the entire object base.
  286. X.PP
  287. XIf \fBvl\fR is invoked without any options or filenames, it simply 
  288. Xprints the contents of the object base, including files (\fIbusy versions\fR)
  289. Xand directories in the current directory. Version objects in
  290. Xthe object base are represented as filenames with a bracketed
  291. X\fIversion identification extension\fR. 
  292. XGenerally, \fBvl\fR tries to give the illusion,
  293. Xas were all the versions in the object base regular files in the current
  294. Xdirectory. While busy versions \- which are regular files \- may be 
  295. Xmanipulated by all commands and tools that operate on files, version
  296. Xobjects can only be manipulated by special tools that operate 
  297. Xon the object base. The tools that operate on the object base, however,
  298. Xcan also access regular files because these are also part of the object base
  299. X(see: Lampen/Mahler, \(lqAn Object Base for Attributed Software Objects\(rq, 
  300. XProceedings of the EUUG Fall '88 Conference, Lisbon).
  301. X.PP
  302. XIf filenames are given as arguments to \fBvl\fR, similarly to ls(1)
  303. Xonly information about these object histories will be printed.
  304. XObject names may also be given in \fIbound version notation\fR,
  305. Xi.e. a notation that identifies a particular version of an object (e.g.
  306. X\fCmkattr.c[2.4]\fR). It is also possible to use a previously assigned
  307. X\fIsymbolic name\fR rather than a numerical 
  308. Xversion identification (e.g. \fCmkattr.c[tools-V4R3]\fR). Make sure
  309. Xto escape the bracket-symbols as these usually have meaning to the
  310. Xshell.
  311. X.PP
  312. XThe program \fBvlog\fR prints the log-entry for specified objects.
  313. XLog-entries usually describe the reason for a particular change
  314. Xto the design object that led to the creation of the specified
  315. Xrevision(s).
  316. X.PP
  317. XThe following options that may be supplied to \fBvl\fR determine the
  318. Xamount of information that will be printed about objects in the 
  319. Xobject base.
  320. X.IP \fB\-l\fR \w'\fB\-owner\ \fI<userid>++\fR'u
  321. XList in long format, giving mode, version state, owner, size in bytes,
  322. Xthe save date, and version identification. 
  323. XFor busy versions
  324. Xthe date field will contain the time of last modification rather than
  325. Xthe save date. The \fIstatus\fR of a version is
  326. Xprinted as: \fBb\fR for \fBbusy\fR, \fBs\fR for \fBsave\fR, \fBp\fR for
  327. X\fBproposed\fR, \fBP\fR for \fBpublished\fR and \fBf\fR for \fBfrozen\fR.
  328. XEach entry of the resulting list is printed on one line.
  329. X.IP \fB\-g\fR
  330. XInclude the group of the version in long output.
  331. X.IP \fB\-a\fR
  332. XList also hidden files (i.e. files with a name beginning with a '\.').
  333. X.IP \fB\-b\fR
  334. XList also objects that are stored in the binary pool.
  335. X.IP \fB\-q\fR
  336. XPrint no information, just set the exit status. This option is useful 
  337. Xto test for the existence of a particular (set of) objects in the 
  338. Xobject base.
  339. X.IP \fB\-h\fR
  340. XPrint brief instructions about how to use this program. 
  341. X.IP \fB\-s\fI\ <state>\fR
  342. XPrint only information about objects that have the specified \fIstate\fR.
  343. XThe state is specified as a single letter (s = save, p = proposed,
  344. XP = published, a = accessed, f = frozen). The letter denoting the state
  345. Xmay be followed by a '+' character, specifying all objects that have
  346. Xthe given or a higher state.
  347. X.IP \fB\-author\fI\ <userid>\fR
  348. XPrint only information about objects that have the specified \fIauthor\fR.
  349. XAuthor may be any valid user id on the current host or in the local
  350. Xnetwork. \fIUserid\fR may be specified either as \fIname\fR or 
  351. X\fIname@host\fR. In case the host part is omitted, the local
  352. Xhost will be assumed.
  353. X.IP \fB\-owner\fI\ <userid>\fR
  354. XPrint only information about objects that have the specified \fIowner\fR.
  355. XOwner may be any valid user id on the current host or in the local
  356. Xnetwork. \fIUserid\fR may be specified either as \fIname\fR or 
  357. X\fIname@host\fR. In case the host part is omitted, the local
  358. Xhost will be assumed.
  359. X.IP \fB\-n\ \fI<sym-name>\fR
  360. XPrint only information about objects having the specified \fIsymbolic name\fR
  361. Xassigned to them. Assignment of symbolic names is often used to mark
  362. Xobject revisions that are part of the same configuration. If \- for
  363. Xexample \- all components of a configuration are marked with the symbolic
  364. Xname \fCtoolpack_V4R3\fR (could be done by \fBshape\fR or 
  365. Xmake(1), using \fBsave\fR or \fBvadm\fR), it will be easy to find these 
  366. Xobjects later by issuing the command:
  367. X.RS
  368. X.DS
  369. X\fCvl -n toolpack_V4R3\fR
  370. X.DE
  371. X.RE
  372. X.IP \fB\-u\fR
  373. XList user defined attributes (\fBuda\fR). Only objects that actually
  374. Xhave user defined attributes will be printed.
  375. X.IP \fB\-U\fR
  376. XLike \fB\-u\fR, but print also the values of user defined attributes.
  377. X.IP \fB\-u:udaspec\fR
  378. XPrint only information about objects that have the specified user
  379. Xdefined attribute(s) with the given values. The command:
  380. X.RS
  381. X.DS
  382. X\fCvl -u:foo=bar,crack=uli\fR
  383. X.DE
  384. Xwould print only those objects, that have the attributes \(lqfoo\(rq and
  385. X\(lqcrack\(rq with the given values.
  386. XIf this option is given as \fB\-ux\fR, also \fIhidden attributes\fR that are
  387. Xused by the version control system and the \fBshape\fR program are
  388. Xprinted.
  389. X.RE
  390. X.IP \fB\-V\ \fI<version>\fR
  391. XPrint only information about the objects determined by \fIversion\fR. 
  392. X\fIVersion\fR can be of the form
  393. X\fIgeneration.revision\fR (e.g. \fC\-V1.19\fR) or \fIgeneration.\fR (e.g.
  394. X\fC\-V2.\fR
  395. Xlists all versions with generation number = 2), or \fI.revision\fR (e.g. 
  396. X\fC\-V.3\fR lists all versions with revision number = 3).
  397. X.IP \fB\-L\fR
  398. XPrint the \fIlogentry\fR for the specified objects. The logentry usually
  399. Xdescibes the nature of a particular change that led to the creation
  400. Xof a new version. See also \fBvlog\fR.
  401. X.IP \fB\-H[\fB+\fR]
  402. XPrint a continuous log-history for the specified objects, beginning
  403. Xat revision 1.0. If a version number is specified by \fB\-V\fR the
  404. Xlog-history is printed from the first revision up to the specified
  405. Xversion. If the option letter \fB\-H\fR is immediately followed by
  406. X\fB+\fR, the log-history is printed from the specified version (-V)
  407. Xup to the last saved version.
  408. X.IP \fB\-version\fR
  409. XPrint the version identification of this program.
  410. X.SH SEE ALSO
  411. Xsave(1), retrv(1), rsrv(1), sbmt(1), shape(1), vadm(1), 
  412. Xaf_intro(3), af_archive(5)
  413. X.SH BUGS
  414. XThe program has difficulties to handle options with optional arguments
  415. Xproperly. Options that have optional arguments should be set at the
  416. Xend of a command line.
  417. X.PP
  418. XThe \fB\-H\fR option does not work.
  419. X.SH AUTHOR
  420. XUli Pralle
  421. X.br
  422. XTechnical University Berlin
  423. X.sp
  424. X\fIUUCP:\fR        uli@coma.uucp (unido!coma!uli)
  425. X.br
  426. X\fIBITNET:\fR    uli@db0tui62
  427. END_OF_FILE
  428. if test 8434 -ne `wc -c <'man/man1/vlog.1'`; then
  429.     echo shar: \"'man/man1/vlog.1'\" unpacked with wrong size!
  430. fi
  431. # end of 'man/man1/vlog.1'
  432. fi
  433. if test -f 'src/afs/lcs.cdlt.c' -a "${1}" != "-c" ; then 
  434.   echo shar: Will not clobber existing file \"'src/afs/lcs.cdlt.c'\"
  435. else
  436. echo shar: Extracting \"'src/afs/lcs.cdlt.c'\" \(8724 characters\)
  437. sed "s/^X//" >'src/afs/lcs.cdlt.c' <<'END_OF_FILE'
  438. X/*
  439. X * Copyright (C) 1989, 1990 W. Koch, A. Lampen, A. Mahler, W. Obst,
  440. X *  and U. Pralle
  441. X * 
  442. X * This software is published on an as-is basis. There is ABSOLUTELY NO
  443. X * WARRANTY for any part of this software to work correctly or as described
  444. X * in the manuals. We do not accept any liability for any kind of damage
  445. X * caused by use of this software, such as loss of data, time, money, or 
  446. X * effort.
  447. X * 
  448. X * Permission is granted to use, copy, modify, or distribute any part of
  449. X * this software as long as this is done without asking for charge, and
  450. X * provided that this copyright notice is retained as part of the source
  451. X * files. You may charge a distribution fee for the physical act of
  452. X * transferring a copy, and you may at your option offer warranty
  453. X * protection in exchange for a fee.
  454. X * 
  455. X * Direct questions to: Tech. Univ. Berlin
  456. X *              Wilfried Koch
  457. X *              Sekr. FR 5-6 
  458. X *              Franklinstr. 28/29
  459. X *              D-1000 Berlin 10, West Germany
  460. X * 
  461. X *              Tel: +49-30-314-22972
  462. X *              E-mail: shape@coma.uucp or shape@db0tui62.bitnet
  463. X */
  464. X
  465. X/* ================================================== */
  466. X/* ================================================== */
  467. X/*                                                    */
  468. X/* MODULE-NAME: cdlt        KEY : cd                  */
  469. X/*              = compute delta                       */
  470. X/* ORIGINAL                                           */
  471. X/* AUTHOR : sibylle         DATE: 28/07/87            */
  472. X/*                                                    */
  473. X/* LAST UPDATE                                        */
  474. X/* AUTHOR :                 DATE:                     */
  475. X/*                                                    */
  476. X/* VERSION: 1.9.2                                     */
  477. X/*                                                    */
  478. X/* ================================================== */
  479. X/*                                                    */
  480. X/* PURPOSE:                                           */
  481. X/*                computation of the delta;           */
  482. X/*                generation of a suffix tree         */
  483. X/*                                                    */
  484. X/* SPECIALITIES:                                      */
  485. X/*                binary files can be handled;        */
  486. X/*                usage of register variables;        */
  487. X/*                hash-offset computed with           */
  488. X/*                shift operations                    */
  489. X/*                                                    */
  490. X/* EXCEPTIONS, ERRORS:                                */
  491. X/*                none                                */
  492. X/*                                                    */
  493. X/* ================================================== */
  494. X/*                                                    */
  495. X/*
  496. X * $Header: lcs.cdlt.c[1.0] Wed Feb 22 16:14:17 1989 shape@coma save $
  497. X */
  498. X
  499. X
  500. X# include "predef.h"
  501. X# include <stdio.h>
  502. X# include "suffix.h"  
  503. X
  504. X#define HASH(STRING,OFFSET)\
  505. X        STRING[OFFSET] +\
  506. X        (STRING[OFFSET + 4] << 1) +\
  507. X        (STRING[OFFSET + 7] << 2) +\
  508. X        (STRING[OFFSET + 11] << 3) +\
  509. X        (STRING[OFFSET + 15] << 4) +\
  510. X        (STRING[OFFSET + 17] << 5)
  511. X
  512. Xextern void ge_add();
  513. Xextern void ge_move();
  514. Xextern void ge_init();
  515. Xextern void ge_finit(); 
  516. Xextern char *malloc();
  517. Xextern char *calloc();
  518. Xextern int bcmp();
  519. X
  520. XLOCAL long src_size = (long) 0;
  521. XLOCAL long trg_size = (long) 0;
  522. XLOCAL char *src_str = NIL;
  523. XLOCAL char *trg_str = NIL;
  524. XLOCAL struct suffixes *suff_array = (struct suffixes *) NIL;
  525. X
  526. X
  527. XLOCAL Bool identical (str1, str2, length1, length2)
  528. X     char *str1, *str2;
  529. X     long length1, length2;
  530. X{
  531. X  if (length1 != length2)
  532. X    return (FALSE);
  533. X  else
  534. X    {
  535. X      if ((bcmp (str1, str2, (int) length1)) == 0)
  536. X    return (TRUE);
  537. X      else 
  538. X    return (FALSE);
  539. X    }
  540. X}
  541. X
  542. XLOCAL Bool build_suffix_tree (string,length)
  543. X     register char *string;
  544. X     long length;
  545. X{
  546. X  register struct indices *current;
  547. X  register int i = 0;
  548. X  register int hash;
  549. X
  550. X  suff_array = (struct suffixes *) malloc(TREESIZE * sizeof (struct suffixes));
  551. X  if (suff_array == (struct suffixes *) NIL)
  552. X    return (FALSE);
  553. X
  554. X  bzero((char *)suff_array, TREESIZE * sizeof(struct suffixes));
  555. X
  556. X  hash =abs(HASH( string, 0));
  557. X  if ((suff_array[hash].next  = (struct indices *) malloc( sizeof (struct indices)))== 0)
  558. X    return (FALSE);
  559. X
  560. X;
  561. X  suff_array[hash].last = suff_array[hash].next;
  562. X  suff_array[hash].next->index = 0;
  563. X  suff_array[hash].next->next = (struct indices *) NIL;
  564. X
  565. X  for (i = 1; i < (length - (MINBLENG - 1)); i++) 
  566. X    {
  567. X      hash = abs(HASH(string,i));
  568. X      if (suff_array[hash].last != (struct indices *) NIL )
  569. X    {
  570. X      if ((current = suff_array[hash].last->next =
  571. X           (struct indices *) malloc( sizeof (struct indices))) == 0)
  572. X        return (FALSE);
  573. X      current->next = (struct indices *) 0;
  574. X      current->index = 0;
  575. X/*      suff_array[hash].last->next = (struct indices * ) 0;
  576. X      suff_array[hash].last->index = 0; */
  577. X    }
  578. X      else
  579. X    {
  580. X      if ((current = suff_array[hash].next =
  581. X      (struct indices *) malloc( sizeof (struct indices))) == 0)
  582. X        return(FALSE);
  583. X      current->next = (struct indices *) 0;
  584. X      current->index = 0;
  585. X/*      suff_array[hash].next->next = (struct indices * ) 0;
  586. X      suff_array[hash].next->index = 0; */
  587. X    }
  588. X      suff_array[hash].last = current;
  589. X  
  590. X      current->index = i;
  591. X    }
  592. X  return (TRUE);
  593. X}
  594. X
  595. X
  596. XLOCAL void find_max_bm(t_str, s_str, t_offset, s_offset, leng)
  597. X     register char *t_str, *s_str;
  598. X     long t_offset;
  599. X     long *s_offset, *leng;
  600. X{
  601. X  register struct indices *current;
  602. X  register int i,j;
  603. X  register int hash;
  604. X  int off;
  605. X  int max;
  606. X  
  607. X  hash = abs(HASH(t_str, t_offset));
  608. X  if (suff_array[hash].next == (struct indices *) NIL)
  609. X    *leng = 0;
  610. X  else
  611. X    {
  612. X      max = 0;
  613. X      off = 0;
  614. X      current = suff_array[hash].next;
  615. X      while (current != (struct indices *) NIL)
  616. X    {
  617. X      i = current->index;
  618. X      j = t_offset;
  619. X      while ((i < src_size) && (j < trg_size) && 
  620. X         (t_str[j] == s_str[i])) 
  621. X        {
  622. X          j++;
  623. X          i++;
  624. X        }
  625. X      if ((i - current->index > max) &&
  626. X          (t_str[t_offset] == s_str[current->index]) &&
  627. X          (t_str[t_offset + 1] == s_str[current->index + 1]))
  628. X        {
  629. X          max = i - current->index;
  630. X          off = current->index;
  631. X        }
  632. X      current = current->next;
  633. X      if (current != (struct indices *) NIL)
  634. X        {
  635. X          while (((t_offset + max) < trg_size) &&
  636. X             ((current->index + max) < src_size) &&
  637. X             (t_str[t_offset + max] !=
  638. X              s_str[current->index + max]) &&
  639. X             (current->next != (struct indices *) NIL))
  640. X        current = current->next;
  641. X        }
  642. X    }
  643. X      *s_offset = off;
  644. X    if(max >= MINBLENG )
  645. X      *leng = max;
  646. X    else
  647. X      *leng = 0;
  648. X    }
  649. X  return;
  650. X}
  651. X
  652. X
  653. X
  654. XEXPORT Bool cd_init_delta(sourcestr, targetstr, sourcesz, targetsz)
  655. X     char *sourcestr, *targetstr;
  656. X     long sourcesz, targetsz;
  657. X{
  658. X  src_size = sourcesz;
  659. X  trg_size = targetsz;
  660. X  src_str = sourcestr;
  661. X  trg_str = targetstr;
  662. X
  663. X  return(TRUE);
  664. X
  665. X}
  666. X
  667. X
  668. XEXPORT void cd_finit_delta()
  669. X{
  670. X  int i;
  671. X  struct indices *curind;
  672. X  struct indices *delind;
  673. X  for(i = 0; i < TREESIZE; i++)
  674. X    {
  675. X      if(suff_array[i].next != (struct indices *) NIL)
  676. X    {
  677. X      curind = suff_array[i].next;
  678. X      while(curind != suff_array[i].last)
  679. X        {
  680. X          delind = curind;
  681. X          curind = curind->next;
  682. X          free((char *)delind);
  683. X        }
  684. X      free((char *)curind);
  685. X    }
  686. X    }
  687. X  free ((char *)suff_array);
  688. X  return;
  689. X}
  690. X
  691. X
  692. XEXPORT Bool cd_comp_delta (deltafile)
  693. X     char *deltafile;
  694. X{
  695. X  register long trg_index = 0;
  696. X  long src_index, matchlength;
  697. X  register long nomtch_trg_index = 0, nomtchlength = 0;
  698. X
  699. X  Bool nomatch = FALSE;
  700. X
  701. X  ge_init (deltafile, trg_str);
  702. X
  703. X  if (identical (src_str, trg_str, src_size, trg_size))
  704. X    {
  705. X      ge_finit();
  706. X      return (TRUE);
  707. X    }
  708. X
  709. X  if ((src_size <= MINBLENG) || (trg_size <= MINBLENG))
  710. X    {
  711. X      ge_add ((long)0, trg_size);
  712. X      ge_finit();
  713. X      return(TRUE);
  714. X    }
  715. X  (void) build_suffix_tree (src_str, src_size);
  716. X  while (trg_index < (trg_size - (MINBLENG - 1)))
  717. X    {
  718. X      find_max_bm (trg_str, src_str, trg_index, &src_index, &matchlength);
  719. X      if (matchlength > 0)
  720. X    {
  721. X      if (nomatch)
  722. X        {
  723. X          ge_add (nomtch_trg_index, nomtchlength); 
  724. X          nomtch_trg_index = 0;
  725. X          nomtchlength = 0;
  726. X          nomatch = FALSE;
  727. X        }
  728. X      ge_move (src_index, matchlength);
  729. X      trg_index = trg_index + matchlength;
  730. X    }
  731. X      else
  732. X    {
  733. X      if (nomatch)
  734. X        nomtchlength++;
  735. X      else
  736. X        {
  737. X          nomatch = TRUE;
  738. X          nomtch_trg_index = trg_index;
  739. X          nomtchlength = 1;
  740. X        }
  741. X      trg_index++;
  742. X      if (trg_index >= trg_size)
  743. X        ge_add (nomtch_trg_index, nomtchlength);
  744. X    }
  745. X    }
  746. X  if (trg_index <= (trg_size - 1))
  747. X    {
  748. X      if (nomatch)
  749. X    ge_add (nomtch_trg_index, (nomtchlength + (trg_size - trg_index)));
  750. X      else
  751. X    ge_add (trg_index, (trg_size - trg_index));
  752. X    }
  753. X  ge_finit();
  754. X  cd_finit_delta();
  755. X  return(TRUE);
  756. X}
  757. X
  758. X
  759. X
  760. X          
  761. X
  762. END_OF_FILE
  763. if test 8724 -ne `wc -c <'src/afs/lcs.cdlt.c'`; then
  764.     echo shar: \"'src/afs/lcs.cdlt.c'\" unpacked with wrong size!
  765. fi
  766. # end of 'src/afs/lcs.cdlt.c'
  767. fi
  768. if test -f 'src/shape/Makefile' -a "${1}" != "-c" ; then 
  769.   echo shar: Will not clobber existing file \"'src/shape/Makefile'\"
  770. else
  771. echo shar: Extracting \"'src/shape/Makefile'\" \(9279 characters\)
  772. sed "s/^X//" >'src/shape/Makefile' <<'END_OF_FILE'
  773. X#
  774. X# Copyright (C) 1989, 1990 W. Koch, A. Lampen, A. Mahler, W. Obst,
  775. X#  and U. Pralle
  776. X# 
  777. X# This software is published on an as-is basis. There is ABSOLUTELY NO
  778. X# WARRANTY for any part of this software to work correctly or as described
  779. X# in the manuals. We do not accept any liability for any kind of damage
  780. X# caused by use of this software, such as loss of data, time, money, or effort.
  781. X# 
  782. X# Permission is granted to use, copy, modify, or distribute any part of
  783. X# this software as long as this is done without asking for charge, and
  784. X# provided that this copyright notice is retained as part of the source
  785. X# files. You may charge a distribution fee for the physical act of
  786. X# transferring a copy, and you may at your option offer warranty
  787. X# protection in exchange for a fee.
  788. X# 
  789. X# Direct questions to: Tech. Univ. Berlin
  790. X#              Wilfried Koch
  791. X#              Sekr. FR 5-6 
  792. X#              Franklinstr. 28/29
  793. X#              D-1000 Berlin 10, West Germany
  794. X# 
  795. X#              Tel: +49-30-314-22972
  796. X#              E-mail: shape@coma.uucp or shape@db0tui62.bitnet
  797. X# 
  798. XUSERID  = `/usr/ucb/whoami`\@`hostname`   # should e.g deliver 'axel@coma'
  799. XUSERNAME = `/usr/ucb/whoami`
  800. XINTEGRATOR = $(USERNAME)          # default setting
  801. X
  802. X#
  803. X#  Tool definition & location part
  804. X#  (these macros might be site and/or system-dependent)
  805. X#
  806. X
  807. XSHELL = /bin/sh
  808. XRCSPATH = /usr/local
  809. X
  810. XBUCKS = $$
  811. X
  812. XCC = cc -DCFFLGS='"$(BUCKS)Flags: <$<> $(CFLAGS) $$"'
  813. XCI = $(RCSPATH)/ci
  814. XCO = $(RCSPATH)/co 
  815. XRLOG = $(RCSPATH)/newrlog
  816. XIDENT = $(RCSPATH)/ident
  817. XRCS = $(RCSPATH)/rcs
  818. X
  819. XNGFLAGS = -f -l -q -m"New System Generation" -s"Stable"
  820. XNRFLAGS  = -q -l -m"This version is part of a release" -s"Release"
  821. X
  822. XNRCIDFLAGS = -u -s"Frozen"
  823. X
  824. XCOFLAGS = -q $(VID)
  825. XLOGFLAGS = -h
  826. X
  827. XMAKE-RULES = /usr/local/lib/Make-Rules
  828. XMAKE-CM-RULES = /usr/local/lib/Make-CM-Rules
  829. X
  830. XSRCDIR = /u/wolf/src/shape
  831. XVPATH = RCS
  832. X
  833. XCC = cc -DCFFLGS='"$$Flags: $(CFLAGS) $$"'
  834. X
  835. X#
  836. X#  Configuration definition part
  837. X#
  838. X
  839. X# CFLAGS = -pg -g -DNOBPOOL -I$(AFSINC)
  840. XCFLAGS = -g -I$(AFSINC) -DMSTATS
  841. X# CFLAGS = -g -I$(AFSINC)
  842. X# CFLAGS = -pg -g -DDEBUG_FILES -I$(AFSINC)
  843. X
  844. X#
  845. X#  Installation specific part
  846. X#
  847. X
  848. XINSTALDIR = /u/shape/bin
  849. X
  850. X#
  851. X#  Product definition part
  852. X#
  853. X
  854. XMAKEFILES =  Makefile.distribution Makefile.bsd43 Makefile.sunos40 Makefile.ultrix20
  855. X
  856. X
  857. XCOMPONENTS = \
  858. X    Makefile \
  859. X    README \
  860. X    shape.1 \
  861. X    attr.c \
  862. X    attr.h \
  863. X    error.c \
  864. X    files.c \
  865. X    files.h \
  866. X    hash.c \
  867. X    hash.h \
  868. X    inherit.c \
  869. X    shape.l \
  870. X    macro.c \
  871. X    macro.h \
  872. X    main.c \
  873. X    shape.h \
  874. X    misc.c \
  875. X    produce.c \
  876. X    rule.c \
  877. X    rule.h \
  878. X    select.c \
  879. X    selrule.c \
  880. X    selrule.h \
  881. X    shapeopt.c \
  882. X    sighand.c \
  883. X    std.c \
  884. X    std.h \
  885. X    string.c \
  886. X    varsec.c \
  887. X    varsec.h \
  888. X    vpath.c
  889. X
  890. X#     version.c
  891. X
  892. X
  893. XPRODUCT = shape
  894. XPROGS = shape
  895. X
  896. XSHAPOBJS = main.o shape.o hash.o macro.o rule.o files.o error.o produce.o std.o selrule.o attr.o varsec.o select.o vpath.o misc.o sighand.o shapeopt.o inherit.o string.o version.o
  897. XHFILES = shape.h macro.h hash.h rule.h selrule.h std.h varsec.h attr.h file.h
  898. X
  899. XVERSION = version
  900. X
  901. X
  902. XAFSLIB = /u/shape/lib/libafs.a
  903. XUTILLIB = /u/shape/lib/libutil.a
  904. X# AFSLIB = /u/shape/lib/libafs.backup
  905. XAFSINC = /u/shape/src/inc
  906. X# AFSINC = /u/andy/shape/afs
  907. XHEADER = shape.h $(AFSINC)/afs.h 
  908. X
  909. XCH = main.c hash.c macro.c rule.c files.c error.c produce.c std.c selrule.c attr.c varsec.c select.c vpath.c misc.c sighand.c inherit.c shapeopt.c string.c \
  910. Xshape.c
  911. X
  912. Xall: shape
  913. X
  914. Xshape: $(SHAPOBJS) $(AFSLIB) $(UTILLIB)  # malloc.o
  915. X    cc -g -o $@ $(SHAPOBJS) $(UTILLIB) $(AFSLIB) -ll
  916. X
  917. Xshapez: $(SHAPOBJS) $(AFSLIB) $(UTILLIB) malloc.o
  918. X    cc -g -o $@ $(SHAPOBJS) malloc.o $(UTILLIB) $(AFSLIB) -ll
  919. X
  920. X
  921. X$(SHAPOBJS):    $(HEADER)
  922. Xmacro.o:    $(HEADER) macro.h
  923. Xhash.o:        $(HEADER) hash.h
  924. Xrule.o:     $(HEADER) rule.h
  925. Xselrule.o:    $(HEADER) selrule.h
  926. Xstd.o:        $(HEADER) std.h
  927. Xvarsec.o:    $(HEADER) varsec.h
  928. Xattr.o:        $(HEADER) attr.h
  929. Xfiles.o:    $(HEADER) files.h
  930. Xversion.o:    version.c
  931. X
  932. XClean:
  933. X    rm shape *.o core
  934. X
  935. Xsbmt:
  936. X    sbmt -q $(MAKEFILES) $(COMPONENTS) Shapefile version.c -n $(RELNAME)
  937. X
  938. Xlint: $(CH)
  939. X    lint  -I/u/shape/src/inc $(CH)
  940. X
  941. Xshar:
  942. X    shar $(MAKEFILES) $(COMPONENTS) Shapefile version.c > shape.sh 
  943. X
  944. X
  945. Xinstall: all
  946. X    @-for i in $(PROGS); \
  947. X    do \
  948. X    echo installing $$i in $(INSTALDIR); \
  949. X    install -c -o $(USERNAME) -g unib $$i $(INSTALDIR);\
  950. X    done;
  951. X
  952. XMakefile: @Makefile
  953. X#  Make-CM-Rules,v 4.12 88/07/26 22:03:52 axel Release $
  954. X#
  955. X#  These rules are all configuration management related, and serve to
  956. X#  prepare system generations and releases. It should not be necessary
  957. X#  to modify them for different products, as long as certain conventions
  958. X#  are obeyed: Define the main-product name in the PRODUCT macro. List 
  959. X#  all components' names (i.e. each revisable entity) in COMPONENTS.
  960. X#  Names of individually produced subtargets should be listed in PROGS.
  961. X#  The main target should be 'all'.
  962. X#
  963. X#  This Makefile sample is intended for 'single Makefile systems'.
  964. X#  To apply the proposed SCM scheme to more complex systems, some 
  965. X#  more rules and conventions have to be defined. 
  966. X#
  967. X
  968. XSUBPRODUCTCIDS = `/bin/echo $(SUBPRODUCTS) | awk '{ ORS=" "; \
  969. X    for (i=1;i<=NF;i++) print $$1 ".cid"; }'`
  970. X
  971. XDATDIR = /u/mach/pdat
  972. X# holds administrative data for all projects
  973. X
  974. XRELNO = $(DATDIR)/rels/$(PRODUCT).rel
  975. XGENNO = $(DATDIR)/gens/$(PRODUCT).gen
  976. XCID = $(PRODUCT).cid
  977. XRELEASING = $(DATDIR)/tmp/.$(PRODUCT)_rel_in_prog
  978. XRSYMNAME = $(PRODUCT)_v`cat $(GENNO)`r`cat $(RELNO)`
  979. X
  980. XSAVESET = `echo * | intersect $(COMPONENTS) $(PROGS)`
  981. XINSTVID = -r$(PRODUCT)_v`$(RLOG) -y $(PRODUCT).cid | tr '.' 'r'`
  982. X@install:
  983. X    @-if [ $(USERNAME) = $(INTEGRATOR) ]; \
  984. X    then \
  985. X    if touch foo 2> /dev/null; \
  986. X    then rm foo; \
  987. X    trap "" 1 2 3; \
  988. X    mkdir .tmpdir; \
  989. X    ln $(SAVESET) *.o Makefile .tmpdir; \
  990. X    rm -f $(SAVESET) *.o Makefile; \
  991. X    $(CO) $(INSTVID) Makefile; \
  992. X    make $(MFLAGS) \
  993. X    "SRCDIR=$(SRCDIR)" \
  994. X    "VID=-r$(PRODUCT)_v`$(RLOG) -y $(PRODUCT).cid | tr '.' 'r'`" \
  995. X    all; \
  996. X    for i in $(PROGS); \
  997. X    do \
  998. X    echo installing $$i in $(INSTALDIR); \
  999. X    install -o $(USERNAME) -g unib $$i $(INSTALDIR);\
  1000. X    done; \
  1001. X    $(CO) -p $(CID) > $(DATDIR)/cids/$(CID); \
  1002. X    chmod 664 $(DATDIR)/cids/$(CID); \
  1003. X    rm -f $(SAVESET) *.o Makefile; \
  1004. X    ln .tmpdir/* $(SRCDIR); \
  1005. X    rm -rf .tmpdir; \
  1006. X    else \
  1007. X    echo '>>>' You need write permission on `pwd` to install $(PRODUCT) \
  1008. X    '<<<'; \
  1009. X    fi; \
  1010. X    else \
  1011. X    echo '>>>' Install $(PRODUCT) as user $(INTEGRATOR) '<<<'; \
  1012. X    fi
  1013. X
  1014. XSAVEDATE = .$(PRODUCT).lastsaved
  1015. X
  1016. X@save: 
  1017. X    cd $(SRCDIR); \
  1018. X    make "SCOMPONENTS=`rcslocks $(COMPONENTS)`" "SFLAGS=-l" \
  1019. X    $(SAVEDATE)
  1020. X
  1021. X$(SAVEDATE): $(SCOMPONENTS)
  1022. X    @echo Saving $?; \
  1023. X    $(CI) $(SFLAGS) $?; \
  1024. X    /bin/date > $(SAVEDATE)
  1025. X
  1026. X# release rule for systems with 'own' components
  1027. Xrelease: @increl @preprel @logconf1 all @logconf2
  1028. X
  1029. X# release rule for systems without own components, just SUBPRODUCTS
  1030. X@release1: @increl @logconf1 all @logconf2
  1031. X
  1032. Xgeneration: @incgen @markcom
  1033. X
  1034. X@generation1: @incgen
  1035. X
  1036. X@logrelease: @logconf1 @logconf2
  1037. X
  1038. X@incgen: # assumes that all COMPONENTS have a busy version 
  1039. X    @incr $(GENNO)
  1040. X    @/bin/echo Declaring generation `cat $(GENNO)` for \
  1041. X    $(PRODUCT) system
  1042. X    @rm -f $(RELNO)
  1043. X
  1044. X@markcom:
  1045. X    @-(cd $(SRCDIR) ; \
  1046. X    $(CI) $(NGFLAGS) -r`cat $(GENNO)`.0 $(COMPONENTS))
  1047. X
  1048. X@increl:
  1049. X    @touch $(RELEASING); \
  1050. X    incr $(RELNO)
  1051. X
  1052. X@preprel:
  1053. X    @/bin/echo Preparing release `cat $(RELNO)` in generation \
  1054. X    `cat $(GENNO)` of $(PRODUCT)
  1055. X    @-(cd $(SRCDIR); $(CI) $(NRFLAGS) Makefile \
  1056. X    `rcslocks $(COMPONENTS)` > /dev/null 2> .diag ; \
  1057. X    for i in $(COMPONENTS) Makefile; \
  1058. X    do \
  1059. X    v=`$(RLOG) -y $$i`; \
  1060. X    echo marking $$i\[$$v\] ; \
  1061. X    $(RCS) -n"$(PRODUCT)_v`cat $(GENNO)`r`cat $(RELNO)`":$$v \
  1062. X    $$i >  /dev/null 2> /dev/null ; \
  1063. X    done ; \
  1064. X    rm -f .diag ; \
  1065. X    /bin/date > $(SAVEDATE))
  1066. X
  1067. X@logconf1:
  1068. X    @/bin/echo Conf-ID: $(PRODUCT) version `cat $(GENNO)` \
  1069. X    release `cat $(RELNO)` of `/bin/date`, > $(CID) ; \
  1070. X    /bin/echo by $(USERID) >> $(CID); \
  1071. X    /bin/echo -n '$$Header' >> $(CID); \
  1072. X    /bin/echo '$$' >> $(CID); \
  1073. X    /bin/echo 'char *$(VERSION) () { static char ConfID[] = \
  1074. X    "'`cat $(GENNO)`.`cat $(RELNO)` '('`date` by $(USERID)')"; \
  1075. X    return ConfID; }' > $(SRCDIR)/$(VERSION).c; 
  1076. X    @(cd $(SRCDIR); \
  1077. X    $(CI) $(NRFLAGS) -n"$(PRODUCT)_v`cat $(GENNO)`r`cat $(RELNO)`" \
  1078. X    $(VERSION).c > /dev/null 2> /dev/null; )
  1079. X
  1080. X# The ci - command doesn't like a '.' charakter in a symname
  1081. X
  1082. XDDOLLAR = $$
  1083. X
  1084. X@logconf2:
  1085. X    @/bin/echo Logging configuration in $(CID);\
  1086. X    $(IDENT) Makefile | awk '{ if ($$1 == "$$Header:") \
  1087. X    printf ("     Header: %s %s %s %s %s %s\n",$$2,$$3,$$4,$$5,$$6,$$7); \
  1088. X    else if (($$1 != "$(DDOLLAR)Flags:") && ($$1 != "$$Log:")) \
  1089. X    print $$0 }' >> $(CID);\
  1090. X    $(IDENT) $(PROGS) | awk '{ \
  1091. X    if ($$1 == "$$Header:") \
  1092. X    printf ("     Header: %s %s %s %s %s %s\n",$$2,$$3,$$4,$$5,$$6,$$7); \
  1093. X    else if ($$1 == "$$Flags:") { ORS = " "; print "     Flags: "; \
  1094. X    for (i=2; i<=NF-1; i++) print $$i; print "\n"; } \
  1095. X    else print $$0 }' >> $(CID);
  1096. X    @echo Identification of incorporated subproducts: >> $(CID); \
  1097. X    (cd $(SRCDIR); $(IDENT) $(SUBPRODUCTCIDS) | awk '{ \
  1098. X    if ($$1 == "$$Header:") \
  1099. X    printf ("     Header: %s %s %s %s %s %s\n",$$2,$$3,$$4,$$5,$$6,$$7); \
  1100. X    else if ($$1 == "$$Flags:") { ORS = " "; print "     Flags: "; \
  1101. X    for (i=2; i<=NF-1; i++) print $$i; print "\n"; } \
  1102. X    else print $$0 }') >> $(CID);
  1103. X    @(cd $(SRCDIR); $(RLOG) $(LOGFLAGS) Makefile $(COMPONENTS)) >> \
  1104. X    $(CID); \
  1105. X    echo; \
  1106. X    echo '***' DESCRIBE PURPOSE OR DESTINATION OF THIS RELEASE \
  1107. X    '['`cat $(GENNO)`.`cat $(RELNO)`']' '***'; \
  1108. X    echo '(terminate with ^D or single '"'.'"')'; \
  1109. X    $(CI) $(NRCIDFLAGS) -r`cat $(GENNO)`.`cat $(RELNO)` \
  1110. X    $(CID) > /dev/null 2> /dev/null; \
  1111. X    rm $(RELEASING)
  1112. X
  1113. END_OF_FILE
  1114. if test 9279 -ne `wc -c <'src/shape/Makefile'`; then
  1115.     echo shar: \"'src/shape/Makefile'\" unpacked with wrong size!
  1116. fi
  1117. # end of 'src/shape/Makefile'
  1118. fi
  1119. if test -f 'src/shape/std.c' -a "${1}" != "-c" ; then 
  1120.   echo shar: Will not clobber existing file \"'src/shape/std.c'\"
  1121. else
  1122. echo shar: Extracting \"'src/shape/std.c'\" \(8603 characters\)
  1123. sed "s/^X//" >'src/shape/std.c' <<'END_OF_FILE'
  1124. X/*
  1125. X * Copyright (C) 1989, 1990 W. Koch, A. Lampen, A. Mahler, W. Obst,
  1126. X *  and U. Pralle
  1127. X * 
  1128. X * This software is published on an as-is basis. There is ABSOLUTELY NO
  1129. X * WARRANTY for any part of this software to work correctly or as described
  1130. X * in the manuals. We do not accept any liability for any kind of damage
  1131. X * caused by use of this software, such as loss of data, time, money, or 
  1132. X * effort.
  1133. X * 
  1134. X * Permission is granted to use, copy, modify, or distribute any part of
  1135. X * this software as long as this is done without asking for charge, and
  1136. X * provided that this copyright notice is retained as part of the source
  1137. X * files. You may charge a distribution fee for the physical act of
  1138. X * transferring a copy, and you may at your option offer warranty
  1139. X * protection in exchange for a fee.
  1140. X * 
  1141. X * Direct questions to: Tech. Univ. Berlin
  1142. X *              Wilfried Koch
  1143. X *              Sekr. FR 5-6 
  1144. X *              Franklinstr. 28/29
  1145. X *              D-1000 Berlin 10, West Germany
  1146. X * 
  1147. X *              Tel: +49-30-314-22972
  1148. X *              E-mail: shape@coma.uucp or shape@db0tui62.bitnet
  1149. X */
  1150. X#ifndef lint
  1151. Xstatic char *RCSid = "$Header: std.c,v 3.0 89/01/24 11:37:03 wolfgang Stable $";
  1152. X#endif
  1153. X#ifndef lint
  1154. Xstatic char *ConfFlg = CFFLGS;    /* should be defined from within Makefile */
  1155. X#endif
  1156. X/*
  1157. X * $Log:    std.c,v $
  1158. X * Revision 3.0  89/01/24  11:37:03  wolfgang
  1159. X * New System Generation
  1160. X * 
  1161. X * Revision 2.10  88/12/21  15:13:06  wolfgang
  1162. X * changes done for lint
  1163. X * 
  1164. X * Revision 2.9  88/11/22  18:56:06  wolfgang
  1165. X * bug fixed: missing initialization.
  1166. X * 
  1167. X * Revision 2.7  88/11/21  15:48:45  wolfgang
  1168. X * return code of all malloc's checked
  1169. X * 
  1170. X * Revision 2.6  88/10/10  17:03:38  wolfgang
  1171. X * This version is part of a release
  1172. X * 
  1173. X * Revision 2.5  88/09/19  14:41:23  wolfgang
  1174. X * little bug fixed
  1175. X * 
  1176. X * Revision 2.4  88/09/19  11:47:34  wolfgang
  1177. X * added +(CC) & +(CFLAGS) in .l.o rule.
  1178. X * 
  1179. X * Revision 2.3  88/09/14  10:52:28  wolfgang
  1180. X * undone last changes
  1181. X * 
  1182. X * Revision 2.2  88/09/13  09:55:29  wolfgang
  1183. X * It's now possible to overload implicit standard rules.
  1184. X * 
  1185. X * Revision 2.1  88/08/19  10:18:11  wolfgang
  1186. X * This version is part of a release
  1187. X * 
  1188. X */
  1189. X
  1190. X/* reearrangement of suffixes ??? */
  1191. X/* implicit predefined rules with more than one target ??? */
  1192. X
  1193. X#include "std.h"
  1194. X#include "shape.h"
  1195. Xstruct rules *stdruletab[STDRULETABSIZE];
  1196. Xint lastrule;
  1197. X
  1198. X/* char *stdsuff = ".o .c .c~ .mod .mod~ .sym .def .def~ .p .p~ .f .f~ .F .F~ .r .r~ .y .y~ .l .l~ .s .s~ .sh .sh~ .h .h~ "; */
  1199. X
  1200. X/* .x~ suffixes are not supportet */
  1201. X
  1202. Xchar *stdsuff = ".o .c .mod .sym .def .a .p .f .F .r .y .l .s .sh .h";
  1203. X
  1204. Xchar *shaperules = "%.o:%.c %.o:%.l %.o:%.y %.o:%.s %.o:%.r %.o:%.F %.o:%.f %.o:%.mod %.o:%.p %.c:%.l %.c:%.y %.sym:%.def %.a:%.c %:%.sh %:%.r %:%.F %:%.f %:%.p %:%.mod %:%.c ";
  1205. X
  1206. Xint implicit_suffs[MAXIMPLICIT] = {12, /*  0   .c.o     */ 
  1207. X                    3, /*  1   .l.o     */ 
  1208. X                    4, /*  2   .y.o     */ 
  1209. X                    5, /*  3   .s.o     */ 
  1210. X                    6, /*  4   .r.o     */ 
  1211. X                    7, /*  5   .F.o     */ 
  1212. X                    8, /*  6   .f.o     */ 
  1213. X                   10, /*  7   .mod.o   */ 
  1214. X                   11, /*  8   .p.o     */ 
  1215. X                    1, /*  9   .l.c     */ 
  1216. X                    2, /* 10   .y.c     */ 
  1217. X                    9, /* 11   .def.sym */ 
  1218. X                    0, /* 12   .c.a     */ 
  1219. X                   13, /* 13   .sh      */ 
  1220. X                   14, /* 14   .r       */ 
  1221. X                   15, /* 15   .F       */ 
  1222. X                   16, /* 16   .f       */ 
  1223. X                   17, /* 17   .p       */ 
  1224. X                   18, /* 18   .mod     */ 
  1225. X                   19, /* 19   .c       */ 
  1226. X                   -1 };
  1227. X
  1228. X
  1229. Xchar *stdrules[] = {
  1230. X
  1231. X/* ".c.a",
  1232. X"\t$(CC) -c $(CFLAGS) $(vflags) $<",
  1233. X"\tar rv $@ $*.o",
  1234. X"\trm -f $*.o", */
  1235. X
  1236. X  "%.a",  /* 0 */
  1237. X  "%.c",
  1238. X  "+(CC)",
  1239. X  "+(CFLAGS)",
  1240. X  "+(vflags)",
  1241. X  "\t$(CC) -c $(CFLAGS) $(vflags) %.c",
  1242. X  "\tar rv %.a %.o",
  1243. X  "\trm -f %.o",
  1244. X
  1245. X/* ".l.c",
  1246. X"\t$(LEX) $(LFLAGS) $<",
  1247. X"\tmv lex.yy.c $@", */
  1248. X
  1249. X  "%.c",  /* 1 */
  1250. X  "%.l",
  1251. X  "+(LEX)",
  1252. X  "+(LFLAGS)",
  1253. X  "\t$(LEX) $(LFLAGS) %.l",
  1254. X  "\tmv lex.yy.c %.c",
  1255. X
  1256. X/* ".y.c",
  1257. X"\t$(YACC) $(YFLAGS) $<",
  1258. X"\tmv y.tab.c $@", */
  1259. X
  1260. X  "%.c",  /* 2 */
  1261. X  "%.y",
  1262. X  "+(YACC)",
  1263. X  "+(YFLAGS)",
  1264. X  "\t$(YACC) $(YFLAGS) %.y",
  1265. X  "\tmv y.tab.c %.c",
  1266. X
  1267. X/* ".l.o",
  1268. X"\t$(LEX) $(LFLAGS) $<",
  1269. X"\t$(CC) $(CFLAGS) $(vflags) -c lex.yy.c",
  1270. X"\trm lex.yy.c",
  1271. X"\tmv lex.yy.o $@", */
  1272. X
  1273. X  "%.o",  /* 3 */
  1274. X  "%.l",
  1275. X  "+(LEX)",
  1276. X  "+(LFLAGS)",
  1277. X  "+(CC)",
  1278. X  "+(CFLAGS)",
  1279. X  "+(vflags)",
  1280. X  "\t$(LEX) $(LFLAGS) %.l",
  1281. X  "\t$(CC) $(CFLAGS) $(vflags) -c lex.yy.c",
  1282. X  "\trm lex.yy.c",
  1283. X  "\tmv lex.yy.o %.o",
  1284. X
  1285. X/* ".y.o",
  1286. X"\t$(YACC) $(YFLAGS) $<",
  1287. X"\t$(CC) $(CFLAGS) $(vflags) -c y.tab.c",
  1288. X"\trm y.tab.c",
  1289. X"\tmv y.tab.o $@", */
  1290. X
  1291. X  "%.o",  /* 4 */
  1292. X  "%.y",
  1293. X  "+(YACC)",
  1294. X  "+(YFLAGS)",
  1295. X  "+(CC)",
  1296. X  "+(CFLAGS)",
  1297. X  "+(vflags)",
  1298. X  "\t$(YACC) $(YFLAGS) %.y",
  1299. X  "\t$(CC) $(CFLAGS) $(vflags) -c y.tab.c",
  1300. X  "\trm y.tab.c",
  1301. X  "\tmv y.tab.o %.o",
  1302. X
  1303. X/* ".s.o",
  1304. X"\t$(AS) $(ASFLAGS) -o $@ $<", */
  1305. X
  1306. X  "%.o",  /* 5 */
  1307. X  "%.s",
  1308. X  "+(AS)",
  1309. X  "+(ASFLAGS)",
  1310. X  "\t$(AS) $(ASFLAGS) -o %.o %.s",
  1311. X
  1312. X/* ".r.o",
  1313. X"\t$(FC) $(RFLAGS) $(FFLAGS) -c $<", */
  1314. X
  1315. X  "%.o",  /* 6 */
  1316. X  "%.r",
  1317. X  "+(FC)",
  1318. X  "+(RFLAGS)",
  1319. X  "+(FFLAGS)",
  1320. X  "\t$(FC) $(RFLAGS) $(FFLAGS) -c %.r",
  1321. X
  1322. X/* ".F.o",
  1323. X"\t$(FC) $(FFLAGS) -c $<", */
  1324. X
  1325. X  "%.o",  /* 7 */
  1326. X  "%.F",
  1327. X  "+(FC)",
  1328. X  "+(FFLAGS)",
  1329. X  "\t$(FC) $(FFLAGS) -c %.F",
  1330. X
  1331. X/* ".f.o",
  1332. X"\t$(FC) $(FFLAGS) -c $<", */
  1333. X
  1334. X  "%.o",  /* 8 * */
  1335. X  "%.f",
  1336. X  "+(FC)",
  1337. X  "+(FFLAGS)",
  1338. X  "\t$(FC) $(FFLAGS) -c %.f",
  1339. X
  1340. X/* ".def.sym",
  1341. X"\t$(M2C) $(M2FLAGS) $<", */
  1342. X
  1343. X  "%.sym",  /* 9 */
  1344. X  "%.def",
  1345. X  "+(M2C)",
  1346. X  "+(M2FLAGS)",
  1347. X  "\t$(M2C) $(M2FLAGS) %.def",
  1348. X
  1349. X/* ".mod.o",
  1350. X"\t$(M2C) $(M2FLAGS) $<", */
  1351. X
  1352. X  "%.o",  /* 10 */
  1353. X  "%.mod",
  1354. X  "+(M2C)",
  1355. X  "+(M2FLAGS)",
  1356. X  "\t$(M2C) $(M2FLAGS) %.o",
  1357. X
  1358. X/* ".p.o",
  1359. X"\t$(PC) $(PFLAGS) -c $<", */
  1360. X
  1361. X  "%.o",  /* 11 */
  1362. X  "%.p",
  1363. X  "+(PC)",
  1364. X  "+(PFLAGS)",
  1365. X  "\t$(PC) $(PFLAGS) -c %.o",
  1366. X
  1367. X/* ".c.o",
  1368. X"\t$(CC) $(CFLAGS) $(vflags) -c $<", */
  1369. X
  1370. X  "%.o",  /* 12 */
  1371. X  "%.c",
  1372. X  "+(CC)",
  1373. X  "+(CFLAGS)",
  1374. X  "+(vflags)",
  1375. X  "\t$(CC) $(CFLAGS) $(vflags) -c %.c",
  1376. X
  1377. X/* ".sh",
  1378. X"\tcat $< >$@; chmod +x $@", */
  1379. X
  1380. X  "%",  /* 13 */
  1381. X  "%.sh",
  1382. X  "\tcat %.sh >%; chmod +x %",
  1383. X
  1384. X/* ".r",
  1385. X"\t$(FC) $(RFLAGS) $(FFLAGS) $(LDFLAGS) $< -o $@", */
  1386. X
  1387. X  "%",  /* 14 */
  1388. X  "%.r",
  1389. X  "+(FC)",
  1390. X  "+(RFLAGS)",
  1391. X  "+(FFLAGS)",
  1392. X  "+(LDFLAGS)",
  1393. X  "\t$(FC) $(RFLAGS) $(FFLAGS) $(LDFLAGS) %.r -o %",
  1394. X
  1395. X/* ".F",
  1396. X"\t$(FC) $(FFLAGS) $(LDFLAGS) $< -o $@", */
  1397. X
  1398. X  "%",  /* 15 */
  1399. X  "%.F",
  1400. X  "+(FC)",
  1401. X  "+(FFLAGS)",
  1402. X  "+(LDFLAGS)",
  1403. X  "\t$(FC) $(FFLAGS) $(LDFLAGS) %.F -o %",
  1404. X
  1405. X/* ".f",
  1406. X"\t$(FC) $(FFLAGS) $(LDFLAGS) $< -o $@", */
  1407. X
  1408. X  "%",  /* 16 */
  1409. X  "%.f",
  1410. X  "+(FC)",
  1411. X  "+(FFLAGS)",
  1412. X  "+(LDFLAGS)",
  1413. X  "\t$(FC) $(FFLAGS) $(LDFLAGS) %.f -o %",
  1414. X
  1415. X/* ".p",
  1416. X"\t$(PC) $(PFLAGS) $(LDFLAGS) $< -o $@", */
  1417. X
  1418. X  "%",  /* 17 */
  1419. X  "%.p",
  1420. X  "+(PC)",
  1421. X  "+(PFLAGS)",
  1422. X  "+(LDFLAGS)",
  1423. X  "\t$(PC) $(PFLAGS) $(LDFLAGS) %.p -o %",
  1424. X
  1425. X/* ".mod",
  1426. X"\t$(M2C) $(M2FLAGS) $(LDFLAGS) $< -e $@ -o $@", */
  1427. X
  1428. X  "%",  /* 18 */
  1429. X  "%.mod",
  1430. X  "+(M2C)",
  1431. X  "+(M2FLAGS)",
  1432. X  "+(LDFLAGS)",
  1433. X  "\t$(M2C) $(M2FLAGS) $(LDFLAGS) %.mod -e % -o %",
  1434. X
  1435. X/* ".c",
  1436. X"\t$(CC) $(CFLAGS) $(LDFLAGS) $< -o $@", */
  1437. X
  1438. X  "%",  /* 19 */
  1439. X  "%.c",
  1440. X  "+(CC)",
  1441. X  "+(CFLAGS)",
  1442. X  "+(LDFLAGS)",
  1443. X  "+(vflags)",
  1444. X  "\t$(CC) $(CFLAGS) $(vflags) $(LDFLAGS) %.c -o %",
  1445. X
  1446. X/* ".SUFFIXES:",
  1447. X".o",".c",".c~",".mod",".mod~",".sym",".def",".def~",".p",".p~",".f",".f~",".F",".F~",".r",".r~",".y",".y~",".l",".l~",".s",".s~",".sh",".sh~",".h",".h~",
  1448. X*/
  1449. X
  1450. X"0"
  1451. X
  1452. X};
  1453. X
  1454. X
  1455. Xadd_stdrules()
  1456. X{
  1457. X  int i = 0;
  1458. X  int j = 0;
  1459. X  int k = 0;
  1460. X  
  1461. X  struct cmds *comm;
  1462. X
  1463. X  while(strcmp(stdrules[i],"0") != 0)
  1464. X      {
  1465. X    if(stdrules[i][0] == '%')
  1466. X      {
  1467. X        if((stdruletab[k] = (struct rules *) malloc( sizeof(struct rules))) == (struct rules *) NIL)
  1468. X          errexit(10,"malloc");
  1469. X        stdruletab[k]->name = stdrules[i];
  1470. X        i++;
  1471. X      }
  1472. X    if(stdrules[i][0] != '\t')
  1473. X      {
  1474. X        j = 0;
  1475. X        while ((stdrules[i][0] != '\t') &&
  1476. X           (stdrules[i][0] != '+') &&
  1477. X           (strcmp(stdrules[i],"0") != 0))
  1478. X          {
  1479. X        stdruletab[k]->deplist[j] = stdrules[i];
  1480. X        i++;
  1481. X        j++;
  1482. X          }
  1483. X        stdruletab[k]->deplist[j] = NIL;
  1484. X      }
  1485. X    if (stdrules[i][0] == '+')
  1486. X      {
  1487. X        j = 0;
  1488. X        while (stdrules[i][0] == '+')
  1489. X          {
  1490. X        stdruletab[k]->heritage[j] = stdrules[i];
  1491. X        i++;
  1492. X        j++;
  1493. X          }
  1494. X        stdruletab[k]->heritage[j] = NIL;
  1495. X      }
  1496. X    else
  1497. X      stdruletab[k]->heritage[0] = NIL;
  1498. X
  1499. X    if (stdrules[i][0] == '\t')
  1500. X      {
  1501. X        if ((stdruletab[k]->cmdlist = (struct cmds *) malloc( sizeof (struct cmds))) == (struct cmds *) NIL)
  1502. X          errexit(10,"malloc");
  1503. X        comm = stdruletab[k]->cmdlist;
  1504. X        while (stdrules[i][0] == '\t')
  1505. X          {
  1506. X        comm->command = stdrules[i];
  1507. X        if ((comm = comm->nextcmd = (struct cmds *) malloc( sizeof (struct cmds *))) == (struct cmds *) NIL)
  1508. X          errexit(10,"malloc");
  1509. X        i++;
  1510. X          }
  1511. X        stdruletab[k]->targetlist[0] = stdruletab[k]->name;
  1512. X        stdruletab[k]->targetlist[1] = NIL;
  1513. X      }
  1514. X    k++;
  1515. X      }
  1516. X  stdruletab[k] = (struct rules *) NIL;
  1517. X  lastrule = k - 1;
  1518. X}
  1519. X
  1520. END_OF_FILE
  1521. if test 8603 -ne `wc -c <'src/shape/std.c'`; then
  1522.     echo shar: \"'src/shape/std.c'\" unpacked with wrong size!
  1523. fi
  1524. # end of 'src/shape/std.c'
  1525. fi
  1526. if test -f 'src/vc/vadm_promote.c' -a "${1}" != "-c" ; then 
  1527.   echo shar: Will not clobber existing file \"'src/vc/vadm_promote.c'\"
  1528. else
  1529. echo shar: Extracting \"'src/vc/vadm_promote.c'\" \(9143 characters\)
  1530. sed "s/^X//" >'src/vc/vadm_promote.c' <<'END_OF_FILE'
  1531. X/*
  1532. X * Copyright (C) 1989, 1990 W. Koch, A. Lampen, A. Mahler, W. Obst,
  1533. X *  and U. Pralle
  1534. X * 
  1535. X * This software is published on an as-is basis. There is ABSOLUTELY NO
  1536. X * WARRANTY for any part of this software to work correctly or as described
  1537. X * in the manuals. We do not accept any liability for any kind of damage
  1538. X * caused by use of this software, such as loss of data, time, money, or 
  1539. X * effort.
  1540. X * 
  1541. X * Permission is granted to use, copy, modify, or distribute any part of
  1542. X * this software as long as this is done without asking for charge, and
  1543. X * provided that this copyright notice is retained as part of the source
  1544. X * files. You may charge a distribution fee for the physical act of
  1545. X * transferring a copy, and you may at your option offer warranty
  1546. X * protection in exchange for a fee.
  1547. X * 
  1548. X * Direct questions to: Tech. Univ. Berlin
  1549. X *              Wilfried Koch
  1550. X *              Sekr. FR 5-6 
  1551. X *              Franklinstr. 28/29
  1552. X *              D-1000 Berlin 10, West Germany
  1553. X * 
  1554. X *              Tel: +49-30-314-22972
  1555. X *              E-mail: shape@coma.uucp or shape@db0tui62.bitnet
  1556. X */
  1557. X#ifndef lint
  1558. Xstatic char *AFSid = "$Header: vadm_promote.c[3.7] Thu Feb 23 18:14:15 1989 axel@coma published $";
  1559. X#ifdef CFFLGS
  1560. Xstatic char *ConfFlg = CFFLGS;
  1561. X    /* should be defined from within Makefile */
  1562. X#endif
  1563. X#endif
  1564. X/*
  1565. X * Log for /u/shape/dist-tape/src/vc/vadm_promote.c[3.3]
  1566. X *     Thu Feb 23 18:14:15 1989 axel@coma published $
  1567. X *  --- empty log message ---
  1568. X *  vadm_promote.c[3.5] Thu Feb 23 18:14:15 1989 axel@coma published $
  1569. X *  --- empty log message ---
  1570. X *  vadm_promote.c[3.6] Thu Feb 23 18:14:15 1989 axel@coma save $
  1571. X *  --- empty log message ---
  1572. X *  vadm_promote.c[3.7] Thu Feb 23 18:14:15 1989 axel@coma published $
  1573. X *  --- empty log message ---
  1574. X */
  1575. X
  1576. X#include <stdio.h>
  1577. X#include <afs.h>
  1578. X
  1579. X#include "afsapp.h"
  1580. X#include "vadm.h"
  1581. X#include "locks.h"
  1582. X
  1583. X/* external */
  1584. Xextern char *malloc(), *st_table[];
  1585. Xextern unsigned int options;
  1586. Xextern int def_vnum;
  1587. Xextern struct Transaction ThisTransaction;
  1588. X
  1589. X/* locals */
  1590. Xchar buf[2048];
  1591. X
  1592. X/**/
  1593. Xstatic
  1594. Xint do_promote (set)
  1595. X     Af_set *set;
  1596. X{
  1597. X  int i, oldstate;
  1598. X  int errs = 0;
  1599. X  char version[1024];
  1600. X
  1601. X  if (af_sortset (set, AF_ATTHUMAN) == -1)
  1602. X    vctl_abort ("do_promote: af_sortset()");
  1603. X      
  1604. X  for (i = 0; i < set->af_nkeys; i++) {
  1605. X    if (setjmp (ThisTransaction.tr_env)) continue;
  1606. X    mkvstring (version, &set->af_klist[i]);
  1607. X    if ((oldstate = af_rstate (&set->af_klist[i])) == -1) {
  1608. X      af_perror ("do_promote()");
  1609. X      return 1;
  1610. X    }
  1611. X
  1612. X    switch (oldstate) {
  1613. X    case AF_BUSY:
  1614. X      (void)sprintf (buf, "%s busy. Fatal", version);
  1615. X      logmsg (buf);
  1616. X      vctl_abort ("CONTACT LOCAL GURU"); /* no return */
  1617. X      break;
  1618. X    case AF_SAVED:
  1619. X      if ((lockeruid(vc_lock_v(&set->af_klist[i], (Uid_t)getuid()))) != 
  1620. X      (Uid_t)getuid()) {
  1621. X    logerr ("can't change state -- locked");
  1622. X    return 1;
  1623. X      }
  1624. X      if (af_sstate (&set->af_klist[i], AF_PROPOSED) == -1) {
  1625. X    af_perror ("af_sstate():");
  1626. X    return 1;
  1627. X      }
  1628. X      (void)vc_unlock_v(&set->af_klist[i]);
  1629. X      (void)sprintf (buf, "%s promoted to state \"%s\".", version,
  1630. X           st_table[AF_PROPOSED]);
  1631. X      logmsg (buf);
  1632. X      break;
  1633. X    case AF_PROPOSED:
  1634. X      if ((lockeruid(vc_lock_v(&set->af_klist[i],(Uid_t)getuid()))) != 
  1635. X      (Uid_t)getuid()) {
  1636. X    logerr ("can't change state -- locked");
  1637. X    return 1;
  1638. X      }
  1639. X      if (af_sstate (&set->af_klist[i], AF_PUBLISHED) == -1) {
  1640. X    af_perror ("af_sstate():");
  1641. X    return 1;
  1642. X      }
  1643. X      (void)vc_unlock_v(&set->af_klist[i]);
  1644. X      (void)sprintf (buf, "%s promoted to state \"%s\".", version,
  1645. X           st_table[AF_PUBLISHED]);
  1646. X      logmsg (buf);
  1647. X      break;
  1648. X    case AF_PUBLISHED:
  1649. X      if ((lockeruid(vc_lock_v(&set->af_klist[i], (Uid_t)getuid()))) != 
  1650. X      (Uid_t)getuid()) {
  1651. X    logerr ("can't change state -- locked");
  1652. X    return 1;
  1653. X      }
  1654. X      if (af_sstate (&set->af_klist[i], AF_ACCESSED) == -1) {
  1655. X    af_perror ("af_sstate():");
  1656. X    return 1;
  1657. X      }
  1658. X      (void)vc_unlock_v(&set->af_klist[i]);
  1659. X      (void)sprintf (buf, "%s promoted to state \"%s\".", version,
  1660. X           st_table[AF_ACCESSED]);
  1661. X      logmsg (buf);
  1662. X      break;
  1663. X    case AF_ACCESSED:
  1664. X      if ((lockeruid(vc_lock_v(&set->af_klist[i], (Uid_t)getuid()))) != 
  1665. X      (Uid_t)getuid()) {
  1666. X    logerr ("can't change state -- locked");
  1667. X    return 1;
  1668. X      }
  1669. X      if (af_sstate (&set->af_klist[i], AF_FROZEN) == -1) {
  1670. X    af_perror ("af_sstate():");
  1671. X    return 1;
  1672. X      }
  1673. X      (void)vc_unlock_v(&set->af_klist[i]);
  1674. X      (void)sprintf (buf, "%s promoted to state \"%s\".", version,
  1675. X           st_table[AF_FROZEN]);
  1676. X      logmsg (buf);
  1677. X      break;
  1678. X    case AF_FROZEN:
  1679. X      (void)sprintf (buf, "%s already frozen. --- Not promoted.", version);
  1680. X      logmsg (buf);
  1681. X      errs++;
  1682. X      break;
  1683. X    default:
  1684. X      (void)sprintf (buf, "%s has unknown version state %d.", version, oldstate);
  1685. X      logmsg (buf);
  1686. X      vctl_abort ("CONTACT LOCAL GURU.");
  1687. X    }
  1688. X  }
  1689. X  if (errs)
  1690. X    return 1;
  1691. X  else
  1692. X    return 0;
  1693. X}
  1694. X
  1695. X/**/
  1696. Xint DoPromote (vlist, ac, av)
  1697. X     struct vc_vlist *vlist;
  1698. X     int ac;
  1699. X     char **av;
  1700. X{
  1701. X  Af_set set;
  1702. X  int errs;
  1703. X  char **erroneous;
  1704. X
  1705. X  if (IsOptionSet(Vopt_version)) {
  1706. X    errs = GetKeysByGenRev
  1707. X    (ac,av, gen(def_vnum), rev(def_vnum), &set, &erroneous);
  1708. X  }
  1709. X  else {
  1710. X    if (!(vlist->from_version_set) || !(vlist->to_version_set))
  1711. X      errs = GetKeysByGenRev 
  1712. X    (ac,av, AF_LASTVERS, AF_LASTVERS, &set, &erroneous);
  1713. X    else
  1714. X      errs = GetKeysByName ( ac, av, vlist, &set, &erroneous);
  1715. X  }
  1716. X  if (errs)
  1717. X    print_erroneous (erroneous, errs);
  1718. X
  1719. X  if (!set.af_nkeys) {
  1720. X    logmsg ("Nothing appropriate found.");
  1721. X    return 1;
  1722. X  }
  1723. X
  1724. X  if (errs && !ask_confirm ("Continue ?", "yes"))
  1725. X    return 1;
  1726. X
  1727. X  return do_promote (&set);
  1728. X}
  1729. X
  1730. X/**/
  1731. Xstatic
  1732. Xint do_unpromote (set)
  1733. X     Af_set *set;
  1734. X{
  1735. X  int i, oldstate;
  1736. X  int errs = 0;
  1737. X  char version[1024];
  1738. X
  1739. X  if (af_sortset (set, AF_ATTHUMAN) == -1)
  1740. X    vctl_abort ("do_unpromote: af_sortset()");
  1741. X      
  1742. X  for (i = 0; i < set->af_nkeys; i++) {
  1743. X    mkvstring (version, &set->af_klist[i]);
  1744. X    if (setjmp (ThisTransaction.tr_env)) continue;
  1745. X    if ((oldstate = af_rstate (&set->af_klist[i])) == -1) {
  1746. X      af_perror ("do_promote()");
  1747. X      return 1;
  1748. X    }
  1749. X
  1750. X    switch (oldstate) {
  1751. X    case AF_BUSY:
  1752. X      (void)sprintf (buf, "%s busy. Fatal", version);
  1753. X      logmsg (buf);
  1754. X      vctl_abort ("CONTACT LOCAL GURU"); /* no return */
  1755. X      break;
  1756. X    case AF_SAVED:
  1757. X      (void)sprintf (buf, "%s already saved.", version);
  1758. X      logmsg (buf);
  1759. X      break;
  1760. X    case AF_PROPOSED:
  1761. X      if ((lockeruid(vc_lock_v(&set->af_klist[i], (Uid_t)getuid()))) != 
  1762. X      (Uid_t)getuid()) {
  1763. X    logerr ("can't change state -- locked");
  1764. X    return 1;
  1765. X      }
  1766. X      if (af_sstate (&set->af_klist[i], AF_SAVED) == -1) {
  1767. X    af_perror ("af_sstate():");
  1768. X    return 1;
  1769. X      }
  1770. X      (void)vc_unlock_v(&set->af_klist[i]);
  1771. X      (void)sprintf (buf, "%s unpromoted to state \"%s\".", version, 
  1772. X           st_table[AF_SAVED]);
  1773. X      logmsg (buf);
  1774. X      break;
  1775. X    case AF_PUBLISHED:
  1776. X      if ((lockeruid(vc_lock_v(&set->af_klist[i], (Uid_t)getuid()))) != 
  1777. X      (Uid_t)getuid()) {
  1778. X    logerr ("can't change state -- locked");
  1779. X    return 1;
  1780. X      }
  1781. X      if (af_sstate (&set->af_klist[i], AF_PROPOSED) == -1) {
  1782. X    af_perror ("af_sstate():");
  1783. X    return 1;
  1784. X      }
  1785. X      (void)vc_unlock_v(&set->af_klist[i]);
  1786. X      (void)sprintf (buf, "%s unpromoted to state \"%s\".", version,
  1787. X           st_table[AF_PROPOSED]);
  1788. X      logmsg (buf);
  1789. X      break;
  1790. X    case AF_ACCESSED:
  1791. X      if ((lockeruid(vc_lock_v(&set->af_klist[i], (Uid_t)getuid()))) != 
  1792. X      (Uid_t)getuid()) {
  1793. X    logerr ("can't change state -- locked");
  1794. X    return 1;
  1795. X      }
  1796. X      if (af_sstate (&set->af_klist[i], AF_PUBLISHED) == -1) {
  1797. X    af_perror ("af_sstate():");
  1798. X    return 1;
  1799. X      }
  1800. X      (void)vc_unlock_v(&set->af_klist[i]);
  1801. X      (void)sprintf (buf, "%s unpromoted to state \"%s\".", version,
  1802. X           st_table[AF_PUBLISHED]);
  1803. X      logmsg (buf);
  1804. X      break;
  1805. X    case AF_FROZEN:
  1806. X      if ((lockeruid(vc_lock_v(&set->af_klist[i], (Uid_t)getuid()))) != 
  1807. X      (Uid_t)getuid()) {
  1808. X    logerr ("can't change state -- locked");
  1809. X    return 1;
  1810. X      }
  1811. X      if (af_sstate (&set->af_klist[i], AF_ACCESSED) == -1) {
  1812. X    af_perror ("af_sstate():");
  1813. X    return 1;
  1814. X      }
  1815. X      (void)vc_unlock_v(&set->af_klist[i]);
  1816. X      (void)sprintf (buf, "%s unpromoted to state \"%s\".", version,
  1817. X           st_table[AF_ACCESSED]);
  1818. X      logmsg (buf);
  1819. X      break;
  1820. X    default:
  1821. X      (void)sprintf (buf, "%s has unknown version state %d.", version, oldstate);
  1822. X      logmsg (buf);
  1823. X      vctl_abort ("CONTACT LOCAL GURU.");
  1824. X    }
  1825. X  }
  1826. X  if (errs)
  1827. X    return 1;
  1828. X  else
  1829. X    return 0;
  1830. X}
  1831. X
  1832. X/**/
  1833. Xint DoUnpromote (vlist, ac, av)
  1834. X     struct vc_vlist *vlist;
  1835. X     int ac;
  1836. X     char **av;
  1837. X{
  1838. X  Af_set set;
  1839. X  int errs;
  1840. X  char **erroneous;
  1841. X
  1842. X  if (IsOptionSet(Vopt_version)) {
  1843. X    errs = GetKeysByGenRev
  1844. X    (ac,av, gen(def_vnum), rev(def_vnum), &set, &erroneous);
  1845. X  }
  1846. X  else {
  1847. X    if (!(vlist->from_version_set) || !(vlist->to_version_set))
  1848. X      errs = GetKeysByGenRev 
  1849. X    (ac,av, AF_LASTVERS, AF_LASTVERS, &set, &erroneous);
  1850. X    else
  1851. X      errs = GetKeysByName (ac, av, vlist, &set, &erroneous);
  1852. X  }
  1853. X  if (errs)
  1854. X    print_erroneous (erroneous, errs);
  1855. X
  1856. X  if (!set.af_nkeys) {
  1857. X    logmsg ("Nothing appropriate found.");
  1858. X    return 1;
  1859. X  }
  1860. X
  1861. X  if (errs && !ask_confirm ("Continue ?", "yes"))
  1862. X    return 1;
  1863. X
  1864. X  return do_unpromote (&set);
  1865. X}
  1866. END_OF_FILE
  1867. if test 9143 -ne `wc -c <'src/vc/vadm_promote.c'`; then
  1868.     echo shar: \"'src/vc/vadm_promote.c'\" unpacked with wrong size!
  1869. fi
  1870. # end of 'src/vc/vadm_promote.c'
  1871. fi
  1872. echo shar: End of archive 10 \(of 33\).
  1873. cp /dev/null ark10isdone
  1874. MISSING=""
  1875. for I in 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 ; do
  1876.     if test ! -f ark${I}isdone ; then
  1877.     MISSING="${MISSING} ${I}"
  1878.     fi
  1879. done
  1880. if test "${MISSING}" = "" ; then
  1881.     echo You have unpacked all 33 archives.
  1882.     rm -f ark[1-9]isdone ark[1-9][0-9]isdone
  1883. else
  1884.     echo You still need to unpack the following archives:
  1885.     echo "        " ${MISSING}
  1886. fi
  1887. ##  End of shell archive.
  1888. exit 0
  1889.