// extensions #if ENABLE_ATOMIC_WRITE internal static RC JournalVFileOpen(VSystem vfs, string name, ref VFile file, VSystem.OPEN flags, int bufferLength) { var p = new JournalVFile(); if (bufferLength > 0) { p.Buffer = C._allocZero(bufferLength); } else { VSystem.OPEN dummy; return(vfs.Open(name, p, flags, out dummy)); } p.Type = 2; p.BufferLength = bufferLength; p.Flags = flags; p.Journal = name; p.Vfs = vfs; file = p; return(RC.OK); }
// extensions internal static RC JournalVFileOpen(VSystem vfs, string name, ref VFile file, VSystem.OPEN flags, int bufferLength) { var p = new JournalVFile(); if (bufferLength > 0) p.Buffer = SysEx.Alloc(bufferLength, true); else { VSystem.OPEN dummy; return vfs.Open(name, p, flags, out dummy); } p.Type = 2; p.BufferLength = bufferLength; p.Flags = flags; p.Journal = name; p.Vfs = vfs; file = p; return RC.OK; }