Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

initfinish.c File Reference

Initialization functions. More...

#include "config.h"
#include "defines.h"
#include <pthread.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <time.h>
#include <gdome.h>
#include "cf_pthread.h"
#include "hashlib.h"
#include "utils.h"
#include "configparser.h"
#include "readline.h"
#include "fo_server.h"
#include "initfinish.h"
#include "charconvert.h"
#include "xml_handling.h"
#include "serverlib.h"

Go to the source code of this file.

Data Structures

struct  s_h_p

Typedefs

typedef s_h_p t_h_p

Functions

t_postinghirarchy_them (t_h_p *parent, t_posting *pst)
void quicksort_posts (t_h_p *list, long low, long high)
void sort_them (t_h_p *node)
void free_structs (t_h_p *node)
t_postingserialize_them (t_h_p *node, int sort)
void sort_postings (t_posting *posts, int sort)
void quicksort_threads (t_thread **list, long low, long high)
void sort_threadlist (t_head *head)
void make_forumtree (t_configuration *cfg, t_head *head)
GdomeNode * get_posting_content (GdomeNodeList *contents, unsigned long long mid)
void make_thread_tree (GdomeNode *posting_newdoc, GdomeNode *posting_index, GdomeNodeList *contents, t_thread *thread, t_posting *post, int level, int pos)
void handle_header (t_posting *p, GdomeNode *n, u_int64_t tid)
void cleanup_forumtree ()


Detailed Description

Initialization functions.

Author:
Christian Kruse, <cjk@wwwtech.de>
This file contains the server initialization functions

Definition in file initfinish.c.


Typedef Documentation

typedef struct s_h_p t_h_p
 

This struct is used to sort the thread list. It contains a hierarchical structure.


Function Documentation

void cleanup_forumtree  ) 
 

This function free()s all for the thread tree reserved memory.

Definition at line 761 of file initfinish.c.

void free_structs t_h_p node  ) 
 

This function cleans up a hierarchical structure

Parameters:
node The t_h_p node

Definition at line 140 of file initfinish.c.

GdomeNode* get_posting_content GdomeNodeList *  contents,
unsigned long long  mid
 

This function searches for the MessageContent entry of the node

Parameters:
contents A node list of the contents ('MessageContent')
mid The message id of the actual message
Returns:
The MessageContent node if found, NULL if not found

Definition at line 499 of file initfinish.c.

void handle_header t_posting p,
GdomeNode *  n,
u_int64_t  tid
 

This function reads the header data of a posting from the xml structure

Parameters:
p A pointer to the posting
n The 'Header' node
tid The thread id

Definition at line 705 of file initfinish.c.

t_posting* hirarchy_them t_h_p parent,
t_posting pst
 

Insert the postings to a hierarchy level. This function works recursively.

Parameters:
parent The parent t_h_p structure
pst The posting pointer
Returns:
The pointer to the next posting in a hierarchy level smaller or equal to ours.

Definition at line 59 of file initfinish.c.

void make_forumtree t_configuration cfg,
t_head head
 

This function creates the forum tree.

Parameters:
cfg The default configuration
head The head variable

Definition at line 370 of file initfinish.c.

void make_thread_tree GdomeNode *  posting_newdoc,
GdomeNode *  posting_index,
GdomeNodeList *  contents,
t_thread thread,
t_posting post,
int  level,
int  pos
 

This function creates recursively a thread structure.

Parameters:
posting_newdoc A node to the posting ('Message')
posting_index A node to the posting in the index file (for unid)
contents A node list of the contents ('MessageContent')
thread A pointer to the thread object
post A pointer to the actual thread
level The level of the posting
pos The position in the content list

Definition at line 558 of file initfinish.c.

void quicksort_posts t_h_p list,
long  low,
long  high
 

Quicksort-function for the postings

Parameters:
list The hierarchical list of postings
low The lower frontier of the field
high The higher frontier of the field

Definition at line 93 of file initfinish.c.

void quicksort_threads t_thread **  list,
long  low,
long  high
 

This function is a quicksort function for the threads.

Parameters:
list The thread list
low The lower frontier of the field
high The higher frontier of the field

Definition at line 267 of file initfinish.c.

t_posting* serialize_them t_h_p node,
int  sort
 

This function serializes a hierarchical structure into a flat chain

Parameters:
node The t_h_p node
sort The sorting direction
Returns:
A posting in this or lower than this hierarchy level

Definition at line 160 of file initfinish.c.

void sort_postings t_posting posts,
int  sort
 

This function sorts the postings

Parameters:
posts The pointer to the first posting in the chain
sort The sorting direction

Definition at line 239 of file initfinish.c.

void sort_them t_h_p node  ) 
 

Sorting function.

Parameters:
node The t_h_p structure node

Definition at line 121 of file initfinish.c.

void sort_threadlist t_head head  ) 
 

This function does all the sorting work

Parameters:
head The head variable

Definition at line 295 of file initfinish.c.


Generated on Sun Apr 25 16:37:39 2004 for Classic Forum by doxygen 1.3.5