PageRenderTime 47ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/Modules/_localemodule.c

https://bitbucket.org/arigo/cpython-withatomic/
C | 680 lines | 538 code | 86 blank | 56 comment | 68 complexity | 8250994cf2f49c0747e1d3820b276989 MD5 | raw file
Possible License(s): 0BSD
  1. /***********************************************************
  2. Copyright (C) 1997, 2002, 2003, 2007, 2008 Martin von Loewis
  3. Permission to use, copy, modify, and distribute this software and its
  4. documentation for any purpose and without fee is hereby granted,
  5. provided that the above copyright notice appear in all copies.
  6. This software comes with no warranty. Use at your own risk.
  7. ******************************************************************/
  8. #define PY_SSIZE_T_CLEAN
  9. #include "Python.h"
  10. #include <stdio.h>
  11. #include <locale.h>
  12. #include <string.h>
  13. #include <ctype.h>
  14. #ifdef HAVE_ERRNO_H
  15. #include <errno.h>
  16. #endif
  17. #ifdef HAVE_LANGINFO_H
  18. #include <langinfo.h>
  19. #endif
  20. #ifdef HAVE_LIBINTL_H
  21. #include <libintl.h>
  22. #endif
  23. #ifdef HAVE_WCHAR_H
  24. #include <wchar.h>
  25. #endif
  26. #if defined(MS_WINDOWS)
  27. #define WIN32_LEAN_AND_MEAN
  28. #include <windows.h>
  29. #endif
  30. PyDoc_STRVAR(locale__doc__, "Support for POSIX locales.");
  31. static PyObject *Error;
  32. /* support functions for formatting floating point numbers */
  33. PyDoc_STRVAR(setlocale__doc__,
  34. "(integer,string=None) -> string. Activates/queries locale processing.");
  35. /* the grouping is terminated by either 0 or CHAR_MAX */
  36. static PyObject*
  37. copy_grouping(char* s)
  38. {
  39. int i;
  40. PyObject *result, *val = NULL;
  41. if (s[0] == '\0')
  42. /* empty string: no grouping at all */
  43. return PyList_New(0);
  44. for (i = 0; s[i] != '\0' && s[i] != CHAR_MAX; i++)
  45. ; /* nothing */
  46. result = PyList_New(i+1);
  47. if (!result)
  48. return NULL;
  49. i = -1;
  50. do {
  51. i++;
  52. val = PyLong_FromLong(s[i]);
  53. if (!val)
  54. break;
  55. if (PyList_SetItem(result, i, val)) {
  56. Py_DECREF(val);
  57. val = NULL;
  58. break;
  59. }
  60. } while (s[i] != '\0' && s[i] != CHAR_MAX);
  61. if (!val) {
  62. Py_DECREF(result);
  63. return NULL;
  64. }
  65. return result;
  66. }
  67. static PyObject*
  68. PyLocale_setlocale(PyObject* self, PyObject* args)
  69. {
  70. int category;
  71. char *locale = NULL, *result;
  72. PyObject *result_object;
  73. if (!PyArg_ParseTuple(args, "i|z:setlocale", &category, &locale))
  74. return NULL;
  75. #if defined(MS_WINDOWS)
  76. if (category < LC_MIN || category > LC_MAX)
  77. {
  78. PyErr_SetString(Error, "invalid locale category");
  79. return NULL;
  80. }
  81. #endif
  82. if (locale) {
  83. /* set locale */
  84. result = setlocale(category, locale);
  85. if (!result) {
  86. /* operation failed, no setting was changed */
  87. PyErr_SetString(Error, "unsupported locale setting");
  88. return NULL;
  89. }
  90. result_object = PyUnicode_DecodeLocale(result, NULL);
  91. if (!result_object)
  92. return NULL;
  93. } else {
  94. /* get locale */
  95. result = setlocale(category, NULL);
  96. if (!result) {
  97. PyErr_SetString(Error, "locale query failed");
  98. return NULL;
  99. }
  100. result_object = PyUnicode_DecodeLocale(result, NULL);
  101. }
  102. return result_object;
  103. }
  104. PyDoc_STRVAR(localeconv__doc__,
  105. "() -> dict. Returns numeric and monetary locale-specific parameters.");
  106. static PyObject*
  107. PyLocale_localeconv(PyObject* self)
  108. {
  109. PyObject* result;
  110. struct lconv *l;
  111. PyObject *x;
  112. result = PyDict_New();
  113. if (!result)
  114. return NULL;
  115. /* if LC_NUMERIC is different in the C library, use saved value */
  116. l = localeconv();
  117. /* hopefully, the localeconv result survives the C library calls
  118. involved herein */
  119. #define RESULT_STRING(s)\
  120. x = PyUnicode_DecodeLocale(l->s, NULL); \
  121. if (!x) goto failed;\
  122. PyDict_SetItemString(result, #s, x);\
  123. Py_XDECREF(x)
  124. #define RESULT_INT(i)\
  125. x = PyLong_FromLong(l->i);\
  126. if (!x) goto failed;\
  127. PyDict_SetItemString(result, #i, x);\
  128. Py_XDECREF(x)
  129. /* Numeric information */
  130. RESULT_STRING(decimal_point);
  131. RESULT_STRING(thousands_sep);
  132. x = copy_grouping(l->grouping);
  133. if (!x)
  134. goto failed;
  135. PyDict_SetItemString(result, "grouping", x);
  136. Py_XDECREF(x);
  137. /* Monetary information */
  138. RESULT_STRING(int_curr_symbol);
  139. RESULT_STRING(currency_symbol);
  140. RESULT_STRING(mon_decimal_point);
  141. RESULT_STRING(mon_thousands_sep);
  142. x = copy_grouping(l->mon_grouping);
  143. if (!x)
  144. goto failed;
  145. PyDict_SetItemString(result, "mon_grouping", x);
  146. Py_XDECREF(x);
  147. RESULT_STRING(positive_sign);
  148. RESULT_STRING(negative_sign);
  149. RESULT_INT(int_frac_digits);
  150. RESULT_INT(frac_digits);
  151. RESULT_INT(p_cs_precedes);
  152. RESULT_INT(p_sep_by_space);
  153. RESULT_INT(n_cs_precedes);
  154. RESULT_INT(n_sep_by_space);
  155. RESULT_INT(p_sign_posn);
  156. RESULT_INT(n_sign_posn);
  157. return result;
  158. failed:
  159. Py_XDECREF(result);
  160. Py_XDECREF(x);
  161. return NULL;
  162. }
  163. #if defined(HAVE_WCSCOLL)
  164. PyDoc_STRVAR(strcoll__doc__,
  165. "string,string -> int. Compares two strings according to the locale.");
  166. static PyObject*
  167. PyLocale_strcoll(PyObject* self, PyObject* args)
  168. {
  169. PyObject *os1, *os2, *result = NULL;
  170. wchar_t *ws1 = NULL, *ws2 = NULL;
  171. if (!PyArg_ParseTuple(args, "UU:strcoll", &os1, &os2))
  172. return NULL;
  173. /* Convert the unicode strings to wchar[]. */
  174. ws1 = PyUnicode_AsWideCharString(os1, NULL);
  175. if (ws1 == NULL)
  176. goto done;
  177. ws2 = PyUnicode_AsWideCharString(os2, NULL);
  178. if (ws2 == NULL)
  179. goto done;
  180. /* Collate the strings. */
  181. result = PyLong_FromLong(wcscoll(ws1, ws2));
  182. done:
  183. /* Deallocate everything. */
  184. if (ws1) PyMem_FREE(ws1);
  185. if (ws2) PyMem_FREE(ws2);
  186. return result;
  187. }
  188. #endif
  189. #ifdef HAVE_WCSXFRM
  190. PyDoc_STRVAR(strxfrm__doc__,
  191. "strxfrm(string) -> string.\n\
  192. \n\
  193. Return a string that can be used as a key for locale-aware comparisons.");
  194. static PyObject*
  195. PyLocale_strxfrm(PyObject* self, PyObject* args)
  196. {
  197. PyObject *str;
  198. Py_ssize_t n1;
  199. wchar_t *s = NULL, *buf = NULL;
  200. size_t n2;
  201. PyObject *result = NULL;
  202. if (!PyArg_ParseTuple(args, "U:strxfrm", &str))
  203. return NULL;
  204. s = PyUnicode_AsWideCharString(str, &n1);
  205. if (s == NULL)
  206. goto exit;
  207. /* assume no change in size, first */
  208. n1 = n1 + 1;
  209. buf = PyMem_Malloc(n1 * sizeof(wchar_t));
  210. if (!buf) {
  211. PyErr_NoMemory();
  212. goto exit;
  213. }
  214. n2 = wcsxfrm(buf, s, n1);
  215. if (n2 >= (size_t)n1) {
  216. /* more space needed */
  217. buf = PyMem_Realloc(buf, (n2+1)*sizeof(wchar_t));
  218. if (!buf) {
  219. PyErr_NoMemory();
  220. goto exit;
  221. }
  222. n2 = wcsxfrm(buf, s, n2+1);
  223. }
  224. result = PyUnicode_FromWideChar(buf, n2);
  225. exit:
  226. if (buf)
  227. PyMem_Free(buf);
  228. if (s)
  229. PyMem_Free(s);
  230. return result;
  231. }
  232. #endif
  233. #if defined(MS_WINDOWS)
  234. static PyObject*
  235. PyLocale_getdefaultlocale(PyObject* self)
  236. {
  237. char encoding[100];
  238. char locale[100];
  239. PyOS_snprintf(encoding, sizeof(encoding), "cp%d", GetACP());
  240. if (GetLocaleInfo(LOCALE_USER_DEFAULT,
  241. LOCALE_SISO639LANGNAME,
  242. locale, sizeof(locale))) {
  243. Py_ssize_t i = strlen(locale);
  244. locale[i++] = '_';
  245. if (GetLocaleInfo(LOCALE_USER_DEFAULT,
  246. LOCALE_SISO3166CTRYNAME,
  247. locale+i, (int)(sizeof(locale)-i)))
  248. return Py_BuildValue("ss", locale, encoding);
  249. }
  250. /* If we end up here, this windows version didn't know about
  251. ISO639/ISO3166 names (it's probably Windows 95). Return the
  252. Windows language identifier instead (a hexadecimal number) */
  253. locale[0] = '0';
  254. locale[1] = 'x';
  255. if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IDEFAULTLANGUAGE,
  256. locale+2, sizeof(locale)-2)) {
  257. return Py_BuildValue("ss", locale, encoding);
  258. }
  259. /* cannot determine the language code (very unlikely) */
  260. Py_INCREF(Py_None);
  261. return Py_BuildValue("Os", Py_None, encoding);
  262. }
  263. #endif
  264. #ifdef HAVE_LANGINFO_H
  265. #define LANGINFO(X) {#X, X}
  266. static struct langinfo_constant{
  267. char* name;
  268. int value;
  269. } langinfo_constants[] =
  270. {
  271. /* These constants should exist on any langinfo implementation */
  272. LANGINFO(DAY_1),
  273. LANGINFO(DAY_2),
  274. LANGINFO(DAY_3),
  275. LANGINFO(DAY_4),
  276. LANGINFO(DAY_5),
  277. LANGINFO(DAY_6),
  278. LANGINFO(DAY_7),
  279. LANGINFO(ABDAY_1),
  280. LANGINFO(ABDAY_2),
  281. LANGINFO(ABDAY_3),
  282. LANGINFO(ABDAY_4),
  283. LANGINFO(ABDAY_5),
  284. LANGINFO(ABDAY_6),
  285. LANGINFO(ABDAY_7),
  286. LANGINFO(MON_1),
  287. LANGINFO(MON_2),
  288. LANGINFO(MON_3),
  289. LANGINFO(MON_4),
  290. LANGINFO(MON_5),
  291. LANGINFO(MON_6),
  292. LANGINFO(MON_7),
  293. LANGINFO(MON_8),
  294. LANGINFO(MON_9),
  295. LANGINFO(MON_10),
  296. LANGINFO(MON_11),
  297. LANGINFO(MON_12),
  298. LANGINFO(ABMON_1),
  299. LANGINFO(ABMON_2),
  300. LANGINFO(ABMON_3),
  301. LANGINFO(ABMON_4),
  302. LANGINFO(ABMON_5),
  303. LANGINFO(ABMON_6),
  304. LANGINFO(ABMON_7),
  305. LANGINFO(ABMON_8),
  306. LANGINFO(ABMON_9),
  307. LANGINFO(ABMON_10),
  308. LANGINFO(ABMON_11),
  309. LANGINFO(ABMON_12),
  310. #ifdef RADIXCHAR
  311. /* The following are not available with glibc 2.0 */
  312. LANGINFO(RADIXCHAR),
  313. LANGINFO(THOUSEP),
  314. /* YESSTR and NOSTR are deprecated in glibc, since they are
  315. a special case of message translation, which should be rather
  316. done using gettext. So we don't expose it to Python in the
  317. first place.
  318. LANGINFO(YESSTR),
  319. LANGINFO(NOSTR),
  320. */
  321. LANGINFO(CRNCYSTR),
  322. #endif
  323. LANGINFO(D_T_FMT),
  324. LANGINFO(D_FMT),
  325. LANGINFO(T_FMT),
  326. LANGINFO(AM_STR),
  327. LANGINFO(PM_STR),
  328. /* The following constants are available only with XPG4, but...
  329. AIX 3.2. only has CODESET.
  330. OpenBSD doesn't have CODESET but has T_FMT_AMPM, and doesn't have
  331. a few of the others.
  332. Solution: ifdef-test them all. */
  333. #ifdef CODESET
  334. LANGINFO(CODESET),
  335. #endif
  336. #ifdef T_FMT_AMPM
  337. LANGINFO(T_FMT_AMPM),
  338. #endif
  339. #ifdef ERA
  340. LANGINFO(ERA),
  341. #endif
  342. #ifdef ERA_D_FMT
  343. LANGINFO(ERA_D_FMT),
  344. #endif
  345. #ifdef ERA_D_T_FMT
  346. LANGINFO(ERA_D_T_FMT),
  347. #endif
  348. #ifdef ERA_T_FMT
  349. LANGINFO(ERA_T_FMT),
  350. #endif
  351. #ifdef ALT_DIGITS
  352. LANGINFO(ALT_DIGITS),
  353. #endif
  354. #ifdef YESEXPR
  355. LANGINFO(YESEXPR),
  356. #endif
  357. #ifdef NOEXPR
  358. LANGINFO(NOEXPR),
  359. #endif
  360. #ifdef _DATE_FMT
  361. /* This is not available in all glibc versions that have CODESET. */
  362. LANGINFO(_DATE_FMT),
  363. #endif
  364. {0, 0}
  365. };
  366. PyDoc_STRVAR(nl_langinfo__doc__,
  367. "nl_langinfo(key) -> string\n"
  368. "Return the value for the locale information associated with key.");
  369. static PyObject*
  370. PyLocale_nl_langinfo(PyObject* self, PyObject* args)
  371. {
  372. int item, i;
  373. if (!PyArg_ParseTuple(args, "i:nl_langinfo", &item))
  374. return NULL;
  375. /* Check whether this is a supported constant. GNU libc sometimes
  376. returns numeric values in the char* return value, which would
  377. crash PyUnicode_FromString. */
  378. for (i = 0; langinfo_constants[i].name; i++)
  379. if (langinfo_constants[i].value == item) {
  380. /* Check NULL as a workaround for GNU libc's returning NULL
  381. instead of an empty string for nl_langinfo(ERA). */
  382. const char *result = nl_langinfo(item);
  383. result = result != NULL ? result : "";
  384. return PyUnicode_DecodeLocale(result, NULL);
  385. }
  386. PyErr_SetString(PyExc_ValueError, "unsupported langinfo constant");
  387. return NULL;
  388. }
  389. #endif /* HAVE_LANGINFO_H */
  390. #ifdef HAVE_LIBINTL_H
  391. PyDoc_STRVAR(gettext__doc__,
  392. "gettext(msg) -> string\n"
  393. "Return translation of msg.");
  394. static PyObject*
  395. PyIntl_gettext(PyObject* self, PyObject *args)
  396. {
  397. char *in;
  398. if (!PyArg_ParseTuple(args, "s", &in))
  399. return 0;
  400. return PyUnicode_DecodeLocale(gettext(in), NULL);
  401. }
  402. PyDoc_STRVAR(dgettext__doc__,
  403. "dgettext(domain, msg) -> string\n"
  404. "Return translation of msg in domain.");
  405. static PyObject*
  406. PyIntl_dgettext(PyObject* self, PyObject *args)
  407. {
  408. char *domain, *in;
  409. if (!PyArg_ParseTuple(args, "zs", &domain, &in))
  410. return 0;
  411. return PyUnicode_DecodeLocale(dgettext(domain, in), NULL);
  412. }
  413. PyDoc_STRVAR(dcgettext__doc__,
  414. "dcgettext(domain, msg, category) -> string\n"
  415. "Return translation of msg in domain and category.");
  416. static PyObject*
  417. PyIntl_dcgettext(PyObject *self, PyObject *args)
  418. {
  419. char *domain, *msgid;
  420. int category;
  421. if (!PyArg_ParseTuple(args, "zsi", &domain, &msgid, &category))
  422. return 0;
  423. return PyUnicode_DecodeLocale(dcgettext(domain,msgid,category), NULL);
  424. }
  425. PyDoc_STRVAR(textdomain__doc__,
  426. "textdomain(domain) -> string\n"
  427. "Set the C library's textdmain to domain, returning the new domain.");
  428. static PyObject*
  429. PyIntl_textdomain(PyObject* self, PyObject* args)
  430. {
  431. char *domain;
  432. if (!PyArg_ParseTuple(args, "z", &domain))
  433. return 0;
  434. domain = textdomain(domain);
  435. if (!domain) {
  436. PyErr_SetFromErrno(PyExc_OSError);
  437. return NULL;
  438. }
  439. return PyUnicode_DecodeLocale(domain, NULL);
  440. }
  441. PyDoc_STRVAR(bindtextdomain__doc__,
  442. "bindtextdomain(domain, dir) -> string\n"
  443. "Bind the C library's domain to dir.");
  444. static PyObject*
  445. PyIntl_bindtextdomain(PyObject* self,PyObject*args)
  446. {
  447. char *domain, *dirname, *current_dirname;
  448. PyObject *dirname_obj, *dirname_bytes = NULL, *result;
  449. if (!PyArg_ParseTuple(args, "sO", &domain, &dirname_obj))
  450. return 0;
  451. if (!strlen(domain)) {
  452. PyErr_SetString(Error, "domain must be a non-empty string");
  453. return 0;
  454. }
  455. if (dirname_obj != Py_None) {
  456. if (!PyUnicode_FSConverter(dirname_obj, &dirname_bytes))
  457. return NULL;
  458. dirname = PyBytes_AsString(dirname_bytes);
  459. } else {
  460. dirname_bytes = NULL;
  461. dirname = NULL;
  462. }
  463. current_dirname = bindtextdomain(domain, dirname);
  464. if (current_dirname == NULL) {
  465. Py_XDECREF(dirname_bytes);
  466. PyErr_SetFromErrno(PyExc_OSError);
  467. return NULL;
  468. }
  469. result = PyUnicode_DecodeLocale(current_dirname, NULL);
  470. Py_XDECREF(dirname_bytes);
  471. return result;
  472. }
  473. #ifdef HAVE_BIND_TEXTDOMAIN_CODESET
  474. PyDoc_STRVAR(bind_textdomain_codeset__doc__,
  475. "bind_textdomain_codeset(domain, codeset) -> string\n"
  476. "Bind the C library's domain to codeset.");
  477. static PyObject*
  478. PyIntl_bind_textdomain_codeset(PyObject* self,PyObject*args)
  479. {
  480. char *domain,*codeset;
  481. if (!PyArg_ParseTuple(args, "sz", &domain, &codeset))
  482. return NULL;
  483. codeset = bind_textdomain_codeset(domain, codeset);
  484. if (codeset)
  485. return PyUnicode_DecodeLocale(codeset, NULL);
  486. Py_RETURN_NONE;
  487. }
  488. #endif
  489. #endif
  490. static struct PyMethodDef PyLocale_Methods[] = {
  491. {"setlocale", (PyCFunction) PyLocale_setlocale,
  492. METH_VARARGS, setlocale__doc__},
  493. {"localeconv", (PyCFunction) PyLocale_localeconv,
  494. METH_NOARGS, localeconv__doc__},
  495. #ifdef HAVE_WCSCOLL
  496. {"strcoll", (PyCFunction) PyLocale_strcoll,
  497. METH_VARARGS, strcoll__doc__},
  498. #endif
  499. #ifdef HAVE_WCSXFRM
  500. {"strxfrm", (PyCFunction) PyLocale_strxfrm,
  501. METH_VARARGS, strxfrm__doc__},
  502. #endif
  503. #if defined(MS_WINDOWS)
  504. {"_getdefaultlocale", (PyCFunction) PyLocale_getdefaultlocale, METH_NOARGS},
  505. #endif
  506. #ifdef HAVE_LANGINFO_H
  507. {"nl_langinfo", (PyCFunction) PyLocale_nl_langinfo,
  508. METH_VARARGS, nl_langinfo__doc__},
  509. #endif
  510. #ifdef HAVE_LIBINTL_H
  511. {"gettext",(PyCFunction)PyIntl_gettext,METH_VARARGS,
  512. gettext__doc__},
  513. {"dgettext",(PyCFunction)PyIntl_dgettext,METH_VARARGS,
  514. dgettext__doc__},
  515. {"dcgettext",(PyCFunction)PyIntl_dcgettext,METH_VARARGS,
  516. dcgettext__doc__},
  517. {"textdomain",(PyCFunction)PyIntl_textdomain,METH_VARARGS,
  518. textdomain__doc__},
  519. {"bindtextdomain",(PyCFunction)PyIntl_bindtextdomain,METH_VARARGS,
  520. bindtextdomain__doc__},
  521. #ifdef HAVE_BIND_TEXTDOMAIN_CODESET
  522. {"bind_textdomain_codeset",(PyCFunction)PyIntl_bind_textdomain_codeset,
  523. METH_VARARGS, bind_textdomain_codeset__doc__},
  524. #endif
  525. #endif
  526. {NULL, NULL}
  527. };
  528. static struct PyModuleDef _localemodule = {
  529. PyModuleDef_HEAD_INIT,
  530. "_locale",
  531. locale__doc__,
  532. -1,
  533. PyLocale_Methods,
  534. NULL,
  535. NULL,
  536. NULL,
  537. NULL
  538. };
  539. PyMODINIT_FUNC
  540. PyInit__locale(void)
  541. {
  542. PyObject *m, *d, *x;
  543. #ifdef HAVE_LANGINFO_H
  544. int i;
  545. #endif
  546. m = PyModule_Create(&_localemodule);
  547. if (m == NULL)
  548. return NULL;
  549. d = PyModule_GetDict(m);
  550. x = PyLong_FromLong(LC_CTYPE);
  551. PyDict_SetItemString(d, "LC_CTYPE", x);
  552. Py_XDECREF(x);
  553. x = PyLong_FromLong(LC_TIME);
  554. PyDict_SetItemString(d, "LC_TIME", x);
  555. Py_XDECREF(x);
  556. x = PyLong_FromLong(LC_COLLATE);
  557. PyDict_SetItemString(d, "LC_COLLATE", x);
  558. Py_XDECREF(x);
  559. x = PyLong_FromLong(LC_MONETARY);
  560. PyDict_SetItemString(d, "LC_MONETARY", x);
  561. Py_XDECREF(x);
  562. #ifdef LC_MESSAGES
  563. x = PyLong_FromLong(LC_MESSAGES);
  564. PyDict_SetItemString(d, "LC_MESSAGES", x);
  565. Py_XDECREF(x);
  566. #endif /* LC_MESSAGES */
  567. x = PyLong_FromLong(LC_NUMERIC);
  568. PyDict_SetItemString(d, "LC_NUMERIC", x);
  569. Py_XDECREF(x);
  570. x = PyLong_FromLong(LC_ALL);
  571. PyDict_SetItemString(d, "LC_ALL", x);
  572. Py_XDECREF(x);
  573. x = PyLong_FromLong(CHAR_MAX);
  574. PyDict_SetItemString(d, "CHAR_MAX", x);
  575. Py_XDECREF(x);
  576. Error = PyErr_NewException("locale.Error", NULL, NULL);
  577. PyDict_SetItemString(d, "Error", Error);
  578. #ifdef HAVE_LANGINFO_H
  579. for (i = 0; langinfo_constants[i].name; i++) {
  580. PyModule_AddIntConstant(m, langinfo_constants[i].name,
  581. langinfo_constants[i].value);
  582. }
  583. #endif
  584. return m;
  585. }
  586. /*
  587. Local variables:
  588. c-basic-offset: 4
  589. indent-tabs-mode: nil
  590. End:
  591. */