aboutsummaryrefslogtreecommitdiff
path: root/src/lib/krb5/ccache/stdio/scc.h
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>1990-11-01 15:13:59 +0000
committerKen Raeburn <raeburn@mit.edu>1990-11-01 15:13:59 +0000
commit9d5af61de37936866d962846f1ef8c268b4381d2 (patch)
tree2e8e2d76057023e8522bc001dceb28d1226a50d9 /src/lib/krb5/ccache/stdio/scc.h
parentd2c1771b6627bda6a80a509d9d0cb961f8a5b981 (diff)
downloadkrb5-9d5af61de37936866d962846f1ef8c268b4381d2.zip
krb5-9d5af61de37936866d962846f1ef8c268b4381d2.tar.gz
krb5-9d5af61de37936866d962846f1ef8c268b4381d2.tar.bz2
Initial revision
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@1388 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/krb5/ccache/stdio/scc.h')
-rw-r--r--src/lib/krb5/ccache/stdio/scc.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/src/lib/krb5/ccache/stdio/scc.h b/src/lib/krb5/ccache/stdio/scc.h
new file mode 100644
index 0000000..89edc99
--- /dev/null
+++ b/src/lib/krb5/ccache/stdio/scc.h
@@ -0,0 +1,62 @@
+/*
+ * $Source$
+ * $Author$
+ * $Id$
+ *
+ * Copyright 1990 by the Massachusetts Institute of Technology.
+ *
+ * For copying and distribution information, please see the file
+ * <krb5/copyright.h>.
+ *
+ * This file contains constant and function declarations used in the
+ * file-based credential cache routines.
+ */
+
+#include <krb5/copyright.h>
+
+#ifndef __KRB5_FILE_CCACHE__
+#define __KRB5_FILE_CCACHE__
+
+#include <krb5/krb5.h>
+#include <krb5/ext-proto.h>
+#include "scc-proto.h"
+#include <krb5/sysincl.h>
+#include <stdio.h>
+
+#define KRB5_OK 0
+
+#define KRB5_SCC_MAXLEN 100
+
+#ifndef TKT_ROOT
+#define TKT_ROOT "/tmp/tkt"
+#endif
+
+/* macros to make checking flags easier */
+#define OPENCLOSE(id) (((krb5_scc_data *)id->data)->flags & KRB5_TC_OPENCLOSE)
+
+typedef struct _krb5_scc_data {
+ char *filename;
+ FILE *file;
+ krb5_flags flags;
+ char stdio_buffer[BUFSIZ];
+} krb5_scc_data;
+
+/* An off_t can be arbitrarily complex */
+typedef struct _krb5_scc_cursor {
+ long pos;
+} krb5_scc_cursor;
+
+#define MAYBE_OPEN(ID, MODE) \
+{ \
+ if (OPENCLOSE (ID)) { \
+ krb5_error_code maybe_open_ret = krb5_scc_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_scc_close_file (ID); \
+ if (!(RET)) RET = maybe_close_ret; } }
+
+/* DO NOT ADD ANYTHING AFTER THIS #endif */
+#endif /* __KRB5_FILE_CCACHE__ */