1
0
mirror of https://github.com/weiju/amiga-stuff synced 2025-11-23 10:39:58 +00:00
Files
amiga-stuff/requesters/dos13.h
Wei-ju Wu 5390244222 requesters: file requester index mapping
map visible selection indexes to file list indexes
2016-01-22 00:05:18 -08:00

38 lines
969 B
C

// dos13 - a module for DOS 1.x interaction
#pragma once
#ifndef __DOS13_H__
#define __DOS13_H__
#include <exec/types.h>
#define FILETYPE_FILE 0
#define FILETYPE_DIR 1
#define FILETYPE_VOLUME 2
// This file requester is only for 1.x, so 31 characters is the
// maximum
#define MAX_FILENAME_LEN 31
/*
* Store file list entries in these entries. Storing a previous pointer allows us to
* navigate backwards, e.g. for scrolling up a file list.
*/
struct FileListEntry {
struct FileListEntry *next, *prev;
UWORD file_type;
UWORD index; // index in the list
UWORD selected;
char name[MAX_FILENAME_LEN + 1];
};
/*
* Scans the specified directory and returns the entries, if dirpath is NULL,
* returns the list of all logical volumes.
*/
extern struct FileListEntry *scan_dir(const char *dirpath, int *num_entries);
/* free the resources allocated in the specified entry list */
void free_file_list(struct FileListEntry *entries);
#endif