mirror of
https://github.com/elliotnunn/libhfs.git
synced 2025-01-13 21:31:50 +00:00
wip builds
This commit is contained in:
parent
7f1c6b1456
commit
93a891e493
0
.stamp/configure
vendored
0
.stamp/configure
vendored
38
acconfig.h
38
acconfig.h
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* libhfs - library for reading and writing Macintosh HFS volumes
|
||||
* Copyright (C) 1996-1998 Robert Leslie
|
||||
*
|
||||
* 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 2 of the License, 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.
|
||||
*
|
||||
* $Id: acconfig.h,v 1.5 1998/04/11 08:27:11 rob Exp $
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
* Definitions selected automatically by `configure' *
|
||||
*****************************************************************************/
|
||||
@TOP@
|
||||
|
||||
/* Define if you want to enable diagnostic debugging support. */
|
||||
#undef DEBUG
|
||||
|
||||
@BOTTOM@
|
||||
|
||||
/*****************************************************************************
|
||||
* End of automatically configured definitions *
|
||||
*****************************************************************************/
|
||||
|
||||
# ifdef DEBUG
|
||||
# include <stdio.h>
|
||||
# endif
|
2
apple.h
2
apple.h
@ -19,6 +19,8 @@
|
||||
* $Id: apple.h,v 1.1 1998/04/11 08:27:11 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
typedef signed char Char;
|
||||
typedef unsigned char UChar;
|
||||
typedef signed char SignedByte;
|
||||
|
10
block.c
10
block.c
@ -19,10 +19,6 @@
|
||||
* $Id: block.c,v 1.11 1998/11/02 22:08:52 rob Exp $
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <errno.h>
|
||||
@ -267,11 +263,11 @@ fail:
|
||||
}
|
||||
|
||||
/*
|
||||
* NAME: compare()
|
||||
* NAME: bcompare()
|
||||
* DESCRIPTION: comparison function for qsort of cache bucket pointers
|
||||
*/
|
||||
static
|
||||
int compare(const bucket **b1, const bucket **b2)
|
||||
int bcompare(const bucket **b1, const bucket **b2)
|
||||
{
|
||||
long diff;
|
||||
|
||||
@ -297,7 +293,7 @@ int dobuckets(hfsvol *vol, bucket **chain, unsigned int len,
|
||||
int result = 0;
|
||||
|
||||
qsort(chain, len, sizeof(*chain),
|
||||
(int (*)(const void *, const void *)) compare);
|
||||
(int (*)(const void *, const void *)) bcompare);
|
||||
|
||||
for (i = 0; i < len; i += count)
|
||||
{
|
||||
|
2
block.h
2
block.h
@ -19,6 +19,8 @@
|
||||
* $Id: block.h,v 1.10 1998/11/02 22:08:53 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
int b_init(hfsvol *);
|
||||
int b_flush(hfsvol *);
|
||||
int b_finish(hfsvol *);
|
||||
|
4
btree.c
4
btree.c
@ -19,10 +19,6 @@
|
||||
* $Id: btree.c,v 1.10 1998/11/02 22:08:54 rob Exp $
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <errno.h>
|
||||
|
2
btree.h
2
btree.h
@ -19,6 +19,8 @@
|
||||
* $Id: btree.h,v 1.8 1998/11/02 22:08:55 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
int bt_getnode(node *, btree *, unsigned long);
|
||||
int bt_putnode(node *);
|
||||
|
||||
|
4
config.h
4
config.h
@ -21,6 +21,8 @@
|
||||
* $Id: acconfig.h,v 1.5 1998/04/11 08:27:11 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/*****************************************************************************
|
||||
* Definitions selected automatically by `configure' *
|
||||
*****************************************************************************/
|
||||
@ -32,7 +34,7 @@
|
||||
/* #undef size_t */
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#define STDC_HEADERS 1
|
||||
//#define STDC_HEADERS 1
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
/* #undef TM_IN_SYS_TIME */
|
||||
|
4
data.c
4
data.c
@ -19,10 +19,6 @@
|
||||
* $Id: data.c,v 1.7 1998/11/02 22:08:57 rob Exp $
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# include <string.h>
|
||||
# include <time.h>
|
||||
|
||||
|
2
data.h
2
data.h
@ -19,6 +19,8 @@
|
||||
* $Id: data.h,v 1.7 1998/11/02 22:08:58 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
extern const unsigned char hfs_charorder[];
|
||||
|
||||
signed char d_getsb(register const unsigned char *);
|
||||
|
@ -1 +0,0 @@
|
||||
block.c btree.c data.c file.c hfs.c low.c medium.c memcmp.c node.c os.c record.c version.c volume.c
|
4
file.c
4
file.c
@ -19,10 +19,6 @@
|
||||
* $Id: file.c,v 1.9 1998/11/02 22:08:59 rob Exp $
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# include <string.h>
|
||||
# include <errno.h>
|
||||
|
||||
|
2
file.h
2
file.h
@ -19,6 +19,8 @@
|
||||
* $Id: file.h,v 1.6 1998/04/11 08:27:12 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
enum {
|
||||
fkData = 0x00,
|
||||
fkRsrc = 0xff
|
||||
|
10
hfs.c
10
hfs.c
@ -19,10 +19,6 @@
|
||||
* $Id: hfs.c,v 1.15 1998/11/02 22:09:00 rob Exp $
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <time.h>
|
||||
@ -1535,11 +1531,11 @@ fail:
|
||||
}
|
||||
|
||||
/*
|
||||
* NAME: compare()
|
||||
* NAME: hcompare()
|
||||
* DESCRIPTION: comparison function for qsort of blocks to be spared
|
||||
*/
|
||||
static
|
||||
int compare(const unsigned int *n1, const unsigned int *n2)
|
||||
int hcompare(const unsigned int *n1, const unsigned int *n2)
|
||||
{
|
||||
return *n1 - *n2;
|
||||
}
|
||||
@ -1760,7 +1756,7 @@ int hfs_format(const char *path, int pnum, int mode, const char *vname,
|
||||
f_init(&bbfile, &vol, HFS_CNID_BADALLOC, "bad blocks");
|
||||
|
||||
qsort(badalloc, nbadblocks, sizeof(*badalloc),
|
||||
(int (*)(const void *, const void *)) compare);
|
||||
(int (*)(const void *, const void *)) hcompare);
|
||||
|
||||
for (i = 0; i < nbadblocks; ++i)
|
||||
{
|
||||
|
2
hfs.h
2
hfs.h
@ -19,6 +19,8 @@
|
||||
* $Id: hfs.h,v 1.11 1998/11/02 22:09:01 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
# include <time.h>
|
||||
|
||||
# define HFS_BLOCKSZ 512
|
||||
|
2
libhfs.h
2
libhfs.h
@ -19,6 +19,8 @@
|
||||
* $Id: libhfs.h,v 1.7 1998/11/02 22:09:02 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
# include "hfs.h"
|
||||
# include "apple.h"
|
||||
|
||||
|
4
low.c
4
low.c
@ -19,10 +19,6 @@
|
||||
* $Id: low.c,v 1.8 1998/11/02 22:09:03 rob Exp $
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <errno.h>
|
||||
|
2
low.h
2
low.h
@ -19,6 +19,8 @@
|
||||
* $Id: low.h,v 1.6 1998/04/11 08:27:13 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
# define HFS_DDR_SIGWORD 0x4552
|
||||
|
||||
# define HFS_PM_SIGWORD 0x504d
|
||||
|
13
main.c
Normal file
13
main.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include "block.c"
|
||||
#include "btree.c"
|
||||
#include "data.c"
|
||||
#include "file.c"
|
||||
#include "hfs.c"
|
||||
#include "low.c"
|
||||
#include "medium.c"
|
||||
#include "memcmp.c"
|
||||
#include "node.c"
|
||||
#include "os.c"
|
||||
#include "record.c"
|
||||
#include "version.c"
|
||||
#include "volume.c"
|
4
medium.c
4
medium.c
@ -19,10 +19,6 @@
|
||||
* $Id: medium.c,v 1.4 1998/11/02 22:09:04 rob Exp $
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <errno.h>
|
||||
|
2
medium.h
2
medium.h
@ -19,6 +19,8 @@
|
||||
* $Id: medium.h,v 1.3 1998/04/11 08:27:13 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
* Partition Types:
|
||||
*
|
||||
|
4
memcmp.c
4
memcmp.c
@ -19,10 +19,6 @@
|
||||
* $Id: memcmp.c,v 1.6 1998/04/11 16:22:48 rob Exp $
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# include <sys/types.h>
|
||||
|
||||
/*
|
||||
|
4
node.c
4
node.c
@ -19,10 +19,6 @@
|
||||
* $Id: node.c,v 1.9 1998/11/02 22:09:05 rob Exp $
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <errno.h>
|
||||
|
2
node.h
2
node.h
@ -19,6 +19,8 @@
|
||||
* $Id: node.h,v 1.7 1998/11/02 22:09:06 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
void n_init(node *, btree *, int, int);
|
||||
|
||||
int n_new(node *);
|
||||
|
@ -19,27 +19,8 @@
|
||||
* $Id: unix.c,v 1.8 1998/11/02 22:09:13 rob Exp $
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# ifdef HAVE_FCNTL_H
|
||||
# include <fcntl.h>
|
||||
# else
|
||||
int open(const char *, int, ...);
|
||||
int fcntl(int, int, ...);
|
||||
# endif
|
||||
|
||||
# ifdef HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
# else
|
||||
int close(int);
|
||||
off_t lseek(int, off_t, int);
|
||||
ssize_t read(int, void *, size_t);
|
||||
ssize_t write(int, const char *, size_t);
|
||||
int stat(const char *, struct stat *);
|
||||
int fstat(int, struct stat *);
|
||||
# endif
|
||||
|
||||
# include <errno.h>
|
||||
# include <sys/stat.h>
|
2
os.h
2
os.h
@ -19,6 +19,8 @@
|
||||
* $Id: os.h,v 1.6 1998/09/15 19:21:05 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
int os_open(void **, const char *, int);
|
||||
int os_close(void **);
|
||||
|
||||
|
4
record.c
4
record.c
@ -19,10 +19,6 @@
|
||||
* $Id: record.c,v 1.9 1998/11/02 22:09:07 rob Exp $
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# include <string.h>
|
||||
|
||||
# include "libhfs.h"
|
||||
|
2
record.h
2
record.h
@ -19,6 +19,8 @@
|
||||
* $Id: record.h,v 1.7 1998/11/02 22:09:08 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
void r_packcatkey(const CatKeyRec *, byte *, unsigned int *);
|
||||
void r_unpackcatkey(const byte *, CatKeyRec *);
|
||||
|
||||
|
@ -19,6 +19,8 @@
|
||||
* $Id: version.h,v 1.6 1998/09/18 22:56:38 rob Exp $
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
extern const char libhfs_rcsid[];
|
||||
|
||||
extern const char libhfs_version[];
|
||||
|
4
volume.c
4
volume.c
@ -19,10 +19,6 @@
|
||||
* $Id: volume.c,v 1.12 1998/11/02 22:09:10 rob Exp $
|
||||
*/
|
||||
|
||||
# ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
# endif
|
||||
|
||||
# include <stdlib.h>
|
||||
# include <string.h>
|
||||
# include <time.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user