X-Git-Url: https://diplodocus.org/git/nmh/blobdiff_plain/1ca8f21e0edfe448b71ac86de1b0cd987547a002..ef0725fd97369e801a56febfdb7a6ec2eaff73c8:/uip/prompter.c diff --git a/uip/prompter.c b/uip/prompter.c index 1564852d..de8b67a8 100644 --- a/uip/prompter.c +++ b/uip/prompter.c @@ -5,11 +5,22 @@ * complete copyright information. */ -#include +#include "h/mh.h" +#include "sbr/m_gmprot.h" +#include "sbr/m_getfld.h" +#include "sbr/getarguments.h" +#include "sbr/smatch.h" +#include "sbr/cpydata.h" +#include "sbr/m_atoi.h" +#include "sbr/context_save.h" +#include "sbr/ambigsw.h" +#include "sbr/print_version.h" +#include "sbr/print_help.h" +#include "sbr/error.h" #include -#include +#include "h/signals.h" #include "h/done.h" -#include +#include "h/utils.h" #include "sbr/m_mktemp.h" #include @@ -42,7 +53,7 @@ DEFINE_SWITCH_ARRAY(PROMPTER, switches); static struct termios tio; static bool wtuser; -static int sigint = 0; +static bool sigint; static jmp_buf sigenv; /* @@ -57,8 +68,11 @@ static void intrser (int); int main (int argc, char **argv) { - int body = 1, prepend = 1, rapid = 0; - int doteof = 0, fdi, fdo, i, state; + bool body = true; + bool prepend = true; + bool rapid = false; + bool doteof = false; + int fdi, fdo, i, state; char *cp, *drft = NULL, *erasep = NULL; char *killp = NULL, name[NAMESZ], field[NMH_BUFSIZ]; char buffer[BUFSIZ]; @@ -100,31 +114,31 @@ main (int argc, char **argv) continue; case PREPSW: - prepend++; + prepend = true; continue; case NPREPSW: - prepend = 0; + prepend = false; continue; case RAPDSW: - rapid++; + rapid = true; continue; case NRAPDSW: - rapid = 0; + rapid = false; continue; case BODYSW: - body++; + body = true; continue; case NBODYSW: - body = 0; + body = false; continue; case DOTSW: - doteof++; + doteof = true; continue; case NDOTSW: - doteof = 0; + doteof = false; continue; } } else { @@ -177,7 +191,7 @@ main (int argc, char **argv) tio.c_cc[VERASE] = save_erase; } - sigint = 0; + sigint = false; SIGNAL2 (SIGINT, intrser); /* @@ -379,7 +393,7 @@ intrser (int i) if (wtuser) longjmp (sigenv, NOTOK); - sigint++; + sigint = true; }