void CloseGetter() { if (getter.pid) { GSet( &cnftalk ); (void)GClose (&getter, 0, 0); Debug( "getter now closed\n" ); } }
/* * GCLIB_DLL_EXPORTED GReturn GCALL GClose(GCon g); */ static PyObject * GClose_gclib(PyObject *self, PyObject *args) { GReturn rc = -1; GCon con = -1; if (!PyArg_ParseTuple(args, "H", &con)) { return NULL; } rc = GClose(con); return Py_BuildValue("l", rc); }
/* Save materials (0=lib, 1=current) to file */ int save_mli(char *fname,int type) { FILE *stream; int error; libtype=type; if((stream=GOpen(fname,"wb"))==NULL) { cant_create(); return(0); } error=0; if(dump_mtlchunk(MLIBMAGIC,stream,NULL)==0) error=1; if(GClose(stream)) error=1; if(error) { write_err(); remove(fname); } if(debug) { getchar(); redraw(0,0,320,200); } if(error) return(0); return(1); }