2007-12-30 17:41:49 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
2009-08-17 12:41:51 +02:00
|
|
|
gbx_archive.h
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-08-17 12:41:51 +02:00
|
|
|
(c) 2000-2009 Benoît Minisini <gambas@users.sourceforge.net>
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2009-08-17 12:41:51 +02:00
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
2007-12-30 17:41:49 +01:00
|
|
|
any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __GBX_ARCHIVE_H
|
|
|
|
#define __GBX_ARCHIVE_H
|
|
|
|
|
|
|
|
#define PROJECT_EXEC
|
|
|
|
|
|
|
|
#include "gb_table.h"
|
|
|
|
#include "gb_file.h"
|
|
|
|
#include "gb_arch.h"
|
|
|
|
#include "gb_list.h"
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
LIST list;
|
|
|
|
ARCH *arch;
|
|
|
|
const char *name;
|
|
|
|
char *domain;
|
|
|
|
TABLE *classes;
|
2010-04-25 12:46:57 +02:00
|
|
|
const char *path;
|
|
|
|
unsigned translation_loaded : 1;
|
2007-12-30 17:41:49 +01:00
|
|
|
}
|
|
|
|
ARCHIVE;
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct {
|
|
|
|
ARCHIVE *arch;
|
|
|
|
ARCH_SYMBOL *sym;
|
2008-11-02 03:40:10 +01:00
|
|
|
int index;
|
2007-12-30 17:41:49 +01:00
|
|
|
int pos;
|
|
|
|
int len;
|
|
|
|
}
|
|
|
|
ARCHIVE_FIND;
|
|
|
|
|
|
|
|
#ifndef __ARCHIVE_C
|
|
|
|
EXTERN ARCHIVE *ARCHIVE_main;
|
|
|
|
#endif
|
|
|
|
|
2009-07-08 21:57:50 +02:00
|
|
|
void ARCHIVE_init(void);
|
|
|
|
void ARCHIVE_exit(void);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-07-08 21:57:50 +02:00
|
|
|
void ARCHIVE_create_main(const char *path);
|
|
|
|
void ARCHIVE_load_main(void);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2010-04-25 12:46:57 +02:00
|
|
|
ARCHIVE *ARCHIVE_create(const char *name, const char *path);
|
2009-07-08 21:57:50 +02:00
|
|
|
void ARCHIVE_delete(ARCHIVE *arch);
|
|
|
|
void ARCHIVE_load(ARCHIVE *arch);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-07-08 21:57:50 +02:00
|
|
|
bool ARCHIVE_get(ARCHIVE *arch, const char **ppath, ARCHIVE_FIND *find);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-07-08 21:57:50 +02:00
|
|
|
bool ARCHIVE_read(ARCHIVE *arch, int pos, void *buffer, int len);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-07-08 21:57:50 +02:00
|
|
|
bool ARCHIVE_exist(ARCHIVE *arch, const char *path);
|
|
|
|
void ARCHIVE_stat(ARCHIVE *arch, const char *path, FILE_STAT *info);
|
|
|
|
bool ARCHIVE_is_dir(ARCHIVE *arch, const char *path);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-07-08 21:57:50 +02:00
|
|
|
void ARCHIVE_dir_first(ARCHIVE *arch, const char *path, const char *pattern, int attr);
|
|
|
|
bool ARCHIVE_dir_next(char **name, int *len, int attr);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-07-08 21:57:50 +02:00
|
|
|
bool ARCHIVE_get_current(ARCHIVE **parch);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-07-08 21:57:50 +02:00
|
|
|
bool ARCHIVE_check_addr(char *addr);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2010-04-05 03:44:43 +02:00
|
|
|
void ARCHIVE_browse(ARCHIVE *arch, void (*found)(const char *path, int64_t size));
|
|
|
|
|
2007-12-30 17:41:49 +01:00
|
|
|
#endif
|