00001 /* 00002 * dbcompat.h -- 00003 * 00004 * this header file contains old db formats which are 00005 * needed or converting old dbs to the new format. 00006 * 00007 * Written for filedb3 by Fabian Knittel <fknittel@gmx.de> 00008 */ 00009 /* 00010 * Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 Eggheads Development Team 00011 * 00012 * This program is free software; you can redistribute it and/or 00013 * modify it under the terms of the GNU General Public License 00014 * as published by the Free Software Foundation; either version 2 00015 * of the License, or (at your option) any later version. 00016 * 00017 * This program is distributed in the hope that it will be useful, 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 * GNU General Public License for more details. 00021 * 00022 * You should have received a copy of the GNU General Public License 00023 * along with this program; if not, write to the Free Software 00024 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00025 */ 00026 /* 00027 * $Id: dbcompat.h,v 1.6 2003-12-11 00:49:10 wcc Exp $ 00028 */ 00029 00030 #ifndef _EGG_MOD_FILESYS_DBCOMPAT_H 00031 #define _EGG_MOD_FILESYS_DBCOMPAT_H 00032 00033 /* 00034 * DB entry structures for v1 and v2 00035 */ 00036 00037 /* Structure for file database (per directory) */ 00038 struct filler1 { 00039 char xxx[1 + 61 + 301 + 10 + 11 + 61]; 00040 unsigned short int uuu[2]; 00041 time_t ttt[2]; 00042 unsigned int iii[2]; 00043 }; 00044 00045 typedef struct { 00046 char version; 00047 unsigned short int stat; /* Misc */ 00048 time_t timestamp; /* Last time this db was updated */ 00049 char filename[61]; 00050 char desc[301]; /* Should be plenty */ 00051 char uploader[10]; /* Where this file came from */ 00052 unsigned char flags_req[11]; /* Access flags required */ 00053 time_t uploaded; /* Time it was uploaded */ 00054 unsigned int size; /* File length */ 00055 unsigned short int gots; /* Times the file was downloaded */ 00056 char unused[512 - sizeof(struct filler1)]; 00057 } filedb1; 00058 00059 struct filler2 { 00060 char xxx[1 + 61 + 186 + 81 + 33 + 22 + 61]; 00061 unsigned short int uuu[2]; 00062 time_t ttt[2]; 00063 unsigned int iii[1]; 00064 }; 00065 00066 typedef struct { 00067 char version; 00068 unsigned short int stat; /* Misc */ 00069 time_t timestamp; /* Last time this db was updated */ 00070 char filename[61]; 00071 char desc[186]; /* Should be plenty - shrink it, we 00072 * Need the space :) */ 00073 char chname[81]; /* Channel for chan spec stuff */ 00074 char uploader[33]; /* Where this file came from */ 00075 char flags_req[22]; /* Access flags required */ 00076 time_t uploaded; /* Time it was uploaded */ 00077 unsigned int size; /* File length */ 00078 unsigned short int gots; /* Times the file was downloaded */ 00079 char unused[512 - sizeof(struct filler2)]; 00080 } filedb2; 00081 00082 /* 00083 * Prototypes 00084 */ 00085 00086 static int convert_old_db(FILE **fdb, char *s); 00087 static int convert_old_files(char *npath, char *s); 00088 00089 #endif /* !_EGG_MOD_FILESYS_DBCOMPAT.H */