Article View: news.software.readers
Article #27352Adding a new SLANG intrinsic function
From: Vikas Agnihotri
Date: Thu, 31 Oct 1996 00:00
Date: Thu, 31 Oct 1996 00:00
62 lines
2224 bytes
2224 bytes
After a suggestion from John, I have extended the slang intrinsics available
to SLRN as follows:
+ used the HEADER_NTAGGED definition already available to define it for use
in the interpreter by adding it to interp.c
+ Mimicked the code for the tag_header() and prev_tagged_header(), next_tagged_header()
intrinsic functions by adding code to ntag_header(), prev_ntagged_header(),
next_ntagged_header, etc.
Added the appropriate function prototypes, etc to make the code compile.
+ Used the % key to numerically tag the subjects with a reg-exp. I get the
message '110 headers tagged' from my slang.sl file. But I dont see
the header display updated to show the 'numerically' tagged headers like I see
when I manually 'tag' the headers with '#'.
Also when I use the ']' and '[' keys , it says 'No more tagged headers'...
What am I doing wrong? I am attaching the relevant files and functions that I
changed.
Thanks,
--Vikas
vikas@insight.att.com
-----
In interp.c
static int Interp_Header_NTagged = HEADER_NTAGGED;
etc.
MAKE_VARIABLE(".HEADER_NTAGGED", &Interp_Header_NTagged, INT_TYPE, 1),
etc.
MAKE_INTRINSIC(".next_ntagged_header", slrn_next_ntagged_header, INT_TYPE, 0)
etc
----
-------
In art.c
int slrn_next_ntagged_header (void) /*{{{*/
{
Slrn_Header_Type *h = Slrn_Current_Header;
if (h == NULL) return 0;
while (h->next != NULL)
{
h = h->next;
if (h->flags & HEADER_NTAGGED)
{
slrn_goto_header (h, 0);
return 1;
}
}
return 0;
}
------
You get the idea, right...
Technical Details
Message-ID:
<slrn57i5vp.j1h.vikas@joshua.insight.att.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <slrn57i5vp.j1h.vikas@joshua.insight.att.com> Subject: Adding a new SLANG intrinsic function Date: Thu, 31 Oct 1996 00:00:00 +0000 From: vikas@insight.att.com (Vikas Agnihotri) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.readers.mbox.zip!not-for-mail X-Deja-AN: 194346239 Organization: AT&T Bell Laboratories, Murray Hill, NJ 07974 Reply-to: vikas@insight.att.com Newsgroups: news.software.readers