C compiler with embedded metalanguage.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

18 lines
398 B

typedef void *PyObject;
int
PyMapping_SetItemString(o, key, value)
PyObject *o;
char *key;
PyObject *value;
{
PyObject *okey;
int r;
if( ! key) return Py_ReturnNullError(),-1;
if (!(okey=PyString_FromString(key))) return -1;
r = PyObject_SetItem(o,okey,value);
if (--( okey )->ob_refcnt != 0) ; else (*( okey )->ob_type->tp_dealloc)((PyObject *)( okey )) ;
return r;
}