GEMLIB  0.44.0
Macros | Typedefs | Functions
MagiC/WDIALOG extension: File selector Library

file selector functions More...

Macros

#define fslx_close(a)   mt_fslx_close(a,aes_global)
 
#define fslx_do(a, b, c, d, e, f, g, h, i, j, k, l, m)   mt_fslx_do(a,b,c,d,e,f,g,h,i,j,k,l,m,aes_global)
 
#define fslx_evnt(a, b, c, d, e, f, g, h)   mt_fslx_evnt(a,b,c,d,e,f,g,h,aes_global)
 
#define fslx_getnxtfile(a, b)   mt_fslx_getnxtfile(a,b,aes_global)
 
#define fslx_open(a, b, c, d, e, f, g, h, i, j, k, l, m)   mt_fslx_open(a,b,c,d,e,f,g,h,i,j,k,l,m,aes_global)
 
#define fslx_set_flags(a, b)   mt_fslx_set_flags(a,b,aes_global)
 
#define SORTBYNAME   0
 
#define SORTBYDATE   1
 
#define SORTBYSIZE   2
 
#define SORTBYTYPE   3
 
#define SORTBYNONE   4
 
#define SORTDEFAULT   -1
 
#define DOSMODE   1
 
#define NFOLLOWSLKS   2
 
#define GETMULTI   8
 
#define SHOW8P3   1
 

Typedefs

typedef short __CDECL(* XFSL_FILTER) (char *path, char *name, GEMLIB_XATTR *xattr)
 

Functions

short mt_fslx_close (void *fsd, short *global)
 
void * mt_fslx_do (char *title, char *path, short pathlen, char *fname, short fnamelen, char *patterns, XFSL_FILTER filter, char *paths, short *sort_mode, short flags, short *button, short *nfiles, char **pattern, short *global)
 
short mt_fslx_evnt (void *fsd, EVNT *events, char *path, char *fname, short *button, short *nfiles, short *sort_mode, char **pattern, short *global)
 
short mt_fslx_getnxtfile (void *fsd, char *fname, short *global)
 
void * mt_fslx_open (char *title, short x, short y, short *handle, char *path, short pathlen, char *fname, short fnamelen, char *patterns, XFSL_FILTER filter, char *paths, short sort_mode, short flags, short *global)
 
short mt_fslx_set_flags (short flags, short *oldval, short *global)
 

Detailed Description

file selector functions

This File Selector library availability can be found calling mt_appl_getinfo(7). Bit 3 of ap_gout1, if equal to 1, says that mt_flsx_xx() functions are available.

Macro Definition Documentation

#define DOSMODE   1

TODO

#define fslx_close (   a)    mt_fslx_close(a,aes_global)

single-thread version of mt_fslx_close()

#define fslx_do (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  k,
  l,
 
)    mt_fslx_do(a,b,c,d,e,f,g,h,i,j,k,l,m,aes_global)

single-thread version of mt_fslx_do()

#define fslx_evnt (   a,
  b,
  c,
  d,
  e,
  f,
  g,
 
)    mt_fslx_evnt(a,b,c,d,e,f,g,h,aes_global)

single-thread version of mt_fslx_evnt()

#define fslx_getnxtfile (   a,
 
)    mt_fslx_getnxtfile(a,b,aes_global)

single-thread version of mt_fslx_getnxtfile()

#define fslx_open (   a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
  i,
  j,
  k,
  l,
 
)    mt_fslx_open(a,b,c,d,e,f,g,h,i,j,k,l,m,aes_global)

single-thread version of mt_fslx_open()

#define fslx_set_flags (   a,
 
)    mt_fslx_set_flags(a,b,aes_global)

single-thread version of mt_fslx_set_flags()

#define GETMULTI   8

TODO

#define NFOLLOWSLKS   2

TODO

#define SHOW8P3   1

TODO

#define SORTBYDATE   1

TODO

#define SORTBYNAME   0

TODO

#define SORTBYNONE   4

TODO

#define SORTBYSIZE   2

TODO

#define SORTBYTYPE   3

TODO

#define SORTDEFAULT   -1

TODO

Typedef Documentation

typedef short __CDECL(* XFSL_FILTER) (char *path, char *name, GEMLIB_XATTR *xattr)

TODO

Function Documentation

short mt_fslx_close ( void *  fsd,
short *  global_aes 
)

Close file selector window or file selector dialog

Parameters
fsdDescriptor that was passed at the successful opening of a file selector window.
global_aesglobal AES array
Returns
0 for error, else 1
Since
mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability

The corresponding descriptor is cleared and the file selector window or dialog is closed.

void* mt_fslx_do ( char *  title,
char *  path,
short  pathlen,
char *  fname,
short  fnamelen,
char *  patterns,
XFSL_FILTER  filter,
char *  paths,
short *  sort_mode,
short  flags,
short *  button,
short *  nfiles,
char **  pattern,
short *  global_aes 
)

File selector dialog

Parameters
title
path
pathlen
fname
fnamelen
patterns
filter
paths
sort_mode
[option CHECK_NULLPTR] sort_mode may be NULL
flags
button
[option CHECK_NULLPTR] button may be NULL
nfiles
[option CHECK_NULLPTR] nfiles may be NULL
pattern
[option CHECK_NULLPTR] pattern may be NULL
global_aesglobal AES array
Returns
Since
mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability

This function is a combination of mt_fslx_open() and mt_fslx_evnt(), but uses a dialog box without a window.

see mt_fslx_open() and mt_fslx_evnt() for more details.

short mt_fslx_evnt ( void *  fsd,
EVNT events,
char *  path,
char *  fname,
short *  button,
short *  nfiles,
short *  sort_mode,
char **  pattern,
short *  global_aes 
)

Service file selector window

Parameters
fsdDescriptor that was passed at a successful opening of a file selector window.
eventsEVENT structure as for wdlg_evnt and fnts_evnt. The events are serviced by the dialog if they are intended for the associated window.
pathPointer to the selected path if the dialog was quit successfully, i.e. by a click on the OK button or by double- clicking on a file.
fnamePointer to the selected filename if the dialog was quit successfully, i.e. by a click on the OK button or by double- clicking on a file.
button
[option CHECK_NULLPTR] button may be NULL
nfiles
[option CHECK_NULLPTR] nfiles may be NULL
sort_mode
[option CHECK_NULLPTR] sort_mode may be NULL
pattern
[option CHECK_NULLPTR] pattern may be NULL
global_aesglobal AES array
Returns
Is 0 if the dialog is to be quit, else 1
Since
mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability

Events, i.e. mouse clicks, messages and keypresses are passed on to the file selector window and serviced by it if appropriate. When an event has been serviced then the corresponding bit in the EVENT structure will be cleared.

short mt_fslx_getnxtfile ( void *  fsd,
char *  fname,
short *  global_aes 
)

Examine further selected files

Parameters
fsdDescriptor that was passed at a successful opening of a file selector window
fnamesee below
global_aesglobal AES array
Returns
0, when no further file is selected, fname is unchanged.
1, when a filename after fname was copied.
Since
mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability
void* mt_fslx_open ( char *  title,
short  x,
short  y,
short *  handle,
char *  path,
short  pathlen,
char *  fname,
short  fnamelen,
char *  patterns,
XFSL_FILTER  filter,
char *  paths,
short  sort_mode,
short  flags,
short *  global_aes 
)

Open file selector window

Parameters
titleWindow title of file selector, may be NULL
x
yScreen coordinates of the upper left corner of the window.
For x=y=-1 the window will be centred.
handleWindow handle after successful opening
[option CHECK_NULLPTR] handle may be NULL
pathComplete path, starts with drive and ends with '\'
pathlenLength of path buffer, i.e. maximum pathlength + 1 (for EOS)
fnameBuffer for the filename
fnamelenLength of filename buffer, i.e. maximum length of filename + 1 (for EOS)
patternsFilemask, e.g. "*.TXT" or "*.PRG,*.APP". The alternatively selectable masks are separated by EOS and terminated by EOS,EOS.
filterMay be NULL. The filter function is called before the mask comparison. If it returns 0 then the file is invalid, if 1 is returned then the filename will be displayed.
pathsPath "history" e.g. "C:\\BIN\\" etc. The alternatively selectable paths are separated by EOS and terminated by EOS,EOS.
sort_modeSort mode for the display. The modes are:
  • SORTBYNAME (0)
  • SORTBYDATE (1)
  • SORTBYSIZE (2)
  • SORTBYTYPE (3)
  • SORTBYNONE (4)
SORTBYNONE here means the physical order on the disk.
flagsVarious settings:
  • DOSMODE (1)
    DOSMODE is the compatibility mode that is also used by fsel_(ex)input and basically returns filenames in the 8+3 format. For this all directories are called with Dopendir(DOPEN_COMPAT).
  • NFOLLOWSLKS (2)
    If NFOLLOWSLKS is set, then symbolic links will not be followed, i.e. date and time etc., as well as the XATTR- structure that is passed to filter, belong to the link itself.
  • GETMULTI (8)
    If GETMULTI is set, one can select and pass several files at the same time. For this fslx_getnxtfile() is used if fslx_evnt() or fslx_do() in the parameter nfiles signals that there are still further files selected.
global_aesglobal AES array
Returns
a descriptor for further actions or NULL if an error has occurred (not enough memory or no more window handles free).
Since
mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability

The corresponding descriptor will be created and the file selector window opened.

short mt_fslx_set_flags ( short  flags,
short *  oldval,
short *  global_aes 
)

Global system settings

Parameters
flagsVarious flags, at present only:
  • SHOW8P3 (1)
    SHOW8P3 is valid only for the display of directories on DOS drives. It corresponds to the switch "Show TOS Files as '8+3'" in Magxdesk.
oldvalPrevious value
[option CHECK_NULLPTR] oldval may be NULL
global_aesglobal AES array
Returns
0, if error
1, if OK
Since
mt_appl_getinfo(7) give informations on mt_fslx_xx() functions availability

This function is used (e.g. by MAGXDESK) in order to set the switch "Show TOS Files as '8+3'" for the file selector as well.