Document my Wysiwyg hook: `reload on signal' for 12.0-CURRENT I have swapped chimera/chimera.man to src/chimera.man I dont know if that will be appropriate for older # *** src/main.c.orig Mon Sep 29 03:33:24 1997 # --- src/main.c Sun Feb 14 16:04:24 1999 # *************** # *** 59,64 **** # --- 59,67 ---- # int argc; # char **argv; # { # + extern int optind; # + int ch ; # + # char base_url[255]; # # signal(SIGINT, sigigh_handler); *** src/main.c.Orig Thu Dec 1 22:52:21 2016 --- src/main.c Thu Dec 1 22:53:03 2016 *************** *** 223,228 **** --- 223,231 ---- int argc; char **argv; { + extern int optind; + int ch + Arg args[2]; char *first; Document *d; *** src/main.c.orig Mon Sep 29 03:33:24 1997 --- src/main.c Sun Feb 14 16:04:24 1999 *************** *** 67,72 **** --- 70,105 ---- signal(SIGTERM, sigigh_handler); signal(SIGPIPE, SIG_IGN); + while ((ch = getopt(argc, argv, "sp")) != EOF) + switch(ch) + { + case 's': /* should extend this to accept --[no]reopen_sig + as in ghostview */ + /* reload on SIGUSR1 */ + /* JJLATER root.reopenSig = True ; */ + break; + case 'p': /* should extend this to accept --[no]pid_report + as in ghostview */ + /* print process number */ + /* JJLATER root.pidReport = True ; */ + break; + case '?': + default: + /* usage(); */ + exit(-1); + break; + } + /* optind starts at 1, thus with chimera -s -p fred.html, optind=3 */ + argc -= (optind -1) ; + *(argv + (optind -1)) = *argv ; /* copy "chimera" for display above window */ + argv += (optind -1) ; + + /* Ignore any unexpectedly early SIGUSR1, though as we've not reported + * our process id yet, it'll be hard for someone to find, except with + * ps(1). + */ + /* if JJLATER (root.reopenSig) signal(SIGUSR1,SIG_IGN); */ + StartReaper(); globalcres = ResourcesCreate(argc, argv); ## next bit fails to apply to 4.4 ## *************** ## *** 82,87 **** ## --- 115,200 ---- ## if (argc > 1) HeadCreate(globalcres, ## RequestCreate(globalcres, argv[1], base_url), NULL); ## else HeadCreate(globalcres, NULL, NULL); ## + ## + #if 0 ## + # This jhs patch from chimera 1 is not yet ported to chimera-2 ## + # ==================== ## + # *************** ## + # *** 193,198 **** ## + # offset(openButtonShortcut), XtRImmediate, (XtPointer)True }, ## + # { "localIndexFiles", "LocalIndexFiles", XtRString, sizeof(char *), ## + # offset(localIndexFiles), XtRString, (XtPointer)"index.html" }, ## + # }; ## + # ## + # static XtActionsRec actionsList[] = ## + # --- 193,202 ---- ## + # offset(openButtonShortcut), XtRImmediate, (XtPointer)True }, ## + # { "localIndexFiles", "LocalIndexFiles", XtRString, sizeof(char *), ## + # offset(localIndexFiles), XtRString, (XtPointer)"index.html" }, ## + # + { "reopenSig", XtCBoolean, XtRBoolean, sizeof(Boolean), ## + # + offset(reopenSig), XtRImmediate, (XtPointer)False }, ## + # + { "pidReport", XtCBoolean, XtRBoolean, sizeof(Boolean), ## + # + offset(pidReport), XtRImmediate, (XtPointer)False }, ## + # }; ## + # ## + # static XtActionsRec actionsList[] = ## + # *************** ## + # *** 252,262 **** ## + # signal(SIGALRM, SIG_IGN); /* changed when necessary in src/net.c */ ## + # signal(SIGPIPE, SIG_IGN); ## + # ## + # StartReaper(); ## + # ## + # root.toplevel = XtAppInitialize(&(root.appcon), "Chimera", NULL, 0, ## + # &argc, argv, fallback_resources, NULL, 0); ## + # if (root.toplevel == 0) exit(1); ## + # ## + # /* ## + # * Grab up the resources. ## + # --- 258,328 ---- ## + # signal(SIGALRM, SIG_IGN); /* changed when necessary in src/net.c */ ## + # signal(SIGPIPE, SIG_IGN); ## + # ## + # StartReaper(); ## + # ## + # root.toplevel = XtAppInitialize(&(root.appcon), "Chimera", NULL, 0, ## + # &argc, argv, fallback_resources, NULL, 0); ## + # if (root.toplevel == 0) exit(1); ## + # + ## + # + /* I would like to do the following ## + # + * if (root.reopenSig == True) and ## + # + * if (root.pidReport == True) ## + # + * much later, in case there is some more ## + # + * initialising that chimera wants to do, but using xxgdb I ## + # + * determined that the call to XtGetApplicationResources zeroes ## + # + * root.reopenSig and root.pidReport ## + # + */ ## + # + if (root.reopenSig == True) ## + # + { ## + # + signal(SIGUSR1,ReloadAction) ; ## + # + /* Set signal handling before printing process number, so no one ## + # + * can send a an unexpectd SIGUSR1 that would kill us. ## + # + * I put off accepting first signal while ghostview is presumably ## + # + * initialising stuff that maybe needed for the resize function ## + # + * (that I never wrote, merely grabbed shared use of). ## + # + # I also presume there's not much advantage to accepting ## + # + * a SIGUSR1 reopen till now. ## + # + */ ## + # + } ## + # + if (root.pidReport == True) ## + # + { ## + # + printf("%d\n",(int)(getpid())); ## + # + /* Before I added the flush, when I called this from a makefile, ## + # + * with a vi process about to start, (needing the signal number) ## + # + the pid was printed too late. ## + # + */ ## + # + fflush(stdout); ## + # + } ## + # ## + # /* ## + # * Grab up the resources. ## + # ==================== ## + #endif /* * And away we go... # does not apply to 4.1.1-RELEASE # *** src/widget.h.orig Fri Apr 18 13:18:38 1997 # --- src/widget.h Fri Oct 2 00:13:07 1998 # *************** # *** 68,73 **** # --- 68,75 ---- # Boolean cacheIgnoreExpires; # Boolean openButtonShortcut; /* enable foo.com -> http://foo.com/ shortcut */ # char *localIndexFiles; /* look for index.html etc. in local directories */ # + Boolean reopenSig; # + Boolean pidReport; # # /* # * Private data #============================== # Below is appended the old equivalent for chimera-1.65 # # *** src/chimera.man.orig Sun Jun 18 12:41:48 1995 # --- src/chimera.man Sun Jun 18 16:14:09 1995 # *************** # *** 6,11 **** # --- 6,13 ---- # # .SH SYNOPSIS # .B chimera # + [\-s] [\-p] # + .\" should later extend to allow ghostview syntax: [\-[no]reopen_sig] [\-[no]pid_report] # .RI [ URL ] # # .SH DESCRIPTION # *************** # *** 22,27 **** # --- 24,59 ---- # The usual Xt options like geometry can also be specified on the command # line. # # + .SH OPTIONS # + .IP "\fB-p (\fPclass\fB pidReport)\fP" 1i # + .\" should later extend to allow ghostview syntax: .IP "\fBpid_report (\fPclass\fB PidReport)\fP" 1i # + .\" added by Julian H. Stacey