From 037e02905b802686be908d4f8cd989f0c5002b99 Mon Sep 17 00:00:00 2001 From: germeier Date: Sun, 27 Oct 2002 17:37:24 +0000 Subject: implemented the switch command finished support for writing files directly from memory (for config files) --- libmpio/directory.c | 75 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 55 insertions(+), 20 deletions(-) (limited to 'libmpio/directory.c') diff --git a/libmpio/directory.c b/libmpio/directory.c index 4795b3d..c5bdc8e 100644 --- a/libmpio/directory.c +++ b/libmpio/directory.c @@ -1,6 +1,6 @@ /* * - * $Id: directory.c,v 1.9 2002/10/27 02:45:28 germeier Exp $ + * $Id: directory.c,v 1.10 2002/10/27 17:37:25 germeier Exp $ * * Library for USB MPIO-* * @@ -607,26 +607,10 @@ mpio_dentry_find_name_8_3(mpio_t *m, BYTE mem, BYTE *filename) WORD wdummy; BYTE fname[129]; BYTE fname_8_3[13]; - BYTE filename_8_3[13]; DWORD ddummy; BYTE *found = 0; int i, j, len; - /* format given filename to a "standard" 8.3 filename */ - memset(filename_8_3, 0x20, 13); - filename_8_3[12]=0; - len=strlen(filename); - i=j=0; - while ((i<13) && (j internal; + if (mem == MPIO_EXTERNAL_MEM) sm = &m->external; + + if (file1 == file2) + return; + + if (file1dir) + { + memcpy(current, sm->dir, p1 - sm->dir); + current += (p1 - sm->dir); + } + /* the second file*/ + memcpy(current, p2, size2); + current += size2; + /* between the files */ + memcpy(current, p1+size1, (p2-p1-size1)); + current += (p2-p1-size1); + /* the first file */ + memcpy(current, p1, size1); + current += size1; + /* and the rest */ + memcpy(current, p2+size2, (sm->dir+DIR_SIZE-p2-size2)); + + /* really update the directory */ + memcpy(sm->dir, tmp, DIR_SIZE); + + return; +} -- cgit v1.2.3