Esempio n. 1
0
node *MYCPPdoPreprocessing(node *syntaxtree)
{
	int  err;
  char *cppcallstr;
  char *dirnm, *basenm;
  
  DBUG_ENTER("MYCPPdoPreprocessing");

  char *buffer1, *buffer2;
  buffer1 = STRcpy(global.infile);
  buffer2 = STRcpy(global.infile);
	dirnm = dirname( buffer1);
	basenm = basename( buffer2);

  if (myglobal.cpp_I != NULL)
  {
    cppcallstr = STRcatn( 10, 
                          "cpp ",
                          "-I ",
                          myglobal.cpp_I,
                          " ",
                          global.infile,
                          " > ",
                          dirnm,
                          "/.",
                          basenm,
                          ".cpp");
  }
  else
  {
    cppcallstr = STRcatn( 7, 
                          "cpp ",
                          global.infile,
                          " > ",
                          dirnm,
                          "/.",
                          basenm,
                          ".cpp");
  }
  
  err = system( cppcallstr);

  cppcallstr = MEMfree( cppcallstr);

  if ( err) {
    CTIabort( "Unable to run C preprocessor");
  }
  
  global.cpp = TRUE;

  MEMfree(buffer1);
  MEMfree(buffer2);
  MEMfree(cppcallstr);

  DBUG_RETURN( syntaxtree);
}
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");
		};
	};
};
Esempio n. 3
0
static info *infoFree(info *inf)
{
  DBUG_ENTER("infofree");

  inf = MEMfree(inf);

  DBUG_RETURN(inf);
}
Esempio n. 4
0
static info *FreeInfo( info *info)
{
  DBUG_ENTER ("FreeInfo");

  info = MEMfree( info);

  DBUG_RETURN( info);
}
Esempio n. 5
0
static info *FreeInfo( info *info)
{
    hashmap_free(info->global);
    hashmap_free(info->local);

    info = MEMfree( info);

    return info;
}
Esempio n. 6
0
static info *
FreeInfo( info *info)
{
  DBUG_ENTER ("FreeInfo");

  INFO_LUT( info) = LUTremoveLut( INFO_LUT( info));
  info = MEMfree (info);

  DBUG_RETURN (info);
}
Esempio n. 7
0
static info *infoFree(info *inf)
{
  DBUG_ENTER("infofree");

  dequeueDestroy(INFO_NETDEQUEUE(inf));
  dequeueDestroy(INFO_BOXDEQUEUE(inf));

  inf = MEMfree(inf);

  DBUG_RETURN(inf);
}
Esempio n. 8
0
/** <!--******************************************************************-->
 *
 * @fn FREEattribString
 *
 * @brief Frees String attribute
 *
 * @param attr String node to process
 * @param parent parent node
 *
 * @return result of Free call, usually NULL
 *
 ***************************************************************************/
char *
FREEattribString (char *attr, node * parent)
{
  DBUG_ENTER ("FREEattribString");

  if (attr != NULL) {
    DBUG_PRINT ("FREE", ("Freeing string '%s' at " F_PTR, attr, attr));
    attr = MEMfree (attr);
  }

  DBUG_RETURN (attr);
}
Esempio n. 9
0
static void dequeueDestroy(dequeue_t *dequeue) 
{
  dequeue_element_t *temp;

  temp = dequeue->first;
  
  while(temp != NULL) {
    
    temp = dequeueElementFree(temp);
  } 

  MEMfree(dequeue);
}
Esempio n. 10
0
bool openFile(const char *snetBase, const char *boxBase, const char *boxType)
{
  char *fileName = STRcatn(3, boxBase, ".", boxType);

  if((srcFile = fopen(fileName, "w")) == NULL) {
    CTIerror(CTI_ERRNO_FILE_ACCESS_ERROR,
	     "Source file %s open failed\n", fileName);
    return FALSE;
  }

  writeGenerationInfo(snetBase, boxBase, boxType);

  MEMfree(fileName);

  return TRUE;
}
Esempio n. 11
0
static dequeue_element_t *dequeueElementFree(dequeue_element_t *element) 
{
  dequeue_element_t *temp;
  
  temp = element->next;

  CTIwarnNode(CTI_ERRNO_DEAD_CODE,
	      element->def, 
	      "Discarding unused metadata (name=\"%s\")", 
	      element->name);

  FREEdoFreeTree(element->def);

  MEMfree(element);

  return temp;
}
Esempio n. 12
0
node *PPLOCnetdef( node *arg_node, info *arg_info )
{
  node *temp;

  DBUG_ENTER("PPLOCnetdef");

  INFO_TOP(arg_info) = NULL;

  if(NETDEF_TOPLEVEL(arg_node)) {
    INFO_TOP(arg_info) = arg_node;
  }

  if(NETDEF_BODY(arg_node) != NULL) {
    NETDEF_BODY(arg_node) = TRAVdo(NETDEF_BODY(arg_node), arg_info);
  }

  if(INFO_TOP(arg_info) != NULL) {

    temp = INFO_TOP(arg_info);

    MEMfree(NETDEF_NAME(arg_node));

    NETDEF_NAME(arg_node) = STRcat(NETDEF_NAME(temp), "__LOC");

    NETDEF_SIGN(temp) = /*COPYdoCopyTree(*/NETDEF_SIGN(arg_node)/*)*/;
    NETDEF_SIGNED(temp) = NETDEF_SIGNED(arg_node);

    NETDEF_SIGN(arg_node) = NULL;
    NETDEF_SIGNED(arg_node) = FALSE;

    NETDEF_TOPLEVEL(temp) = TRUE;
    NETDEF_NOSHIELDS(temp) = TRUE;

    NETDEF_TOPLEVEL(arg_node) = FALSE;
    NETDEF_NOSHIELDS(arg_node) = TRUE;

    arg_node = temp;

    INFO_TOP(arg_info) = NULL;
  }

  DBUG_RETURN(arg_node);
}
Esempio n. 13
0
static void dequeueElementDestroy(dequeue_element_t *element) 
{
  MEMfree(element);
}
Esempio n. 14
0
static info *FreeInfo( info *info)
{
  info = MEMfree( info);

  return info;
}