ezmlmx 0.68
ezmlmx
Loading...
Searching...
No Matches
tagmsg.c
Go to the documentation of this file.
1#include "stralloc.h"
2#include "scan.h"
3#include "fmt.h"
4#include "cookie.h"
5#include "readclose.h"
6#include "errtxt.h"
7#include "subscribe.h"
8#include "makehash.h"
9#include "idx.h"
10#include "logmsg.h"
11
12#define WHO "tagmsg" // FIXME
13
19
20static stralloc key = {0};
21static char hash[COOKIE];
22static char strnum[FMT_ULONG]; /* message number as sz */
23
37
38void tagmsg(const char *dir,unsigned long msgnum,const char *seed,const char *action,
39 char *ho,unsigned long bs,unsigned long chunk)
40{
41 unsigned int i;
42
43 strnum[fmt_ulong(strnum,msgnum)] = '\0'; /* message nr ->string*/
44
45 switch (openreadclose("key",&key,32)) {
46 case -1: logmsg(WHO,111,FATAL,B(ERR_READ,key.s));
47 case 0: logmsg(WHO,100,FATAL,B(key.s,ERR_NOEXIST));
48 }
49
50 cookie(hash,key.s,key.len,strnum,seed,action);
51 for (i = 0; i < COOKIE; i++)
52 ho[i] = hash[i];
53}
#define COOKIE
Definition cookie.h:4
Error messages. If you translate these, I would urge you to keep the English version as well....
#define ERR_NOEXIST
Definition errtxt.h:40
#define ERR_READ
Definition errtxt.h:18
#define WHO
Definition author.c:1
stralloc seed
Definition ezmlm-get.c:74
char * dir
void cookie(char *hash, const char *key, unsigned int keylen, const char *date, const char *addr, const char *action)
Definition cookie.c:14
unsigned long msgnum
buffer bs
stralloc action
Definition ezmlm-store.c:84
const char * logmsg(const char *dir, unsigned long num, unsigned long listno, unsigned long subs, int done)
Definition loginfo.c:32
void tagmsg(const char *dir, unsigned long msgnum, const char *seed, const char *action, char *hashout, unsigned long bodysize, unsigned long chunk)
Definition tagmsg.c:45