Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lyskom-server-ceder-1616-generations-topgit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Per Cederqvist
lyskom-server-ceder-1616-generations-topgit
Commits
925de6d3
Commit
925de6d3
authored
Feb 20, 1994
by
Pontus Hagland
Browse files
Options
Downloads
Patches
Plain Diff
Rewritten.
parent
2daba666
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/server/cache.h
+75
-190
75 additions, 190 deletions
src/server/cache.h
with
75 additions
and
190 deletions
src/server/cache.h
+
75
−
190
View file @
925de6d3
/*
/*
* $Id: cache.h,v 0.1
1
199
3
/0
8/04 23:01:33 ceder
Exp $
* $Id: cache.h,v 0.1
2
199
4
/0
2/20 14:14:15 law
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.
...
@@ -23,226 +23,111 @@
...
@@ -23,226 +23,111 @@
* Please mail bug reports to bug-lyskom@lysator.liu.se.
* Please mail bug reports to bug-lyskom@lysator.liu.se.
*/
*/
/*
/*
* $Id: cache.h,v 0.11 1993/08/04 23:01:33 ceder Exp $
* database cache header file
*
* This file contains the cached data that the server stores.
* .h file created by ceder 1990-04-18
*/
*/
/* cache_sync_all only returns when everything is written to disk. */
struct
matching_info
*
match_table
;
extern
void
/* match_table, see build_matching_info() */
cache_sync_all
(
void
);
/* First, some things which I want here. /ceder */
extern
struct
matching_info
*
match_table
;
extern
void
/******** initiation and shutdown of cache *******************************/
cached_lock_conf
(
Conf_no
conf_no
);
extern
Success
Success
init_cache
(
void
);
init
_cache
(
void
);
/*
init
iate cache (called at initiation/startup of server) */
extern
void
void
free_all_cache
(
void
);
cached_unlock_conf
(
Conf_no
conf
);
/* flush, shutdown cache and free all cache memory (called at shutdown) */
extern
void
void
cache_emergency_exit
(
void
);
cached_lock_person
(
Pers_no
pers
);
/* dump emergency files, etc, if possible */
extern
void
/******** miscellanous cache master routines *****************************/
cached_unlock_person
(
Pers_no
pers
);
extern
Success
void
cache_limit_size
(
void
);
cached_delete_person
(
Pers_no
pres
);
/* end-of-atomic, may clear read entries */
extern
Success
void
cache_sync
(
void
);
cached_delete_text
(
Text_no
text
);
/* flush all, dont wait for disk */
extern
Success
Bool
sync_part
(
void
);
build_matching_info
(
void
);
/* sync timout routine, TRUE=>long timeout before next */
extern
void
/* Write out everything. */
void
cache_sync_all
(
void
);
cache_sync
(
void
);
/* flush all & wait until disk is synced */
/* S}d{r ja. Tack f|r mig. /ceder */
void
tell_cache_garb_text
(
int
running
);
/* tell cache that garb_text is in progress, ie never flush cache */
/*
void
dump_cache_stats
(
FILE
*
stat_file
);
* Name caching routines
void
dump_cache_mem_usage
(
FILE
*
stat_file
);
*/
/* dump cache statistics etc */
/*
* change_name changes the cached conference name. It is only called when
* a conference name is changed or a conference is deleted.
*
* cached_change_name(foo, EMPTY_STRING); should be used when a conference
* is deleted. (Eller ska det vara annorlunda? S} g|r jag nu... /ceder)
*/
extern
void
cached_change_name
(
Conf_no
name_num
,
String
new_name
);
/******** object manipulation routines ***********************************/
extern
Bool
void
mark_person_as_changed
(
Pers_no
pers
);
cached_conf_exists
(
Conf_no
conf_no
);
void
mark_text_as_changed
(
Text_no
text
);
void
mark_conference_as_changed
(
Conf_no
conf
);
/* mark as changed (object is to be re-written to disk) */
/*
void
cached_lock_conf
(
Conf_no
conf
);
* Calls for the cacheing of conf_type:
void
cached_unlock_conf
(
Conf_no
conf
);
* cached_get_conf_type() returns the type.
void
cached_lock_person
(
Pers_no
pers
);
* The type is set when mark_conference_as_changed is called.
void
cached_unlock_person
(
Pers_no
pers
);
*/
/* lock (do never remove object from memory) & unlock
*/
/* Get conference type */
Success
cached_create_person
(
Pers_no
pers
);
/* Undefined result if the conf doesn't exist. */
Conf_no
cached_create_conf
(
String
name
);
Text_no
cached_create_text
(
const
String
message
);
/* create object (returns FALSE if person existed) */
extern
Conf_type
Person
*
cached_get_person_stat
(
Pers_no
person
);
cached_get_conf_type
(
Conf_no
conf_no
);
Conference
*
cached_get_conf_stat
(
Conf_no
conf
);
Text_stat
*
cached_get_text_stat
(
Text_no
text
);
/* get object from database */
/*
String
cached_get_text
(
Text_no
text
);
* Return number of conferences present. (Actually, return a number
/* return text. String is to be freed by caller */
* at least as large as the number of conferences present).
*/
extern
Conf_no
cached_no_of_existing_conferences
(
void
);
/*
Success
cached_delete_person
(
Pers_no
pers
);
* Get garb_nice for a certain conference.
Success
cached_delete_text
(
Text_no
text
);
* It is set when mark_conference_as_changed is called.
Success
cached_delete_conf
(
Conf_no
conf
);
*/
/* remove object from database */
extern
Garb_nice
cached_get_garb_nice
(
Conf_no
conf_no
);
extern
String
Pers_no
traverse_person
(
Pers_no
sead
);
cached_get_name
(
Conf_no
conf_no
);
Conf_no
traverse_conference
(
Conf_no
sead
);
Text_no
traverse_text
(
Text_no
sead
);
/* return number of next existing object */
ext
ern
Local_text_no
T
ext
_no
query_next_text_num
(
void
);
cached_get_highest_local_no
(
Conf_no
conf_no
);
/* returns highest text_num +1 */
/******** misc conference routines **************************************/
void
cached_change_name
(
Conf_no
conf
,
String
new_name
);
/*
/*
change conferance name
* Various function calls to tell the cache that something is changed.
cached_change_name(foo,EMPTY_STRING);
*/
is used when a conference is deleted
*/
void
Bool
cached_conf_exists
(
Conf_no
conf
);
mark_person_as_changed
(
Pers_no
pers_no
);
/* returns TRUE when a conference exists */
Conf_type
cached_get_conf_type
(
Conf_no
conf
);
/* returns conference type
conf_type is set when mark_conference_as_changed is called (?) */
void
Garb_nice
cached_get_garb_nice
(
Conf_no
conf
);
mark_conference_as_changed
(
Conf_no
conf_no
);
/* Get garb_nice from smallconf */
String
cached_get_name
(
Conf_no
conf
);
/* returns conference name from smallconf */
void
Local_text_no
cached_get_highest_local_no
(
Conf_no
conf
);
mark_text_as_changed
(
Text_no
text_no
);
/* returns highes text number in a certain conference */
Success
cached_lookup_name
(
const
String
name
,
Conf_list_old
*
result
);
/* match from name => conf_list_old */
/******** miscellanous wierd routines ************************************/
Success
build_matching_info
(
void
);
/*
* Person-related calls
*/
extern
Success
cached_create_person
(
Pers_no
person
);
extern
Person
*
cached_get_person_stat
(
Pers_no
person
);
/* Returns NULL if person
doesn't exist */
/*
* Conference-related calls
*/
extern
Conf_no
cached_create_conf
(
String
name
);
extern
Success
cached_delete_conf
(
Conf_no
conf
);
extern
Success
cached_lookup_name
(
const
String
name
,
Conf_list_old
*
result
);
extern
Conference
*
cached_get_conf_stat
(
Conf_no
conf_no
);
/*
* Calls to handle texts
*/
extern
String
cached_get_text
(
Text_no
text
);
/* The string should be free'd by the caller */
extern
Text_stat
*
cached_get_text_stat
(
Text_no
text
);
extern
Text_no
cached_create_text
(
const
String
message
);
/*
* traverse_text can be used to cycle through all existing texts. 0 will
* be returned once in the "cycle".
*/
extern
Text_no
traverse_text
(
Text_no
seed
);
/*
* traverse_person can be used to cycle through all existing persons. 0 will
* be returned once in the "cycle".
*/
extern
Pers_no
traverse_person
(
Pers_no
seed
);
/*
* traverse_conference can be used to cycle through all existing conferences.
* 0 will be returned once in the "cycle".
*/
extern
Conf_no
traverse_conference
(
Conf_no
seed
);
/*
* Free all memory used by the cache. This should only be done
* as part of the shutdown sequence. The purpose of this is to
* make it possible to see if there are any memory leaks.
*/
void
free_all_cache
(
void
);
/*
* Limit the number of 'clean' cache entries.
*/
void
cache_limit_size
(
void
);
/*
* Dump cache statistics.
*/
void
dump_cache_stats
(
FILE
*
stat_file
);
/*
* Dump memory usage.
*/
void
dump_cache_mem_usage
(
FILE
*
stat_file
);
/*
* Export the highest text_no for searching.
*/
int
query_next_text_num
(
void
);
/*
* Tell the cache that a text garbage collection operation is in progress
* or is finished.
*/
void
tell_cache_garb_text
(
int
running
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment