Lines Matching defs:dp

141 			decl_t	*dp;
148 for (dp = $2; dp && (errstr == NULL);
149 dp = dp->d_next) {
152 decl_AddDS(dp, $1, &errstr);
153 if (sp = decl_Verify(dp))
1298 * 1) The type_t *tp is added to the end of the type_t *dp list.
1302 type_AddTail(type_t *dp, type_t *tp) {
1303 type_t *lastp = dp;
1311 return (dp);
1518 decl_t *dp = malloc(sizeof (decl_t));
1520 assert(dp != NULL);
1522 dp->d_name = NULL;
1523 dp->d_type = NULL;
1524 dp->d_next = NULL;
1525 dp->d_ds = declspec_Construct();
1526 dp->d_ellipsis = 0;
1530 return (dp);
1536 decl_Destroy(decl_t *dp) {
1537 while (dp) {
1538 decl_t *nextp = dp->d_next;
1540 type_Destroy(dp->d_type);
1541 declspec_Destroy(dp->d_ds);
1542 free(dp->d_name);
1543 free(dp);
1545 dp = nextp;
1560 decl_GetArgLength(decl_t *dp) {
1563 for (len = 0; dp; dp = dp->d_next)
1574 decl_GetNext(decl_t *dp) {
1575 return (dp->d_next);
1579 decl_GetDeclSpec(decl_t *dp) {
1580 return (declspec_GetSTT(dp->d_ds));
1584 decl_GetDSName(decl_t *dp) {
1585 return (declspec_GetTag(dp->d_ds));
1589 decl_GetType(decl_t *dp) {
1590 return (dp->d_type);
1594 decl_IsVarargs(decl_t *dp) {
1595 return (dp->d_ellipsis);
1599 decl_IsFunction(decl_t *dp) {
1600 return (type_IsFunction(dp->d_type));
1604 decl_GetName(decl_t *dp) {
1605 return (dp->d_name);
1613 decl_AddArg(decl_t *dp, decl_t *tp) {
1614 decl_t *lastp = dp;
1622 return (dp);
1630 decl_IsVoid(decl_t *dp) {
1631 return ((declspec_GetSTT(dp->d_ds) & TS_VOID) && (dp->d_type == NULL));
1639 decl_IsVoidArray(decl_t *dp) {
1641 type_t *tp = dp->d_type;
1650 (declspec_GetSTT(dp->d_ds) & TS_VOID);
1661 decl_Verify(decl_t *dp) {
1664 if (decl_IsVoid(dp))
1666 else if (decl_IsVoidArray(dp))
1669 ep = type_Verify(dp->d_type);
1679 decl_VerifyArgs(decl_t *dp) {
1680 decl_t *tp = dp;
1683 if (dp) {
1685 int nargs = decl_GetArgLength(dp);
1687 for (; dp; dp = dp->d_next)
1688 if (decl_IsVoid(dp)) {
1691 if (decl_GetName(dp))
1694 } else if (decl_IsVoidArray(dp))
1712 decl_AddDS(decl_t *dp, decl_spec_t *dsp, const char **err) {
1713 declspec_AddDS(dp->d_ds, dsp, err);
1715 return (dp);
1726 decl_SetName(decl_t *dp, char *s) {
1727 free(dp->d_name);
1728 dp->d_name = strdup(s);
1729 assert(dp->d_name != NULL);
1731 return (dp);
1739 decl_AddTypeTail(decl_t *dp, type_t *tp) {
1740 if (dp->d_type)
1741 type_AddTail(dp->d_type, tp);
1743 dp->d_type = tp;
1745 return (dp);
1753 decl_addptr(decl_t *dp, type_t *tp) {
1754 decl_AddTypeTail(dp, tp);
1756 return (dp);
1765 decl_addary(decl_t *dp, char *sizep) {
1769 decl_AddTypeTail(dp, tp);
1771 return (dp);
1780 decl_addfun(decl_t *dp, decl_t *arglist) {
1788 decl_AddTypeTail(dp, tp);
1790 return (dp);
1802 decl_addellipsis(decl_t *dp) {
1803 dp->d_ellipsis = 1;
1805 return (dp);
1811 decl_PrintDecl(decl_t *dp, int lvl) {
1814 while (dp) {
1818 (dp->d_name)? dp->d_name : "<null>",
1819 declspec_ToString(buf, dp->d_ds));
1821 if (dp->d_type)
1822 type_PrintType(dp->d_type, lvl + 1);
1824 dp = dp->d_next;
1838 decl_ToString(char *bufp, decl_dts_t out, decl_t *dp,
1844 type_t *tp = dp->d_type;
1853 namep = dp->d_name;
1952 declspec_ToString(tmp2, dp->d_ds), tmp);
1955 declspec_ToString(tmp2, dp->d_ds), tmp);
1962 decl_AddArgNames(decl_t *dp) {
1964 decl_t *p = dp;
1966 if (decl_IsFunction(dp)) {
1968 decl_t *p = dp->d_type->t_args;
1985 return (dp);
2064 decl_PrintTraceInfo(decl_t *dp) {
2075 if (dp == NULL)
2079 (dp->d_name) ? dp->d_name : "<null>");
2081 isptrfun = type_IsPtrFun(dp->d_type);
2082 if (type_IsFunction(dp->d_type) || isptrfun)
2083 decl_GetTraceInfo(dp, f_type, f_print, &funargs);
2093 if (type_IsVarargs(dp->d_type))
2138 decl_GetTraceInfo(decl_t *dp, char *f_type, char *f_print, decl_t **funargs)
2143 if (dp == NULL)
2147 declspec_ToString(buf, dp->d_ds));
2149 de_const(declspec_ToString(buf, dp->d_ds)));
2150 tp = dp->d_type;
2161 tp = decl_GetType(dp);
2167 *funargs = dp->d_type->t_args;
2172 decl_ToFormal(decl_t *dp)
2177 type_t *tp = dp->d_type;