| 1 | #ifdef RCSID |
| 2 | static char RCSid[] = |
| 3 | "$Header$"; |
| 4 | #endif |
| 5 | |
| 6 | /* |
| 7 | * Copyright (c) 1999, 2002 Michael J. Roberts. All Rights Reserved. |
| 8 | * |
| 9 | * Please see the accompanying license file, LICENSE.TXT, for information |
| 10 | * on using and copying this software. |
| 11 | */ |
| 12 | /* |
| 13 | Name |
| 14 | askf_os.c - dialog-based implementation of tio_askfile |
| 15 | Function |
| 16 | Implements tio_askfile() using the OS-layer os_askfile() routine. |
| 17 | Notes |
| 18 | Only one of askf_tx.c or askf_os.c should be included in a given |
| 19 | executable. For a text-only version, include askf_tx. For a version |
| 20 | where os_askfile() provides a file dialog, use askf_os instead. |
| 21 | |
| 22 | We provide a choice of tio_askfile() implementations in the portable |
| 23 | code (rather than only through the OS code) so that we can call |
| 24 | the formatted text output routines in this version. An OS-layer |
| 25 | implementation could not call the formatted output routines (it would |
| 26 | have to call os_printf directly), which would result in poor prompt |
| 27 | formatting any time a prompt exceeded a single line of text. |
| 28 | Modified |
| 29 | 09/27/99 MJRoberts - Creation |
| 30 | */ |
| 31 | |
| 32 | #include "os.h" |
| 33 | #include "std.h" |
| 34 | #include "tio.h" |
| 35 | |
| 36 | /* |
| 37 | * formatted text-only file prompt |
| 38 | */ |
| 39 | int tio_askfile(const char *prompt, char *reply, int replen, |
| 40 | int prompt_type, os_filetype_t file_type) |
| 41 | { |
| 42 | /* let the OS layer handle it */ |
| 43 | return os_askfile(prompt, reply, replen, prompt_type, file_type); |
| 44 | } |
| 45 |