From: John Kohl Date: Fri, 4 May 1990 15:50:21 +0000 (+0000) Subject: new, improved interface from Dan Bernstein X-Git-Tag: krb5-1.0-alpha2~666 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f7dc391e26eab4e3ae956053bf9e9b326a57c506;p=krb5.git new, improved interface from Dan Bernstein git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@736 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/krb5/rcache.h b/src/include/krb5/rcache.h index 168fe434f..fecd271aa 100644 --- a/src/include/krb5/rcache.h +++ b/src/include/krb5/rcache.h @@ -17,28 +17,41 @@ #define KRB5_RCACHE__ typedef struct krb5_rc_st { - struct krb5_rc_ops *ops; - void *data; + struct _krb5_rc_ops *ops; + krb5_pointer data; } *krb5_rcache; typedef struct _krb5_rc_ops { - char *prefix; - krb5_error_code (*resolve) PROTOTYPE((krb5_rcache *, - char *)); - krb5_error_code (*new) PROTOTYPE((krb5_rcache *, - struct _krb5_rc_ops *)); - krb5_error_code (*get_name) PROTOTYPE((krb5_rcache, char *, int)); - krb5_error_code (*init) PROTOTYPE((krb5_rcache, - krb5_deltat)); - krb5_error_code (*recover) PROTOTYPE((krb5_rcache)); - krb5_error_code (*destroy) PROTOTYPE((krb5_rcache)); - krb5_error_code (*close) PROTOTYPE((krb5_rcache)); - krb5_error_code (*store) PROTOTYPE((krb5_rcache, - krb5_tkt_authent *, - krb5_boolean)); - krb5_error_code (*get_span) PROTOTYPE((krb5_rcache, krb5_deltat *)); - krb5_error_code (*expunge) PROTOTYPE((krb5_rcache)); + char *type; + krb5_error_code (*init)PROTOTYPE((krb5_rcache,krb5_deltat)); /* create */ + krb5_error_code (*recover)PROTOTYPE((krb5_rcache)); /* open */ + krb5_error_code (*destroy)PROTOTYPE((krb5_rcache)); + krb5_error_code (*close)PROTOTYPE((krb5_rcache)); + krb5_error_code (*store)PROTOTYPE((krb5_rcache,krb5_tkt_authent *)); + krb5_error_code (*expunge)PROTOTYPE((krb5_rcache)); + krb5_error_code (*get_span)PROTOTYPE((krb5_rcache,krb5_deltat *)); + char *(*get_name)PROTOTYPE((krb5_rcache)); + krb5_error_code (*resolve)PROTOTYPE((krb5_rcache *,char *)); } krb5_rc_ops; +krb5_error_code krb5_rc_default PROTOTYPE((krb5_rcache *)); +krb5_error_code krb5_rc_register_type PROTOTYPE((krb5_rc_ops *)); +krb5_error_code krb5_rc_resolve_type PROTOTYPE((krb5_rcache *,char *)); +krb5_error_code krb5_rc_resolve_full PROTOTYPE((krb5_rcache *,char *)); +char *krb5_rc_get_type PROTOTYPE((krb5_rcache)); +char *krb5_rc_default_type PROTOTYPE((void)); +char *krb5_rc_default_name PROTOTYPE((void)); + +#define krb5_rc_initialize(id, span) (*(id)->ops->init)(id, span) +#define krb5_rc_recover(id) (*(id)->ops->recover)(id) +#define krb5_rc_destroy(id) (*(id)->ops->destroy)(id) +#define krb5_rc_close(id) (*(id)->ops->close)(id) +#define krb5_rc_store(id, authent) (*(id)->ops->store)(id, authent) +#define krb5_rc_expunge(id) (*(id)->ops->expunge)(id) +#define krb5_rc_get_lifespan(id, spanp) (*(id)->ops->get_span)(id, spanp) +#define krb5_rc_get_name(id) (*(id)->ops->get_name)(id) +#define krb5_rc_resolve(id, name) (*(id)->ops->resolve)(id, name) + +extern krb5_rc_ops krb5_rc_dfl_ops; #endif /* KRB5_RCACHE__ */