SCCS-vsn: usr.bin/sccs/sccs.c 1.25
# include <sysexits.h>
# include <whoami.h>
# include <sysexits.h>
# include <whoami.h>
-static char SccsId[] = "@(#)sccs.c 1.24 %G%";
+static char SccsId[] = "@(#)sccs.c 1.25 %G%";
# define bitset(bit, word) ((bit) & (word))
# define bitset(bit, word) ((bit) & (word))
# define NO_SDOT 0001 /* no s. on front of args */
# define REALUSER 0002 /* protected (e.g., admin) */
# define NO_SDOT 0001 /* no s. on front of args */
# define REALUSER 0002 /* protected (e.g., admin) */
+/* modes for the "clean", "info", "check" ops */
+# define CLEANC 0 /* clean command */
+# define INFOC 1 /* info command */
+# define CHECKC 2 /* check command */
+
# ifdef CSVAX
# define PROGPATH(name) "/usr/local/name"
# endif CSVAX
# ifdef CSVAX
# define PROGPATH(name) "/usr/local/name"
# endif CSVAX
"del", CMACRO, 0, "delta/get",
"delt", CMACRO, 0, "delta/get",
"fix", FIX, 0, NULL,
"del", CMACRO, 0, "delta/get",
"delt", CMACRO, 0, "delta/get",
"fix", FIX, 0, NULL,
- "clean", CLEAN, REALUSER, (char *) TRUE,
- "info", CLEAN, REALUSER, (char *) FALSE,
+ "clean", CLEAN, REALUSER, (char *) CLEANC,
+ "info", CLEAN, REALUSER, (char *) INFOC,
+ "check", CLEAN, REALUSER, (char *) CHECKC,
"unedit", UNEDIT, 0, NULL,
NULL, -1, 0, NULL
};
"unedit", UNEDIT, 0, NULL,
NULL, -1, 0, NULL
};
exit(EX_SOFTWARE);
case CLEAN:
exit(EX_SOFTWARE);
case CLEAN:
- clean((bool) cmd->sccspath);
+ clean((int) cmd->sccspath);
** exists in the current directory is purged.
**
** Parameters:
** exists in the current directory is purged.
**
** Parameters:
-** really -- if TRUE, remove everything.
-** else, just report status.
+** tells whether this came from a "clean", "info", or
+** "check" command.
**
** Returns:
** none.
**
** Side Effects:
**
** Returns:
** none.
**
** Side Effects:
-** removes files in the current directory.
+** Removes files in the current directory.
+** Prints information regarding files being edited.
+** Exits if a "check" command.
-clean(really)
- bool really;
{
struct direct dir;
struct stat stbuf;
{
struct direct dir;
struct stat stbuf;
}
/* the s. file exists and no p. file exists -- unlink the g-file */
}
/* the s. file exists and no p. file exists -- unlink the g-file */
{
strncpy(buf, &dir.d_name[2], sizeof dir.d_name - 2);
buf[sizeof dir.d_name - 2] = '\0';
{
strncpy(buf, &dir.d_name[2], sizeof dir.d_name - 2);
buf[sizeof dir.d_name - 2] = '\0';
- if (!gotedit && !really)
+ if (!gotedit && mode == INFOC)
printf("Nothing being edited\n");
printf("Nothing being edited\n");
+ if (mode == CHECKC)
+ exit(gotedit);
}
\f/*
** UNEDIT -- unedit a file
}
\f/*
** UNEDIT -- unedit a file