[cc65] Directory reading functions

Date view Thread view Subject view

From: josef.soucek_at_ct.cz
Date: 2003-01-17 18:31:54


Hi!
I have have come across the fact, that there are no directory functions 
implemented yet.
I have designed two functions for opening directory and for reading 
directory entry.
It is very 'simplified' version of POSIX opendir() and readdir().
The 'library' for C64 is currently written in C working. I will send it if 
there is anybody interested.
Best regards,
 Josef Soucek

The preliminary header file:

/* ls_cbm.h */
/* This is header file for directory oriented functions for cbm systems */

#ifndef _LS_CBM_H
#define _LS_CBM_H

/* CBM TYPES */

#define T_PRG   1
#define T_SEQ   2
#define T_USR   3
#define T_DIR   4
#define T_OTHER 5          /* Undefined file types */

/* CBM ACCESS */

#define A_RO    1          /* Read only   */
#define A_RW    3          /* Read, Write */

typedef struct cbm_dirent { unsigned char cbm_name[17];
                            unsigned int cbm_size;     /* Size in 256B 
blocks */
                            unsigned char cbm_type;
                            unsigned char cbm_access; }; 


unsigned char cbm_opendir( unsigned char lfn, unsigned char device);
/* Opens directory listing
 * Returns 0 if opening directory was successful
 */

unsigned char cbm_readdir( unsigned char lfn, struct cbm_dirent *l_dirent);
/* Reads one directory line into cbm_dirent structure
 * Returns 0 if reading directory line was successful
 * Returns 'true' if reading directory failed or no more files to read
 */

/* Close directory by cbm_close( unsigned char lfn) and cbm_k_clrch() */


/* End of ls_cbm.h */
#endif



----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo_at_musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.


Date view Thread view Subject view

This archive was generated by hypermail 2.1.3 : 2003-01-17 18:32:24 CET