Article View: news.software.nn
Article #405Re: Corrupted db.h
From: Peter Andersen
Date: Thu, 17 May 1990 09:13
Date: Thu, 17 May 1990 09:13
112 lines
3734 bytes
3734 bytes
Here's my db.h from nn 6.4.2:
==============================
/*
* (c) Copyright 1990, Kim Fabricius Storm. All rights reserved.
*
* DATABASE ORGANIZATION:
*
* The central nn information is contained in following files:
* DB_DIRECTORY/MASTER
* DB_DIRECTORY/GROUPS
* DB_DIRECTORY/DATA/nnn.x
* DB_DIRECTORY/DATA/nnn.d
*
* The MASTER file consists of a header and one entry for each news
* group. The sequence of the group headers defines the group
* number associated with the group.
*
* The GROUPS file contains the names of the news groups; the names
* occur in the same sequence as in the MASTER file.
*
* For each news group, the DATA directory contains two files whose
* name is constructed from the group number 'nnn':
*
* nnn.x Index file
* nnn.d Data file
*
* The index file provides a a mapping from article numbers to offsets
* in the data file.
*
* The data file contains the actual header data. Each article is
* represented by a Header, an array of Cross Postings, and the
* strings representing the sender name and the article subject:
*
* header
* group_number 1 [ if cross posted ]
* group_number 2
* ...
* sender name (null terminated) [if sender_length > 0]
* subject (null terminated) [if subject_length > 0]
*
* For a digest, cross posted groups are only specified for the
* first entry (the header entry).
*
* On disk, the article_number is negative for digest article
* header and zero for following sub articles.
*
* The format of the index and data files are specified below.
*
* Unless NETWORK_DATABASE is defined, the database will
* will contain machine dependent binary data.
*/
#ifdef NETWORK_DATABASE
typedef int32 cross_post_number;
#ifdef NETWORK_BYTE_ORDER
#define NETW_CROSS_INT(cp) cp
#define NETW_CROSS_EXT(cp) cp
#else
#define NETW_CROSS_INT(cp) ntohl(cp)
#define NETW_CROSS_EXT(cp) htonl(cp)
#endif
#else
typedef group_number cross_post_number;
#define NETW_CROSS_INT(cp) cp
#define NETW_CROSS_EXT(cp) cp
#endif
typedef struct {
article_number dh_number;
time_stamp dh_date; /* encoded Date: filed (not a time_t value!!) */
off_t dh_hpos; /* absolute offset for first byte of header */
off_t dh_lpos; /* absolute offset for last byte of article */
int16 dh_fpos; /* relative offset for first byte in article text */
int16 dh_lines;
int8 dh_replies;
int8 dh_cross_postings;
int8 dh_subject_length;
int8 dh_sender_length;
} data_header;
#define DBUF_SIZE 255
typedef struct {
int dh_type;
#define DH_NORMAL 0
#define DH_DIGEST_HEADER 1
#define DH_SUB_DIGEST 2
cross_post_number dh_cross[DBUF_SIZE+1];
char dh_sender[DBUF_SIZE+1];
char dh_subject[DBUF_SIZE+1];
} data_dynamic_data;
/* open database files */
FILE *open_data_file();
/* data access */
off_t get_index_offset(), get_data_offset();
extern data_header db_hdr;
extern data_dynamic_data db_data;
Technical Details
Message-ID:
<datpete.642935630@janne>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!gmdzi!unido!mcsun!sunic!dkuug!daimi!datpeteReferences:
<750@ssp11.idca.tds.philips.nl> <May90.143107.19254@ixi.co.uk>Show Full Headers
Complete Article Headers
Message-ID: <datpete.642935630@janne> Subject: Re: Corrupted db.h Date: Thu, 17 May 1990 09:13:50 +0000 From: datpete@daimi.dk (Peter Andersen) References: <750@ssp11.idca.tds.philips.nl> <May90.143107.19254@ixi.co.uk> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.nn.mbox.zip!gmdzi!unido!mcsun!sunic!dkuug!daimi!datpete Newsgroups: news.software.nn Sender: news@daimi.dk Distribution: eunet Organization: DAIMI: Computer Science Department, Aarhus University, Denmark Lines: 112 Posted: Thu May 17 10:13:50 1990