Guido van Rossum | f70e43a | 1991-02-19 12:39:46 +0000 | [diff] [blame] | 1 | |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 2 | /* Map C struct members to Python object attributes */ |
| 3 | |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 4 | #include "Python.h" |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 5 | |
| 6 | #include "structmember.h" |
| 7 | |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 8 | static PyObject * |
Thomas Wouters | f70ef4f | 2000-07-22 18:47:25 +0000 | [diff] [blame] | 9 | listmembers(struct memberlist *mlist) |
Guido van Rossum | 2f1d87e | 1991-10-20 20:24:14 +0000 | [diff] [blame] | 10 | { |
| 11 | int i, n; |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 12 | PyObject *v; |
Guido van Rossum | 2f1d87e | 1991-10-20 20:24:14 +0000 | [diff] [blame] | 13 | for (n = 0; mlist[n].name != NULL; n++) |
| 14 | ; |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 15 | v = PyList_New(n); |
Guido van Rossum | 2f1d87e | 1991-10-20 20:24:14 +0000 | [diff] [blame] | 16 | if (v != NULL) { |
| 17 | for (i = 0; i < n; i++) |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 18 | PyList_SetItem(v, i, |
| 19 | PyString_FromString(mlist[i].name)); |
| 20 | if (PyErr_Occurred()) { |
| 21 | Py_DECREF(v); |
Guido van Rossum | 2f1d87e | 1991-10-20 20:24:14 +0000 | [diff] [blame] | 22 | v = NULL; |
| 23 | } |
| 24 | else { |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 25 | PyList_Sort(v); |
Guido van Rossum | 2f1d87e | 1991-10-20 20:24:14 +0000 | [diff] [blame] | 26 | } |
| 27 | } |
| 28 | return v; |
| 29 | } |
| 30 | |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 31 | PyObject * |
Thomas Wouters | f70ef4f | 2000-07-22 18:47:25 +0000 | [diff] [blame] | 32 | PyMember_Get(char *addr, struct memberlist *mlist, char *name) |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 33 | { |
| 34 | struct memberlist *l; |
| 35 | |
Guido van Rossum | 2f1d87e | 1991-10-20 20:24:14 +0000 | [diff] [blame] | 36 | if (strcmp(name, "__members__") == 0) |
| 37 | return listmembers(mlist); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 38 | for (l = mlist; l->name != NULL; l++) { |
| 39 | if (strcmp(l->name, name) == 0) { |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 40 | PyObject *v; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 41 | addr += l->offset; |
| 42 | switch (l->type) { |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 43 | case T_BYTE: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 44 | v = PyInt_FromLong((long) |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 45 | (((*(char*)addr & 0xff) |
| 46 | ^ 0x80) - 0x80)); |
| 47 | break; |
| 48 | case T_UBYTE: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 49 | v = PyInt_FromLong((long) *(char*)addr & 0xff); |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 50 | break; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 51 | case T_SHORT: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 52 | v = PyInt_FromLong((long) *(short*)addr); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 53 | break; |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 54 | case T_USHORT: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 55 | v = PyInt_FromLong((long) |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 56 | *(unsigned short*)addr); |
| 57 | break; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 58 | case T_INT: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 59 | v = PyInt_FromLong((long) *(int*)addr); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 60 | break; |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 61 | case T_UINT: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 62 | v = PyInt_FromLong((long) |
| 63 | *(unsigned int*)addr); |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 64 | break; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 65 | case T_LONG: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 66 | v = PyInt_FromLong(*(long*)addr); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 67 | break; |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 68 | case T_ULONG: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 69 | v = PyLong_FromDouble((double) |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 70 | *(unsigned long*)addr); |
| 71 | break; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 72 | case T_FLOAT: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 73 | v = PyFloat_FromDouble((double)*(float*)addr); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 74 | break; |
| 75 | case T_DOUBLE: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 76 | v = PyFloat_FromDouble(*(double*)addr); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 77 | break; |
| 78 | case T_STRING: |
| 79 | if (*(char**)addr == NULL) { |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 80 | Py_INCREF(Py_None); |
| 81 | v = Py_None; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 82 | } |
| 83 | else |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 84 | v = PyString_FromString(*(char**)addr); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 85 | break; |
Jack Jansen | 599f0d1 | 1994-12-14 13:04:05 +0000 | [diff] [blame] | 86 | case T_STRING_INPLACE: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 87 | v = PyString_FromString((char*)addr); |
Jack Jansen | 599f0d1 | 1994-12-14 13:04:05 +0000 | [diff] [blame] | 88 | break; |
| 89 | #ifdef macintosh |
| 90 | case T_PSTRING: |
| 91 | if (*(char**)addr == NULL) { |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 92 | Py_INCREF(Py_None); |
| 93 | v = Py_None; |
Jack Jansen | 599f0d1 | 1994-12-14 13:04:05 +0000 | [diff] [blame] | 94 | } |
| 95 | else |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 96 | v = PyString_FromStringAndSize( |
| 97 | (*(char**)addr)+1, |
| 98 | **(unsigned char**)addr); |
Jack Jansen | 599f0d1 | 1994-12-14 13:04:05 +0000 | [diff] [blame] | 99 | break; |
| 100 | case T_PSTRING_INPLACE: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 101 | v = PyString_FromStringAndSize( |
| 102 | ((char*)addr)+1, |
| 103 | *(unsigned char*)addr); |
Jack Jansen | 599f0d1 | 1994-12-14 13:04:05 +0000 | [diff] [blame] | 104 | break; |
| 105 | #endif /* macintosh */ |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 106 | case T_CHAR: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 107 | v = PyString_FromStringAndSize((char*)addr, 1); |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 108 | break; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 109 | case T_OBJECT: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 110 | v = *(PyObject **)addr; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 111 | if (v == NULL) |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 112 | v = Py_None; |
| 113 | Py_INCREF(v); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 114 | break; |
| 115 | default: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 116 | PyErr_SetString(PyExc_SystemError, |
| 117 | "bad memberlist type"); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 118 | v = NULL; |
| 119 | } |
| 120 | return v; |
| 121 | } |
| 122 | } |
| 123 | |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 124 | PyErr_SetString(PyExc_AttributeError, name); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 125 | return NULL; |
| 126 | } |
| 127 | |
| 128 | int |
Thomas Wouters | f70ef4f | 2000-07-22 18:47:25 +0000 | [diff] [blame] | 129 | PyMember_Set(char *addr, struct memberlist *mlist, char *name, PyObject *v) |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 130 | { |
| 131 | struct memberlist *l; |
Guido van Rossum | adf0e43 | 1998-05-20 22:25:32 +0000 | [diff] [blame] | 132 | PyObject *oldv; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 133 | |
| 134 | for (l = mlist; l->name != NULL; l++) { |
| 135 | if (strcmp(l->name, name) == 0) { |
Jack Jansen | 599f0d1 | 1994-12-14 13:04:05 +0000 | [diff] [blame] | 136 | #ifdef macintosh |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 137 | if (l->readonly || l->type == T_STRING || |
| 138 | l->type == T_PSTRING) |
| 139 | { |
Jack Jansen | 599f0d1 | 1994-12-14 13:04:05 +0000 | [diff] [blame] | 140 | #else |
| 141 | if (l->readonly || l->type == T_STRING ) { |
| 142 | #endif /* macintosh */ |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 143 | PyErr_SetString(PyExc_TypeError, |
| 144 | "readonly attribute"); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 145 | return -1; |
| 146 | } |
Guido van Rossum | 1d5735e | 1994-08-30 08:27:36 +0000 | [diff] [blame] | 147 | if (v == NULL && l->type != T_OBJECT) { |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 148 | PyErr_SetString(PyExc_TypeError, |
Guido van Rossum | 1d5735e | 1994-08-30 08:27:36 +0000 | [diff] [blame] | 149 | "can't delete numeric/char attribute"); |
| 150 | return -1; |
| 151 | } |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 152 | addr += l->offset; |
| 153 | switch (l->type) { |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 154 | case T_BYTE: |
| 155 | case T_UBYTE: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 156 | if (!PyInt_Check(v)) { |
| 157 | PyErr_BadArgument(); |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 158 | return -1; |
| 159 | } |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 160 | *(char*)addr = (char) PyInt_AsLong(v); |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 161 | break; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 162 | case T_SHORT: |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 163 | case T_USHORT: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 164 | if (!PyInt_Check(v)) { |
| 165 | PyErr_BadArgument(); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 166 | return -1; |
| 167 | } |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 168 | *(short*)addr = (short) PyInt_AsLong(v); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 169 | break; |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 170 | case T_UINT: |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 171 | case T_INT: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 172 | if (!PyInt_Check(v)) { |
| 173 | PyErr_BadArgument(); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 174 | return -1; |
| 175 | } |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 176 | *(int*)addr = (int) PyInt_AsLong(v); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 177 | break; |
| 178 | case T_LONG: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 179 | if (!PyInt_Check(v)) { |
| 180 | PyErr_BadArgument(); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 181 | return -1; |
| 182 | } |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 183 | *(long*)addr = PyInt_AsLong(v); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 184 | break; |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 185 | case T_ULONG: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 186 | if (PyInt_Check(v)) |
| 187 | *(long*)addr = PyInt_AsLong(v); |
| 188 | else if (PyLong_Check(v)) |
| 189 | *(long*)addr = PyLong_AsLong(v); |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 190 | else { |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 191 | PyErr_BadArgument(); |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 192 | return -1; |
| 193 | } |
| 194 | break; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 195 | case T_FLOAT: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 196 | if (PyInt_Check(v)) |
Guido van Rossum | 644a12b | 1997-04-09 19:24:53 +0000 | [diff] [blame] | 197 | *(float*)addr = |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 198 | (float) PyInt_AsLong(v); |
| 199 | else if (PyFloat_Check(v)) |
| 200 | *(float*)addr = |
| 201 | (float) PyFloat_AsDouble(v); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 202 | else { |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 203 | PyErr_BadArgument(); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 204 | return -1; |
| 205 | } |
| 206 | break; |
| 207 | case T_DOUBLE: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 208 | if (PyInt_Check(v)) |
Guido van Rossum | 644a12b | 1997-04-09 19:24:53 +0000 | [diff] [blame] | 209 | *(double*)addr = |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 210 | (double) PyInt_AsLong(v); |
| 211 | else if (PyFloat_Check(v)) |
| 212 | *(double*)addr = PyFloat_AsDouble(v); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 213 | else { |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 214 | PyErr_BadArgument(); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 215 | return -1; |
| 216 | } |
| 217 | break; |
| 218 | case T_OBJECT: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 219 | Py_XINCREF(v); |
Guido van Rossum | adf0e43 | 1998-05-20 22:25:32 +0000 | [diff] [blame] | 220 | oldv = *(PyObject **)addr; |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 221 | *(PyObject **)addr = v; |
Guido van Rossum | adf0e43 | 1998-05-20 22:25:32 +0000 | [diff] [blame] | 222 | Py_XDECREF(oldv); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 223 | break; |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 224 | case T_CHAR: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 225 | if (PyString_Check(v) && |
| 226 | PyString_Size(v) == 1) { |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 227 | *(char*)addr = |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 228 | PyString_AsString(v)[0]; |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 229 | } |
| 230 | else { |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 231 | PyErr_BadArgument(); |
Guido van Rossum | ab2490a | 1992-06-03 17:07:23 +0000 | [diff] [blame] | 232 | return -1; |
| 233 | } |
Tim Peters | 547397c | 2001-01-27 06:20:08 +0000 | [diff] [blame] | 234 | break; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 235 | default: |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 236 | PyErr_SetString(PyExc_SystemError, |
| 237 | "bad memberlist type"); |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 238 | return -1; |
| 239 | } |
| 240 | return 0; |
| 241 | } |
| 242 | } |
| 243 | |
Guido van Rossum | 79f25d9 | 1997-04-29 20:08:16 +0000 | [diff] [blame] | 244 | PyErr_SetString(PyExc_AttributeError, name); |
Guido van Rossum | 73531a3 | 1990-12-20 23:12:40 +0000 | [diff] [blame] | 245 | return -1; |
Guido van Rossum | 3f5da24 | 1990-12-20 15:06:42 +0000 | [diff] [blame] | 246 | } |