2007-12-30 17:41:49 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
|
|
archive.c
|
|
|
|
|
|
|
|
The archive management routines
|
|
|
|
|
|
|
|
(c) 2000-2007 Benoit Minisini <gambas@users.sourceforge.net>
|
|
|
|
|
|
|
|
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
|
|
|
|
the Free Software Foundation; either version 1, or (at your option)
|
|
|
|
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.
|
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#define __GBX_ARCHIVE_C
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <sys/mman.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include "gb_common.h"
|
|
|
|
#include "gb_error.h"
|
|
|
|
#include "gb_alloc.h"
|
|
|
|
|
|
|
|
#include "gbx_string.h"
|
|
|
|
#include "gbx_stream.h"
|
|
|
|
#include "gbx_component.h"
|
|
|
|
#include "gbx_regexp.h"
|
|
|
|
#include "gbx_exec.h"
|
|
|
|
#include "gbx_class.h"
|
2008-12-31 16:55:40 +01:00
|
|
|
#include "gbx_project.h"
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
#include "gbx_archive.h"
|
|
|
|
|
|
|
|
#include "gb_arch_temp.h"
|
|
|
|
|
|
|
|
/* main archive project (used only if gbx is run with -x flag) */
|
2008-01-17 22:39:26 +01:00
|
|
|
ARCHIVE *ARCHIVE_main = NULL;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
static ARCHIVE *_archive_list = NULL;
|
|
|
|
|
|
|
|
static char *arch_pattern = NULL;
|
|
|
|
static int arch_index = 0;
|
|
|
|
static ARCH *arch_dir = NULL;
|
2008-11-02 03:40:10 +01:00
|
|
|
static char *arch_prefix = NULL;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
ARCHIVE *ARCHIVE_create(const char *name)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
ARCHIVE *arch;
|
|
|
|
|
|
|
|
ALLOC_ZERO(&arch, sizeof(ARCHIVE), "ARCHIVE_create");
|
|
|
|
|
|
|
|
arch->name = name;
|
|
|
|
|
|
|
|
if (name)
|
|
|
|
STRING_new(&arch->domain, name, 0);
|
|
|
|
else
|
|
|
|
STRING_new(&arch->domain, "gb", 0);
|
|
|
|
|
|
|
|
arch->translation_loaded = FALSE;
|
|
|
|
|
|
|
|
TABLE_create(&arch->classes, sizeof(CLASS_SYMBOL), TF_IGNORE_CASE);
|
|
|
|
|
|
|
|
LIST_insert(&_archive_list, arch, &arch->list);
|
|
|
|
|
|
|
|
return arch;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void load_exported_class(ARCHIVE *arch)
|
|
|
|
{
|
|
|
|
/*STREAM stream;*/
|
|
|
|
char *buffer;
|
|
|
|
int len;
|
|
|
|
char *name;
|
2009-01-09 15:07:56 +01:00
|
|
|
CLASS *class;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
/* COMPONENT_current is set => it will look in the archive */
|
|
|
|
|
|
|
|
if (!FILE_exist(".list"))
|
|
|
|
return;
|
|
|
|
|
|
|
|
STREAM_load(".list", &buffer, &len);
|
|
|
|
/* The file must end with a newline !*/
|
|
|
|
buffer[len - 1] = 0;
|
|
|
|
|
|
|
|
#if DEBUG_COMP
|
|
|
|
fprintf(stderr, ".list file:\n-----------\n\n%s\n----------\n\n", buffer);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
name = strtok(buffer, "\n");
|
|
|
|
while (name)
|
|
|
|
{
|
|
|
|
#if DEBUG_COMP
|
|
|
|
fprintf(stderr, "Check %s global\n", name);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
CLASS_check_global(name);
|
|
|
|
name = strtok(NULL, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
FREE(&buffer, "load_exported_class");
|
|
|
|
|
|
|
|
|
|
|
|
STREAM_load(".list", &buffer, &len);
|
|
|
|
/* The file must end with a newline !*/
|
|
|
|
buffer[len - 1] = 0;
|
|
|
|
|
|
|
|
name = strtok(buffer, "\n");
|
|
|
|
while (name)
|
|
|
|
{
|
|
|
|
#if DEBUG_COMP
|
|
|
|
fprintf(stderr, "Load %s global\n", name);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
len = strlen(name);
|
|
|
|
if (len > 2 && name[len - 1] == '?')
|
|
|
|
{
|
|
|
|
name[len - 1] = 0;
|
|
|
|
if (!CLASS_look_global(name, strlen(name)))
|
2009-01-09 15:07:56 +01:00
|
|
|
class = CLASS_find_global(name);
|
|
|
|
else
|
|
|
|
class = NULL;
|
2007-12-30 17:41:49 +01:00
|
|
|
}
|
|
|
|
else
|
2009-01-09 15:07:56 +01:00
|
|
|
class = CLASS_find_global(name);
|
|
|
|
|
|
|
|
if (class)
|
|
|
|
{
|
|
|
|
class->component = COMPONENT_current;
|
|
|
|
CLASS_load(class);
|
|
|
|
}
|
|
|
|
|
2007-12-30 17:41:49 +01:00
|
|
|
name = strtok(NULL, "\n");
|
|
|
|
}
|
|
|
|
|
|
|
|
FREE(&buffer, "load_exported_class");
|
|
|
|
}
|
|
|
|
|
|
|
|
static void load_archive(ARCHIVE *arch, const char *path)
|
|
|
|
{
|
|
|
|
if (path)
|
|
|
|
arch->arch = ARCH_open(path);
|
|
|
|
else
|
|
|
|
arch->arch = NULL;
|
|
|
|
|
|
|
|
//if (arch != ARCHIVE_main)
|
|
|
|
load_exported_class(arch);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void ARCHIVE_load(ARCHIVE *arch)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
char *path = FILE_buffer();
|
|
|
|
|
2008-02-19 00:07:24 +01:00
|
|
|
sprintf(path, ARCH_PATTERN, COMPONENT_path, arch->name);
|
2007-12-30 17:41:49 +01:00
|
|
|
if (!FILE_exist(path))
|
2008-02-19 00:07:24 +01:00
|
|
|
sprintf(path, ARCH_PATTERN, COMPONENT_user_path, arch->name);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
load_archive(arch, path);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void ARCHIVE_create_main(const char *path)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
ARCHIVE_main = ARCHIVE_create(NULL);
|
|
|
|
|
|
|
|
if (path)
|
|
|
|
ARCHIVE_main->arch = ARCH_open(path);
|
|
|
|
else
|
|
|
|
ARCHIVE_main->arch = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void ARCHIVE_load_main()
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
load_exported_class(ARCHIVE_main);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void ARCHIVE_delete(ARCHIVE *arch)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
LIST_remove(&_archive_list, arch, &arch->list);
|
|
|
|
|
|
|
|
if (arch->arch)
|
|
|
|
ARCH_close(arch->arch);
|
|
|
|
|
|
|
|
TABLE_delete(&arch->classes);
|
|
|
|
STRING_free(&arch->domain);
|
|
|
|
|
|
|
|
FREE(&arch, "ARCHIVE_delete");
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void ARCHIVE_init(void)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
//ARCH_create(path);
|
|
|
|
//ARCHIVE_main = _arch_list;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void ARCHIVE_exit(void)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
if (ARCHIVE_main)
|
|
|
|
ARCHIVE_delete(ARCHIVE_main);
|
|
|
|
|
|
|
|
STRING_free(&arch_pattern);
|
2008-11-02 03:40:10 +01:00
|
|
|
STRING_free(&arch_prefix);
|
2007-12-30 17:41:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* ### *parch must be initialized to NULL or a valid archive */
|
|
|
|
/* Returns a true archive, never the main archive if we are not running an executable */
|
2009-01-02 18:15:07 +01:00
|
|
|
static bool get_current(ARCHIVE **parch, const char **ppath)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
if (*parch)
|
|
|
|
return FALSE;
|
|
|
|
|
2009-01-02 18:15:07 +01:00
|
|
|
if (strncmp(*ppath, "../", 3) == 0)
|
2008-12-31 16:55:40 +01:00
|
|
|
{
|
|
|
|
*parch = EXEC_arch ? ARCHIVE_main : NULL;
|
2009-01-02 18:15:07 +01:00
|
|
|
*ppath += 3;
|
2008-12-31 16:55:40 +01:00
|
|
|
}
|
|
|
|
else if (COMPONENT_current && COMPONENT_current->archive)
|
2007-12-30 17:41:49 +01:00
|
|
|
*parch = COMPONENT_current->archive;
|
|
|
|
else if (CP && CP->component && CP->component->archive)
|
|
|
|
*parch = CP->component->archive;
|
|
|
|
else
|
|
|
|
*parch = EXEC_arch ? ARCHIVE_main : NULL;
|
|
|
|
|
|
|
|
return *parch == NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Can return the main archive even if we are not running an executable */
|
2008-01-17 22:39:26 +01:00
|
|
|
bool ARCHIVE_get_current(ARCHIVE **parch)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
if (COMPONENT_current && COMPONENT_current->archive)
|
|
|
|
*parch = COMPONENT_current->archive;
|
|
|
|
else if (CP && CP->component && CP->component->archive)
|
|
|
|
*parch = CP->component->archive;
|
|
|
|
else
|
|
|
|
*parch = ARCHIVE_main;
|
|
|
|
|
|
|
|
return *parch == NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-01-02 18:15:07 +01:00
|
|
|
bool ARCHIVE_get(ARCHIVE *arch, const char **ppath, ARCHIVE_FIND *find)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
ARCH_FIND f;
|
2008-12-31 16:55:40 +01:00
|
|
|
struct stat buf;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-01-02 18:15:07 +01:00
|
|
|
if (get_current(&arch, ppath))
|
2008-12-31 16:55:40 +01:00
|
|
|
{
|
|
|
|
// no archive found, we try a lstat
|
|
|
|
chdir(PROJECT_path);
|
2009-01-02 18:15:07 +01:00
|
|
|
if (stat(*ppath, &buf))
|
2008-12-31 16:55:40 +01:00
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
find->pos = S_ISDIR(buf.st_mode) ? -1 : 0;
|
|
|
|
find->sym = NULL;
|
|
|
|
find->len = (int)buf.st_size;
|
|
|
|
find->index = -1;
|
|
|
|
find->arch = NULL;
|
|
|
|
return FALSE;
|
|
|
|
}
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-01-02 18:15:07 +01:00
|
|
|
if (ARCH_find(arch->arch, *ppath, 0, &f))
|
2007-12-30 17:41:49 +01:00
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
find->sym = f.sym;
|
|
|
|
find->pos = f.pos;
|
|
|
|
find->len = f.len;
|
2008-11-02 03:40:10 +01:00
|
|
|
find->index = f.index;
|
2007-12-30 17:41:49 +01:00
|
|
|
find->arch = arch;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
bool ARCHIVE_exist(ARCHIVE *arch, const char *path)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
ARCHIVE_FIND find;
|
|
|
|
|
2008-12-31 16:55:40 +01:00
|
|
|
//if (get_current(&arch, &path))
|
|
|
|
// return FALSE;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-01-02 18:15:07 +01:00
|
|
|
return (!ARCHIVE_get(arch, &path, &find));
|
2007-12-30 17:41:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
bool ARCHIVE_is_dir(ARCHIVE *arch, const char *path)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
ARCHIVE_FIND find;
|
|
|
|
|
2009-01-02 18:15:07 +01:00
|
|
|
if (ARCHIVE_get(arch, &path, &find))
|
2007-12-30 17:41:49 +01:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return (find.pos < 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void ARCHIVE_stat(ARCHIVE *arch, const char *path, FILE_STAT *info)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
ARCHIVE_FIND find;
|
|
|
|
struct stat buf;
|
|
|
|
|
|
|
|
//if (get_current(&arch))
|
|
|
|
// THROW_SYSTEM(ENOENT, path);
|
|
|
|
|
2009-01-02 18:15:07 +01:00
|
|
|
if (ARCHIVE_get(arch, &path, &find))
|
2007-12-30 17:41:49 +01:00
|
|
|
THROW_SYSTEM(ENOENT, path);
|
|
|
|
|
|
|
|
fstat(find.arch->arch->fd, &buf);
|
|
|
|
|
|
|
|
info->type = find.pos < 0 ? GB_STAT_DIRECTORY : GB_STAT_FILE;
|
|
|
|
info->mode = 0400;
|
|
|
|
|
|
|
|
info->size = find.len;
|
|
|
|
info->atime = (int)buf.st_mtime;
|
|
|
|
info->mtime = (int)buf.st_mtime;
|
|
|
|
info->ctime = (int)buf.st_mtime;
|
|
|
|
info->hidden = (*FILE_get_name(path) == '.');
|
|
|
|
info->uid = buf.st_uid;
|
|
|
|
info->gid = buf.st_gid;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
bool ARCHIVE_read(ARCHIVE *arch, int pos, void *buffer, int len)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
return ARCH_read(arch->arch, pos, buffer, len);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-12-31 16:55:40 +01:00
|
|
|
void ARCHIVE_dir_first(ARCHIVE *arch, const char *path, const char *pattern, int attr)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
2008-11-02 03:40:10 +01:00
|
|
|
ARCHIVE_FIND find;
|
|
|
|
char abs_path[16];
|
|
|
|
int abs_len;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-12-31 16:55:40 +01:00
|
|
|
/*if (get_current(&arch, &path))
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
arch_dir = NULL;
|
|
|
|
return;
|
2008-12-31 16:55:40 +01:00
|
|
|
}*/
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-01-02 18:15:07 +01:00
|
|
|
if (ARCHIVE_get(arch, &path, &find))
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
2008-11-02 03:40:10 +01:00
|
|
|
arch_dir = NULL;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2008-12-31 16:55:40 +01:00
|
|
|
if (!find.sym)
|
|
|
|
{
|
|
|
|
// By calling FILE_dir_first() again, we are sure that next calls to
|
|
|
|
// FILE_dir_next() will never call ARCHIVE_dir_next().
|
2009-01-02 18:15:07 +01:00
|
|
|
FILE_dir_first(FILE_cat(PROJECT_path, path, NULL), pattern, attr);
|
2008-12-31 16:55:40 +01:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pattern == NULL)
|
|
|
|
pattern = "*";
|
|
|
|
|
2009-01-04 19:55:25 +01:00
|
|
|
arch = find.arch;
|
2008-11-02 03:40:10 +01:00
|
|
|
arch_dir = arch->arch;
|
|
|
|
arch_index = 0;
|
|
|
|
|
2007-12-30 17:41:49 +01:00
|
|
|
STRING_free(&arch_pattern);
|
|
|
|
STRING_new(&arch_pattern, pattern, 0);
|
|
|
|
|
2008-11-02 03:40:10 +01:00
|
|
|
//if (arch_dir->header.version == 2)
|
|
|
|
//{
|
|
|
|
if (find.index)
|
|
|
|
abs_len = sprintf(abs_path, "/%d:", find.index);
|
|
|
|
else
|
|
|
|
abs_len = 0;
|
|
|
|
/*}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ARCH_get_absolute_path(path, strlen(path), abs_path, &abs_len);
|
|
|
|
|
|
|
|
if (abs_len && abs_path[abs_len - 1] != '/')
|
|
|
|
{
|
|
|
|
abs_path[abs_len] = '/';
|
|
|
|
abs_len++;
|
|
|
|
}
|
|
|
|
}*/
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-11-02 03:40:10 +01:00
|
|
|
STRING_free(&arch_prefix);
|
|
|
|
if (abs_len)
|
|
|
|
STRING_new(&arch_prefix, abs_path, abs_len);
|
2007-12-30 17:41:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
bool ARCHIVE_dir_next(char **name, int *len, int attr)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
SYMBOL *sym;
|
|
|
|
char *s = NULL;
|
|
|
|
int l = 0;
|
2008-11-02 03:40:10 +01:00
|
|
|
int lenp;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
/*if (arch_fd < 0)
|
|
|
|
return FILE_dir_next(name, len);*/
|
|
|
|
|
|
|
|
if (!arch_dir)
|
|
|
|
return TRUE;
|
|
|
|
|
2008-11-02 03:40:10 +01:00
|
|
|
lenp = STRING_length(arch_prefix);
|
|
|
|
|
2007-12-30 17:41:49 +01:00
|
|
|
for(;;)
|
|
|
|
{
|
|
|
|
if (arch_index >= arch_dir->header.n_symbol)
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
sym = (SYMBOL *)&arch_dir->symbol[arch_index];
|
|
|
|
sym = (SYMBOL *)&arch_dir->symbol[sym->sort];
|
|
|
|
|
|
|
|
if (arch_pattern == NULL)
|
|
|
|
break;
|
|
|
|
|
|
|
|
arch_index++;
|
|
|
|
|
|
|
|
if (attr == GB_STAT_DIRECTORY && (((ARCH_SYMBOL *)sym)->pos >= 0))
|
|
|
|
continue;
|
|
|
|
|
2008-11-02 03:40:10 +01:00
|
|
|
if (sym->len < lenp)
|
2007-12-30 17:41:49 +01:00
|
|
|
continue;
|
|
|
|
|
2008-11-02 03:40:10 +01:00
|
|
|
if (lenp)
|
|
|
|
{
|
|
|
|
if (strncmp(sym->name, arch_prefix, lenp))
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
else // special case: root directory when header.version == 2
|
|
|
|
{
|
|
|
|
if (!strncmp(sym->name, "/", 1))
|
|
|
|
continue;
|
|
|
|
}
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-11-02 03:40:10 +01:00
|
|
|
s = sym->name + lenp;
|
|
|
|
l = sym->len - lenp;
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
if (l < 0)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (memchr(s, '/', l))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if (!REGEXP_match(arch_pattern, STRING_length(arch_pattern), s, l))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
*name = s;
|
|
|
|
*len = l;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
bool ARCHIVE_check_addr(char *addr)
|
2007-12-30 17:41:49 +01:00
|
|
|
{
|
|
|
|
ARCHIVE *arch;
|
|
|
|
ARCH *a;
|
|
|
|
|
|
|
|
LIST_for_each(arch, _archive_list)
|
|
|
|
{
|
|
|
|
a = arch->arch;
|
|
|
|
if (a && addr >= a->addr && addr < &a->addr[a->length])
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|