From: John Kohl Date: Tue, 12 Feb 1991 14:08:47 +0000 (+0000) Subject: add defines for vno and open flags X-Git-Tag: krb5-1.0-alpha4~300 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=49baa43cc5038b966112c232ef87a89790bab2fb;p=krb5.git add defines for vno and open flags add macros for MAYBE_OPEN/CLOSE git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1672 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/ccache/file/fcc.h b/src/lib/krb5/ccache/file/fcc.h index 07ca0a76f..c310b1c93 100644 --- a/src/lib/krb5/ccache/file/fcc.h +++ b/src/lib/krb5/ccache/file/fcc.h @@ -3,7 +3,7 @@ * $Author$ * $Id$ * - * Copyright 1990 by the Massachusetts Institute of Technology. + * Copyright 1990,1991 by the Massachusetts Institute of Technology. * * For copying and distribution information, please see the file * . @@ -27,6 +27,11 @@ #define KRB5_FCC_MAXLEN 100 +#define KRB5_FCC_FVNO 0x0501 /* krb v5, fcc v1 */ +#define FCC_OPEN_AND_ERASE 1 +#define FCC_OPEN_RDWR 2 +#define FCC_OPEN_RDONLY 3 + #ifndef TKT_ROOT #define TKT_ROOT "/tmp/tkt" #endif @@ -45,5 +50,22 @@ typedef struct _krb5_fcc_cursor { off_t pos; } krb5_fcc_cursor; +#define MAYBE_OPEN(ID, MODE) \ +{ \ + if (OPENCLOSE (ID)) { \ + krb5_error_code maybe_open_ret = krb5_fcc_open_file (ID,MODE); \ + if (maybe_open_ret) return maybe_open_ret; } } + +#define MAYBE_CLOSE(ID, RET) \ +{ \ + if (OPENCLOSE (ID)) { \ + krb5_error_code maybe_close_ret = krb5_fcc_close_file (ID); \ + if (!(RET)) RET = maybe_close_ret; } } + +#define MAYBE_CLOSE_IGNORE(ID) \ +{ \ + if (OPENCLOSE (ID)) { \ + (void) krb5_fcc_close_file (ID); } } + /* DO NOT ADD ANYTHING AFTER THIS #endif */ #endif /* __KRB5_FILE_CCACHE__ */