Exemple #1
0
/* *********************************************************************   */
static int vt100c_curposreport()
{
char numbuf[30];
char outbuf[50];

    tc_strcpy(outbuf,"\x27 [ ");
    tc_itoa(pcvid_wherex(),numbuf,10);
    tc_strcat(outbuf,numbuf);
    tc_strcat(outbuf,";");
    tc_itoa(pcvid_wherey(),numbuf,10);
    tc_strcat(outbuf,numbuf);
    tc_strcat(outbuf,"R");
    vt100c_sends(outbuf);
    return(0);
}
Exemple #2
0
int _wcache_get_filename(char *fileName, struct wcache_ctx *cc, struct wcache_entry *entry)
{
char *name;

	tc_strcpy(fileName, cc->cachePrefix);
	name = &fileName[tc_strlen(fileName)];
	tc_itoa(entry->fileIndex, name, 16);
	tc_strcat(fileName, ".dat");

	return (0);
}
Exemple #3
0
char * webc_ip_to_str(char * ipstr, unsigned char * ipaddr)
{
int n;

	ipstr[0] = '\0';

	for (n=0; n<4; n++)	
	{
		tc_itoa(ipaddr[n], &(ipstr[tc_strlen(ipstr)]), 10);
		if (n<3)
		{
			tc_strcat(ipstr, ".");
		}
	}
	
	return (ipstr);
}
char *webc_CreateVFile (const char *pName, int iMimeType, long lSize, WEBC_PFBYTE pData, WEBC_UINT16 wFlags, VFileDeleteFn Destructor)
{
#if (WEBC_SUPPORT_INTERNAL)
int n;
char unique_name[20];

	if (!pName)
	{
		tc_strcpy(unique_name, "\xffvfile");
		tc_itoa(_nextUniqueNum, &unique_name[tc_strlen(unique_name)], 10);
		pName = unique_name;
		_nextUniqueNum++;
	}

	for (n=0; n<NUM_VFILE_ENTRIES; n++)
	{
		if (!gWebcVFileTable[n].pName)
		{
			gWebcVFileTable[n].pName = webc_malloc_string_copy_8(pName, __FILE__, __LINE__);
			gWebcVFileTable[n].iMimeType = (WebcFileContentType) iMimeType;
			gWebcVFileTable[n].lSize = lSize;
			if (wFlags & WEBC_VFILE_COPY)
			{
				gWebcVFileTable[n].pData = (WEBC_PFBYTE) WEBC_MALLOC(lSize);
				if (!gWebcVFileTable[n].pData)
				{
					gWebcVFileTable[n].lSize = 0;
				}
				else
				{
					tc_movebytes(gWebcVFileTable[n].pData, pData, lSize);
				}
			}
			else
			{
				gWebcVFileTable[n].pData = pData;
			}
			gWebcVFileTable[n].wFlags = wFlags | WEBC_VFILE_CREATED;
			gWebcVFileTable[n].Destroy = Destructor;
			return (gWebcVFileTable[n].pName);
		}
	}
#endif

	return 0;
}