home *** CD-ROM | disk | FTP | other *** search
- /* $Id: cvs.h,v 1.24.1.1 91/01/18 12:13:48 berliner Exp $ */
-
- #include <string.h>
- #include <stdio.h>
- #include <time.h>
- #include <direct.h>
- #include "ndbm.h"
- #include "regex.h"
-
- #ifdef OS2
- /* OS/2 can generally use / too, but not in some places when commands
- * are passed to CMD.EXE for execution (i.e. I/O redirection). */
- #define DIRSEP '\\'
- #define DIRSEPSTR "\\"
- #define ISDIRSEP(c) ((c) == DIRSEP || (c) == '/')
- extern char *index_sep(char *);
- extern char *rindex_sep(char *);
- #define system(c) (flushall(),system(c))
- #else
- #define DIRSEP '/'
- #define DIRSEPSTR "/"
- #define ISDIRSEP(c) ((c) == DIRSEP)
- #define index_sep(p) index(p, DIRSEP)
- #define rindex_sep(p) rindex(p, DIRSEP)
- #define stricmp strcmp
- #define strnicmp strncmp
- #endif
-
- /*
- * Copyright (c) 1989, Brian Berliner
- *
- * You may distribute under the terms of the GNU General Public License
- * as specified in the README file that comes with the CVS 1.0 kit.
- *
- * Definitions for the CVS Administrative directory and
- * the files it contains. Here as #define's to make changing
- * the names a simple task.
- */
- #define CVSADM "CVS.adm"
- #define CVSEXT_OPT "CVS.opt"
- #define CVSEXT_LOG "CVS.log"
-
- #define CVSADM_ENT "CVS.adm/Entries"
- #define CVSADM_ENTBAK "CVS.adm/Entries.Bak"
- #define CVSADM_ENTSTAT "CVS.adm/Entries.Sta"
- #define CVSADM_FILE "CVS.adm/Files"
- #define CVSADM_MOD "CVS.adm/Mod"
- #define CVSADM_REP "CVS.adm/Reposit.ory"
- #define CVSADM_CIPROG "CVS.adm/Checkin.prg"
-
- /*
- * Definitions for the CVSROOT Administrative directory and
- * the files it contains. This directory is created as a
- * sub-directory of the $CVSROOT environment variable, and holds
- * global administration information for the entire source
- * repository beginning at $CVSROOT.
- */
- #define CVSROOTADM "CVSROOT.adm"
- #define CVSROOTADM_MODULES "CVSROOT.adm/modules"
- #define CVSROOTADM_LOGINFO "CVSROOT.adm/loginfo"
-
- /* support for the CVSROOTADM files */
- #define CVSMODULE_FILE "modules" /* last component of CVSROOTADM_MODULES */
- #define CVSMODULE_TMP "#mXXXXXX"
- #define CVSMODULE_OPTS "ai:o:t:"
- #define CVSLOGINFO_FILE "loginfo" /* last component of CVSROOTADM_LOGINFO */
- #define CVSLOGINFO_TMP "#lXXXXXX"
-
- /* Other CVS file names */
- #define CVSATTIC "Attic"
- #define CVSLCK "#cvs_lck"
- #define CVSTFL "#tfl"
- #define CVSRFL "#rfl"
- #define CVSWFL "#wfl"
- #define CVSPREFIX ""
- #define CVSTEMP "#cXXXXXX"
-
- /* miscellaneous CVS defines */
- #define CVSEDITPREFIX "CVS: "
- #define CVSLCKAGE 600 /* 10-min old lock files cleaned up */
- #define CVSLCKSLEEP 15 /* wait 15 seconds before retrying */
- #define DFLT_RECORD "nul"
- #define BAKPREFIX "#"
-
- #define DEVNULL "nul"
- #define CONSOLE "con" /* or "/dev/tty" */
-
- #define FALSE 0
- #define TRUE 1
-
- /*
- * Definitions for the RCS file names.
- */
- #define RCS "rcs"
- #define RCS_CI "ci"
- #define RCS_CO "co"
- #define RCS_RLOG "rlog"
- #define RCS_DIFF "rcsdiff"
- #define RCS_MERGE "rcsmerge"
- #define RCS_MERGE_PAT "^>>>>>>> " /* runs "grep" with this pattern */
- #define RCSID_PAT "\"\\$Id.*\\$\"" /* when committing files */
- #define RCSEXT Rcsext
- #define RCSHEAD "head"
- #define RCSBRANCH "branch"
- #define RCSSYMBOL "symbols"
- #define RCSDATE "date"
- #define RCSDESC "desc" /* ends the search for branches */
- #define DATEFORM "%02d.%02d.%02d.%02d.%02d.%02d"
-
- /* Programs that cvs runs */
- #define DIFF "diff"
- #define GREP "grep"
- #define RM "rm"
- #define SORT "sort"
-
- /*
- * Environment variable used by CVS
- */
- #define CVSREAD_ENV "CVSREAD" /* make files read-only */
- #define CVSREAD_DFLT FALSE /* writable files by default */
-
- #define TMPDIR_ENV "TMP" /* temp directory */
- #define TMPDIR_DFLT "" /* directory to put temp files into */
-
- #define RCSBIN_ENV "RCSBIN" /* RCS binary directory */
- #define RCSBIN_DFLT "/bin" /* directory to find RCS progs */
- #define RCSINIT_ENV "RCSINIT" /* RCS option settings */
-
- #define EDITOR_ENV "EDITOR" /* which editor to use */
- #define EDITOR_DFLT "emacs" /* somewhat standard */
-
- #define CVSROOT_ENV "CVSROOT" /* source directory root */
- #define CVSROOT_DFLT NULL /* No dflt; must set for checkout */
-
- /*
- * If the beginning of the Repository matches the following string,
- * strip it so that the output to the logfile does not contain a full pathname.
- *
- * If the CVSROOT environment variable is set, it overrides this define.
- */
- #define REPOS_STRIP "/src/master/"
-
- /*
- * The maximum number of files per each CVS directory.
- * This is mainly for sizing arrays statically rather than
- * dynamically. 3000 seems plenty for now.
- */
- #define MAXFILEPERDIR 1000
- #define MAXLINELEN 1000 /* max input line from a file */
- #define MAXPROGLEN 30000 /* max program length to system() */
- #define MAXLISTLEN 10000 /* For [A-Z]list holders */
- #define MAXMESGLEN 1000 /* max RCS log message size */
-
- /*
- * The type of request that is being done in do_module() &&
- * the type of request that is being done in Find_Names().
- */
- enum mtype { CHECKOUT, TAG, PATCH };
- enum ftype { ALL, ALLPLUSATTIC, MOD };
-
- extern char *progname, *command;
- extern char Clist[], Glist[], Mlist[], Olist[], Dlist[];
- extern char Alist[], Rlist[], Wlist[], Llist[], Blist[];
- extern char User[], Repository[], SRepository[], Rcs[];
- extern char VN_User[], VN_Rcs[], TS_User[], TS_Rcs[];
- extern char Options[], Tag[], Date[], prog[];
- extern char *Tmpdir, *Rcsbin, *Editor, *CVSroot, *Rcsext;
- extern int really_quiet, quiet;
- extern int use_editor;
- extern int cvswrite;
- extern int force_tag_match;
-
- extern int fileargc; /* for Find_Names() */
- extern char *fileargv[];
-
- /*
- * Externs that are included directly in the CVS sources
- */
- extern FILE *open_file();
- extern char *xmalloc();
- extern int ppstrcmp();
- extern int ppstrcmp_files();
- extern void Lock_Cleanup();
-
- /*
- * Externs that are included in libc, but are used frequently
- * enough to warrant defining here.
- */
- extern char *optarg; /* for getopt() support */
- extern int optind;
-
- #define DBLKSIZ 1024
- #define MAXPATHLEN 256
- #define COPYBUFFER 16384
-
- #define R_OK 04
- #define W_OK 02
-
- #define mkstemp(n) (mktemp(n), open(n, O_CREAT|O_TRUNC|O_RDWR, 0644))
- #define getwd(d) getcwd(d, MAXPATHLEN)
- #define geteuid() 0
- #define gethostname(n, s) -1
-
- #define max(a,b) (((a) > (b)) ? (a) : (b))
- #define min(a,b) (((a) < (b)) ? (a) : (b))
-
- #define WEXITSTATUS(x) (x & 255)
-
- #define index strchr
- #define rindex strrchr
-
- #define mkdir(p, m) mkdir(p)
-
- #define bcmp(x, y, n) memcmp(x, y, n)
- #define bcopy(s, d, n) memcpy(d, s, n)
-
- #include "proto.h"
-
-