Lines Matching defs:self
545 signaldict_init(PyObject *self, PyObject *args UNUSED, PyObject *kwds UNUSED)
547 SdFlagAddr(self) = NULL;
552 signaldict_len(PyObject *self UNUSED)
559 signaldict_iter(PyObject *self UNUSED)
565 signaldict_getitem(PyObject *self, PyObject *key)
574 return SdFlags(self)&flag ? incr_true() : incr_false();
578 signaldict_setitem(PyObject *self, PyObject *key, PyObject *value)
598 SdFlags(self) |= flag;
601 SdFlags(self) &= ~flag;
608 signaldict_repr(PyObject *self)
619 b[i] = SdFlags(self)&cm->flag ? "True" : "False";
663 signaldict_copy(PyObject *self, PyObject *args UNUSED)
665 return flags_as_dict(SdFlags(self));
730 context_get##mem(PyObject *self, void *closure UNUSED) \
732 return PyLong_FromSsize_t(mpd_get##mem(CTX(self))); \
737 context_get##mem(PyObject *self, void *closure UNUSED) \
739 return PyLong_FromUnsignedLong(mpd_get##mem(CTX(self))); \
753 context_getround(PyObject *self, void *closure UNUSED)
755 int i = mpd_getround(CTX(self));
762 context_getcapitals(PyObject *self, void *closure UNUSED)
764 return PyLong_FromLong(CtxCaps(self));
769 context_getallcr(PyObject *self, void *closure UNUSED)
771 return PyLong_FromLong(mpd_getcr(CTX(self)));
776 context_getetiny(PyObject *self, PyObject *dummy UNUSED)
778 return PyLong_FromSsize_t(mpd_etiny(CTX(self)));
782 context_getetop(PyObject *self, PyObject *dummy UNUSED)
784 return PyLong_FromSsize_t(mpd_etop(CTX(self)));
788 context_setprec(PyObject *self, PyObject *value, void *closure UNUSED)
798 ctx = CTX(self);
808 context_setemin(PyObject *self, PyObject *value, void *closure UNUSED)
818 ctx = CTX(self);
828 context_setemax(PyObject *self, PyObject *value, void *closure UNUSED)
838 ctx = CTX(self);
849 context_unsafe_setprec(PyObject *self, PyObject *value)
851 mpd_context_t *ctx = CTX(self);
869 context_unsafe_setemin(PyObject *self, PyObject *value)
871 mpd_context_t *ctx = CTX(self);
889 context_unsafe_setemax(PyObject *self, PyObject *value)
891 mpd_context_t *ctx = CTX(self);
910 context_setround(PyObject *self, PyObject *value, void *closure UNUSED)
920 ctx = CTX(self);
929 context_setcapitals(PyObject *self, PyObject *value, void *closure UNUSED)
942 CtxCaps(self) = (int)x;
949 context_settraps(PyObject *self, PyObject *value, void *closure UNUSED)
959 ctx = CTX(self);
969 context_settraps_list(PyObject *self, PyObject *value)
979 ctx = CTX(self);
988 context_settraps_dict(PyObject *self, PyObject *value)
1003 ctx = CTX(self);
1013 context_setstatus(PyObject *self, PyObject *value, void *closure UNUSED)
1023 ctx = CTX(self);
1033 context_setstatus_list(PyObject *self, PyObject *value)
1043 ctx = CTX(self);
1052 context_setstatus_dict(PyObject *self, PyObject *value)
1067 ctx = CTX(self);
1076 context_setclamp(PyObject *self, PyObject *value, void *closure UNUSED)
1087 ctx = CTX(self);
1097 context_setallcr(PyObject *self, PyObject *value, void *closure UNUSED)
1108 ctx = CTX(self);
1118 context_getattr(PyObject *self, PyObject *name)
1124 retval = ((PyDecContextObject *)self)->traps;
1129 retval = ((PyDecContextObject *)self)->flags;
1135 return PyObject_GenericGetAttr(self, name);
1139 context_setattr(PyObject *self, PyObject *name, PyObject *value)
1149 return context_settraps_dict(self, value);
1152 return context_setstatus_dict(self, value);
1156 return PyObject_GenericSetAttr(self, name, value);
1160 context_setattrs(PyObject *self, PyObject *prec, PyObject *rounding,
1165 if (prec != Py_None && context_setprec(self, prec, NULL) < 0) {
1168 if (rounding != Py_None && context_setround(self, rounding, NULL) < 0) {
1171 if (emin != Py_None && context_setemin(self, emin, NULL) < 0) {
1174 if (emax != Py_None && context_setemax(self, emax, NULL) < 0) {
1177 if (capitals != Py_None && context_setcapitals(self, capitals, NULL) < 0) {
1180 if (clamp != Py_None && context_setclamp(self, clamp, NULL) < 0) {
1186 ret = context_settraps_list(self, traps);
1190 ret = context_settraps(self, traps, NULL);
1194 ret = context_settraps_dict(self, traps);
1202 ret = context_setstatus_list(self, status);
1206 ret = context_setstatus(self, status, NULL);
1210 ret = context_setstatus_dict(self, status);
1221 context_clear_traps(PyObject *self, PyObject *dummy UNUSED)
1223 CTX(self)->traps = 0;
1228 context_clear_flags(PyObject *self, PyObject *dummy UNUSED)
1230 CTX(self)->status = 0;
1246 PyDecContextObject *self = NULL;
1250 self = PyObject_New(PyDecContextObject, &PyDecContext_Type);
1253 self = (PyDecContextObject *)type->tp_alloc(type, 0);
1256 if (self == NULL) {
1260 self->traps = PyObject_CallObject((PyObject *)PyDecSignalDict_Type, NULL);
1261 if (self->traps == NULL) {
1262 self->flags = NULL;
1263 Py_DECREF(self);
1266 self->flags = PyObject_CallObject((PyObject *)PyDecSignalDict_Type, NULL);
1267 if (self->flags == NULL) {
1268 Py_DECREF(self);
1272 ctx = CTX(self);
1281 SdFlagAddr(self->traps) = &ctx->traps;
1282 SdFlagAddr(self->flags) = &ctx->status;
1284 CtxCaps(self) = 1;
1285 self->tstate = NULL;
1287 return (PyObject *)self;
1291 context_dealloc(PyDecContextObject *self)
1294 if (self == cached_context) {
1299 Py_XDECREF(self->traps);
1300 Py_XDECREF(self->flags);
1301 Py_TYPE(self)->tp_free(self);
1305 context_init(PyObject *self, PyObject *args, PyObject *kwds)
1331 self, prec, rounding,
1338 context_repr(PyDecContextObject *self)
1345 assert(PyDecContext_Check(self));
1346 ctx = CTX(self);
1363 self->capitals, ctx->clamp, flags, traps);
1429 context_copy(PyObject *self, PyObject *args UNUSED)
1438 *CTX(copy) = *CTX(self);
1440 CtxCaps(copy) = CtxCaps(self);
1446 context_reduce(PyObject *self, PyObject *args UNUSED)
1453 ctx = CTX(self);
1467 Py_TYPE(self),
1469 CtxCaps(self), ctx->clamp, flags, traps
1596 PyDec_GetCurrentContext(PyObject *self UNUSED, PyObject *args UNUSED)
1611 PyDec_SetCurrentContext(PyObject *self UNUSED, PyObject *v)
1693 PyDec_GetCurrentContext(PyObject *self UNUSED, PyObject *args UNUSED)
1700 PyDec_SetCurrentContext(PyObject *self UNUSED, PyObject *v)
1742 PyDecContextManagerObject *self;
1769 self = PyObject_New(PyDecContextManagerObject,
1771 if (self == NULL) {
1775 self->local = context_copy(local, NULL);
1776 if (self->local == NULL) {
1777 self->global = NULL;
1778 Py_DECREF(self);
1781 self->global = global;
1782 Py_INCREF(self->global);
1785 self->local, prec, rounding,
1791 Py_DECREF(self);
1795 return (PyObject *)self;
1799 ctxmanager_dealloc(PyDecContextManagerObject *self)
1801 Py_XDECREF(self->local);
1802 Py_XDECREF(self->global);
1803 PyObject_Free(self);
1807 ctxmanager_set_local(PyDecContextManagerObject *self, PyObject *args UNUSED)
1811 ret = PyDec_SetCurrentContext(NULL, self->local);
1817 Py_INCREF(self->local);
1818 return self->local;
1822 ctxmanager_restore_global(PyDecContextManagerObject *self,
1827 ret = PyDec_SetCurrentContext(NULL, self->global);
3581 dec_as_integer_ratio(PyObject *self, PyObject *args UNUSED)
3592 if (mpd_isspecial(MPD(self))) {
3593 if (mpd_isnan(MPD(self))) {
3611 if (!mpd_qcopy(MPD(tmp), MPD(self), &status)) {
3943 nm_##MPDFUNC(PyObject *self) \
3954 MPDFUNC(MPD(result), MPD(self), CTX(context), &status); \
3966 nm_##MPDFUNC(PyObject *self, PyObject *other) \
3974 CONVERT_BINOP(&a, &b, self, other, context); \
3996 dec_##MPDFUNC(PyObject *self, PyObject *dummy UNUSED) \
3998 return MPDFUNC(MPD(self)) ? incr_true() : incr_false(); \
4004 dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds) \
4015 return MPDFUNC(MPD(self), CTX(context)) ? incr_true() : incr_false(); \
4021 dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds) \
4038 MPDFUNC(MPD(result), MPD(self), CTX(context), &status); \
4050 dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds) \
4064 CONVERT_BINOP_RAISE(&a, &b, self, other, context); \
4088 dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds) \
4101 CONVERT_BINOP_RAISE(&a, &b, self, other, context); \
4119 dec_##MPDFUNC(PyObject *self, PyObject *args, PyObject *kwds) \
4133 CONVERT_TERNOP_RAISE(&a, &b, &c, self, other, third, context); \
4315 dec_mpd_adjexp(PyObject *self, PyObject *dummy UNUSED)
4319 if (mpd_isspecial(MPD(self))) {
4323 retval = mpd_adjexp(MPD(self));
4330 dec_canonical(PyObject *self, PyObject *dummy UNUSED)
4332 Py_INCREF(self);
4333 return self;
4337 dec_conjugate(PyObject *self, PyObject *dummy UNUSED)
4339 Py_INCREF(self);
4340 return self;
4344 dec_mpd_radix(PyObject *self UNUSED, PyObject *dummy UNUSED)
4358 dec_mpd_qcopy_abs(PyObject *self, PyObject *dummy UNUSED)
4367 mpd_qcopy_abs(MPD(result), MPD(self), &status);
4378 dec_mpd_qcopy_negate(PyObject *self, PyObject *dummy UNUSED)
4387 mpd_qcopy_negate(MPD(result), MPD(self), &status);
4402 dec_mpd_class(PyObject *self, PyObject *args, PyObject *kwds)
4414 cp = mpd_class(MPD(self), CTX(context));
4419 dec_mpd_to_eng(PyObject *self, PyObject *args, PyObject *kwds)
4433 size = mpd_to_eng_size(&s, MPD(self), CtxCaps(context));
4450 dec_mpd_qcopy_sign(PyObject *self, PyObject *args, PyObject *kwds)
4464 CONVERT_BINOP_RAISE(&a, &b, self, other, context);
4485 dec_mpd_same_quantum(PyObject *self, PyObject *args, PyObject *kwds)
4498 CONVERT_BINOP_RAISE(&a, &b, self, other, context);
4624 dec_ceil(PyObject *self, PyObject *dummy UNUSED)
4629 return dec_as_long(self, context, MPD_ROUND_CEILING);
4634 dec_complex(PyObject *self, PyObject *dummy UNUSED)
4639 f = PyDec_AsFloat(self);
4655 dec_copy(PyObject *self, PyObject *dummy UNUSED)
4657 Py_INCREF(self);
4658 return self;
4663 dec_floor(PyObject *self, PyObject *dummy UNUSED)
4668 return dec_as_long(self, context, MPD_ROUND_FLOOR);
4788 dec_hash(PyDecObject *self)
4790 if (self->hash == -1) {
4791 self->hash = _dec_hash(self);
4794 return self->hash;
4799 dec_reduce(PyObject *self, PyObject *dummy UNUSED)
4803 str = dec_str(self);
4808 result = Py_BuildValue("O(O)", Py_TYPE(self), str);
4829 dec_trunc(PyObject *self, PyObject *dummy UNUSED)
4834 return dec_as_long(self, context, MPD_ROUND_DOWN);
4839 dec_real(PyObject *self, void *closure UNUSED)
4841 Py_INCREF(self);
4842 return self;
4846 dec_imag(PyObject *self UNUSED, void *closure UNUSED)