home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / database / postgres / postgre4.z / postgre4 / src / access / common / scankey.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-08-27  |  1.7 KB  |  70 lines

  1. /* ----------------------------------------------------------------
  2.  *   FILE
  3.  *    scan.c
  4.  *    
  5.  *   DESCRIPTION
  6.  *    scan direction and key code
  7.  *
  8.  *   INTERFACE ROUTINES
  9.  *    
  10.  *   NOTES
  11.  *    
  12.  *   IDENTIFICATION
  13.  *    $Header: /private/postgres/src/access/common/RCS/scankey.c,v 1.4 1992/02/24 19:46:33 mer Exp $
  14.  * ----------------------------------------------------------------
  15.  */
  16.  
  17. #include "tmp/c.h"
  18. #include "access/sdir.h"
  19. #include "access/attnum.h"
  20. #include "access/skey.h"
  21.  
  22. RcsId("$Header: /private/postgres/src/access/common/RCS/scankey.c,v 1.4 1992/02/24 19:46:33 mer Exp $");
  23.  
  24. /*
  25.  *    ScanDirectionIsValid, ScanDirectionIsBackward
  26.  *    ScanDirectionIsNoMovement, ScanDirectionIsForward
  27.  *        .. are now macros in sdir.h
  28.  *
  29.  *    ScanKeyIsValid, ScanKeyEntryIsValid, ScanKeyEntryIsLegal
  30.  *        .. are now macros in skey.h -cim 4/27/91
  31.  */
  32.  
  33. /* ----------------
  34.  *    ScanKeyEntrySetIllegal
  35.  * ----------------
  36.  */
  37. void
  38. ScanKeyEntrySetIllegal(entry)
  39.     ScanKeyEntry    entry;
  40. {
  41.     Assert(ScanKeyEntryIsValid(entry));
  42.  
  43.     entry->flags = 0;    /* just in case... */
  44.     entry->attributeNumber = InvalidAttributeNumber;
  45.     entry->procedure = 0;    /* should be InvalidRegProcedure */
  46. }
  47.  
  48. /* ----------------
  49.  *    ScanKeyEntryInitialize
  50.  * ----------------
  51.  */
  52. void
  53. ScanKeyEntryInitialize(entry, flags, attributeNumber, procedure, argument)
  54.     ScanKeyEntry    entry;
  55.     bits16        flags;
  56.     AttributeNumber    attributeNumber;
  57.     RegProcedure    procedure;
  58.     Datum        argument;
  59. {
  60.     Assert(ScanKeyEntryIsValid(entry));
  61.  
  62.     entry->flags = flags;
  63.     entry->attributeNumber = attributeNumber;
  64.     entry->procedure = procedure;
  65.     entry->argument = argument;
  66.     fmgr_info(procedure, &entry->func, &entry->nargs);
  67.  
  68.     Assert(ScanKeyEntryIsLegal(entry));
  69. }
  70.