From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Macdonald To: Bob Manson Cc: gnats-devel@sourceware.cygnus.com, bug-gnats@gnu.org, Tony Parent Subject: gnatsd accepting new PRs Date: Mon, 23 Aug 1999 10:58:00 -0000 Message-id: References: <199908231738.KAA09737@tristam.juniper.net> X-SW-Source: 1999-q3/msg00014.html Bob - back in April, Tony Parent contributed a patch to allow gnatsd to accept new PRs directly. This is a feature that everyone has wanted for a long long time. One benefit is that front-ends can notify the user immediately of the new PR number. I don't suppose that this ever got picked up? The patch probably wouldn't match your new code now. Here are the notes that Tony last sent, just to give you an idea of what was done. I have the "version 3" of the actual patch, if you want it. I never installed the patch itself, but I gave a little bit of feedback to the first couple of attempts to help Tony as he was doing it. --- snip --- Here is version 3 of a patch to gnats-3.110 that changes gnatsd so that it can create new PR's directly. It adds a new command to gnatsd "crte" that takes a PR text followed by a "." on a line by itself. The basic difference from version 2 of this patch is that I no longer use setjmp/longjmp in punt(). The code is still in there, but is turned off for now via a #ifdef. I left the setjmp/longjmp in just in case. You may discard this if you don't want it. Not using setjmp/longjmp makes the gnats() function in file-pr.c more convuluted, but hopefully more portable. Procedure: - Check for db lock. -- print error and return if locked - Lock db if unlocked. - Read in text. - Call gnats() function from file-pr to create new PR - Unlock db. - Print out PR number. (Return PR # to client.) Some things I had to change: Makefile -- to add file-pr.o to gnatsd cmds.c -- to add the command. Other changes in this file include a quite flag so reset and unlock don't print out stuff if an error occured, and the addition of the crte command to the help function. file-pr -- Changed the function "gnats()" to return an integer. This is the new PR number or -1 if none. It used to return void so all previous calls will simply discard this value. Therefore this should be safe. gnatsd.c -- Added the command to the list of possible commands. ...RickM...