stab.c (d0cef73d40a409e3116f095b83633b1364e95741) stab.c (ba00ec3d539f213abbda3a45ef8c539306cac098)
1/*
2 * Copyright (c) 1998-2001, 2003 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
11 *
12 */
13
14#include <sendmail.h>
15
1/*
2 * Copyright (c) 1998-2001, 2003 Sendmail, Inc. and its suppliers.
3 * All rights reserved.
4 * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved.
5 * Copyright (c) 1988, 1993
6 * The Regents of the University of California. All rights reserved.
7 *
8 * By using this file, you agree to the terms and conditions set
9 * forth in the LICENSE file which can be found at the top level of
10 * the sendmail distribution.
11 *
12 */
13
14#include <sendmail.h>
15
16SM_RCSID("@(#)$Id: stab.c,v 8.89 2006/08/15 23:24:58 ca Exp $")
16SM_RCSID("@(#)$Id: stab.c,v 8.91 2011/08/08 17:33:34 ca Exp $")
17
18/*
19** STAB -- manage the symbol table
20**
21** Parameters:
22** name -- the name to be looked up or inserted.
23** type -- the type of symbol.
24** op -- what to do:

--- 35 unchanged lines hidden (view full) ---

60 hfunc = type;
61 for (p = name; *p != '\0'; p++)
62 hfunc = ((hfunc << 1) ^ (SM_LOWER(*p) & 0377)) % STABSIZE;
63
64 if (tTd(36, 9))
65 sm_dprintf("(hfunc=%d) ", hfunc);
66
67 ps = &SymTab[hfunc];
17
18/*
19** STAB -- manage the symbol table
20**
21** Parameters:
22** name -- the name to be looked up or inserted.
23** type -- the type of symbol.
24** op -- what to do:

--- 35 unchanged lines hidden (view full) ---

60 hfunc = type;
61 for (p = name; *p != '\0'; p++)
62 hfunc = ((hfunc << 1) ^ (SM_LOWER(*p) & 0377)) % STABSIZE;
63
64 if (tTd(36, 9))
65 sm_dprintf("(hfunc=%d) ", hfunc);
66
67 ps = &SymTab[hfunc];
68 if (type == ST_MACRO || type == ST_RULESET)
68 if (type == ST_MACRO || type == ST_RULESET || type == ST_NAMECANON)
69 {
70 while ((s = *ps) != NULL &&
71 (s->s_symtype != type || strcmp(name, s->s_name)))
72 ps = &s->s_next;
73 }
74 else
75 {
76 while ((s = *ps) != NULL &&

--- 31 unchanged lines hidden (view full) ---

108
109 /* determine size of new entry */
110 switch (type)
111 {
112 case ST_CLASS:
113 len = sizeof(s->s_class);
114 break;
115
69 {
70 while ((s = *ps) != NULL &&
71 (s->s_symtype != type || strcmp(name, s->s_name)))
72 ps = &s->s_next;
73 }
74 else
75 {
76 while ((s = *ps) != NULL &&

--- 31 unchanged lines hidden (view full) ---

108
109 /* determine size of new entry */
110 switch (type)
111 {
112 case ST_CLASS:
113 len = sizeof(s->s_class);
114 break;
115
116 case ST_ADDRESS:
117 len = sizeof(s->s_address);
118 break;
119
120 case ST_MAILER:
121 len = sizeof(s->s_mailer);
122 break;
123
124 case ST_ALIAS:
125 len = sizeof(s->s_alias);
126 break;
127

--- 348 unchanged lines hidden ---
116 case ST_MAILER:
117 len = sizeof(s->s_mailer);
118 break;
119
120 case ST_ALIAS:
121 len = sizeof(s->s_alias);
122 break;
123

--- 348 unchanged lines hidden ---