Commit 3a1da42c authored by Per Cederqvist's avatar Per Cederqvist

Lots of const qualifiers added.

parent 124fe918
/*
* $Id: aux-items.c,v 1.24 1999/07/10 22:32:40 ceder Exp $
* $Id: aux-items.c,v 1.25 2000/09/02 19:46:09 ceder Exp $
* Copyright (C) 1994-1999 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -177,8 +177,8 @@ static Aux_item_definition simple_aux_item =
/* Forward declarations */
static Bool
aux_item_check_unique(Aux_item *item,
Aux_item_definition *xdef,
aux_item_check_unique(const Aux_item *item,
const Aux_item_definition *xdef,
Aux_item_list *add_to_list,
unsigned long start_looking_at);
......@@ -191,7 +191,7 @@ aux_item_check_unique(Aux_item *item,
*/
static Aux_item_definition *
aux_item_default_definition(Aux_item *item)
aux_item_default_definition(const Aux_item *item)
{
/* A predefined aux_item that we didn't find a definition for is
illegal. */
......@@ -251,7 +251,7 @@ aux_item_default_definition(Aux_item *item)
*/
Aux_item_trigger
aux_item_find_trigger(char *trigger_name)
aux_item_find_trigger(const char *trigger_name)
{
unsigned long i = 0;
......@@ -265,7 +265,7 @@ aux_item_find_trigger(char *trigger_name)
}
Aux_item_validation_function
aux_item_find_validator(char *validator_name)
aux_item_find_validator(const char *validator_name)
{
unsigned long i = 0;
......@@ -286,8 +286,8 @@ aux_item_find_validator(char *validator_name)
* have a valid information.
*/
Aux_item_definition *
find_aux_item_definition(Aux_item *item)
const Aux_item_definition *
find_aux_item_definition(const Aux_item *item)
{
Aux_item_definition *def;
......@@ -335,7 +335,7 @@ aux_item_fix_trigger_data(Aux_item_trigger_data *data)
static void
aux_item_call_add_triggers(Aux_item_definition *def,
aux_item_call_add_triggers(const Aux_item_definition *def,
Object_type object_type,
unsigned long item_index,
unsigned long integer_argument,
......@@ -360,7 +360,7 @@ aux_item_call_add_triggers(Aux_item_definition *def,
}
static void
aux_item_call_delete_triggers(Aux_item_definition *def,
aux_item_call_delete_triggers(const Aux_item_definition *def,
Object_type object_type,
unsigned long item_index,
unsigned long integer_argument,
......@@ -384,7 +384,7 @@ aux_item_call_delete_triggers(Aux_item_definition *def,
}
static void
aux_item_call_undelete_triggers(Aux_item_definition *def,
aux_item_call_undelete_triggers(const Aux_item_definition *def,
Object_type object_type,
unsigned long item_index,
unsigned long integer_argument,
......@@ -440,7 +440,7 @@ aux_item_definition_add(Aux_item_definition *def)
*/
static void
aux_item_definition_cache_regexp(Aux_item_definition *def,
aux_item_definition_cache_regexp(const Aux_item_definition *def,
unsigned long ix)
{
struct re_pattern_buffer *pat_buf;
......@@ -559,7 +559,7 @@ free_aux_item_definitions(void)
long
find_aux_item_index(Aux_item_list *list, unsigned long aux_no)
find_aux_item_index(const Aux_item_list *list, unsigned long aux_no)
{
unsigned long i;
......@@ -610,7 +610,7 @@ find_linked_aux_item_list(Aux_item *item)
/* Find the aux item that ITEM is linked to */
static Aux_item *
static const Aux_item *
find_linked_aux_item(Aux_item *item)
{
Aux_item_list *target_list;
......@@ -901,7 +901,7 @@ prepare_aux_item_list(Aux_item_list *list,
void prepare_aux_item(Aux_item *item,
Pers_no creator,
Aux_item_definition *def)
const Aux_item_definition *def)
{
if (item == NULL)
return;
......@@ -933,7 +933,7 @@ void prepare_aux_item(Aux_item *item,
static Bool aux_item_validate(Aux_item_validation_data validation_data)
{
unsigned long i;
Aux_item_definition *def;
const Aux_item_definition *def;
def = validation_data.def;
for (i = 0; i < def->num_validators; i++)
......@@ -1060,8 +1060,8 @@ static Bool aux_item_validate(Aux_item_validation_data validation_data)
*/
Bool
aux_item_add_perm(Aux_item *item,
Aux_item_definition *def,
aux_item_add_perm(const Aux_item *item,
const Aux_item_definition *def,
Pers_no item_creator,
Pers_no object_creator,
Bool owner_check,
......@@ -1181,8 +1181,8 @@ aux_item_add_perm(Aux_item *item,
*/
static Bool
aux_item_check_unique(Aux_item *item,
Aux_item_definition *def,
aux_item_check_unique(const Aux_item *item,
const Aux_item_definition *def,
Aux_item_list *add_to_list,
unsigned long start_looking_at)
{
......@@ -1193,7 +1193,8 @@ aux_item_check_unique(Aux_item *item,
start_looking_at >= add_to_list->length)
return TRUE;
def = def ? def : find_aux_item_definition(item);
if (def != NULL)
def = find_aux_item_definition(item);
if (def == NULL || !def->one_per_person)
return TRUE;
......@@ -1219,7 +1220,7 @@ aux_item_check_unique(Aux_item *item,
void
aux_inherit_items(Aux_item_list *target,
Aux_item_list *parent,
const Aux_item_list *parent,
unsigned long *counter,
Pers_no target_creator,
Bool creating,
......@@ -1229,7 +1230,7 @@ aux_inherit_items(Aux_item_list *target,
{
int i;
Aux_item item;
Aux_item_definition *def;
const Aux_item_definition *def;
/* Inheriting linked items is strange, but works. */
......@@ -1289,9 +1290,9 @@ aux_inherit_items(Aux_item_list *target,
*/
void
filter_aux_item_list(Aux_item_list *original,
Aux_item_list *result,
Connection *viewer_conn)
filter_aux_item_list(const Aux_item_list *original,
Aux_item_list *result,
const Connection *viewer_conn)
{
Aux_item *orig_aux;
unsigned long from, to;
......@@ -1332,12 +1333,12 @@ filter_aux_item_list(Aux_item_list *original,
*/
Success
check_delete_aux_item_list(Number_list *items_to_delete,
Aux_item_list *list_to_delete_from)
check_delete_aux_item_list(const Number_list *items_to_delete,
const Aux_item_list *list_to_delete_from)
{
long i;
Aux_item *item;
Aux_item_definition *def;
const Aux_item *item;
const Aux_item_definition *def;
for (i = 0; i < items_to_delete->length; i++)
{
......@@ -1391,7 +1392,7 @@ check_delete_aux_item_list(Number_list *items_to_delete,
*/
void
delete_aux_item_list(Number_list *items_to_delete,
delete_aux_item_list(const Number_list *items_to_delete,
Aux_item_list *list_to_delete_from,
Object_type object_type,
unsigned long object_no,
......@@ -1399,7 +1400,7 @@ delete_aux_item_list(Number_list *items_to_delete,
{
long i;
Aux_item *item;
Aux_item *linked_item;
const Aux_item *linked_item;
long item_index;
long item_to_delete;
unsigned long linked_object_no;
......@@ -1480,7 +1481,7 @@ delete_aux_item_list(Number_list *items_to_delete,
*/
void
undelete_aux_item_list(Number_list *items_to_undelete,
undelete_aux_item_list(const Number_list *items_to_undelete,
Aux_item_list *list_to_undelete_from,
Object_type object_type,
unsigned long object_no,
......@@ -1490,7 +1491,7 @@ undelete_aux_item_list(Number_list *items_to_undelete,
unsigned long saved_err_stat;
long i;
Aux_item *item;
Aux_item *linked_item;
const Aux_item *linked_item;
Aux_item_list *linked_item_list;
long item_index;
long item_to_undelete;
......@@ -1586,7 +1587,7 @@ commit_aux_item_list_internal(Aux_item_list *list_to_commit, Bool shallow)
{
long i; /* Loop index */
long target; /* Where to move items when compacting */
Aux_item *linked_item;
const Aux_item *linked_item;
Aux_item_list *aux_item_list;
......@@ -1659,8 +1660,8 @@ void commit_aux_item_list(Aux_item_list *list_to_commit)
* Return a pointer to the item in LIST with aux_no 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)
{
long item_index = find_aux_item_index(list, aux_no);
......@@ -1709,7 +1710,7 @@ text_stat_check_add_aux_item_list(Text_stat *text_s,
{
Aux_item *item;
unsigned long i;
Aux_item_definition *def;
const Aux_item_definition *def;
if (list == NULL)
return OK;
......@@ -1776,7 +1777,7 @@ conf_stat_check_add_aux_item_list(Conference *conf,
{
unsigned long i;
Aux_item *item;
Aux_item_definition *def;
const Aux_item_definition *def;
if (list == NULL)
return OK;
......@@ -1847,7 +1848,7 @@ Success system_check_add_aux_item_list(Info *info,
{
unsigned long i;
Aux_item *item;
Aux_item_definition *def;
const Aux_item_definition *def;
if (list == NULL)
return OK;
......
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