From: Ken Raeburn Date: Wed, 8 Jan 2003 03:42:54 +0000 (+0000) Subject: Make ccache and rcache ops tables const X-Git-Tag: krb5-1.3-alpha1~185 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=44253a4ea4baf7cf7789f9ee60f76b1d268feb53;p=krb5.git Make ccache and rcache ops tables const git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15092 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/include/ChangeLog b/src/include/ChangeLog index 76a2a95ec..93599755c 100644 --- a/src/include/ChangeLog +++ b/src/include/ChangeLog @@ -1,3 +1,10 @@ +2003-01-07 Ken Raeburn + + * k5-int.h (krb5_cc_dfl_ops): Declare as pointer to const. + (struct krb5_rc_st): Field ops now points to const. + (krb5_rc_register_type): Ops argument now points to const. + (krb5_rc_dfl_ops): Now const. + 2003-01-06 Sam Hartman * krb5.hin: Add support for setting a callback to generate the diff --git a/src/include/k5-int.h b/src/include/k5-int.h index 8b1b683d7..0d98e8fa2 100644 --- a/src/include/k5-int.h +++ b/src/include/k5-int.h @@ -1714,13 +1714,13 @@ struct _krb5_cc_ops { krb5_flags); }; -extern krb5_cc_ops *krb5_cc_dfl_ops; +extern const krb5_cc_ops *krb5_cc_dfl_ops; /* And this should be in lib/krb5/rcache somewhere. */ struct krb5_rc_st { krb5_magic magic; - struct _krb5_rc_ops *ops; + const struct _krb5_rc_ops *ops; krb5_pointer data; }; @@ -1749,9 +1749,9 @@ struct _krb5_rc_ops { typedef struct _krb5_rc_ops krb5_rc_ops; -krb5_error_code krb5_rc_register_type (krb5_context, krb5_rc_ops *); +krb5_error_code krb5_rc_register_type (krb5_context, const krb5_rc_ops *); -extern krb5_rc_ops krb5_rc_dfl_ops; +extern const krb5_rc_ops krb5_rc_dfl_ops; typedef struct _krb5_kt_ops { krb5_magic magic; diff --git a/src/lib/krb5/ccache/ChangeLog b/src/lib/krb5/ccache/ChangeLog index 3d7af5461..3fd7b3ef0 100644 --- a/src/lib/krb5/ccache/ChangeLog +++ b/src/lib/krb5/ccache/ChangeLog @@ -1,3 +1,7 @@ +2003-01-07 Ken Raeburn + + * ccdefops.c (krb5_cc_dfl_ops): Now points to const. + 2002-09-03 Ken Raeburn * cc_file.c, cc_memory.c, cc_retr.c, ccbase.c, cccopy.c, diff --git a/src/lib/krb5/ccache/ccdefops.c b/src/lib/krb5/ccache/ccdefops.c index 85978e268..cdeab0674 100644 --- a/src/lib/krb5/ccache/ccdefops.c +++ b/src/lib/krb5/ccache/ccdefops.c @@ -40,11 +40,11 @@ */ #include "stdcc.h" /* from ccapi subdir */ -krb5_cc_ops *krb5_cc_dfl_ops = &krb5_cc_stdcc_ops; +const krb5_cc_ops *krb5_cc_dfl_ops = &krb5_cc_stdcc_ops; #else #include "fcc.h" -krb5_cc_ops *krb5_cc_dfl_ops = &krb5_cc_file_ops; +const krb5_cc_ops *krb5_cc_dfl_ops = &krb5_cc_file_ops; #endif diff --git a/src/lib/krb5/rcache/ChangeLog b/src/lib/krb5/rcache/ChangeLog index 7f28a4501..5172c6615 100644 --- a/src/lib/krb5/rcache/ChangeLog +++ b/src/lib/krb5/rcache/ChangeLog @@ -1,3 +1,11 @@ +2003-01-07 Ken Raeburn + + * rc_base.c (struct krb5_rc_typelist): Field "ops" now points to + const. + (krb5_rc_register_type): Likewise for "ops" argument. + * rcdef.c (krb5_rc_dfl_ops): Now const. + * rc_dfl.h (krb5_rc_dfl_ops): Declaration deleted. + 2002-09-05 Ken Raeburn * rc_io.c (krb5_rc_io_move): Missed a variable name change. diff --git a/src/lib/krb5/rcache/rc_base.c b/src/lib/krb5/rcache/rc_base.c index 96532f773..da04dfbc0 100644 --- a/src/lib/krb5/rcache/rc_base.c +++ b/src/lib/krb5/rcache/rc_base.c @@ -20,7 +20,7 @@ struct krb5_rc_typelist { - krb5_rc_ops *ops; + const krb5_rc_ops *ops; struct krb5_rc_typelist *next; }; static struct krb5_rc_typelist krb5_rc_typelist_dfl = { &krb5_rc_dfl_ops, 0 }; @@ -30,7 +30,8 @@ static struct krb5_rc_typelist *typehead = &krb5_rc_typelist_dfl; semaphore ex_typelist = 1; #endif -krb5_error_code krb5_rc_register_type(krb5_context context, krb5_rc_ops *ops) +krb5_error_code krb5_rc_register_type(krb5_context context, + const krb5_rc_ops *ops) { struct krb5_rc_typelist *t; #ifdef SEMAPHORE diff --git a/src/lib/krb5/rcache/rc_dfl.h b/src/lib/krb5/rcache/rc_dfl.h index 51c62ef31..e50ed753b 100644 --- a/src/lib/krb5/rcache/rc_dfl.h +++ b/src/lib/krb5/rcache/rc_dfl.h @@ -13,8 +13,6 @@ #ifndef KRB5_RC_DFL_H #define KRB5_RC_DFL_H -extern krb5_rc_ops krb5_rc_dfl_ops; /* initialized to the following */ - krb5_error_code KRB5_CALLCONV krb5_rc_dfl_init (krb5_context, krb5_rcache, diff --git a/src/lib/krb5/rcache/rcdef.c b/src/lib/krb5/rcache/rcdef.c index 338408fe0..726816b4b 100644 --- a/src/lib/krb5/rcache/rcdef.c +++ b/src/lib/krb5/rcache/rcdef.c @@ -30,7 +30,7 @@ #include "k5-int.h" #include "rc_dfl.h" -krb5_rc_ops krb5_rc_dfl_ops = +const krb5_rc_ops krb5_rc_dfl_ops = { 0, "dfl",