예제 #1
0
/*----------------------------------------------------------------------*
                           rtp_net_str_to_ip
 *----------------------------------------------------------------------*/
int rtp_net_str_to_ip (unsigned char *ipAddr, char *str, int *type)
{
    char * ptr;
    char savech;
    int nbytes;
    int n;

    *type = RTP_NET_TYPE_IPV4;
    nbytes = 4;

    for (n=0; n<nbytes; n++)
    {
        ptr = str;
        while (*ptr != '.' && *ptr != '\0')
        {
            ptr++;
        }

        savech = *ptr;
        *ptr = '\0';
        ipAddr[n] =  (unsigned char)rtp_atoi((const char *) str);
        if (savech == '\0')
        {
            break;
        }
        *ptr = savech;

        str = ptr + 1;
    }

    return (0);
}
예제 #2
0
static void DragStart(HBROWSER_HANDLE hbrowser, HDOC_HANDLE hdoc, HELEMENT_HANDLE helem, HTMLEvent* event)
{
	char ShadowId[80];
	char xmlDomstr[512];
	char *p;
	ShadowId[0]=0;
	rtp_strcat(ShadowId, "Shadow");
	p = webc_ElementGetIdASCII(helem);
	if (p)
	{
		rtp_sprintf(xmlDomstr,"%s.%s",PALLETDOMSTR,p);
		rtp_strcat(ShadowId, p);
		webc_FreeASCIIString(p);
	}
	else
		goto error;
	int X;
	int Y;
	IXML_Element *xmlElement;
	xmlElement = rtpxmlGetElemInDocFromDomStr(PalletTemplate,xmlDomstr);
	if (rtpxmlGetElemTextInElem (xmlElement, "left"))
		X = rtp_atoi(rtpxmlGetElemTextInElem (xmlElement, "left"));
	else
		X = 0;
	if (rtpxmlGetElemTextInElem (xmlElement, "top"))
		Y = rtp_atoi(rtpxmlGetElemTextInElem (xmlElement, "top"));
	else
		Y = 0;
	HELEMENT_HANDLE h = webc_DocFindElement (hdoc, ShadowId, 0, HTML_ELEMENT_ANY, 0);
	if (h)
	{
		webc_ElementSetXYPosition(h, X, Y);
		webc_ElementSetZindex(h, 2000);
		webc_ElementHide(h, WEBC_FALSE);
		webc_DragStart(hbrowser, hdoc, h, X, Y, DragCb, event->data.position.x,event->data.position.y);
	}
	return;
error:
	assert(0);
	;
}
예제 #3
0
파일: rtpgui.c 프로젝트: layerfsd/cifssmb
static int _rtp_gui_prompt_int(char *indent, char *prompt)
{
char inbuffer[32];
int rval = -1;

	while (rval == -1)
	{
		rtp_gui_prompt_text(indent, prompt, inbuffer);
		if (inbuffer[0]  >= '0' && inbuffer[0] <= '9')
			rval = rtp_atoi(inbuffer);
	}
	return(rval);
}