Ejemplo n.º 1
0
int
DWGimpl::readFile(char* filename) {
    int error;
    error = dwg_read_file(filename, &data);

    if (!error) {
        ReadDWG(&data);
    }

    dwg_free(&data);
    /* This value is the return value for `main',
    so clamp it to either 0 or 1.  */
    return error ? 1 : 0;
}
static PyObject *load_dwg(PyObject *self, PyObject *args)
{
	char* filename;

	if (!PyArg_ParseTuple(args, "s", &filename))
	{
		return NULL;
	}

  /* Read dwg data */
  int success = dwg_read_file(filename, &dwg);
  if (success != 0)
    {
    	return Py_BuildValue("i", success);
    }

	return Py_BuildValue("i", 0);
}
Ejemplo n.º 3
0
int
test_SVG(char *filename)
{
  int error;
  Dwg_Data dwg;

  error = dwg_read_file(filename, &dwg);

  if (!error)
    {
      output_SVG(&dwg);
    }

  dwg_free(&dwg);
  /* This value is the return value for `main',
     so clamp it to either 0 or 1.  */
  return error ? 1 : 0;
}