aboutsummaryrefslogtreecommitdiff
path: root/axe.h
blob: 1301d0cc30965ef47580b02fdaad6539ca26f420 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <getopt.h>
#include <dirent.h>

extern char *optarg;
extern int optind, optopt, opterr;

/* struct atari_dirent {
   unsigned char flag; // bit 7=deleted 6=normal 5=locked 0=open4write
   unsigned char countlo;
   unsigned char counthi;
   unsigned char startlo;
   unsigned char starthi;
   char namelo[8];
   char namehi[3];
};
*/

#define TF_PRINT 1
#define TF_DELETE 2

int load_disk(unsigned char *disk, char *);
int write_disk(unsigned char *disk, char *);

int get_confirm(char *);
void usage(char *);
void print_entry(unsigned char *buf);
/*void dump_links(unsigned char *disk,unsigned char *ent);*/
void traverse_file(unsigned char *disk, unsigned char *ent, int ACTION);
void dump_file(unsigned char *disk, unsigned char *ent, char *);
int parse_filename(char *filename, char *result);
int make_filename(char *filename, char *result);
int make_dir(char *filename);
void dump_sector(unsigned char *disk, int);
void read_sector(unsigned char *disk, int, unsigned char *buf);
void write_sector(unsigned char *disk, int, unsigned char *buf);
void write_blank_disk(char *filename);
void write_file(unsigned char *disk, char *filename);
/*int check_dir(unsigned char *disk,char *filename);*/
int get_dentry(unsigned char *disk);
int get_free_sector(unsigned char *disk);
void mark_used(unsigned char *vtoc_sector, int sector);
void mark_free(unsigned char *vtoc_sector, int sector);
int vtoc_byte(int sector);
int vtoc_bit(int sector);