Commit 124fe918 authored by Per Cederqvist's avatar Per Cederqvist

(Aux_item_validation_data): const qualifiers added to the item and def members.

(aux_inherit_items): const qualifiers added to some arguments.
(aux_item_add_perm): Likewise.
(prepare_aux_item): Likewise.
(find_aux_item_definition): Likewise.
(aux_item_find_trigger): Likewise.
(aux_item_find_validator): Likewise.
(find_aux_item): Likewise.
(filter_aux_item_list): Likewise.
(delete_aux_item_list): Likewise.
(undelete_aux_item_list): Likewise.
(check_delete_aux_item_list): Likewise.
parent 69e8d02b
/* /*
* $Id: aux-items.h,v 1.13 1999/06/26 11:37:09 ceder Exp $ * $Id: aux-items.h,v 1.14 2000/09/02 19:45:25 ceder Exp $
* Copyright (C) 1994-1999 Lysator Academic Computer Association. * Copyright (C) 1994-1999 Lysator Academic Computer Association.
* *
* This file is part of the LysKOM server. * This file is part of the LysKOM server.
...@@ -72,8 +72,8 @@ typedef enum { ...@@ -72,8 +72,8 @@ typedef enum {
typedef struct typedef struct
{ {
Aux_item *item; const Aux_item *item;
Aux_item_definition *def; const Aux_item_definition *def;
Pers_no item_creator; Pers_no item_creator;
Pers_no object_creator; Pers_no object_creator;
Bool owner_check; Bool owner_check;
...@@ -153,10 +153,14 @@ extern Aux_item_definition empty_aux_item_definition; ...@@ -153,10 +153,14 @@ extern Aux_item_definition empty_aux_item_definition;
* of the target object (author for texts, person for persons and * of the target object (author for texts, person for persons and
* conference for conferences */ * conference for conferences */
void aux_inherit_items(Aux_item_list *target, Aux_item_list *parent, void aux_inherit_items(Aux_item_list *target,
unsigned long *counter, Pers_no target_creator, const Aux_item_list *parent,
Bool creating, Object_type object_type, unsigned long *counter,
unsigned long object_no, void *object); Pers_no target_creator,
Bool creating,
Object_type object_type,
unsigned long object_no,
void *object);
...@@ -172,10 +176,14 @@ void aux_inherit_items(Aux_item_list *target, Aux_item_list *parent, ...@@ -172,10 +176,14 @@ void aux_inherit_items(Aux_item_list *target, Aux_item_list *parent,
* If you think you need to call this, and you're not hacking functions * If you think you need to call this, and you're not hacking functions
* in aux-items.c, you should rethink your strategy. */ * in aux-items.c, you should rethink your strategy. */
Bool aux_item_add_perm(Aux_item *item, Aux_item_definition *def, Bool aux_item_add_perm(const Aux_item *item,
Pers_no item_creator, Pers_no object_creator, const Aux_item_definition *def,
Bool owner_check, Aux_item_list *add_to_list, Pers_no item_creator,
unsigned long start_looking_at, Bool creating, Pers_no object_creator,
Bool owner_check,
Aux_item_list *add_to_list,
unsigned long start_looking_at,
Bool creating,
Object_type object_type); Object_type object_type);
...@@ -188,29 +196,30 @@ Bool aux_item_add_perm(Aux_item *item, Aux_item_definition *def, ...@@ -188,29 +196,30 @@ Bool aux_item_add_perm(Aux_item *item, Aux_item_definition *def,
void prepare_aux_item_list(Aux_item_list *list, Pers_no creator); void prepare_aux_item_list(Aux_item_list *list, Pers_no creator);
void prepare_aux_item(Aux_item *item, Pers_no creator, void prepare_aux_item(Aux_item *item, Pers_no creator,
Aux_item_definition *def); const Aux_item_definition *def);
/* Find the aux_item_definition for item. Returns a pointer to the /* Find the aux_item_definition for item. Returns a pointer to the
* definition or NULL if the item's tag is invalid. */ * definition or NULL if the item's tag is invalid. */
Aux_item_definition *find_aux_item_definition(Aux_item *item); const Aux_item_definition *find_aux_item_definition(const Aux_item *item);
/* Get the function pointer for a named trigger */ /* Get the function pointer for a named trigger */
Aux_item_trigger aux_item_find_trigger(char *trigger_name); Aux_item_trigger aux_item_find_trigger(const char *trigger_name);
/* Get the function pointer for a named validation function */ /* Get the function pointer for a named validation function */
Aux_item_validation_function aux_item_find_validator(char *validator_name); Aux_item_validation_function
aux_item_find_validator(const char *validator_name);
/* Get a pointer to the item in list with aux-no aux_no. Returns /* Get a pointer to the item in list with aux-no aux_no. Returns
* NULL if there is no such item */ * NULL if there is no such item */
long find_aux_item_index(Aux_item_list *list, unsigned long aux_no); long find_aux_item_index(const Aux_item_list *list, unsigned long aux_no);
Aux_item *find_aux_item(Aux_item_list *list, unsigned long aux_no); const Aux_item *find_aux_item(const Aux_item_list *list, unsigned long aux_no);
...@@ -219,15 +228,15 @@ Aux_item *find_aux_item(Aux_item_list *list, unsigned long aux_no); ...@@ -219,15 +228,15 @@ Aux_item *find_aux_item(Aux_item_list *list, unsigned long aux_no);
* original will be places. All memory allocated in this call is * original will be places. All memory allocated in this call is
* allocaed with tmp_alloc */ * allocaed with tmp_alloc */
void filter_aux_item_list(Aux_item_list *original, void filter_aux_item_list(const Aux_item_list *original,
Aux_item_list *result, Aux_item_list *result,
Connection *conn); const Connection *conn);
/* delete items_to_delete from list_to_delete_from /* Delete items_to_delete from list_to_delete_from.
* list_to_delete_from and its elements may be modified */ * list_to_delete_from and its elements may be modified. */
void delete_aux_item_list(Number_list *items_to_delete, void delete_aux_item_list(const Number_list *items_to_delete,
Aux_item_list *list_to_delete_from, Aux_item_list *list_to_delete_from,
Object_type object_type, Object_type object_type,
unsigned long object_no, unsigned long object_no,
...@@ -235,10 +244,10 @@ void delete_aux_item_list(Number_list *items_to_delete, ...@@ -235,10 +244,10 @@ void delete_aux_item_list(Number_list *items_to_delete,
/* undelete items in items_to_undelete from list_to_undelete_from /* Undelete items in items_to_undelete from list_to_undelete_from.
* list_to_delete_from and its elements may be modified */ * list_to_delete_from and its elements may be modified. */
void undelete_aux_item_list(Number_list *items_to_undelete, void undelete_aux_item_list(const Number_list *items_to_undelete,
Aux_item_list *list_to_undelete_from, Aux_item_list *list_to_undelete_from,
Object_type object_type, Object_type object_type,
unsigned long object_no, unsigned long object_no,
...@@ -254,13 +263,13 @@ commit_aux_item_list(Aux_item_list *list_to_commit); ...@@ -254,13 +263,13 @@ commit_aux_item_list(Aux_item_list *list_to_commit);
* err_stat and returns FAILURE if deletion of any single item is * err_stat and returns FAILURE if deletion of any single item is
* not allowed */ * not allowed */
Success check_delete_aux_item_list(Number_list *items_to_delete, Success check_delete_aux_item_list(const Number_list *items_to_delete,
Aux_item_list *list_to_delete_from); const Aux_item_list *list_to_delete_from);
/* Att item_list to the aux_item_list of text_s. item_creator is the /* Add item_list to the aux_item_list of text_s. item_creator is the
* person who is adding the items. Does not check for permission first */ * person who is adding the items. Does not check for permission first. */
void text_stat_add_aux_item_list(Text_stat *text_s, void text_stat_add_aux_item_list(Text_stat *text_s,
Text_no text_no, Text_no text_no,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment