From cbadcb46e4898cb46ad9b49dba8cc4fc789a164a Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Mon, 12 Aug 1996 14:10:34 +0000 Subject: [PATCH] New function p_query_attset to define default attribute set. --- util/Makefile | 4 ++-- util/pquery.c | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/util/Makefile b/util/Makefile index 1439bf0..04c6c1a 100644 --- a/util/Makefile +++ b/util/Makefile @@ -1,7 +1,7 @@ -# Copyright (C) 1994, Index Data I/S +# Copyright (C) 1994-1996, Index Data I/S # All rights reserved. # Sebastian Hammer, Adam Dickmeiss -# $Id: Makefile,v 1.20 1996-05-22 08:36:07 adam Exp $ +# $Id: Makefile,v 1.21 1996-08-12 14:10:34 adam Exp $ SHELL=/bin/sh INCLUDE=-I../include -I. diff --git a/util/pquery.c b/util/pquery.c index e57b2a1..d0709b0 100644 --- a/util/pquery.c +++ b/util/pquery.c @@ -1,10 +1,13 @@ /* - * Copyright (c) 1995, Index Data. + * Copyright (c) 1995-1996, Index Data. * See the file LICENSE for details. * Sebastian Hammer, Adam Dickmeiss * * $Log: pquery.c,v $ - * Revision 1.9 1996-03-15 11:03:46 adam + * Revision 1.10 1996-08-12 14:10:35 adam + * New function p_query_attset to define default attribute set. + * + * Revision 1.9 1996/03/15 11:03:46 adam * Attribute set can be set globally for a query with the @attrset * operator. The @attr operator has an optional attribute-set specifier * that sets the attribute set locally. @@ -44,6 +47,8 @@ #include +static oid_value p_query_dfset = VAL_NONE; + static const char *query_buf; static const char *query_lex_buf; static int query_lex_len; @@ -332,6 +337,8 @@ Z_RPNQuery *p_query_rpn (ODR o, oid_proto proto, const char *qbuf) lex (); } if (topSet == VAL_NONE) + topSet = p_query_dfset; + if (topSet == VAL_NONE) topSet = VAL_BIB1; oset.proto = proto; oset.oclass = CLASS_ATTSET; @@ -368,6 +375,8 @@ Z_AttributesPlusTerm *p_query_scan (ODR o, oid_proto proto, lex (); } if (topSet == VAL_NONE) + topSet = p_query_dfset; + if (topSet == VAL_NONE) topSet = VAL_BIB1; oset.proto = proto; oset.oclass = CLASS_ATTSET; @@ -409,3 +418,9 @@ Z_AttributesPlusTerm *p_query_scan (ODR o, oid_proto proto, return rpn_term (o, proto, num_attr, attr_list, attr_set); } +int p_query_attset (const char *arg) +{ + p_query_dfset = oid_getvalbyname (arg); + return (p_query_dfset == VAL_NONE) ? -1 : 0; +} + -- 1.7.10.4