Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
aa95e5e5
Commit
aa95e5e5
authored
Feb 20, 1994
by
Per Cederqvist
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the comments before what they comment.
parent
02bbbae1
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
28 deletions
+31
-28
src/server/cache.h
src/server/cache.h
+31
-28
No files found.
src/server/cache.h
View file @
aa95e5e5
/*
/*
* $Id: cache.h,v 0.1
2
1994/02/20 1
4:14:15 law
Exp $
* $Id: cache.h,v 0.1
3
1994/02/20 1
6:21:15 ceder
Exp $
* Copyright (C) 1991 Lysator Academic Computer Association.
* Copyright (C) 1991 Lysator Academic Computer Association.
*
*
* This file is part of the LysKOM server.
* This file is part of the LysKOM server.
...
@@ -32,100 +32,103 @@ struct matching_info *match_table;
...
@@ -32,100 +32,103 @@ struct matching_info *match_table;
/******** initiation and shutdown of cache *******************************/
/******** initiation and shutdown of cache *******************************/
Success
init_cache
(
void
);
/* initiate cache (called at initiation/startup of server) */
/* initiate cache (called at initiation/startup of server) */
Success
init_cache
(
void
);
void
free_all_cache
(
void
);
/* flush, shutdown cache and free all cache memory (called at shutdown) */
/* flush, shutdown cache and free all cache memory (called at shutdown) */
void
free_all_cache
(
void
);
void
cache_emergency_exit
(
void
);
/* dump emergency files, etc, if possible */
/* dump emergency files, etc, if possible */
void
cache_emergency_exit
(
void
);
/******** miscellanous cache master routines *****************************/
/******** miscellanous cache master routines *****************************/
void
cache_limit_size
(
void
);
/* end-of-atomic, may clear read entries */
/* end-of-atomic, may clear read entries */
void
cache_limit_size
(
void
);
void
cache_sync
(
void
);
/* flush all, dont wait for disk */
/* flush all, dont wait for disk */
void
cache_sync
(
void
);
Bool
sync_part
(
void
);
/* sync timout routine, TRUE=>long timeout before next */
/* sync timout routine, TRUE=>long timeout before next */
Bool
sync_part
(
void
);
void
cache_sync_all
(
void
);
/* flush all & wait until disk is synced */
/* flush all & wait until disk is synced */
void
cache_sync_all
(
void
);
void
tell_cache_garb_text
(
int
running
);
/* tell cache that garb_text is in progress, ie never flush cache */
/* tell cache that garb_text is in progress, ie never flush cache */
void
tell_cache_garb_text
(
int
running
);
/* dump cache statistics etc */
void
dump_cache_stats
(
FILE
*
stat_file
);
void
dump_cache_stats
(
FILE
*
stat_file
);
void
dump_cache_mem_usage
(
FILE
*
stat_file
);
void
dump_cache_mem_usage
(
FILE
*
stat_file
);
/* dump cache statistics etc */
/******** object manipulation routines ***********************************/
/******** object manipulation routines ***********************************/
/* mark as changed (object is to be re-written to disk) */
void
mark_person_as_changed
(
Pers_no
pers
);
void
mark_person_as_changed
(
Pers_no
pers
);
void
mark_text_as_changed
(
Text_no
text
);
void
mark_text_as_changed
(
Text_no
text
);
void
mark_conference_as_changed
(
Conf_no
conf
);
void
mark_conference_as_changed
(
Conf_no
conf
);
/* mark as changed (object is to be re-written to disk) */
/* lock (do never remove object from memory) & unlock */
void
cached_lock_conf
(
Conf_no
conf
);
void
cached_lock_conf
(
Conf_no
conf
);
void
cached_unlock_conf
(
Conf_no
conf
);
void
cached_unlock_conf
(
Conf_no
conf
);
void
cached_lock_person
(
Pers_no
pers
);
void
cached_lock_person
(
Pers_no
pers
);
void
cached_unlock_person
(
Pers_no
pers
);
void
cached_unlock_person
(
Pers_no
pers
);
/* lock (do never remove object from memory) & unlock */
/* create object (returns FALSE if person existed) */
Success
cached_create_person
(
Pers_no
pers
);
Success
cached_create_person
(
Pers_no
pers
);
Conf_no
cached_create_conf
(
String
name
);
Conf_no
cached_create_conf
(
String
name
);
Text_no
cached_create_text
(
const
String
message
);
Text_no
cached_create_text
(
const
String
message
);
/* create object (returns FALSE if person existed) */
/* get object from database */
Person
*
cached_get_person_stat
(
Pers_no
person
);
Person
*
cached_get_person_stat
(
Pers_no
person
);
Conference
*
cached_get_conf_stat
(
Conf_no
conf
);
Conference
*
cached_get_conf_stat
(
Conf_no
conf
);
Text_stat
*
cached_get_text_stat
(
Text_no
text
);
Text_stat
*
cached_get_text_stat
(
Text_no
text
);
/* get object from database */
String
cached_get_text
(
Text_no
text
);
/* return text. String is to be freed by caller */
/* return text. String is to be freed by caller */
String
cached_get_text
(
Text_no
text
);
/* remove object from database */
Success
cached_delete_person
(
Pers_no
pers
);
Success
cached_delete_person
(
Pers_no
pers
);
Success
cached_delete_text
(
Text_no
text
);
Success
cached_delete_text
(
Text_no
text
);
Success
cached_delete_conf
(
Conf_no
conf
);
Success
cached_delete_conf
(
Conf_no
conf
);
/* remove object from database */
/* return number of next existing object */
Pers_no
traverse_person
(
Pers_no
sead
);
Pers_no
traverse_person
(
Pers_no
sead
);
Conf_no
traverse_conference
(
Conf_no
sead
);
Conf_no
traverse_conference
(
Conf_no
sead
);
Text_no
traverse_text
(
Text_no
sead
);
Text_no
traverse_text
(
Text_no
sead
);
/* return number of next existing object */
Text_no
query_next_text_num
(
void
);
/* returns highest text_num +1 */
/* returns highest text_num +1 */
Text_no
query_next_text_num
(
void
);
/******** misc conference routines **************************************/
/******** misc conference routines **************************************/
void
cached_change_name
(
Conf_no
conf
,
String
new_name
);
/* Change conferance name.
/* change conferance name
cached_change_name(foo,EMPTY_STRING);
cached_change_name(foo,EMPTY_STRING);
is used when a conference is deleted */
is used when a conference is deleted. */
void
cached_change_name
(
Conf_no
conf
,
String
new_name
);
Bool
cached_conf_exists
(
Conf_no
conf
);
/* returns TRUE when a conference exists */
/* returns TRUE when a conference exists */
Bool
cached_conf_exists
(
Conf_no
conf
);
Conf_type
cached_get_conf_type
(
Conf_no
conf
);
/* returns conference type.
/* returns conference type
conf_type is set when mark_conference_as_changed is called (?) */
conf_type is set when mark_conference_as_changed is called (?) */
Conf_type
cached_get_conf_type
(
Conf_no
conf
);
Garb_nice
cached_get_garb_nice
(
Conf_no
conf
);
/* Get garb_nice from smallconf */
/* Get garb_nice from smallconf */
Garb_nice
cached_get_garb_nice
(
Conf_no
conf
);
String
cached_get_name
(
Conf_no
conf
);
/* returns conference name from smallconf */
/* returns conference name from smallconf */
String
cached_get_name
(
Conf_no
conf
);
Local_text_no
cached_get_highest_local_no
(
Conf_no
conf
);
/* returns highes text number in a certain conference */
/* returns highes text number in a certain conference */
Local_text_no
cached_get_highest_local_no
(
Conf_no
conf
);
Success
cached_lookup_name
(
const
String
name
,
Conf_list_old
*
result
);
/* match from name => conf_list_old */
/* match from name => conf_list_old */
Success
cached_lookup_name
(
const
String
name
,
Conf_list_old
*
result
);
/* How many conferences exists? */
Conf_no
cached_no_of_existing_conferences
(
void
);
/******** miscellanous wierd routines ************************************/
/******** miscellanous wierd routines ************************************/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment