From 73e8fe6157dde6c17aa4239efc65aff2a25e99d0 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Sun, 12 Nov 2017 00:10:48 +0000 Subject: [PATCH 1/1] seq_read.c: Move interface to own file. --- Makefile.am | 1 + h/prototypes.h | 18 ------------------ sbr/folder_read.c | 1 + sbr/seq_read.c | 1 + sbr/seq_read.h | 25 +++++++++++++++++++++++++ 5 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 sbr/seq_read.h diff --git a/Makefile.am b/Makefile.am index 065bae38..1190a6a5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -429,6 +429,7 @@ noinst_HEADERS = \ sbr/seq_list.h \ sbr/seq_nameok.h \ sbr/seq_print.h \ + sbr/seq_read.h \ sbr/showfile.h \ sbr/smatch.h \ sbr/snprintb.h \ diff --git a/h/prototypes.h b/h/prototypes.h index a70fa621..be8a1d11 100644 --- a/h/prototypes.h +++ b/h/prototypes.h @@ -67,24 +67,6 @@ int pidwait (pid_t, int); void scan_detect_mbox_style (FILE *); void scan_finished(void); -/* - * Read the sequence files for the folder referenced in the given - * struct msgs and populate the sequence entries in the struct msgs. - * - * Arguments: - * - * mp - Folder structure to add sequence entries to - * lockflag - If true, obtain a write lock on the sequence file. - * Additionally, the sequence file will remain open - * and a pointer to the filehandle will be stored in - * folder structure, where it will later be used by - * seq_save(). - * - * Return values: - * OK - successfully read the sequence files, or they don't exist - * NOTOK - failed to lock sequence file - */ -int seq_read (struct msgs * mp, int lockflag); void seq_save (struct msgs *); void seq_setcur (struct msgs *, int); void seq_setprev (struct msgs *); diff --git a/sbr/folder_read.c b/sbr/folder_read.c index 044059fb..18a9ec14 100644 --- a/sbr/folder_read.c +++ b/sbr/folder_read.c @@ -6,6 +6,7 @@ */ #include "h/mh.h" +#include "seq_read.h" #include "m_atoi.h" #include "folder_read.h" #include "error.h" diff --git a/sbr/seq_read.c b/sbr/seq_read.c index 751568c3..e63f8101 100644 --- a/sbr/seq_read.c +++ b/sbr/seq_read.c @@ -7,6 +7,7 @@ */ #include "h/mh.h" +#include "seq_read.h" #include "ssequal.h" #include "trimcpy.h" #include "getcpy.h" diff --git a/sbr/seq_read.h b/sbr/seq_read.h new file mode 100644 index 00000000..a4d872c0 --- /dev/null +++ b/sbr/seq_read.h @@ -0,0 +1,25 @@ +/* seq_read.h -- read the .mh_sequence file and + * -- initialize sequence information + * + * This code is Copyright (c) 2017, by the authors of nmh. See the + * COPYRIGHT file in the root directory of the nmh distribution for + * complete copyright information. */ + +/* + * Read the sequence files for the folder referenced in the given + * struct msgs and populate the sequence entries in the struct msgs. + * + * Arguments: + * + * mp - Folder structure to add sequence entries to + * lockflag - If true, obtain a write lock on the sequence file. + * Additionally, the sequence file will remain open + * and a pointer to the filehandle will be stored in + * folder structure, where it will later be used by + * seq_save(). + * + * Return values: + * OK - successfully read the sequence files, or they don't exist + * NOTOK - failed to lock sequence file + */ +int seq_read(struct msgs *, int); -- 2.48.1