public unsafe static Progress PollProgress() { var ptr = poll_progress(); ProgressC progress = new ProgressC(); progress = (ProgressC)Marshal.PtrToStructure(ptr, typeof(ProgressC)); Progress prog = new Progress { Finished = progress.finished != 0, NewFile = progress.new_file != 0, NewState = progress.new_state != 0, ProgressS = progress.state, ProgressPercentage = progress.progress, File = progress.file_name }; return(prog); }
public unsafe static Progress StartPacking(string twinsPath, string imagePathName) { var ptr = start_packing(twinsPath, imagePathName); ProgressC progress = new ProgressC(); progress = (ProgressC)Marshal.PtrToStructure(ptr, typeof(ProgressC)); Progress prog = new Progress { Finished = progress.finished != 0, NewFile = progress.new_file != 0, NewState = progress.new_state != 0, ProgressS = progress.state, ProgressPercentage = progress.progress, File = progress.file_name }; return(prog); }