Make ccache and rcache ops tables const
authorKen Raeburn <raeburn@mit.edu>
Wed, 8 Jan 2003 03:42:54 +0000 (03:42 +0000)
committerKen Raeburn <raeburn@mit.edu>
Wed, 8 Jan 2003 03:42:54 +0000 (03:42 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15092 dc483132-0cff-0310-8789-dd5450dbe970

src/include/ChangeLog
src/include/k5-int.h
src/lib/krb5/ccache/ChangeLog
src/lib/krb5/ccache/ccdefops.c
src/lib/krb5/rcache/ChangeLog
src/lib/krb5/rcache/rc_base.c
src/lib/krb5/rcache/rc_dfl.h
src/lib/krb5/rcache/rcdef.c

index 76a2a95ec0845250db2e9796b0c818db78cca4d1..93599755c85c315c413e56245c6945eda78d6849 100644 (file)
@@ -1,3 +1,10 @@
+2003-01-07  Ken Raeburn  <raeburn@mit.edu>
+
+       * 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  <hartmans@mit.edu>
 
        * krb5.hin: Add support for setting a callback to generate the
index 8b1b683d78daff36bf916fc510c9d8317747f778..0d98e8fa2c6879ac1557c4c6b5528da33732b2d4 100644 (file)
@@ -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;
index 3d7af54612b3fce2b41d62d775f38ffff070a6e4..3fd7b3ef0ae935bf246a025f8dc78b6f54016a4d 100644 (file)
@@ -1,3 +1,7 @@
+2003-01-07  Ken Raeburn  <raeburn@mit.edu>
+
+       * ccdefops.c (krb5_cc_dfl_ops): Now points to const.
+
 2002-09-03  Ken Raeburn  <raeburn@mit.edu>
 
        * cc_file.c, cc_memory.c, cc_retr.c, ccbase.c, cccopy.c,
index 85978e268fb53810d7a052c527e625535667ea21..cdeab0674c9b06b4dad457ca496ddffc7a71491e 100644 (file)
  */
 #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
index 7f28a4501d04addb364a752edff133d1bd3e6808..5172c6615b3814c60e04aae1cb3d5319cbedf383 100644 (file)
@@ -1,3 +1,11 @@
+2003-01-07  Ken Raeburn  <raeburn@mit.edu>
+
+       * 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  <raeburn@mit.edu>
 
        * rc_io.c (krb5_rc_io_move): Missed a variable name change.
index 96532f773dcce3fa15d83afe11105f92d2c21437..da04dfbc00fef5733c86602d2b113e5f11033072 100644 (file)
@@ -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
index 51c62ef310ba6816b7842bb34a84925e783aaa40..e50ed753bbf8d400c909f0a5a36fff89f4c50882 100644 (file)
@@ -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,
index 338408fe009ade9be76033728ef448631e50f620..726816b4b3a0c93d7890992f2e02e033fc545fcd 100644 (file)
@@ -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",