void	oImgBitmap::setContents(EXTfldval &pContents) {
	if (mImage == NULL) {
		// really?
	} else {
		// We get the binary as is, we assume the contents is raw picture data in any format supported by STB
		qlong bitmapLen = pContents.getBinLen();
		if (bitmapLen > 0) {
			qbyte * bitmapData = (qbyte *)MEMmalloc(sizeof(qbyte) * (bitmapLen+1));
			if (bitmapData != NULL) {
				qlong	reallen;
				pContents.getBinary(bitmapLen, bitmapData, reallen);

				// and assign it to our image
				mImage->copy(bitmapData, reallen);

				// and free our memory
				MEMfree(bitmapData);
			} else {
				oBaseComponent::addToTraceLog("setContents: Couldn't allocate memory for pixel buffer");
			};
		} else {
			oBaseComponent::addToTraceLog("setContents: No image specified");
		};
	};
};
示例#2
0
static info *infoMake()
{
  info *result;
  DBUG_ENTER("infoMake");
  result = MEMmalloc(sizeof(info));
  infoClear(result);
  DBUG_RETURN(result);
}
示例#3
0
文件: print.c 项目: ksbhat/CoCoKS
static info *MakeInfo()
{
  info *result;
  
  result = MEMmalloc(sizeof(info));

  INFO_FIRSTERROR(result) = FALSE;
  
  return result;
}
示例#4
0
static dequeue_t *dequeueCreate() 
{
  dequeue_t *result;

  result = MEMmalloc(sizeof(dequeue_t));

  result->first = NULL;
  result->last = NULL;

  return result;
}
示例#5
0
static info *MakeInfo()
{
    info *result;

    result = MEMmalloc(sizeof(info));

    result->nest_level = 0;
    result->local = hashmap_create();
    result->global = hashmap_create();

    return result;
}
示例#6
0
static info *
MakeInfo( void)
{
  info *result;

  DBUG_ENTER ("MakeInfo");

  result = MEMmalloc (sizeof (info));
  INFO_LUT(result) = LUTgenerateLut();

  DBUG_RETURN (result);
}
示例#7
0
static info *infoMake()
{
  info *result;

  DBUG_ENTER("infoMake");

  result = MEMmalloc(sizeof(info));

  INFO_PATTERN(result)  = NULL;
  INFO_TAGS(result)     = 0;

  DBUG_RETURN(result);
}
示例#8
0
static info *infoMake()
{
  info *result;

  DBUG_ENTER("infoMake");

  result = MEMmalloc(sizeof(info));

  INFO_LOC(result) = LOCATION_UNKNOWN; //0
  INFO_TOP(result) = NULL;

  DBUG_RETURN(result);
}
示例#9
0
static dequeue_element_t *dequeueElementCreate(node *def, char *name) 
{
  dequeue_element_t *result;

  result = MEMmalloc(sizeof(dequeue_element_t));

  result->name = name;
  result->def = def;

  result->next = NULL;

  return result;
}
示例#10
0
/* Makes an info struct. */
static info *infoMake(bool collectUTs, bool collectCTs)
{
  info *result;

  DBUG_ENTER("infoMake");

  result = MEMmalloc(sizeof(info));

  INFO_VRECTYPE(result) = TYPnewVrectype();
  INFO_COLLECTUTS(result) = collectUTs;
  INFO_COLLECTCTS(result) = collectCTs;

  DBUG_RETURN(result);
}
示例#11
0
static info *
MakeInfo ()
{
  info *result;

  DBUG_ENTER ("MakeInfo");

  result = MEMmalloc (sizeof (info));

  INFO_FREE_FLAG (result) = NULL;
  INFO_FREE_ASSIGN (result) = NULL;

  DBUG_RETURN (result);
}
示例#12
0
	static info *MakeInfo(void)
	{
		info *result;

		DBUG_ENTER( "MakeInfo");

		result = (info *)MEMmalloc(sizeof(info));

		INFO_TYPE( result) = 0;
		INFO_FUNTYPE( result) =0;
		INFO_HASRETURN( result) =0;


		DBUG_RETURN( result);
	}
示例#13
0
static info *MakeInfo(void)
{
  info *result;

  DBUG_ENTER( "MakeInfo");

  result = (info *)MEMmalloc(sizeof(info));

  INFO_ADD( result) = 0;
  INFO_SUB( result) = 0;
  INFO_MUL( result) = 0;
  INFO_DIV( result) = 0;
  INFO_MOD( result) = 0;

  DBUG_RETURN( result);
}