# 2.11BSD#431 - /usr/ingres/source/access/setkey.c

##### Functions

    clearkeys         X
    setkey            X

       1: # include   "../ingres.h"
       2: # include   "../symbol.h"
       3:
       4: /*
       5: **	Clearkeys - reset all key indicators in descriptor
       6: **
       7: **	Clearkeys is used to clear the key supplied
       8: **	flags before calls to setkey
       9: */
      10:
      11:
      12: clearkeys(des)
      13: struct descriptor   *des;
      14: {
      15:     register struct descriptor  *d;
      16:     register int            i;
      17:
      18:     d = des;
      19:     for (i = 0; i <= d->relatts; i++)
      20:         d->relgiven[i] = 0;
      21:     return (0);
      22: }
      23:
      24: /*
      25: **	Setkey - indicate a partial key for find
      26: **
      27: **	Setkey is used to set a key value into place
      28: **	in a key. The key can be as large as the entire
      29: **	tuple. Setkey moves the key value into the
      30: **	proper place in the key and marks the value as
      31: **	supplied
      32: **
      33: **	If the value is a null pointer, then the key is
      34: **	cleared.
      35: **
      36: **	Clearkeys should be called once before the
      37: **	first call to setkey.
      38: **
      39: */
      40:
      41: setkey(d1, key, value, domnum)
      42: struct descriptor   *d1;
      43: char            *key;
      44: char            *value;
      45: int         domnum;
      46:
      47: {
      48:     register struct descriptor  *d;
      49:     register int            dom, len;
      50:     char                *cp;
      51:
      52:     d = d1;
      53:     dom = domnum;
      54:
      55: #	ifdef xATR1
      56:     if (tTf(96, 0))
      57:         printf("setkey: %.14s, %d\n", d->relid, dom);
      58: #	endif
      59:
      60:     /* check validity of domain number */
      61:     if (dom < 1 || dom > d->relatts)
      62:         syserr("setkey:rel=%.12s,dom=%d", d->relid, dom);
      63:
      64:     /* if value is null, clear key */
      65:     if (value == 0)
      66:     {
      67:         d->relgiven[dom] = 0;
      68:         return;
      69:     }
      70:
      71:     /* mark as given */
      72:     d->relgiven[dom] = 1;
      73:
      74:     len = d->relfrml[dom] & I1MASK;
      75:     cp = &key[d->reloff[dom]];
      76:
      77:     if (d->relfrmt[dom] == CHAR)
      78:         pmove(value, cp, len, ' ');
      79:     else
      80:         bmove(value, cp, len);
      81: }

#### Defined functions

clearkeys defined in line 12; used 41 times

- in /usr/ingres/source/access/opencatalog.c line 114
- in /usr/ingres/source/access/openr.c line 122, 185, 226
- in /usr/ingres/source/dbu/display.c line 304
- in /usr/ingres/source/dbu/get_seq_atts.c line 50
- in /usr/ingres/source/dbu/modify.c line 213, 966, 987
- in /usr/ingres/source/dbu/pr_prot.c line 141
- in /usr/ingres/source/dbu/pr_tree.c line 239
- in /usr/ingres/source/dbu/readtree.c line 300
- in /usr/ingres/source/dbu/rmqm.c line 387, 675, 733
- in /usr/ingres/source/dbu/save.c line 122
- in /usr/ingres/source/dbu/userdestroy.c line 66, 73, 98
- in /usr/ingres/source/ovqp/key.c line 204
- in /usr/ingres/source/parser/attfcn.c line 68
- in /usr/ingres/source/parser/xdot.c line 40
- in /usr/ingres/source/qrymod/readtree.c line 321
- in /usr/ingres/source/support/creatdb.c line 1633
- in /usr/ingres/source/support/purge.c line 201
- in /usr/ingres/source/support/restore.c line 329, 339, 384, 545, 569, 613, 629, 694, 739, 783, 822, 837, 921, 935, 1008, 1022

setkey defined in line 41; used 132 times

- in /usr/ingres/source/access/batch.c line 102-103(2)
- in /usr/ingres/source/access/openr.c line 191-197(3), 233-234(2)
- in /usr/ingres/source/dbu/copy.c line 676-677(2)
- in /usr/ingres/source/dbu/destroy.c line 84-88(3)
- in /usr/ingres/source/dbu/display.c line 305-306(2)
- in /usr/ingres/source/dbu/get_p_tid.c line 57-58(2)
- in /usr/ingres/source/dbu/get_seq_atts.c line 51-52(2)
- in /usr/ingres/source/dbu/help.c line 320-321(2), 337-338(2)
- in /usr/ingres/source/dbu/index.c line 88-89(2), 100, 201-202(2)
- in /usr/ingres/source/dbu/modify.c line 309-310(2), 340, 967-968(2), 988-989(2)
- in /usr/ingres/source/dbu/modupdate.c line 142-143(2), 157-158(2)
- in /usr/ingres/source/dbu/pr_prot.c line 142-143(2)
- in /usr/ingres/source/dbu/pr_tree.c line 240-241(2)
- in /usr/ingres/source/dbu/purgetup.c line 27-28(2)
- in /usr/ingres/source/dbu/readtree.c line 301-305(5)
- in /usr/ingres/source/dbu/rmqm.c line 383-389(5), 536, 595, 676-677(2), 734-735(2)
- in /usr/ingres/source/dbu/save.c line 123-124(2)
- in /usr/ingres/source/dbu/secupdate.c line 40-41(2), 101, 112
- in /usr/ingres/source/dbu/userdestroy.c line 56-57(2), 67-68(2), 74-75(2), 88-89(2)
- in /usr/ingres/source/decomp/reformat.c line 495-496(2)
- in /usr/ingres/source/ovqp/key.c line 236
- in /usr/ingres/source/ovqp/strategy.c line 90-91(2)
- in /usr/ingres/source/parser/attfcn.c line 69-71(3)
- in /usr/ingres/source/parser/xdot.c line 42-43(2)
- in /usr/ingres/source/qrymod/d_integ.c line 181-182(2)
- in /usr/ingres/source/qrymod/d_prot.c line 237-238(2), 268-272(3)
- in /usr/ingres/source/qrymod/define.c line 225-230(4)
- in /usr/ingres/source/qrymod/integrity.c line 126-127(2)
- in /usr/ingres/source/qrymod/protect.c line 482-483(2)
- in /usr/ingres/source/qrymod/readtree.c line 322-326(5)
- in /usr/ingres/source/support/creatdb.c line 1634
- in /usr/ingres/source/support/purge.c line 202-203(2)
- in /usr/ingres/source/support/restore.c line 340-341(2), 546-547(2), 570-571(2), 614-615(2), 630-631(2), 695-697(3), 740-743(3), 784-787(3), 838-839(2), 936-937(2), 1023-1024(2)

Last modified: 1980-12-17 Generated: 2016-12-26 | Generated by src2html V0.67 page hit count: 528 |