_export p4char*
p4_header_comma (const char *name, int len, p4_Wordl *wid)
{
int hc;
# if defined PFE_WTIH_FFA || defined PFE_WITH_FIG
# define p4_ZNAMES_ALLOWED 0
# else
# define p4_ZNAMES_ALLOWED 0
# endif
if (len == 0)
p4_throw (P4_ON_ZERO_NAME);
if (len > NFACNTMAX || len > (1 << CHAR_BIT)-1)
if (! p4_ZNAMES_ALLOWED)
{
P4_fail2 ("nametoolong: '%.*s'" , len, name);
p4_throw (P4_ON_NAME_TOO_LONG);
}
if (REDEFINED_MSG && p4_search_wordlist (name, len, CURRENT))
p4_outf ("\n\"%.*s\" is redefined " , len, name);
#if defined PFE_WITH_FFA
DP += 2; DP += len; FX (p4_align);
memmove (DP-len, name, len);
LAST = DP-len -1;
*LAST = len;
LAST[-1] = '\x80' ;
#elif defined PFE_WITH_FIG
DP += 1; DP += len; FX (p4_align);
memmove (DP-len, name, len);
LAST = DP-len -1;
*LAST = len;
*LAST |= '\x80' ;
#else
LAST = DP++;
if (name != DP) memcpy(DP, name, len);
*LAST = len;
if (p4_ZNAMES_ALLOWED && *LAST != len) { *LAST = 0; DP[len] = 0; len++; }
*LAST |= '\x80' ;
DP += len; FX (p4_align);
#endif
hc = (wid->flag & WORDL_NOHASH) ? 0 : p4_wl_hash (LAST+1, len);
FX_PCOMMA (wid->thread[hc]);
wid->thread[hc] = LAST;
return LAST;
} |