From 40d9f3eed513f4263f93aa6400acae931083a183 Mon Sep 17 00:00:00 2001 From: Colin Leroy-Mira Date: Sun, 10 Nov 2024 13:38:35 +0100 Subject: [PATCH] Apple2: Provide a way to get directory file count The information is available in the directory key block. Providing it to the user as soon as opendir() is done can save them costly code. --- doc/apple2.sgml | 1 + doc/apple2enh.sgml | 1 + doc/funcref.sgml | 21 +++++++++++++++++++++ include/apple2.h | 5 +++++ include/dirent.h | 2 -- libsrc/apple2/dir.h | 1 + libsrc/apple2/dir.inc | 2 +- libsrc/apple2/dir_file_count.s | 24 ++++++++++++++++++++++++ libsrc/apple2/opendir.s | 21 ++++++++++----------- 9 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 libsrc/apple2/dir_file_count.s diff --git a/doc/apple2.sgml b/doc/apple2.sgml index c0255c4f7..c6b2fe8eb 100644 --- a/doc/apple2.sgml +++ b/doc/apple2.sgml @@ -332,6 +332,7 @@ usage. _datetime allow_lowercase beep +dir_file_count get_ostype gmtime_dt mktime_dt diff --git a/doc/apple2enh.sgml b/doc/apple2enh.sgml index 9c46bd4fb..ea950fa26 100644 --- a/doc/apple2enh.sgml +++ b/doc/apple2enh.sgml @@ -332,6 +332,7 @@ usage. _filetype _datetime beep +dir_file_count get_ostype gmtime_dt mktime_dt diff --git a/doc/funcref.sgml b/doc/funcref.sgml index ea2350aad..7664739fe 100644 --- a/doc/funcref.sgml +++ b/doc/funcref.sgml @@ -97,6 +97,7 @@ function. _dos_type allow_lowercase + @@ -109,6 +110,7 @@ function. _dos_type + @@ -3524,6 +3526,25 @@ used in presence of a prototype. +dir_file_count