logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

bagder: uisimulator/common io.c,1.2,1.3: msg#00041

Subject: bagder: uisimulator/common io.c,1.2,1.3
Update of /cvsroot/rockbox/uisimulator/common
In directory labb.contactor.se:/var/tmp/cvs-serv22987/uisimulator/common

Modified Files:
        io.c 
Log Message:
translate from rockbox's open() options to the options used by the host


Index: io.c
===================================================================
RCS file: /cvsroot/rockbox/uisimulator/common/io.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- io.c        14 Jun 2004 07:00:50 -0000      1.2
+++ io.c        14 Jun 2004 22:22:49 -0000      1.3
@@ -54,6 +54,24 @@
 
 typedef struct mydir MYDIR;
 
+static unsigned int rockbox2sim(int opt)
+{
+    int newopt = 0;
+    if(opt & 1)
+        newopt |= O_WRONLY;
+    if(opt & 2)
+        newopt |= O_RDWR;
+    if(opt & 4)
+        newopt |= O_CREAT;
+    if(opt & 8)
+        newopt |= O_APPEND;
+    if(opt & 0x10)
+        newopt |= O_TRUNC;
+
+    return newopt;
+}
+
+
 MYDIR *sim_opendir(const char *name)
 {
     char buffer[256]; /* sufficiently big */
@@ -109,9 +127,10 @@
 }
 
 
-int sim_open(const char *name, int opts)
+int sim_open(const char *name, int o)
 {
     char buffer[256]; /* sufficiently big */
+    int opts = rockbox2sim(o);
 
     if(name[0] == '/') {
         sprintf(buffer, "%s%s", SIMULATOR_ARCHOS_ROOT, name);

_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox-cvs



<Prev in Thread] Current Thread [Next in Thread>