Updating documentation, last bugfixes before first release.

This commit is contained in:
Paul Mosier 2021-09-18 23:11:10 -04:00
parent 443e2fbb35
commit 7582526c6f
12 changed files with 2932 additions and 207 deletions

View File

@ -1 +1,3 @@
See the code of conduct section in README.md
"Do unto others as you would have them do unto you."
All abuse or malign speech will be ignored or censored.

View File

@ -1 +1,9 @@
See the contributing section in README.md
Thanks for being willing to expand on this project. For feature requests or bug reports, see the README. The following is for code/patch submissions.
When submitting a patch, please keep to a similar indentation & coding style (tabstop to 4, 1TBS indentation, attention to doxygen comments in the header files). I didn't use the C++ standard library in my coding to see if I could make the project work without it; don't feel constrained to the same.
You can 'make debug' and/or 'make doc' for debugging versions or doxygen-generated documentation (if you care about that sort of thing). Submitted code should be free of any warnings on compilation and have no memory leaks as reported by 'valgrind --leak-check=full --show-possibly-lost=no'.
I can work with you on all of this to bring any code up to spec if you're feeling squeamish about contributing. I'd rather have collaboration than crickets, so to speak.
You can submit pull requests through tildegit for review. You must be willing to have all code become GPL licensed if accepted.

2577
Doxyfile Normal file

File diff suppressed because it is too large Load Diff

View File

@ -22,13 +22,17 @@ ifeq ($(wildcard /usr/include/sword),)
endif
doc:
doxygen Doxyfile
install:
cp -v scriptura $PREFIX/bin
cp -v scriptura $PREFIX/bin
uninstall:
rm -v $PREFIX/bin
rm -v $PREFIX/bin
clean:
rm -f $(TARGET)
rm -rf $(TARGET) html latex

View File

@ -1,26 +1,33 @@
# Scriptura
A ncurses-based frontend to the SWORD project, the CrossWire Bible Society's Bible software project.
A ncurses-based frontend to the SWORD project, the CrossWire Bible Society's Bible software library.
This program was written to scratch a personal itch. I do a lot of daily computer work in the command line, I wanted something more feature-rich than libsword's diatheke, and I wanted to sharpen my C skills. I imagine there are probably a single-digit's amount of people in the world who are interested in doing their Bible study from a command line terminal. If you happen to be one of them, please feel free to use this program. Its layout and interface are very loosely based on OliveTree, a Bible study app popular on the Android platform.
## Dependencies
* clang
* libsword and its development libraries (often available in most distributions' standard repos)
* ncurses and its development libraries (any modern Linux version should work)
* clang
* doxygen (optional, if you're a documentation nerd)
## Getting started
To install scriptura:
To install scriptura (into /usr/local by default):
> git clone https://tildegit.org/paladin1/scriptura.git
>
> cd scriptura
>
> make
> make install
>
> sudo make install
On first run, scriptura assumes that a King James module is intalled and available. Many modules from CrossWire are [available here](https://www.crosswire.org/ftpmirror/pub/sword/packages/rawzip/) and other frontends have their own repos. To install them from the command line:
> mkdir -p $HOME/.sword/
>
> cd $HOME/.sword/
>
> curl https://www.crosswire.org/ftpmirror/pub/sword/packages/rawzip/KJVA.zip
>
> unzip KJVA.zip
A configuration file will be created at $HOME/.config/scriptura.ini. You can see the sample config file in the codebase for available options.
@ -32,27 +39,16 @@ When the software is running, the '?' key will give you the list of commands ava
Menus and forms will not render correctly if your terminal window is too narrow. Resize the terminal and this should work.
## Contributing
Thanks for being willing to expand on this project. For feature requests, bug reports, or other support see the section below.
## Feedback / Support / Gratuity
For patch or code submissions, see the CONTRIBUTING file.
For code submissions, please keep to a similar indentation & coding style (tabstop to 4, 1TBS indentation). I didn't use the C++ standard library in my coding to see if I could make the project work without it; don't feel constrained to the same.
You can submit pull requests through tildegit for review. You must be willing to have all code submissions become GPL licensed.
## Feedback / Support
Please use the tildegit project forum page to submit any feature requests, bug reports, or other feedback. For bugs, please include the descriptions of whatever module was used and relevant config/environment settings, and a list of steps to reproduce the problem. Please also adhere to the code of conduct, given in the section below.
Please use the tildegit project forum page to submit any feature requests or bug reports. For bugs, please include the descriptions of whatever module was used and relevant config/environment settings, and a list of steps to reproduce the problem. Please also adhere to the code of conduct.
Other means of contact [can be found here](https://keyoxide.org/hkp/paladin1%40sdf.org)
This project is basically a one-man operation. If you'd like to show your support financially, you can contribute via:
- /Paypal - paladin1/ at /sdf.org/
- /BTC - bc1q9dfau346z38jth35gkaxacd3fljvfgw6cqcyyv/
## Code of Conduct
"Do unto others as you would have them do unto you."
All abuse or malign speech will be ignored or censored.
- _Paypal - paladin1_ at _sdf.org_
- _BTC - bc1q9dfau346z38jth35gkaxacd3fljvfgw6cqcyyv_
## Disclaimer

View File

@ -1,4 +1,20 @@
// Part of the Scriptura program
// Copyright 2021, Paul Mosier
//
// This file is part of Scriptura, a ncurses-based Bible study
// software for the libsword backend.
//
// Scriptura is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, under version 2 of the License.
//
// Scriptura is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Scriptura. If not, see <https://www.gnu.org/licenses/>.
// free.cpp - free functions / globals
#include <ncurses.h>

69
free.h
View File

@ -1,4 +1,20 @@
// Part of the Scriptura program
// Copyright 2021, Paul Mosier
//
// This file is part of Scriptura, a ncurses-based Bible study
// software for the libsword backend.
//
// Scriptura is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, under version 2 of the License.
//
// Scriptura is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Scriptura. If not, see <https://www.gnu.org/licenses/>.
// free.h - free functions / globals
#ifndef SCRIPT_GLOBAL
@ -7,54 +23,51 @@
#include <swconfig.h>
#include <swbuf.h>
// structure for management of list of strings
typedef struct arraystruct {
int length; // number of elements
const char ** strings; // list of strings
//! Structure to make managing arrays easier. Who doesn't like arrays?
typedef struct {
int length; //!< number of elements
const char ** strings; //!< list of strings
} starray;
// structure to hold a module ID & search key
typedef struct modst {
const char* modname; // name of module
const char* searchkey; // our search key for the module
int keytype; // 0 - versekey, 1 - treekey, 2 - direct
int searchtype; // type of search to be performed, if any
const char* scope; // scope of search, if any
/*! Structure to hold a module ID, search key, and related search parameters.
* One is stored by each pane. */
typedef struct {
const char* modname; //!< name of module
const char* searchkey; //!< our search key for the module
int keytype; //!< 0 - versekey, 1 - treekey, 2 - direct
int searchtype; //!< type of search to be performed, if any
const char* scope; //!< scope of search, if any
} modkey;
// strings for holding various large texts
//! String giving all in-program key commands. Displayed in the help window.
extern char HELPTEXT[];
//! String giving the informative text on the command line, for '-h'
extern char CLITEXT[];
// global copy of configuration settings
//! Global copy of the program's configuration file settings.
extern sword::SWConfig config;
/* wrapup
* close out of ncurses gracefully, display an exit message if we have one, and
* quit */
/*! Close out of ncurses gracefully, display an exit message if we have one, and
* quit. */
void wrapup(int exitval, const char* str);
/* trim
* trim trailing whitespace for a string */
//! Trim trailing whitespace for a string.
void trim(char* str);
/* parseConf
* parse through a configuration setting from SWConfig */
//! parse through a configuration setting from SWConfig
int parseConf(sword::SWBuf buf);
/* strmatch
* determine if a substring is present at either the beginning of a string or
/*! Determine if a substring is present at either the beginning of a string or
* at any point within it, depending on a toggle for a flag -- return integer
* of matching index */
* of matching index. */
int strmatch(wchar_t text[], const wchar_t* key, int matchnow);
/* stappend
* append a new string to a starray */
//! Append a new string to a starray.
starray stappend(starray arr, const char* newstr);
/* stinit
* initialize a new starray */
//! Initialize a new starray.
starray stinit(starray arr);

View File

@ -1,5 +1,21 @@
/* Part of the Scriptura software
* pane.cpp - class to handle pane layout */
// Copyright 2021, Paul Mosier
//
// This file is part of Scriptura, a ncurses-based Bible study
// software for the libsword backend.
//
// Scriptura is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, under version 2 of the License.
//
// Scriptura is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Scriptura. If not, see <https://www.gnu.org/licenses/>.
// pane.cpp -- subwindow management
#include <stdlib.h>
#include <ncurses.h>
@ -92,23 +108,14 @@ void pane::renderText() {
if (! text) wrapup(1, "Error allocating memory in renderText.\n");
wmemset(text, L'\0', length + 1);
// some typographical quotes won't go through mbstowcs, so alter those
/* some typographical quotes won't go through mbstowcs, so alter those; this
* seems inefficient, but we don't know how many bytes are in each multibyte
* char so I think it has to be done this way */
for (int i = 0; i < length; i++) {
int converted = mbstowcs(text, rawtext, i);
int converted = mbstowcs(text, rawtext, 1);
if (converted == -1) strncpy(&(rawtext[i-1]), "'", 1);
}
/*
mbstowcs(text, rawtext, length + 1);
for (int foo = 0; foo < length + 2; foo++) {
int converted = mbstowcs(text, rawtext, foo);
if (converted == -1) {
fprintf(stderr, "codes: %x\n", rawtext[foo-1]);
break;
}
}*/
//fprintf(stderr, "length: %d\n", length);
//fprintf(stderr, "rawtext: %s\n", rawtext);
//fprintf(stderr, "text: %ls\n\n", text);
mbstowcs(text, rawtext, length - 1);
// kept for debugging
//fwprintf(stderr, L"(O): %ls\n\n", text);

192
pane.h
View File

@ -1,4 +1,20 @@
// Part of the Scriptura program
// Copyright 2021, Paul Mosier
//
// This file is part of Scriptura, a ncurses-based Bible study
// software for the libsword backend.
//
// Scriptura is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, under version 2 of the License.
//
// Scriptura is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Scriptura. If not, see <https://www.gnu.org/licenses/>.
// pane.h -- header file for pane class
#ifndef PANE
@ -12,108 +28,140 @@
#include "free.h"
// pane - defines a window complex to display data retrieved from sword
//! Defines a window complex to display data retrieved from sword.
class pane {
WINDOW *win; // the window drawing the bounding box
char titlebar[40]; // window titlebar
bool hasFocus; // holds window focus status
WINDOW *win; //!< the window drawing the bounding box
char titlebar[40]; //!< window titlebar
bool hasFocus; //!< holds window focus status
WINDOW *pad; /* typically a pad holding buffer text, but may
* instead be a window holding a menu or form */
int padx, pady; // the pad bounding box upper left corner
int padrows, padcols; // the pad bounding box dimensions
WINDOW *pad; /*!< typically a pad holding buffer text, but may
* instead be a window holding a menu or form */
int padx; //!< pad bounding box upper left X coord
int pady; //!< pad bounding box upper left Y coord
int padrows; //!< the pad's number of rows
int padcols; //!< the pad's number of columns
// if pad is an ncurses pad, then:
int buflocx, buflocy; // the pad buffer location (ie. where we are)
int bufsizex, bufsizey; // the pad buffer size (height & width)
int buflocx; //!< if pad is a true pad, our current X location
int buflocy; //!< if pad is a true pad, our current Y location
int bufsizex; //!< if pad is a true pad, it's full number of rows
int bufsizey; //!< if pad is a true pad, it's full number of columns
modkey mod; // module key associated with this pane
char* rawtext; // copy of unprocessed text the pane is showing
modkey mod; //!< module key associated with this pane
char* rawtext; //!< copy of unprocessed text the pane is showing
/* retitle
* refresh the title of the window */
//! Refresh the title of the window.
void retitle();
/* renderText
* take a text to display and format it for display, also creating the pad
* to hold it */
/*! Take a text to display and format it for display, also creating the pad
* to hold it. */
void renderText();
/* printInstructions
* for floating panes, print out instruction lines that fit in the window
* bounds - returns the next available row in the window to print on */
int printInstructions(int y, const char* inst);
/*! For floating panes, print out instruction lines that fit in the window
* bounds
* \returns the next available row in the window to print on. */
int printInstructions(int y, //!< starting y coord to print at
const char* inst //!< the line of text to print
);
public:
int x, y; // starting X & Y locations on screen
int height, width; // size of pane (the outer window)
int x; //!< starting X location on screen
int y; //!< starting Y location on screen
int height; //!< full height of the pane
int width; //!< full width of the pane
/* constructor
* Takes as input the upper left (Y,X) coord for the window, its number of
* lines & columns, and the text for the titlebar */
pane(int starty, int startx, int lines, int cols, const char* title);
//! Pane constructor.
pane(int starty, //!< the pane's upper left Y coord
int startx, //!< the pane's upper left Y coord
int lines, //!< the pane's number of lines
int cols, //!< the pane's number of columns
const char* title //!< starting titlebar text
);
/* resize
* resize the window & pad, in the case of terminal resizing */
void resize(int starty, int startx, int lines, int cols);
//! Resize the window & pad, in the case of terminal resizing.
void resize(int starty, //!< starting y coord of pane
int startx, //!< starting x coord of pane
int lines, //!< new number of lines
int cols //!< new number of columns
);
/* setTitle
* sets the title of the window & truncates if too long */
void setTitle(const char* newtitle);
//! Sets the title of the window & truncates if too long.
void setTitle(const char* newtitle //!< the new title to set
);
/* loadText
* Loads text into the panel. */
void loadText(const char* stext);
//! Have a pane display a string of text.
void loadText(const char* stext //!< the text to load
);
/* redraw
* Update the window whenever there is a change to make. Optionally takes a
* boolean that will refresh the outer window border */
void redraw(bool borders = false);
//! When the window changes, put them on the screen.
void redraw(bool borders = false /*!< Optional. If true, will refresh the
* window outer border. */
);
/* pagination functions - move up or down a line or a page in the window */
//! Move down a page in the window.
void nextPage();
//! Move down a line in the window.
void scrollDown();
//! Move up a line in the window.
void scrollUp();
//! Move up a page in the window.
void prevPage();
/* toggleFocus
* Toggles whether the pane has focus. Will refresh the window titlebar. */
//! Toggles whether the pane has focus. Will refresh the window titlebar.
void toggleFocus();
/* loadMenu
* given an option list, create a menu and return the selected list index */
int loadMenu(starray opts);
/*! Have a pane display a generated menu for user selection.
* \returns integer index of selected item,
* -1 if escaping out,
* -2 if terminal was resized */
int loadMenu(starray opts //!< the array of strings used as menu items
);
/* loadForm
* given an array of strings, and an instruction line, create a form and
* return the entered text - will return with starray.length = 0 if user
* backs out */
starray loadForm(starray inputs, const char* secondinst);
/*! Have the pane display a form for user input.
* \returns a list of strings of user input, with starray.length = the
* length of input fields if successful, 0 if the user escaped out,
* and -1 if the terminal was resized */
starray loadForm(starray inputs, //!< list of form item descriptions
const char* secondinst //!< instruction line for top of form
);
/* menuclean
* given a menu, list of items, and number of items, unpost & free up
* allocated memory */
void menuClean(MENU* menu, ITEM** items, int numitems);
//! Unpost a menu and free up all allocated memory for it.
void menuClean(MENU* menu, //!< the menu that was loaded
ITEM** items, //!< the array of menu items
int numitems //!< the number of menu items
);
/* formClean
* given a form, fields, and number of fields, free up allocated memory */
void formClean(FORM* form, FIELD** fields, int numfields);
//! Clean up a loaded form, freeing up all allocated memory
void formClean(FORM* form, //!< the form that was loaded
FIELD** fields, //!< the array of form fields
int numfields //!< the number of form fields
);
/* setModule
* change the module associated with this pane - stores the module index
* and switches the pane title to be something else */
void setModule(const char* newtitle, const char* newmod, int keytype);
/*! Change the module associated with this pane - stores the module index
* and switches the pane title to be something else. */
void setModule(const char* newtitle, //!< the new titlebar for this pane
const char* newmod, //!< the new module to load in modkey
int keytype /*!< indicates how the module is keyed,
* see modkey in scabbard.h */
);
/* setKey
* change the searchkey associated with this pane */
void setKey(const char* newkey);
//! Change the searchkey associated with this pane.
void setKey(const char* newkey //!< the new searchkey to assign into modkey
);
/* setSearch
* set the search parameters stored in the modkey for this pane */
void setSearch(int type, const char* scope);
//! Set the search parameters stored in the modkey for this pane.
void setSearch(int type, /*!< the search type int used by Sword:
* 0 - word or part
* 1 - phrase
* 2 - multiple words
* 3 - attribute (eg. Strongs) */
const char* scope //!< scope to search within, in key format
);
/* getModkey
* gets the modkey associated with this pane */
/*! Gets the modkey associated with this pane.
* \returns modkey associated with this pane */
modkey getModkey();
};

View File

@ -1,4 +1,20 @@
// Part of the Scriptura program
// Copyright 2021, Paul Mosier
//
// This file is part of Scriptura, a ncurses-based Bible study
// software for the libsword backend.
//
// Scriptura is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, under version 2 of the License.
//
// Scriptura is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Scriptura. If not, see <https://www.gnu.org/licenses/>.
// scabbard.cpp - manage interface to Sword
// it's funny, right?

View File

@ -1,4 +1,20 @@
// Part of the Scriptura program
// Copyright 2021, Paul Mosier
//
// This file is part of Scriptura, a ncurses-based Bible study
// software for the libsword backend.
//
// Scriptura is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, under version 2 of the License.
//
// Scriptura is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Scriptura. If not, see <https://www.gnu.org/licenses/>.
// scabbard.h -- header for Scabbard
@ -25,85 +41,92 @@
#include "free.h"
// structure for associating a Sword module type to a list of modules
typedef struct modstruct {
char label[25]; // the module type
int keytype; // 0 - versekey, 1 - treekey, 2 - direct
int modlen; // length of module list
sword::SWModule ** modlist; // list of modules
//! Structure for associating a Sword module type to a list of modules.
typedef struct {
char label[25]; //!< the module type
int keytype; //!< 0 - versekey, 1 - treekey, 2 - direct/alpha
int modlen; //!< length of module list
sword::SWModule ** modlist; //!< list of modules
} modtype;
// scabbard - handles our interface to the Sword library
//! Handles the interface to the Sword library.
class scabbard {
// Sword-specific data structures
//! Sword manager structure
sword::SWMgr swrd;
sword::ModMap::iterator iter;
/* module data fields of interest
/*! Sword iterator for module parsing.
* Module data fields of interest:
* name - internal name
* description - full text name
* type - class of module */
sword::ModMap::iterator iter;
int nummods; // number of module types that contain modules
int nummods; //!< number of module types that contain modules
int markred; //!< flag for returning red letter output
int markstrongs; //!< flag for returning Strong's numbers
int markfoot; //!< flag for returning footnotes
// flags for various forms of markup for output text
int markred;
int markstrongs;
int markfoot;
/*! Parse a list of verses (Gen 1:1,3; Eph 1:5-10, etc)
* \returns the full text of the verses requested as one long string */
const char* parseVerses(sword::SWModule *text, //!< the source to reference
sword::ListKey lk //!< list of verses to get
);
/* parseVerses
* given a ListKey, parse it and return the text of the passages
* contained therein */
const char* parseVerses(sword::SWModule *text, sword::ListKey lk);
/* directSearch
* for modules not keyed to verse, return the closest (or exact) match in
* the module to the search term specified in modkey */
const char* directSearch(sword::SWModule *text, modkey mod);
/*! Helper to the search function for non-versekeyed modules.
* \returns the closest (or exact) match to a search term */
const char* directSearch(sword::SWModule *text,
//!< the module to search on
modkey mod
//!< modkey containing the search term
);
public:
/* constructor - takes as input various preferences on text markup from
* our config file */
//! Takes as input various preferences on text markup from our config file
scabbard();
/* struct to hold listing of different modules - each modtype corresponds
* to a different type of module - see comments above */
/*! Struct to hold listing of different modules - each modtype corresponds
* to a different type of module - see comments for modtype */
modtype modules[4];
/* getModClassifications
* returns the list of the module types known to the system */
/*! Get all module types loaded in and accessible by Sword.
* \returns the module types loaded into an array */
starray getModClassifications();
/* getModDescriptions
* given an integer index from getModClassification, return the module
* descriptions for all modules of that type */
starray getModDescriptions(int type);
/*! Get the full text names of all modules of a given type (Bibles,
* commentaries, etc.)
* \returns all module text names in an array */
starray getModDescriptions(int type //!< from getModClassifications()
);
/* getModName
* given integer indices from getModClassifications and getModDescriptions,
* return the module name for the module in question */
const char* getModName(int modt, int mod);
/*! Get the internal module name for a specific module.
* \returns the name requested */
const char* getModName(int modt, //!< from getModClassifications()
int mod //!< from getModDescriptions()
);
/* getModDescription
* given integer indices from getModClassifications and getModDescriptions,
* return the module description for the module */
const char* getModDescription(int modt, int mod);
/*! Get the full text name for a module.
* \returns the module description */
const char* getModDescription(int modt, //!< from getModClassifications()
int mod //!< from getModDescriptions()
);
/* getKeyType
* given an integer index from getModClassifications, return the flag for
* which key type for searching we're supposed to use */
int getKeyType(int modt);
/*! Determine how a module is keyed/indexed.
* \returns the proper keytype; see the keytype field for modkey */
int getKeyType(int modt //!< return value from getModClassifications()
);
/* getSpan
* given a modkey, return the chapter containing the passage */
const char* getSpan(modkey mod);
/*! Do a passage or text lookup.
* \returns the passage or text referenced in the modkey */
const char* getSpan(modkey mod //!< the modkey supplied by the pane
);
/* search
* given a modkey containing a search term, return the search results */
const char* search(modkey mod);
/*! Search for a term or passage.
* \returns the text requested, or in the case of a non-versekeyed text,
* the nearest alphabetical entry to the search term supplied */
const char* search(modkey mod //!< the modkey supplied by the pane
);
};

View File

@ -1,5 +1,19 @@
/* Scriptura - ncurses based Bible study software using libsword
* Authored by Paul Mosier */
// Copyright 2021, Paul Mosier
//
// This file is part of Scriptura, a ncurses-based Bible study
// software for the libsword backend.
//
// Scriptura is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, under version 2 of the License.
//
// Scriptura is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Scriptura. If not, see <https://www.gnu.org/licenses/>.
// system
#include <stdio.h>
@ -28,12 +42,12 @@ int panelength, panewidth;
sword::SWConfig config;
// refresh every portion of a list of panes we are given
//! Refresh every portion of a list of panes we are given.
void wipeit(pane* panes) {
for (int i = 0; i < NUMPANES; i++) panes[i].redraw(true);
}
// display a form field
//! Display a form field.
starray showForm(const char* title, starray inputs, const char* secondinst,
int floaty, int floatx, int floatheight, int floatwidth) {
// pull up the floating form
@ -44,7 +58,7 @@ starray showForm(const char* title, starray inputs, const char* secondinst,
return ret;
}
// save the config array -- we abstract this out in case this changes
//! Save the config array -- we abstract this out in case this changes.
void saveit(char* configfile) {
/* This is clumsy but we have to use this particular constructor for
* config() so we can save to disk. The global config object uses a
@ -54,7 +68,7 @@ void saveit(char* configfile) {
newconfig.save();
}
// set various standard screen landmarks
//! Set various standard screen landmarks.
void landmarks() {
// place background text
mvprintw(LINES - 1 , COLS - 20, "%s", "? - help q - quit");
@ -86,7 +100,7 @@ void landmarks() {
}
}
// resize the standard screen
//! Resize the standard screen.
void doresize(pane* p) {
// terminal window was resized
clear();
@ -337,9 +351,10 @@ int main(int argc, char** argv) {
starray inst;
inst = stinit(inst);
/* these happen to be in the same order as the integer key used
* by Sword to determine the search type, and this may be
* subject to breakage if those integer values change */
/* NOTE -- these happen to be in the same order as the
* integer key used by Sword to determine the search type,
* and this may be subject to breakage if those integer values
* change */
inst = stappend(inst, "Search for this word or part:");
inst = stappend(inst, "Search for this phrase:");
inst = stappend(inst, "Search for multiple words:");