bcmath.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 5 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2016 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | This source file is subject to version 3.01 of the PHP license, |
  8. | that is bundled with this package in the file LICENSE, and is |
  9. | available through the world-wide-web at the following url: |
  10. | http://www.php.net/license/3_01.txt |
  11. | If you did not receive a copy of the PHP license and are unable to |
  12. | obtain it through the world-wide-web, please send a note to |
  13. | license@php.net so we can mail you a copy immediately. |
  14. +----------------------------------------------------------------------+
  15. | Author: Andi Gutmans <andi@zend.com> |
  16. +----------------------------------------------------------------------+
  17. */
  18. /* $Id$ */
  19. #ifdef HAVE_CONFIG_H
  20. #include "config.h"
  21. #endif
  22. #include "php.h"
  23. #if HAVE_BCMATH
  24. #include "php_ini.h"
  25. #include "ext/standard/info.h"
  26. #include "php_bcmath.h"
  27. #include "libbcmath/src/bcmath.h"
  28. ZEND_DECLARE_MODULE_GLOBALS(bcmath)
  29. static PHP_GINIT_FUNCTION(bcmath);
  30. static PHP_GSHUTDOWN_FUNCTION(bcmath);
  31. /* {{{ arginfo */
  32. ZEND_BEGIN_ARG_INFO_EX(arginfo_bcadd, 0, 0, 2)
  33. ZEND_ARG_INFO(0, left_operand)
  34. ZEND_ARG_INFO(0, right_operand)
  35. ZEND_ARG_INFO(0, scale)
  36. ZEND_END_ARG_INFO()
  37. ZEND_BEGIN_ARG_INFO_EX(arginfo_bcsub, 0, 0, 2)
  38. ZEND_ARG_INFO(0, left_operand)
  39. ZEND_ARG_INFO(0, right_operand)
  40. ZEND_ARG_INFO(0, scale)
  41. ZEND_END_ARG_INFO()
  42. ZEND_BEGIN_ARG_INFO_EX(arginfo_bcmul, 0, 0, 2)
  43. ZEND_ARG_INFO(0, left_operand)
  44. ZEND_ARG_INFO(0, right_operand)
  45. ZEND_ARG_INFO(0, scale)
  46. ZEND_END_ARG_INFO()
  47. ZEND_BEGIN_ARG_INFO_EX(arginfo_bcdiv, 0, 0, 2)
  48. ZEND_ARG_INFO(0, left_operand)
  49. ZEND_ARG_INFO(0, right_operand)
  50. ZEND_ARG_INFO(0, scale)
  51. ZEND_END_ARG_INFO()
  52. ZEND_BEGIN_ARG_INFO(arginfo_bcmod, 0)
  53. ZEND_ARG_INFO(0, left_operand)
  54. ZEND_ARG_INFO(0, right_operand)
  55. ZEND_END_ARG_INFO()
  56. ZEND_BEGIN_ARG_INFO_EX(arginfo_bcpowmod, 0, 0, 3)
  57. ZEND_ARG_INFO(0, x)
  58. ZEND_ARG_INFO(0, y)
  59. ZEND_ARG_INFO(0, mod)
  60. ZEND_ARG_INFO(0, scale)
  61. ZEND_END_ARG_INFO()
  62. ZEND_BEGIN_ARG_INFO_EX(arginfo_bcpow, 0, 0, 2)
  63. ZEND_ARG_INFO(0, x)
  64. ZEND_ARG_INFO(0, y)
  65. ZEND_ARG_INFO(0, scale)
  66. ZEND_END_ARG_INFO()
  67. ZEND_BEGIN_ARG_INFO_EX(arginfo_bcsqrt, 0, 0, 1)
  68. ZEND_ARG_INFO(0, operand)
  69. ZEND_ARG_INFO(0, scale)
  70. ZEND_END_ARG_INFO()
  71. ZEND_BEGIN_ARG_INFO_EX(arginfo_bccomp, 0, 0, 2)
  72. ZEND_ARG_INFO(0, left_operand)
  73. ZEND_ARG_INFO(0, right_operand)
  74. ZEND_ARG_INFO(0, scale)
  75. ZEND_END_ARG_INFO()
  76. ZEND_BEGIN_ARG_INFO(arginfo_bcscale, 0)
  77. ZEND_ARG_INFO(0, scale)
  78. ZEND_END_ARG_INFO()
  79. /* }}} */
  80. const zend_function_entry bcmath_functions[] = {
  81. PHP_FE(bcadd, arginfo_bcadd)
  82. PHP_FE(bcsub, arginfo_bcsub)
  83. PHP_FE(bcmul, arginfo_bcmul)
  84. PHP_FE(bcdiv, arginfo_bcdiv)
  85. PHP_FE(bcmod, arginfo_bcmod)
  86. PHP_FE(bcpow, arginfo_bcpow)
  87. PHP_FE(bcsqrt, arginfo_bcsqrt)
  88. PHP_FE(bcscale, arginfo_bcscale)
  89. PHP_FE(bccomp, arginfo_bccomp)
  90. PHP_FE(bcpowmod, arginfo_bcpowmod)
  91. PHP_FE_END
  92. };
  93. zend_module_entry bcmath_module_entry = {
  94. STANDARD_MODULE_HEADER,
  95. "bcmath",
  96. bcmath_functions,
  97. PHP_MINIT(bcmath),
  98. PHP_MSHUTDOWN(bcmath),
  99. NULL,
  100. NULL,
  101. PHP_MINFO(bcmath),
  102. NO_VERSION_YET,
  103. PHP_MODULE_GLOBALS(bcmath),
  104. PHP_GINIT(bcmath),
  105. PHP_GSHUTDOWN(bcmath),
  106. NULL,
  107. STANDARD_MODULE_PROPERTIES_EX
  108. };
  109. #ifdef COMPILE_DL_BCMATH
  110. ZEND_GET_MODULE(bcmath)
  111. #endif
  112. /* {{{ PHP_INI */
  113. PHP_INI_BEGIN()
  114. STD_PHP_INI_ENTRY("bcmath.scale", "0", PHP_INI_ALL, OnUpdateLongGEZero, bc_precision, zend_bcmath_globals, bcmath_globals)
  115. PHP_INI_END()
  116. /* }}} */
  117. /* {{{ PHP_GINIT_FUNCTION
  118. */
  119. static PHP_GINIT_FUNCTION(bcmath)
  120. {
  121. bcmath_globals->bc_precision = 0;
  122. bc_init_numbers(TSRMLS_C);
  123. }
  124. /* }}} */
  125. /* {{{ PHP_GSHUTDOWN_FUNCTION
  126. */
  127. static PHP_GSHUTDOWN_FUNCTION(bcmath)
  128. {
  129. _bc_free_num_ex(&bcmath_globals->_zero_, 1);
  130. _bc_free_num_ex(&bcmath_globals->_one_, 1);
  131. _bc_free_num_ex(&bcmath_globals->_two_, 1);
  132. }
  133. /* }}} */
  134. /* {{{ PHP_MINIT_FUNCTION
  135. */
  136. PHP_MINIT_FUNCTION(bcmath)
  137. {
  138. REGISTER_INI_ENTRIES();
  139. return SUCCESS;
  140. }
  141. /* }}} */
  142. /* {{{ PHP_MSHUTDOWN_FUNCTION
  143. */
  144. PHP_MSHUTDOWN_FUNCTION(bcmath)
  145. {
  146. UNREGISTER_INI_ENTRIES();
  147. return SUCCESS;
  148. }
  149. /* }}} */
  150. /* {{{ PHP_MINFO_FUNCTION
  151. */
  152. PHP_MINFO_FUNCTION(bcmath)
  153. {
  154. php_info_print_table_start();
  155. php_info_print_table_row(2, "BCMath support", "enabled");
  156. php_info_print_table_end();
  157. DISPLAY_INI_ENTRIES();
  158. }
  159. /* }}} */
  160. /* {{{ php_str2num
  161. Convert to bc_num detecting scale */
  162. static void php_str2num(bc_num *num, char *str TSRMLS_DC)
  163. {
  164. char *p;
  165. if (!(p = strchr(str, '.'))) {
  166. bc_str2num(num, str, 0 TSRMLS_CC);
  167. return;
  168. }
  169. bc_str2num(num, str, strlen(p+1) TSRMLS_CC);
  170. }
  171. /* }}} */
  172. /* {{{ split_bc_num
  173. Convert to bc_num detecting scale */
  174. static bc_num split_bc_num(bc_num num) {
  175. bc_num newnum;
  176. if (num->n_refs >= 1) {
  177. return num;
  178. }
  179. newnum = _bc_new_num_ex(0, 0, 0);
  180. *newnum = *num;
  181. newnum->n_refs = 1;
  182. num->n_refs--;
  183. return newnum;
  184. }
  185. /* }}} */
  186. /* {{{ proto string bcadd(string left_operand, string right_operand [, int scale])
  187. Returns the sum of two arbitrary precision numbers */
  188. PHP_FUNCTION(bcadd)
  189. {
  190. char *left, *right;
  191. long scale_param = 0;
  192. bc_num first, second, result;
  193. int left_len, right_len;
  194. int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
  195. if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
  196. return;
  197. }
  198. if (argc == 3) {
  199. scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
  200. }
  201. bc_init_num(&first TSRMLS_CC);
  202. bc_init_num(&second TSRMLS_CC);
  203. bc_init_num(&result TSRMLS_CC);
  204. php_str2num(&first, left TSRMLS_CC);
  205. php_str2num(&second, right TSRMLS_CC);
  206. bc_add (first, second, &result, scale);
  207. if (result->n_scale > scale) {
  208. result = split_bc_num(result);
  209. result->n_scale = scale;
  210. }
  211. Z_STRVAL_P(return_value) = bc_num2str(result);
  212. Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
  213. Z_TYPE_P(return_value) = IS_STRING;
  214. bc_free_num(&first);
  215. bc_free_num(&second);
  216. bc_free_num(&result);
  217. return;
  218. }
  219. /* }}} */
  220. /* {{{ proto string bcsub(string left_operand, string right_operand [, int scale])
  221. Returns the difference between two arbitrary precision numbers */
  222. PHP_FUNCTION(bcsub)
  223. {
  224. char *left, *right;
  225. int left_len, right_len;
  226. long scale_param = 0;
  227. bc_num first, second, result;
  228. int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
  229. if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
  230. return;
  231. }
  232. if (argc == 3) {
  233. scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
  234. }
  235. bc_init_num(&first TSRMLS_CC);
  236. bc_init_num(&second TSRMLS_CC);
  237. bc_init_num(&result TSRMLS_CC);
  238. php_str2num(&first, left TSRMLS_CC);
  239. php_str2num(&second, right TSRMLS_CC);
  240. bc_sub (first, second, &result, scale);
  241. if (result->n_scale > scale) {
  242. result = split_bc_num(result);
  243. result->n_scale = scale;
  244. }
  245. Z_STRVAL_P(return_value) = bc_num2str(result);
  246. Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
  247. Z_TYPE_P(return_value) = IS_STRING;
  248. bc_free_num(&first);
  249. bc_free_num(&second);
  250. bc_free_num(&result);
  251. return;
  252. }
  253. /* }}} */
  254. /* {{{ proto string bcmul(string left_operand, string right_operand [, int scale])
  255. Returns the multiplication of two arbitrary precision numbers */
  256. PHP_FUNCTION(bcmul)
  257. {
  258. char *left, *right;
  259. int left_len, right_len;
  260. long scale_param = 0;
  261. bc_num first, second, result;
  262. int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
  263. if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
  264. return;
  265. }
  266. if (argc == 3) {
  267. scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
  268. }
  269. bc_init_num(&first TSRMLS_CC);
  270. bc_init_num(&second TSRMLS_CC);
  271. bc_init_num(&result TSRMLS_CC);
  272. php_str2num(&first, left TSRMLS_CC);
  273. php_str2num(&second, right TSRMLS_CC);
  274. bc_multiply (first, second, &result, scale TSRMLS_CC);
  275. if (result->n_scale > scale) {
  276. result = split_bc_num(result);
  277. result->n_scale = scale;
  278. }
  279. Z_STRVAL_P(return_value) = bc_num2str(result);
  280. Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
  281. Z_TYPE_P(return_value) = IS_STRING;
  282. bc_free_num(&first);
  283. bc_free_num(&second);
  284. bc_free_num(&result);
  285. return;
  286. }
  287. /* }}} */
  288. /* {{{ proto string bcdiv(string left_operand, string right_operand [, int scale])
  289. Returns the quotient of two arbitrary precision numbers (division) */
  290. PHP_FUNCTION(bcdiv)
  291. {
  292. char *left, *right;
  293. int left_len, right_len;
  294. long scale_param = 0;
  295. bc_num first, second, result;
  296. int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
  297. if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
  298. return;
  299. }
  300. if (argc == 3) {
  301. scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
  302. }
  303. bc_init_num(&first TSRMLS_CC);
  304. bc_init_num(&second TSRMLS_CC);
  305. bc_init_num(&result TSRMLS_CC);
  306. php_str2num(&first, left TSRMLS_CC);
  307. php_str2num(&second, right TSRMLS_CC);
  308. switch (bc_divide(first, second, &result, scale TSRMLS_CC)) {
  309. case 0: /* OK */
  310. if (result->n_scale > scale) {
  311. result = split_bc_num(result);
  312. result->n_scale = scale;
  313. }
  314. Z_STRVAL_P(return_value) = bc_num2str(result);
  315. Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
  316. Z_TYPE_P(return_value) = IS_STRING;
  317. break;
  318. case -1: /* division by zero */
  319. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero");
  320. break;
  321. }
  322. bc_free_num(&first);
  323. bc_free_num(&second);
  324. bc_free_num(&result);
  325. return;
  326. }
  327. /* }}} */
  328. /* {{{ proto string bcmod(string left_operand, string right_operand)
  329. Returns the modulus of the two arbitrary precision operands */
  330. PHP_FUNCTION(bcmod)
  331. {
  332. char *left, *right;
  333. int left_len, right_len;
  334. bc_num first, second, result;
  335. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &left, &left_len, &right, &right_len) == FAILURE) {
  336. return;
  337. }
  338. bc_init_num(&first TSRMLS_CC);
  339. bc_init_num(&second TSRMLS_CC);
  340. bc_init_num(&result TSRMLS_CC);
  341. bc_str2num(&first, left, 0 TSRMLS_CC);
  342. bc_str2num(&second, right, 0 TSRMLS_CC);
  343. switch (bc_modulo(first, second, &result, 0 TSRMLS_CC)) {
  344. case 0:
  345. Z_STRVAL_P(return_value) = bc_num2str(result);
  346. Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
  347. Z_TYPE_P(return_value) = IS_STRING;
  348. break;
  349. case -1:
  350. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Division by zero");
  351. break;
  352. }
  353. bc_free_num(&first);
  354. bc_free_num(&second);
  355. bc_free_num(&result);
  356. return;
  357. }
  358. /* }}} */
  359. /* {{{ proto string bcpowmod(string x, string y, string mod [, int scale])
  360. Returns the value of an arbitrary precision number raised to the power of another reduced by a modulous */
  361. PHP_FUNCTION(bcpowmod)
  362. {
  363. char *left, *right, *modulous;
  364. int left_len, right_len, modulous_len;
  365. bc_num first, second, mod, result;
  366. long scale = BCG(bc_precision);
  367. int scale_int;
  368. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sss|l", &left, &left_len, &right, &right_len, &modulous, &modulous_len, &scale) == FAILURE) {
  369. return;
  370. }
  371. bc_init_num(&first TSRMLS_CC);
  372. bc_init_num(&second TSRMLS_CC);
  373. bc_init_num(&mod TSRMLS_CC);
  374. bc_init_num(&result TSRMLS_CC);
  375. php_str2num(&first, left TSRMLS_CC);
  376. php_str2num(&second, right TSRMLS_CC);
  377. php_str2num(&mod, modulous TSRMLS_CC);
  378. scale_int = (int) ((int)scale < 0) ? 0 : scale;
  379. if (bc_raisemod(first, second, mod, &result, scale_int TSRMLS_CC) != -1) {
  380. if (result->n_scale > scale_int) {
  381. result = split_bc_num(result);
  382. result->n_scale = scale_int;
  383. }
  384. Z_STRVAL_P(return_value) = bc_num2str(result);
  385. Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
  386. Z_TYPE_P(return_value) = IS_STRING;
  387. } else {
  388. RETVAL_FALSE;
  389. }
  390. bc_free_num(&first);
  391. bc_free_num(&second);
  392. bc_free_num(&mod);
  393. bc_free_num(&result);
  394. return;
  395. }
  396. /* }}} */
  397. /* {{{ proto string bcpow(string x, string y [, int scale])
  398. Returns the value of an arbitrary precision number raised to the power of another */
  399. PHP_FUNCTION(bcpow)
  400. {
  401. char *left, *right;
  402. int left_len, right_len;
  403. long scale_param = 0;
  404. bc_num first, second, result;
  405. int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
  406. if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
  407. return;
  408. }
  409. if (argc == 3) {
  410. scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
  411. }
  412. bc_init_num(&first TSRMLS_CC);
  413. bc_init_num(&second TSRMLS_CC);
  414. bc_init_num(&result TSRMLS_CC);
  415. php_str2num(&first, left TSRMLS_CC);
  416. php_str2num(&second, right TSRMLS_CC);
  417. bc_raise (first, second, &result, scale TSRMLS_CC);
  418. if (result->n_scale > scale) {
  419. result = split_bc_num(result);
  420. result->n_scale = scale;
  421. }
  422. Z_STRVAL_P(return_value) = bc_num2str(result);
  423. Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
  424. Z_TYPE_P(return_value) = IS_STRING;
  425. bc_free_num(&first);
  426. bc_free_num(&second);
  427. bc_free_num(&result);
  428. return;
  429. }
  430. /* }}} */
  431. /* {{{ proto string bcsqrt(string operand [, int scale])
  432. Returns the square root of an arbitray precision number */
  433. PHP_FUNCTION(bcsqrt)
  434. {
  435. char *left;
  436. int left_len;
  437. long scale_param = 0;
  438. bc_num result;
  439. int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
  440. if (zend_parse_parameters(argc TSRMLS_CC, "s|l", &left, &left_len, &scale_param) == FAILURE) {
  441. return;
  442. }
  443. if (argc == 2) {
  444. scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
  445. }
  446. bc_init_num(&result TSRMLS_CC);
  447. php_str2num(&result, left TSRMLS_CC);
  448. if (bc_sqrt (&result, scale TSRMLS_CC) != 0) {
  449. if (result->n_scale > scale) {
  450. result = split_bc_num(result);
  451. result->n_scale = scale;
  452. }
  453. Z_STRVAL_P(return_value) = bc_num2str(result);
  454. Z_STRLEN_P(return_value) = strlen(Z_STRVAL_P(return_value));
  455. Z_TYPE_P(return_value) = IS_STRING;
  456. } else {
  457. php_error_docref(NULL TSRMLS_CC, E_WARNING, "Square root of negative number");
  458. }
  459. bc_free_num(&result);
  460. return;
  461. }
  462. /* }}} */
  463. /* {{{ proto int bccomp(string left_operand, string right_operand [, int scale])
  464. Compares two arbitrary precision numbers */
  465. PHP_FUNCTION(bccomp)
  466. {
  467. char *left, *right;
  468. int left_len, right_len;
  469. long scale_param = 0;
  470. bc_num first, second;
  471. int scale = BCG(bc_precision), argc = ZEND_NUM_ARGS();
  472. if (zend_parse_parameters(argc TSRMLS_CC, "ss|l", &left, &left_len, &right, &right_len, &scale_param) == FAILURE) {
  473. return;
  474. }
  475. if (argc == 3) {
  476. scale = (int) ((int)scale_param < 0) ? 0 : scale_param;
  477. }
  478. bc_init_num(&first TSRMLS_CC);
  479. bc_init_num(&second TSRMLS_CC);
  480. bc_str2num(&first, left, scale TSRMLS_CC);
  481. bc_str2num(&second, right, scale TSRMLS_CC);
  482. Z_LVAL_P(return_value) = bc_compare(first, second);
  483. Z_TYPE_P(return_value) = IS_LONG;
  484. bc_free_num(&first);
  485. bc_free_num(&second);
  486. return;
  487. }
  488. /* }}} */
  489. /* {{{ proto bool bcscale(int scale)
  490. Sets default scale parameter for all bc math functions */
  491. PHP_FUNCTION(bcscale)
  492. {
  493. long new_scale;
  494. if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &new_scale) == FAILURE) {
  495. return;
  496. }
  497. BCG(bc_precision) = ((int)new_scale < 0) ? 0 : new_scale;
  498. RETURN_TRUE;
  499. }
  500. /* }}} */
  501. #endif
  502. /*
  503. * Local variables:
  504. * tab-width: 4
  505. * c-basic-offset: 4
  506. * End:
  507. * vim600: sw=4 ts=4 fdm=marker
  508. * vim<600: sw=4 ts=4
  509. */