示例#1
0
文件: pysocket.c 项目: KaSt/nereamud
PyObject *PySocket_getaccount(PySocket *self, void *closure) {
  SOCKET_DATA *sock = PySocket_AsSocket((PyObject *)self);
  if(sock == NULL)
    return NULL;
  else {
    ACCOUNT_DATA *acc = socketGetAccount(sock);
    if(acc == NULL)
      return Py_BuildValue("O", Py_None);
    return Py_BuildValue("O", accountGetPyFormBorrowed(acc));
  }
}
示例#2
0
PyObject *accountGetPyForm(ACCOUNT_DATA *acc) {
  PyObject *pyform = accountGetPyFormBorrowed(acc);
  Py_INCREF(pyform);
  return pyform;
}