PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
plpy_resultobject.h File Reference
#include "access/tupdesc.h"
Include dependency graph for plpy_resultobject.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  PLyResultObject
 

Typedefs

typedef struct PLyResultObject PLyResultObject
 

Functions

void PLy_result_init_type (void)
 
PyObject * PLy_result_new (void)
 

Typedef Documentation

Function Documentation

void PLy_result_init_type ( void  )

Definition at line 94 of file plpy_resultobject.c.

References elog, ERROR, and PLy_ResultType.

Referenced by PLy_init_plpy().

95 {
96  if (PyType_Ready(&PLy_ResultType) < 0)
97  elog(ERROR, "could not initialize PLy_ResultType");
98 }
#define ERROR
Definition: elog.h:43
static PyTypeObject PLy_ResultType
#define elog
Definition: elog.h:219
PyObject* PLy_result_new ( void  )

Definition at line 101 of file plpy_resultobject.c.

References PLyResultObject::nrows, NULL, PLy_ResultType, PLyResultObject::rows, PLyResultObject::status, and PLyResultObject::tupdesc.

Referenced by PLy_cursor_fetch(), and PLy_spi_execute_fetch_result().

102 {
103  PLyResultObject *ob;
104 
105  if ((ob = PyObject_New(PLyResultObject, &PLy_ResultType)) == NULL)
106  return NULL;
107 
108  /* ob->tuples = NULL; */
109 
110  Py_INCREF(Py_None);
111  ob->status = Py_None;
112  ob->nrows = PyInt_FromLong(-1);
113  ob->rows = PyList_New(0);
114  ob->tupdesc = NULL;
115 
116  return (PyObject *) ob;
117 }
static PyTypeObject PLy_ResultType
#define NULL
Definition: c.h:226
PyObject_HEAD PyObject * nrows