From b781834f315ce0cc57b17bd0d7796c1392c7b7c6 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 9 May 2018 13:52:52 -0700 Subject: [PATCH] SCP: Add sim_dir_scan API for general use. --- scp.c | 4 ++-- scp.h | 9 +++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/scp.c b/scp.c index 206ff0ba..911f6721 100644 --- a/scp.c +++ b/scp.c @@ -5786,7 +5786,7 @@ typedef void (*DIR_ENTRY_CALLBACK)(const char *directory, #if defined (_WIN32) -static t_stat sim_dir_scan (const char *cptr, DIR_ENTRY_CALLBACK entry, void *context) +t_stat sim_dir_scan (const char *cptr, DIR_ENTRY_CALLBACK entry, void *context) { HANDLE hFind; WIN32_FIND_DATAA File; @@ -5841,7 +5841,7 @@ return SCPE_OK; #endif #endif /* defined (HAVE_GLOB) */ -static t_stat sim_dir_scan (const char *cptr, DIR_ENTRY_CALLBACK entry, void *context) +t_stat sim_dir_scan (const char *cptr, DIR_ENTRY_CALLBACK entry, void *context) { #if defined (HAVE_GLOB) glob_t paths; diff --git a/scp.h b/scp.h index 7d49aad1..c83ded41 100644 --- a/scp.h +++ b/scp.h @@ -37,6 +37,9 @@ #ifndef SIM_SCP_H_ #define SIM_SCP_H_ 0 +#include "sim_fio.h" +#include + #ifdef __cplusplus extern "C" { #endif @@ -227,6 +230,12 @@ size_t sim_strlcpy (char *dst, const char *src, size_t size); #ifndef strcasecmp #define strcasecmp(str1, str2) sim_strcasecmp ((str1), (str2)) #endif +typedef void (*DIR_ENTRY_CALLBACK)(const char *directory, + const char *filename, + t_offset FileSize, + const struct stat *filestat, + void *context); +t_stat sim_dir_scan (const char *cptr, DIR_ENTRY_CALLBACK entry, void *context); CONST char *get_sim_opt (int32 opt, CONST char *cptr, t_stat *st); CONST char *get_sim_sw (CONST char *cptr); const char *put_switches (char *buf, size_t bufsize, uint32 sw);