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

archiver.c File Reference

The archiver functions. More...

#include "config.h"
#include "defines.h"
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/wait.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 "serverlib.h"
#include "xml_handling.h"
#include "charconvert.h"
#include "archiver.h"

Go to the source code of this file.

Functions

void cf_delete_threadfile (t_thread *t)
time_t cf_get_time (GdomeNode *n)
void cf_make_path (u_char *path)
void cf_archive_threads (t_thread **to_archive, int len)
void cf_run_archiver_and_write_to_disk (void)
void cf_archive_thread (int sockfd, u_int64_t tid)


Detailed Description

The archiver functions.

Author:
Christian Kruse, <cjk@wwwtech.de>
This file contains the archiver functions. The archiver is complex enough to give him an own file.

Todo:
Archive only if voting is high enough

Implement indexer for the "SELFHTML Suche" and the "Neue SELFHTML Suche"

Definition in file archiver.c.


Function Documentation

void cf_archive_thread int  sockfd,
u_int64_t  tid
 

This function archives a specific thread.

Parameters:
sockfd The client socket from which the request came
tid The thread id of the thread to archive

Definition at line 545 of file archiver.c.

void cf_archive_threads t_thread **  to_archive,
int  len
 

This function archives a list of threads to their right position in the archive.

Parameters:
to_archive The thread list of to archive threads
len The length of the list

Definition at line 126 of file archiver.c.

void cf_delete_threadfile t_thread t  ) 
 

This function deletes an archived thread file

Parameters:
t The thread structure

Definition at line 55 of file archiver.c.

time_t cf_get_time GdomeNode *  n  ) 
 

Reads the <Date longSec="epochseconds"/> element and returns them.

Parameters:
n The <Header> element
Returns:
0 on error, the epoch secons on success

Definition at line 65 of file archiver.c.

void cf_make_path u_char *  path  ) 
 

This function creates the path segments if necessary. Beginning from the start on every / it stops and calls mkdir() with the string to the actual position

Parameters:
path The full path

Definition at line 98 of file archiver.c.

void cf_run_archiver_and_write_to_disk void   ) 
 

This function runs the archiver and writes the actual threadlist to disk. It gets exclusive access to the postings, so don't call this function *too* often!

Definition at line 292 of file archiver.c.


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