Ejemplo n.º 1
0
void				ft_print_c(va_list *ap, t_format *f)
{
	t_ullong		arg;

	arg = va_arg(*ap, t_ullong);
	update_format(f);
	get_result(arg, f);
	init_f(f);
}
Ejemplo n.º 2
0
int        s_pyvpi_value_setvalue(s_pyvpi_value *self, PyObject *value, void *closure)
{
    PyObject * tmp;
    if (value == NULL) {
        PyErr_SetString(VpiError, "Can't set index to NULL.");
        return -1;
    }
    Py_INCREF(self->obj);
    tmp = self->obj;
    Py_INCREF(value);
    Py_DECREF(self->obj);
    if(update_format(self,self->_vpi_value.format,value) == -1) {
        Py_DECREF(value);
        self->obj = tmp;
        return -1;
    }
    Py_DECREF(tmp);
    return 0;
}
Ejemplo n.º 3
0
int  pyvpi_value_Init(s_pyvpi_value *self, PyObject *args, PyObject *kwds)
{
    static char *kwlist[] = {"format", NULL};

    self->_vpi_value.format = vpiHexStrVal; //Default value.
    Py_DECREF(self->obj);
    self->obj    = PyString_FromString("");
    self->_vpi_value.value.str = PyString_AsString(self->obj);
    if (! PyArg_ParseTupleAndKeywords(args, kwds, "|i", kwlist,
                                      &self->_vpi_value.format))
    {
        PyErr_SetString(VpiError, "The pyvpi.Value initial args must be "
                        "(format = int).");
        return -1;
    }
    Py_DECREF(self->obj);       //For inital, we need no object...
    pyvpi_verbose("pyvpi.Value is Initial, "
                  "format is "FADDR_MARCO".\n",self->_vpi_value.format);
    return update_format(self,self->_vpi_value.format,NULL);
}