GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — python-ldap/Modules/berval.c at main · python-ldap/python-ldap Expand file tree/ Copy pathberval.cMore file actions 46 lines (39 loc) · 1.09 KB / Copy pathberval.cFile metadata and controls46 lines (39 loc) · 1.09 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 /* See https://www.python-ldap.org/ for details. */ #include "pythonldap.h" /* * Copies out the data from a berval, and returns it as a new Python object, * Returns None if the berval pointer is NULL. * * Note that this function is not the exact inverse of LDAPberval_from_object * with regards to the NULL/None conversion. * * Returns a new Python object on success, or NULL on failure. */ PyObject * LDAPberval_to_object(const struct berval *bv) { PyObject *ret = NULL; if (!bv || !bv->bv_val) { ret = Py_NewRef(Py_None); } else { ret = PyBytes_FromStringAndSize(bv->bv_val, bv->bv_len); } return ret; } /* * Same as LDAPberval_to_object, but returns a Unicode PyObject. * Use when the value is known to be text (for instance a distinguishedName). * * Returns a new Python object on success, or NULL on failure. */ PyObject * LDAPberval_to_unicode_object(const struct berval *bv) { PyObject *ret = NULL; if (!bv) { ret = Py_NewRef(Py_None); } else { ret = PyUnicode_FromStringAndSize(bv->bv_val, bv->bv_len); } return ret; } |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |