Exemplo n.º 1
0
void cg_http_packet_setheaderlong(CgHttpPacket *httpPkt, const char* name, long value)
{
	char svalue[CG_STRING_LONG_BUFLEN];

	cg_log_debug_l4("Entering...\n");

	cg_http_packet_setheadervalue(httpPkt, name, cg_long2str(value, svalue, sizeof(svalue)));

	cg_log_debug_l4("Leaving...\n");
}
Exemplo n.º 2
0
void cg_upnpav_resource_setsize(CgUpnpAvResource *res, long value)
{
    char strBuf[CG_STRING_LONG_BUFLEN];

    if (value <= 0) {
        cg_xml_node_removeattribute(res, CG_UPNPAV_RESOURCE_PROTOCOLINFO_SIZE);
        return;
    }
    cg_xml_node_setattribute(res, CG_UPNPAV_RESOURCE_PROTOCOLINFO_SIZE, cg_long2str(value, strBuf, (CG_STRING_LONG_BUFLEN-1)));
}
Exemplo n.º 3
0
void cg_string_setlongvalue(CgString *str, long value)
{
	char buf[CG_STRING_LONG_BUFLEN];

	cg_log_debug_l5("Entering...\n");

	cg_string_setvalue(str, cg_long2str(value, buf, sizeof(buf)));

	cg_log_debug_l5("Leaving...\n");
}
Exemplo n.º 4
0
const char *cg_upnp_event_subscription_totimeoutheaderstring(CgTime time, CgString *buf)
{
    char timeBuf[CG_STRING_LONG_BUFLEN];

    cg_log_debug_l4("Entering...\n");

    if (time != CG_UPNP_SUBSCRIPTION_INFINITE_VALUE) {
        cg_string_setvalue(buf, CG_UPNP_SUBSCRIPTION_TIMEOUT_HEADER);
        cg_string_addvalue(buf, cg_long2str(time, timeBuf, sizeof(timeBuf)));
    }
    else
        cg_string_setvalue(buf, CG_UPNP_SUBSCRIPTION_INFINITE_STRING);
    return cg_string_getvalue(buf);

    cg_log_debug_l4("Leaving...\n");
}