[gnome-commander] InternalViewer: Move ViewerFileOps struct declaration into header file



commit 804d1cdf031c503d2904809f0c9204040e2aeafd
Author: Uwe Scholz <u scholz83 gmx de>
Date:   Thu Jan 21 21:33:02 2021 +0100

    InternalViewer: Move ViewerFileOps struct declaration into header file

 src/intviewer/fileops.cc | 23 -----------------------
 src/intviewer/fileops.h  | 25 +++++++++++++++++++++++--
 2 files changed, 23 insertions(+), 25 deletions(-)
---
diff --git a/src/intviewer/fileops.cc b/src/intviewer/fileops.cc
index e361b8cf..395694fb 100644
--- a/src/intviewer/fileops.cc
+++ b/src/intviewer/fileops.cc
@@ -53,29 +53,6 @@
 using namespace std;
 
 
-struct _ViewerFileOps
-{
-    // File handling (based on 'Midnight Commander'-'s view.c)
-    char *filename;        // Name of the file
-    unsigned char *data;    // Memory area for the file to be viewed
-    int file;        // File descriptor (for mmap and munmap)
-    int mmapping;        // Did we use mmap on the file?
-
-    // Growing buffers information
-    int growing_buffer;    // Use the growing buffers?
-    char **block_ptr;    // Pointer to the block pointers
-    int   blocks;        // The number of blocks in *block_ptr
-    struct stat s;        // stat for file
-
-    offset_type last;           // Last byte shown
-    offset_type last_byte;      // Last byte of file
-    offset_type first;        // First byte in file
-    offset_type bottom_first;    // First byte shown when very last page is displayed
-                    // For the case of WINCH we should reset it to -1
-    offset_type bytes_read;     // How much of file is read
-};
-
-
 ViewerFileOps *gv_fileops_new()
 {
     ViewerFileOps *fops = g_new0 (ViewerFileOps, 1);
diff --git a/src/intviewer/fileops.h b/src/intviewer/fileops.h
index f4486192..2778d4e5 100644
--- a/src/intviewer/fileops.h
+++ b/src/intviewer/fileops.h
@@ -22,6 +22,8 @@
  *
  */
 
+#include <sys/stat.h>
+
 #pragma once
 
 /*
@@ -33,8 +35,27 @@
     calling order should be: open->load->[use file with "get_byte"]->free (which calls close)
 */
 
-
-typedef struct _ViewerFileOps ViewerFileOps;
+struct ViewerFileOps
+{
+    // File handling (based on 'Midnight Commander'-'s view.c)
+    char *filename;        // Name of the file
+    unsigned char *data;    // Memory area for the file to be viewed
+    int file;        // File descriptor (for mmap and munmap)
+    int mmapping;        // Did we use mmap on the file?
+
+    // Growing buffers information
+    int growing_buffer;    // Use the growing buffers?
+    char **block_ptr;    // Pointer to the block pointers
+    int   blocks;        // The number of blocks in *block_ptr
+    struct stat s;        // stat for file
+
+    offset_type last;           // Last byte shown
+    offset_type last_byte;      // Last byte of file
+    offset_type first;        // First byte in file
+    offset_type bottom_first;    // First byte shown when very last page is displayed
+                    // For the case of WINCH we should reset it to -1
+    offset_type bytes_read;     // How much of file is read
+};
 
 ViewerFileOps *gv_fileops_new();
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]