startParameterlessFunction("void", getWorkName(filter,selfID)+"__close");
startParameterlessFunction("void", ClusterUtils.getWorkName(filter,selfID) +"__close");
    private void predefinedFilterInit(JMethodDeclaration self, 				      CType return_type,				      String function_name,				      int selfID) {	// No wrapper code around init since may need to create defns at file 	// level.  We assume that the code generator will continue to	// generate code for init before code for work, so scope of	// any file-level code will include the work function.	//	// should replace this if sequence...    	p.print ("// predefinedFilterInit " + filter.getIdent()); p.newLine();	if (filter instanceof SIRFileReader) {	    SIRFileReader filter = (SIRFileReader)this.filter;	    p.print ("FILE* "+fpName(filter)+";"); p.newLine(); p.newLine();	    startParameterlessFunction(""+return_type, function_name);	    p.print (fpName(filter) + " = fopen(\"" + filter.getFileName() +		   "\", \"r\");"); p.newLine();	    p.print ("assert (" + fpName(filter) + ");"); p.newLine();	    endFunction();	    	    startParameterlessFunction("void", getWorkName(filter,selfID)+"__close");	    p.print ("fclose("+fpName(filter)+");"); p.newLine();	    endFunction();	} else if (filter instanceof SIRFileWriter) {	    SIRFileWriter filter = (SIRFileWriter)this.filter;	    p.print ("FILE* "+fpName(filter)+";"); p.newLine(); p.newLine();	    startParameterlessFunction(""+return_type, function_name);	    p.print (fpName(filter) + " = fopen(\"" + filter.getFileName() +		   "\", \"w\");"); p.newLine();	    p.print ("assert (" + fpName(filter) + ");"); p.newLine();	    endFunction();	    startParameterlessFunction("void", getWorkName(filter,selfID)+"__close");	    p.print ("fclose("+fpName(filter)+");"); p.newLine();	    endFunction();	} else if (filter instanceof SIRIdentity) {	    throw new Error("Unsupported predefined filter " 				+filter.getIdent());	} else if (filter instanceof SIRDummySink) {	    // TODO:  get right exception for unimplemented.	    throw new Error("Unsupported predefined filter " 				+filter.getIdent());	} else if (filter instanceof SIRDummySource) {	    throw new Error("Unsupported predefined filter " 				+filter.getIdent());	} else {	    // TODO:  get right unchecked exception for unextended code...	    throw new Error("Unknown predefined filter " 				+filter.getIdent());	}    }