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