leafnode  1.12.0
About: Leafnode is a store & forward NNTP proxy for small (dialup) sites.
  Fossies Dox: leafnode-1.12.0.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

activutil.c File Reference
#include "leafnode.h"
#include "activutil.h"
#include "ln_log.h"
#include "mastring.h"
#include <ctype.h>
#include "system.h"
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <sys/stat.h>
#include <stdlib.h>
#include <unistd.h>
Include dependency graph for activutil.c:

Go to the source code of this file.

Data Structures

struct  nglist
 

Functions

void newsgroup_copy (struct newsgroup *d, const struct newsgroup *s)
 
int compactive (const void *a, const void *b)
 
void insertgroup (const char *name, long unsigned first, long unsigned last, time_t age)
 
void newgroupdesc (const char *groupname, const char *description)
 
void changegroupdesc (const char *groupname, const char *description)
 
void mergegroups (void)
 
static long helpfindgroup (struct newsgroup *act, const char *name, long low, long high)
 
struct newsgroupxfindgroup (struct newsgroup *act, const char *name, unsigned long actsize)
 
struct newsgroupfindgroup (const char *name)
 
int writeactive (void)
 
void freeactive (struct newsgroup *act)
 
void readactive (void)
 
void fakeactive (void)
 
char * activeread (void)
 
int killactiveread (void)
 

Variables

size_t activesize
 
struct newsgroupactive = NULL
 
size_t oldactivesize
 
struct newsgroupoldactive = NULL
 
static struct nglistnewgroup = NULL
 

Function Documentation

◆ activeread()

char * activeread ( void  )

Definition at line 582 of file activutil.c.

References critmalloc(), and spooldir.

Referenced by checkactive(), killactiveread(), and updateactive().

◆ changegroupdesc()

void changegroupdesc ( const char *  groupname,
const char *  description 
)

Definition at line 144 of file activutil.c.

References critstrdup(), newsgroup::desc, and findgroup().

Referenced by nntpactive().

◆ compactive()

int compactive ( const void *  a,
const void *  b 
)

Definition at line 62 of file activutil.c.

References newsgroup::name.

Referenced by mergegroups(), readactive(), validateactive(), and writeactive().

◆ fakeactive()

void fakeactive ( void  )

◆ findgroup()

struct newsgroup * findgroup ( const char *  name)

◆ freeactive()

void freeactive ( struct newsgroup act)

Definition at line 351 of file activutil.c.

References newsgroup::desc, and newsgroup::name.

Referenced by main(), and readactive().

◆ helpfindgroup()

static long helpfindgroup ( struct newsgroup act,
const char *  name,
long  low,
long  high 
)
static

Definition at line 221 of file activutil.c.

References helpfindgroup(), and name.

Referenced by helpfindgroup(), and xfindgroup().

◆ insertgroup()

void insertgroup ( const char *  name,
long unsigned  first,
long unsigned  last,
time_t  age 
)

◆ killactiveread()

int killactiveread ( void  )

Definition at line 595 of file activutil.c.

References activeread(), ln_log(), LNLOG_CTOP, LNLOG_SERR, and rc.

Referenced by fakeactive(), and main().

◆ mergegroups()

void mergegroups ( void  )

◆ newgroupdesc()

void newgroupdesc ( const char *  groupname,
const char *  description 
)

Definition at line 124 of file activutil.c.

References critstrdup(), newsgroup::desc, nglist::entry, newsgroup::name, newgroup, and nglist::next.

Referenced by process_input().

◆ newsgroup_copy()

void newsgroup_copy ( struct newsgroup d,
const struct newsgroup s 
)

◆ readactive()

◆ writeactive()

◆ xfindgroup()

struct newsgroup * xfindgroup ( struct newsgroup act,
const char *  name,
unsigned long  actsize 
)

Definition at line 242 of file activutil.c.

References helpfindgroup(), and name.

Referenced by findgroup(), and insertgroup().

Variable Documentation

◆ active

◆ activesize

size_t activesize

Definition at line 39 of file activutil.c.

Referenced by findgroup(), main(), mergegroups(), readactive(), rereadactive(), and validateactive().

◆ newgroup

struct nglist* newgroup = NULL
static

Definition at line 70 of file activutil.c.

Referenced by insertgroup(), mergegroups(), and newgroupdesc().

◆ oldactive

struct newsgroup* oldactive = NULL

Definition at line 42 of file activutil.c.

Referenced by insertgroup(), and main().

◆ oldactivesize

size_t oldactivesize

Definition at line 41 of file activutil.c.

Referenced by insertgroup(), and main().