SCP: Add sim_dir_scan API for general use.
This commit is contained in:
parent
5ee2944f40
commit
b781834f31
2 changed files with 11 additions and 2 deletions
4
scp.c
4
scp.c
|
@ -5786,7 +5786,7 @@ typedef void (*DIR_ENTRY_CALLBACK)(const char *directory,
|
||||||
|
|
||||||
#if defined (_WIN32)
|
#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;
|
HANDLE hFind;
|
||||||
WIN32_FIND_DATAA File;
|
WIN32_FIND_DATAA File;
|
||||||
|
@ -5841,7 +5841,7 @@ return SCPE_OK;
|
||||||
#endif
|
#endif
|
||||||
#endif /* defined (HAVE_GLOB) */
|
#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)
|
#if defined (HAVE_GLOB)
|
||||||
glob_t paths;
|
glob_t paths;
|
||||||
|
|
9
scp.h
9
scp.h
|
@ -37,6 +37,9 @@
|
||||||
#ifndef SIM_SCP_H_
|
#ifndef SIM_SCP_H_
|
||||||
#define SIM_SCP_H_ 0
|
#define SIM_SCP_H_ 0
|
||||||
|
|
||||||
|
#include "sim_fio.h"
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
@ -227,6 +230,12 @@ size_t sim_strlcpy (char *dst, const char *src, size_t size);
|
||||||
#ifndef strcasecmp
|
#ifndef strcasecmp
|
||||||
#define strcasecmp(str1, str2) sim_strcasecmp ((str1), (str2))
|
#define strcasecmp(str1, str2) sim_strcasecmp ((str1), (str2))
|
||||||
#endif
|
#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_opt (int32 opt, CONST char *cptr, t_stat *st);
|
||||||
CONST char *get_sim_sw (CONST char *cptr);
|
CONST char *get_sim_sw (CONST char *cptr);
|
||||||
const char *put_switches (char *buf, size_t bufsize, uint32 sw);
|
const char *put_switches (char *buf, size_t bufsize, uint32 sw);
|
||||||
|
|
Loading…
Add table
Reference in a new issue