示例#1
0
文件: Array.cpp 项目: chick/hindemith
std::string Array::getDeclaration(MemLevel mlev)
{
  if(mlev == ELEMENT)
  {
    return get_ctype(properties["dtype"]) + " " + properties["name"] + "_elt;";
  }
  else if(mlev == THREAD)
  {
    return get_ctype(properties["dtype"]) + " " + properties["name"] + "_thr;";
  }
  else
  {
    return "";
  }
}
示例#2
0
文件: ctype.c 项目: bahamas10/openzfs
/*
 * A word about widths: if the width mask is specified, then libc
 * unconditionally honors it.  Otherwise, it assumes printable
 * characters have width 1, and non-printable characters have width
 * -1 (except for NULL which is special with with 0).  Hence, we have
 * no need to inject defaults here -- the "default" unset value of 0
 * indicates that libc should use its own logic in wcwidth as described.
 */
void
add_width(int wc, int width)
{
	ctype_node_t	*ctn;

	if ((ctn = get_ctype(wc)) == NULL) {
		INTERR;
		return;
	}
	ctn->ctype &= ~(_CTYPE_SWM);
	switch (width) {
	case 0:
		ctn->ctype |= _CTYPE_SW0;
		break;
	case 1:
		ctn->ctype |= _CTYPE_SW1;
		break;
	case 2:
		ctn->ctype |= _CTYPE_SW2;
		break;
	case 3:
		ctn->ctype |= _CTYPE_SW3;
		break;
	}
}
示例#3
0
文件: ctype.c 项目: bahamas10/openzfs
void
add_ctype(int val)
{
	ctype_node_t	*ctn;

	if ((ctn = get_ctype(val)) == NULL) {
		INTERR;
		return;
	}
	add_ctype_impl(ctn);
	last_ctype = ctn->wc;
}
示例#4
0
void mime_head::build_head(string& out, bool clean)
{
	if (clean)
		out.clear();
	if (m_headers)
	{
		std::list<HEADER*>::const_iterator cit = m_headers->begin();
		for (; cit != m_headers->end(); ++cit)
		{
			out.format_append("%s: %s\r\n",
				(*cit)->name, (*cit)->value);
		}
	}
	char buf[64];
	rfc822 rfc;
	rfc.mkdate_cst(time(NULL), buf, sizeof(buf));
	out.format_append("Date: %s\r\n", buf);

	if (m_from)
		out.format_append("From: %s\r\n", m_from->c_str());
	if (m_replyto)
		out.format_append("Reply-To: %s\r\n", m_replyto->c_str());
	if (m_returnpath)
		out.format_append("Return-Path: %s\r\n", m_returnpath->c_str());
	if (m_tos)
		append_recipients(out, "To", *m_tos);
	if (m_ccs)
		append_recipients(out, "Cc", *m_ccs);
	if (m_bccs)
		append_recipients(out, "Bcc", *m_bccs);
	if (m_subject)
		out.format_append("Subject: %s\r\n", m_subject->c_str());
	out.append("MIME-Version: 1.0\r\n");
	out.format_append("Content-Type: %s/%s", get_ctype(), get_stype());
	if (m_boundary)
		out.format_append(";\r\n\tboundary=\"%s\"\r\n",
			m_boundary->c_str());
	else
		out.append("\r\n");

	out.append("\r\n");
}
示例#5
0
文件: ctype.c 项目: bahamas10/openzfs
void
add_ctype_range(int end)
{
	ctype_node_t	*ctn;
	wchar_t		cur;

	if (end < last_ctype) {
		errf(_("malformed character range (%u ... %u))"),
		    last_ctype, end);
		return;
	}
	for (cur = last_ctype + 1; cur <= end; cur++) {
		if ((ctn = get_ctype(cur)) == NULL) {
			INTERR;
			return;
		}
		add_ctype_impl(ctn);
	}
	last_ctype = end;

}
示例#6
0
文件: ctype.c 项目: bahamas10/openzfs
void
add_caseconv(int val, int wc)
{
	ctype_node_t	*ctn;

	ctn = get_ctype(val);
	if (ctn == NULL) {
		INTERR;
		return;
	}

	switch (last_kw) {
	case T_TOUPPER:
		ctn->toupper = wc;
		break;
	case T_TOLOWER:
		ctn->tolower = wc;
		break;
	default:
		INTERR;
		break;
	}
}
示例#7
0
文件: Array.cpp 项目: chick/hindemith
std::string Array::parameterStr()
{
  return "__global " + get_ctype(properties["dtype"]) + " * " + properties["name"];
}
示例#8
0
void ddlgen_notify_class_function_arg(const DDL_CLS* cls, const DDL_FUN* fun, const DDL_ARG* arg)
{
    if(!get_ctype(arg, 1)) ddlgen_error_set("invalid type");
    //printf("....<%s> <%s> <%s> <%s> <%s> %d", __FUNCTION__, arg->type, arg->name, arg->size, arg->count, arg->ispointer);
}
示例#9
0
void ddlgen_notify_struct_arg(const DDL_STR* str, const DDL_ARG* arg)
{
    if(!get_ctype(arg, 0)) ddlgen_error_set("invalid type");
    //printf("....<%s> <%s> <%s> <%s> <%s> %d", __FUNCTION__, arg->type, arg->name, arg->size, arg->count, arg->ispointer);
}