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"); }; }; };
static info *infoFree(info *inf) { DBUG_ENTER("infofree"); inf = MEMfree(inf); DBUG_RETURN(inf); }
static info *FreeInfo( info *info) { DBUG_ENTER ("FreeInfo"); info = MEMfree( info); DBUG_RETURN( info); }
static info *FreeInfo( info *info) { hashmap_free(info->global); hashmap_free(info->local); info = MEMfree( info); return info; }
static info * FreeInfo( info *info) { DBUG_ENTER ("FreeInfo"); INFO_LUT( info) = LUTremoveLut( INFO_LUT( info)); info = MEMfree (info); DBUG_RETURN (info); }
static info *infoFree(info *inf) { DBUG_ENTER("infofree"); dequeueDestroy(INFO_NETDEQUEUE(inf)); dequeueDestroy(INFO_BOXDEQUEUE(inf)); inf = MEMfree(inf); DBUG_RETURN(inf); }
/** <!--******************************************************************--> * * @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); }
static void dequeueDestroy(dequeue_t *dequeue) { dequeue_element_t *temp; temp = dequeue->first; while(temp != NULL) { temp = dequeueElementFree(temp); } MEMfree(dequeue); }
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; }
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; }
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); }
static void dequeueElementDestroy(dequeue_element_t *element) { MEMfree(element); }
static info *FreeInfo( info *info) { info = MEMfree( info); return info; }