Style policy: reformat multiline comments to conform to style(9).

This commit is contained in:
Maxim Sobolev 2001-05-17 10:12:45 +00:00
parent 2f8b721157
commit 7f7ace8fb2
10 changed files with 83 additions and 46 deletions

View File

@ -117,7 +117,10 @@ pkg_do(char *pkg)
fclose(cfile);
}
else {
strcpy(pkg_fullname, pkg); /* copy for sanity's sake, could remove pkg_fullname */
strcpy(pkg_fullname, pkg); /*
* Copy for sanity's sake,
* could remove pkg_fullname
*/
if (strcmp(pkg, "-")) {
if (stat(pkg_fullname, &sb) == FAIL) {
warnx("can't stat package file '%s'", pkg_fullname);
@ -324,7 +327,8 @@ pkg_do(char *pkg)
}
}
/* Test whether to use the old method of passing tokens to installation
/*
* Test whether to use the old method of passing tokens to installation
* scripts, and set appropriate variables..
*/

View File

@ -173,8 +173,10 @@ pkg_perform(char **pkgs)
/* Make first "real contents" pass over it */
check_list(home, &plist);
(void) umask(022); /* make sure gen'ed directories, files don't have
group or other write bits. */
(void) umask(022); /*
* Make sure gen'ed directories, files don't have
* group or other write bits.
*/
/* copy_plist(home, &plist); */
/* mark_plist(&plist); */

View File

@ -116,8 +116,10 @@ copy_plist(char *home, Package *plist)
dev_t curdir;
maxargs = sysconf(_SC_ARG_MAX);
maxargs -= 64; /* some slop for the tar cmd text,
and sh -c */
maxargs -= 64; /*
* Some slop for the tar cmd text,
* and sh -c
*/
where_args = malloc(maxargs);
if (!where_args) {
cleanup(0);
@ -132,9 +134,11 @@ copy_plist(char *home, Package *plist)
if (stat(".", &stb) == 0)
curdir = stb.st_dev;
else
curdir = (dev_t) -1; /* It's ok if this is a valid dev_t;
this is just a hint for an
optimization. */
curdir = (dev_t) -1; /*
* It's ok if this is a valid dev_t;
* this is just a hint for an
* optimization.
*/
while (p) {
if (p->type == PLIST_CWD)
@ -152,11 +156,15 @@ copy_plist(char *home, Package *plist)
if (fexists(fn)) {
if (lstat(fn, &stb) == 0 && stb.st_dev == curdir &&
S_ISREG(stb.st_mode)) {
/* if we can link it to the playpen, that avoids a copy
and saves time. */
/*
* If we can link it to the playpen, that avoids a copy
* and saves time.
*/
if (p->name[0] != '/') {
/* don't link abspn stuff--it doesn't come from
local dir! */
/*
* Don't link abspn stuff--it doesn't come from
* local dir!
*/
if (trylink(fn, p->name) == 0) {
p = p->next;
continue;
@ -198,8 +206,10 @@ copy_plist(char *home, Package *plist)
sprintf(fn, "%s/%s", mythere ? mythere : where, p->name);
if (lstat(fn, &stb) == 0 && stb.st_dev == curdir &&
S_ISREG(stb.st_mode)) {
/* if we can link it to the playpen, that avoids a copy
and saves time. */
/*
* If we can link it to the playpen, that avoids a copy
* and saves time.
*/
if (trylink(fn, p->name) == 0) {
p = p->next;
continue;

View File

@ -178,7 +178,8 @@ pkg_do(char *pkg)
}
}
/* Test whether to use the old method of passing tokens to deinstallation
/*
* Test whether to use the old method of passing tokens to deinstallation
* scripts, and set appropriate variables..
*/
@ -213,8 +214,10 @@ pkg_do(char *pkg)
errx(2, __FUNCTION__ ": unable to return to working directory %s!", home);
}
/* Some packages aren't packed right, so we need to just ignore
delete_package()'s status. Ugh! :-( */
/*
* Some packages aren't packed right, so we need to just ignore
* delete_package()'s status. Ugh! :-(
*/
if (delete_package(FALSE, CleanDirs, &Plist) == FAIL)
warnx(
"couldn't entirely delete package (perhaps the packing list is\n"

View File

@ -158,12 +158,17 @@ fileGetURL(char *base, char *spec)
if (!isURL(spec)) {
if (!base && !hint)
return NULL;
/* We've been given an existing URL (that's known-good) and now we need
to construct a composite one out of that and the basename we were
handed as a dependency. */
/*
* We've been given an existing URL (that's known-good) and now we need
* to construct a composite one out of that and the basename we were
* handed as a dependency.
*/
if (base) {
strcpy(fname, base);
/* Advance back two slashes to get to the root of the package hierarchy */
/*
* Advance back two slashes to get to the root of the package
* hierarchy
*/
cp = strrchr(fname, '/');
if (cp) {
*cp = '\0'; /* chop name */
@ -179,7 +184,10 @@ fileGetURL(char *base, char *spec)
return NULL;
}
else {
/* Otherwise, we've been given an environment variable hinting at the right location from sysinstall */
/*
* Otherwise, we've been given an environment variable hinting
* at the right location from sysinstall
*/
strcpy(fname, hint);
strcat(fname, spec);
strcat(fname, ".tgz");
@ -312,8 +320,9 @@ fileGetContents(char *fname)
return contents;
}
/* Takes a filename and package name, returning (in "try") the canonical "preserve"
* name for it.
/*
* Takes a filename and package name, returning (in "try") the
* canonical "preserve" name for it.
*/
Boolean
make_preserve_name(char *try, int max, char *name, char *file)
@ -464,7 +473,8 @@ unpack(char *pkg, char *flist)
return 0;
}
/* Using fmt, replace all instances of:
/*
* Using fmt, replace all instances of:
*
* %F With the parameter "name"
* %D With the parameter "dir"

View File

@ -29,10 +29,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* Convention: all functions that operate on a FILE * also take a filename
for diagnostic purposes. The file can be connected to a pipe, so
- don't rewind
- don't reopen from filename.
/*
* Convention: all functions that operate on a FILE * also take a filename
* for diagnostic purposes. The file can be connected to a pipe, so
* - don't rewind
* - don't reopen from filename.
*/
struct mygzip_header;

View File

@ -38,8 +38,9 @@
#include "gzip.h"
#include "pgp.h"
/* Signatures follow a simple format
(endianess was chosen to conform to gzip header format)
/*
* Signatures follow a simple format
* (endianess was chosen to conform to gzip header format)
*/
SIGNTAG known_tags[KNOWN_TAGS] = {

View File

@ -35,9 +35,10 @@
#define CONTINUATION 0x02
#define EXTRA_FIELD 0x04
/* meaningful fields in a gzip header, see gzip proper for details.
This structure should not be fiddled with outside of gzip_read_header
and gzip_write_header
/*
* Meaningful fields in a gzip header, see gzip proper for details.
* This structure should not be fiddled with outside of gzip_read_header
* and gzip_write_header
*/
struct mygzip_header {
char method;
@ -72,8 +73,10 @@ extern int gzip_read_header __P((FILE *f, /*@out@*/struct mygzip_header *h, \
/* gzip_write_header returns 1 for success */
extern int gzip_write_header __P((FILE *f, const struct mygzip_header *h, \
/*@null@*/struct signature *sign));
/* writing header to memory. Returns size needed, or 0 if buffer too small
buffer must be at least 14 characters */
/*
* Writing header to memory. Returns size needed, or 0 if buffer too small
* buffer must be at least 14 characters
*/
extern int gzip_copy_header __P((const struct mygzip_header *h, \
/*@null@*/struct signature *sign, \
void (*add)(void *, const char *, size_t), void *data));

View File

@ -235,8 +235,9 @@ return;
/* Retrieve the pgp passphrase */
p = getpass("Enter passphrase:");
/* somewhat kludgy code to get the passphrase to pgp, see
pgp documentation for the gore
/*
* Somewhat kludgy code to get the passphrase to pgp, see
* pgp documentation for the gore
*/
if (pipe(fd) != 0) {
perror("pkg_sign");
@ -249,8 +250,9 @@ return;
case 0:
{
(void)close(fd[0]);
/* the child fills the pipe with copies of the passphrase.
Expect violent death when father exits.
/*
* The child fills the pipe with copies of the passphrase.
* Expect violent death when father exits.
*/
printf("Child process %d stuffing passphrase in pipe:\n", getpid());
for(;;) {

View File

@ -50,11 +50,12 @@ struct sha1_checker {
#define SHA1_TEMPLATE "SHA1 (%s) = "
#define BUFSIZE (MAXID+sizeof(SHA1_TEMPLATE)+2*SHA_DIGEST_LENGTH+1)
/* Finalize SHA1 checksum for our sha1_context into result
(size at least BUFSIZE). Returns the length of the checksum
marker, e.g., SHA1 (id) = xxxxxxxxx
^here
Return 0 for errors.
/*
* Finalize SHA1 checksum for our sha1_context into result
* (size at least BUFSIZE). Returns the length of the checksum
* marker, e.g., SHA1 (id) = xxxxxxxxx
* ^here
* Return 0 for errors.
*/
size_t
sha1_build_checksum(result, n)