--- os2sdk/demos/examples/move/move.c 2018/08/09 12:25:13 1.1 +++ os2sdk/demos/examples/move/move.c 2018/08/09 12:26:09 1.1.1.2 @@ -1,26 +1,27 @@ /* - * Program to demonstrate DOSFINDFIRST and DOSMOVE. + * Program to demonstrate DosFindFirst and DosMove. * - * Compile as: cl -AL -G2 -Lp move.c + * Compile as: cl -AL -G0 -Lp move.c + * + * Created by Microsoft Corp. 1987 */ -#include +#define INCL_DOSFILEMGR + +#include +#include #include #include -#define BYTE unsigned char -#define WORD unsigned int -#define DWORD unsigned long - main (argc, argv) int argc ; char *argv [] ; { - struct FileFindBuf findbuf ; - WORD handle = 0xFFFF ; - WORD count = 1 ; + FILEFINDBUF findbuf ; + HDIR handle = 0xFFFF ; + UINT count = 1 ; char oldpath [81], newpath [81], oldspec [81], newspec [81] ; - WORD code ; + UINT code ; char *ptr ; if (argc < 3) { @@ -41,23 +42,23 @@ main (argc, argv) if (newpath [strlen (newpath) - 1] != '\\') strcat (newpath, "\\") ; - DOSFINDFIRST (argv [1], &handle, 7, &findbuf, + DosFindFirst (argv [1], &handle, 7, &findbuf, sizeof (findbuf), &count, 0L) ; while(count) { strcpy (oldspec, oldpath) ; - strcat (oldspec, findbuf.file_name) ; + strcat (oldspec, findbuf.achName) ; strcpy (newspec, newpath) ; - strcat (newspec, findbuf.file_name) ; + strcat (newspec, findbuf.achName) ; - code = DOSMOVE (oldspec, newspec, 0L) ; + code = DosMove (oldspec, newspec, 0L) ; printf ("%s --> %s %s\n", oldspec, newspec, code ? "FAILED" : "") ; - DOSFINDNEXT (handle, &findbuf, sizeof (findbuf), &count) ; + DosFindNext (handle, &findbuf, sizeof (findbuf), &count) ; } - DOSFINDCLOSE (handle) ; + DosFindClose (handle) ; }