diff options
Diffstat (limited to 'AppPkg/Applications/Python/Python-2.7.10/Objects/stringlib/ctype.h')
-rw-r--r-- | AppPkg/Applications/Python/Python-2.7.10/Objects/stringlib/ctype.h | 109 |
1 files changed, 109 insertions, 0 deletions
diff --git a/AppPkg/Applications/Python/Python-2.7.10/Objects/stringlib/ctype.h b/AppPkg/Applications/Python/Python-2.7.10/Objects/stringlib/ctype.h new file mode 100644 index 0000000000..df2fede7e5 --- /dev/null +++ b/AppPkg/Applications/Python/Python-2.7.10/Objects/stringlib/ctype.h @@ -0,0 +1,109 @@ +/* NOTE: this API is -ONLY- for use with single byte character strings. */
+/* Do not use it with Unicode. */
+
+#include "bytes_methods.h"
+
+static PyObject*
+stringlib_isspace(PyObject *self)
+{
+ return _Py_bytes_isspace(STRINGLIB_STR(self), STRINGLIB_LEN(self));
+}
+
+static PyObject*
+stringlib_isalpha(PyObject *self)
+{
+ return _Py_bytes_isalpha(STRINGLIB_STR(self), STRINGLIB_LEN(self));
+}
+
+static PyObject*
+stringlib_isalnum(PyObject *self)
+{
+ return _Py_bytes_isalnum(STRINGLIB_STR(self), STRINGLIB_LEN(self));
+}
+
+static PyObject*
+stringlib_isdigit(PyObject *self)
+{
+ return _Py_bytes_isdigit(STRINGLIB_STR(self), STRINGLIB_LEN(self));
+}
+
+static PyObject*
+stringlib_islower(PyObject *self)
+{
+ return _Py_bytes_islower(STRINGLIB_STR(self), STRINGLIB_LEN(self));
+}
+
+static PyObject*
+stringlib_isupper(PyObject *self)
+{
+ return _Py_bytes_isupper(STRINGLIB_STR(self), STRINGLIB_LEN(self));
+}
+
+static PyObject*
+stringlib_istitle(PyObject *self)
+{
+ return _Py_bytes_istitle(STRINGLIB_STR(self), STRINGLIB_LEN(self));
+}
+
+
+/* functions that return a new object partially translated by ctype funcs: */
+
+static PyObject*
+stringlib_lower(PyObject *self)
+{
+ PyObject* newobj;
+ newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self));
+ if (!newobj)
+ return NULL;
+ _Py_bytes_lower(STRINGLIB_STR(newobj), STRINGLIB_STR(self),
+ STRINGLIB_LEN(self));
+ return newobj;
+}
+
+static PyObject*
+stringlib_upper(PyObject *self)
+{
+ PyObject* newobj;
+ newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self));
+ if (!newobj)
+ return NULL;
+ _Py_bytes_upper(STRINGLIB_STR(newobj), STRINGLIB_STR(self),
+ STRINGLIB_LEN(self));
+ return newobj;
+}
+
+static PyObject*
+stringlib_title(PyObject *self)
+{
+ PyObject* newobj;
+ newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self));
+ if (!newobj)
+ return NULL;
+ _Py_bytes_title(STRINGLIB_STR(newobj), STRINGLIB_STR(self),
+ STRINGLIB_LEN(self));
+ return newobj;
+}
+
+static PyObject*
+stringlib_capitalize(PyObject *self)
+{
+ PyObject* newobj;
+ newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self));
+ if (!newobj)
+ return NULL;
+ _Py_bytes_capitalize(STRINGLIB_STR(newobj), STRINGLIB_STR(self),
+ STRINGLIB_LEN(self));
+ return newobj;
+}
+
+static PyObject*
+stringlib_swapcase(PyObject *self)
+{
+ PyObject* newobj;
+ newobj = STRINGLIB_NEW(NULL, STRINGLIB_LEN(self));
+ if (!newobj)
+ return NULL;
+ _Py_bytes_swapcase(STRINGLIB_STR(newobj), STRINGLIB_STR(self),
+ STRINGLIB_LEN(self));
+ return newobj;
+}
|