v8js_methods.cc 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. /*
  2. +----------------------------------------------------------------------+
  3. | PHP Version 7 |
  4. +----------------------------------------------------------------------+
  5. | Copyright (c) 1997-2017 The PHP Group |
  6. +----------------------------------------------------------------------+
  7. | http://www.opensource.org/licenses/mit-license.php MIT License |
  8. +----------------------------------------------------------------------+
  9. | Author: Jani Taskinen <[email protected]> |
  10. | Author: Patrick Reilly <[email protected]> |
  11. | Author: Stefan Siegl <[email protected]> |
  12. +----------------------------------------------------------------------+
  13. */
  14. #ifdef HAVE_CONFIG_H
  15. #include "config.h"
  16. #endif
  17. #include "php_v8js_macros.h"
  18. #include "v8js_commonjs.h"
  19. #include "v8js_exceptions.h"
  20. extern "C" {
  21. #include "zend_exceptions.h"
  22. }
  23. /* global.exit - terminate execution */
  24. V8JS_METHOD(exit) /* {{{ */
  25. {
  26. v8::Isolate *isolate = info.GetIsolate();
  27. v8js_terminate_execution(isolate);
  28. }
  29. /* }}} */
  30. /* global.sleep - sleep for passed seconds */
  31. V8JS_METHOD(sleep) /* {{{ */
  32. {
  33. v8::Isolate *isolate = info.GetIsolate();
  34. v8js_ctx *c = (v8js_ctx *) isolate->GetData(0);
  35. v8::Maybe<int32_t> t = info[0]->Int32Value(v8::Local<v8::Context>::New(isolate, c->context));
  36. if (t.IsJust()) {
  37. php_sleep(t.FromJust());
  38. }
  39. }
  40. /* }}} */
  41. /* global.print - php print() */
  42. V8JS_METHOD(print) /* {{{ */
  43. {
  44. v8::Isolate *isolate = info.GetIsolate();
  45. zend_long ret = 0;
  46. for (int i = 0; i < info.Length(); i++) {
  47. v8::String::Utf8Value str(isolate, info[i]);
  48. const char *cstr = ToCString(str);
  49. ret = PHPWRITE(cstr, strlen(cstr));
  50. }
  51. info.GetReturnValue().Set(zend_long_to_v8js(ret, isolate));
  52. }
  53. /* }}} */
  54. static void v8js_dumper(v8::Isolate *isolate, v8::Local<v8::Value> var, int level) /* {{{ */
  55. {
  56. v8js_ctx *c = (v8js_ctx *) isolate->GetData(0);
  57. v8::Local<v8::Context> v8_context = v8::Local<v8::Context>::New(isolate, c->context);
  58. if (level > 1) {
  59. php_printf("%*c", (level - 1) * 2, ' ');
  60. }
  61. if (var.IsEmpty())
  62. {
  63. php_printf("<empty>\n");
  64. return;
  65. }
  66. if (var->IsNull() || var->IsUndefined() /* PHP compat */)
  67. {
  68. php_printf("NULL\n");
  69. return;
  70. }
  71. if (var->IsInt32())
  72. {
  73. v8::Maybe<int64_t> value = var->IntegerValue(v8_context);
  74. if (value.IsNothing())
  75. {
  76. php_printf("<empty>\n");
  77. }
  78. else
  79. {
  80. php_printf("int(%ld)\n", (long) value.FromJust());
  81. }
  82. return;
  83. }
  84. if (var->IsUint32())
  85. {
  86. v8::Maybe<uint32_t> value = var->Uint32Value(v8_context);
  87. if (value.IsNothing())
  88. {
  89. php_printf("<empty>\n");
  90. }
  91. else
  92. {
  93. php_printf("int(%lu)\n", (unsigned long) value.FromJust());
  94. }
  95. return;
  96. }
  97. if (var->IsNumber())
  98. {
  99. v8::Maybe<double> value = var->NumberValue(v8_context);
  100. if (value.IsNothing())
  101. {
  102. php_printf("<empty>\n");
  103. }
  104. else
  105. {
  106. php_printf("float(%f)\n", value.FromJust());
  107. }
  108. return;
  109. }
  110. if (var->IsBoolean())
  111. {
  112. v8::Maybe<bool> value = var->BooleanValue(v8_context);
  113. if (value.IsNothing())
  114. {
  115. php_printf("<empty>\n");
  116. }
  117. else
  118. {
  119. php_printf("bool(%s)\n", value.FromJust() ? "true" : "false");
  120. }
  121. return;
  122. }
  123. v8::TryCatch try_catch(isolate); /* object.toString() can throw an exception */
  124. v8::Local<v8::String> details;
  125. if(var->IsRegExp()) {
  126. v8::RegExp *re = v8::RegExp::Cast(*var);
  127. details = re->GetSource();
  128. }
  129. else {
  130. details = var->ToDetailString(v8_context).FromMaybe(v8::Local<v8::String>());
  131. if (try_catch.HasCaught()) {
  132. details = V8JS_SYM("<toString threw exception>");
  133. }
  134. }
  135. v8::String::Utf8Value str(isolate, details);
  136. const char *valstr = ToCString(str);
  137. size_t valstr_len = str.length();
  138. if (var->IsString())
  139. {
  140. php_printf("string(%zu) \"", valstr_len);
  141. PHPWRITE(valstr, valstr_len);
  142. php_printf("\"\n");
  143. }
  144. else if (var->IsDate())
  145. {
  146. // fake the fields of a PHP DateTime
  147. php_printf("Date(%s)\n", valstr);
  148. }
  149. else if (var->IsRegExp())
  150. {
  151. php_printf("regexp(/%s/)\n", valstr);
  152. }
  153. else if (var->IsArray())
  154. {
  155. v8::Local<v8::Array> array = v8::Local<v8::Array>::Cast(var);
  156. uint32_t length = array->Length();
  157. php_printf("array(%d) {\n", length);
  158. for (unsigned i = 0; i < length; i++) {
  159. php_printf("%*c[%d] =>\n", level * 2, ' ', i);
  160. v8::MaybeLocal<v8::Value> value = array->Get(v8_context, i);
  161. if (value.IsEmpty())
  162. {
  163. php_printf("<empty>\n");
  164. }
  165. else
  166. {
  167. v8js_dumper(isolate, value.ToLocalChecked(), level + 1);
  168. }
  169. }
  170. if (level > 1) {
  171. php_printf("%*c", (level - 1) * 2, ' ');
  172. }
  173. ZEND_PUTS("}\n");
  174. }
  175. else if (var->IsObject())
  176. {
  177. v8::Local<v8::Object> object = v8::Local<v8::Object>::Cast(var);
  178. v8::String::Utf8Value cname(isolate, object->GetConstructorName());
  179. int hash = object->GetIdentityHash();
  180. if (var->IsFunction() && strcmp(ToCString(cname), "Closure") != 0)
  181. {
  182. php_printf("object(Closure)#%d {\n%*c", hash, level * 2 + 2, ' ');
  183. v8::Local<v8::String> source;
  184. if (object->ToString(v8_context).ToLocal(&source))
  185. {
  186. v8::String::Utf8Value csource(isolate, source);
  187. php_printf("%s\n", ToCString(csource));
  188. }
  189. else
  190. {
  191. php_printf("<empty>\n");
  192. }
  193. }
  194. else
  195. {
  196. v8::MaybeLocal<v8::Array> keys = object->GetOwnPropertyNames(v8_context);
  197. uint32_t length = keys.IsEmpty() ? 0 : keys.ToLocalChecked()->Length();
  198. if (strcmp(ToCString(cname), "Array") == 0 ||
  199. strcmp(ToCString(cname), "V8Object") == 0) {
  200. php_printf("array");
  201. } else {
  202. php_printf("object(%s)#%d", ToCString(cname), hash);
  203. }
  204. php_printf(" (%d) {\n", length);
  205. for (unsigned i = 0; i < length; i++) {
  206. v8::MaybeLocal<v8::Value> key_slot = keys.ToLocalChecked()->Get(v8_context, i);
  207. v8::Local<v8::String> key;
  208. if (key_slot.IsEmpty() || !key_slot.ToLocalChecked()->ToString(v8_context).ToLocal(&key))
  209. {
  210. key = V8JS_SYM("<empty>");
  211. }
  212. v8::String::Utf8Value key_name(isolate, key);
  213. php_printf("%*c[\"%s\"] =>\n", level * 2, ' ', ToCString(key_name));
  214. v8::MaybeLocal<v8::Value> value = object->Get(v8_context, key);
  215. if (value.IsEmpty())
  216. {
  217. php_printf("<empty>\n");
  218. }
  219. else
  220. {
  221. v8js_dumper(isolate, value.ToLocalChecked(), level + 1);
  222. }
  223. }
  224. }
  225. if (level > 1) {
  226. php_printf("%*c", (level - 1) * 2, ' ');
  227. }
  228. ZEND_PUTS("}\n");
  229. }
  230. else /* null, undefined, etc. */
  231. {
  232. php_printf("<%s>\n", valstr);
  233. }
  234. }
  235. /* }}} */
  236. /* global.var_dump - Dump JS values */
  237. V8JS_METHOD(var_dump) /* {{{ */
  238. {
  239. v8::Isolate *isolate = info.GetIsolate();
  240. for (int i = 0; i < info.Length(); i++) {
  241. v8js_dumper(isolate, info[i], 1);
  242. }
  243. info.GetReturnValue().Set(V8JS_NULL);
  244. }
  245. /* }}} */
  246. V8JS_METHOD(require)
  247. {
  248. v8::Isolate *isolate = info.GetIsolate();
  249. v8js_ctx *c = (v8js_ctx *) isolate->GetData(0);
  250. v8::String::Utf8Value module_base(isolate, info.Data());
  251. const char *module_base_cstr = ToCString(module_base);
  252. // Check that we have a module loader
  253. if(Z_TYPE(c->module_loader) == IS_NULL) {
  254. info.GetReturnValue().Set(isolate->ThrowException(V8JS_SYM("No module loader")));
  255. return;
  256. }
  257. v8::String::Utf8Value module_id_v8(isolate, info[0]);
  258. const char *module_id = ToCString(module_id_v8);
  259. char *normalised_path, *module_name;
  260. if (Z_TYPE(c->module_normaliser) == IS_NULL) {
  261. // No custom normalisation routine registered, use internal one
  262. normalised_path = (char *)emalloc(PATH_MAX);
  263. module_name = (char *)emalloc(PATH_MAX);
  264. v8js_commonjs_normalise_identifier(module_base_cstr, module_id, normalised_path, module_name);
  265. }
  266. else {
  267. // Call custom normaliser
  268. int call_result;
  269. zval params[2];
  270. zval normaliser_result;
  271. zend_try {
  272. {
  273. isolate->Exit();
  274. v8::Unlocker unlocker(isolate);
  275. ZVAL_STRING(&params[0], module_base_cstr);
  276. ZVAL_STRING(&params[1], module_id);
  277. call_result = call_user_function_ex(EG(function_table), NULL, &c->module_normaliser,
  278. &normaliser_result, 2, params, 0, NULL);
  279. }
  280. isolate->Enter();
  281. if (call_result == FAILURE) {
  282. info.GetReturnValue().Set(isolate->ThrowException(V8JS_SYM("Module normaliser callback failed")));
  283. }
  284. }
  285. zend_catch {
  286. v8js_terminate_execution(isolate);
  287. V8JSG(fatal_error_abort) = 1;
  288. call_result = FAILURE;
  289. }
  290. zend_end_try();
  291. zval_ptr_dtor(&params[0]);
  292. zval_ptr_dtor(&params[1]);
  293. if(call_result == FAILURE) {
  294. return;
  295. }
  296. // Check if an exception was thrown
  297. if (EG(exception)) {
  298. if (c->flags & V8JS_FLAG_PROPAGATE_PHP_EXCEPTIONS) {
  299. zval tmp_zv;
  300. ZVAL_OBJ(&tmp_zv, EG(exception));
  301. info.GetReturnValue().Set(isolate->ThrowException(zval_to_v8js(&tmp_zv, isolate)));
  302. zend_clear_exception();
  303. } else {
  304. v8js_terminate_execution(isolate);
  305. }
  306. return;
  307. }
  308. if (Z_TYPE(normaliser_result) != IS_ARRAY) {
  309. zval_ptr_dtor(&normaliser_result);
  310. info.GetReturnValue().Set(isolate->ThrowException(V8JS_SYM("Module normaliser didn't return an array")));
  311. return;
  312. }
  313. HashTable *ht = HASH_OF(&normaliser_result);
  314. int num_elements = zend_hash_num_elements(ht);
  315. if(num_elements != 2) {
  316. zval_ptr_dtor(&normaliser_result);
  317. info.GetReturnValue().Set(isolate->ThrowException(V8JS_SYM("Module normaliser expected to return array of 2 strings")));
  318. return;
  319. }
  320. zval *data;
  321. ulong index = 0;
  322. ZEND_HASH_FOREACH_VAL(ht, data) {
  323. if (Z_TYPE_P(data) != IS_STRING) {
  324. convert_to_string(data);
  325. }
  326. switch(index++) {
  327. case 0: // normalised path
  328. normalised_path = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data));
  329. break;
  330. case 1: // normalised module id
  331. module_name = estrndup(Z_STRVAL_P(data), Z_STRLEN_P(data));
  332. break;
  333. }
  334. }
  335. ZEND_HASH_FOREACH_END();
  336. zval_ptr_dtor(&normaliser_result);
  337. }
  338. char *normalised_module_id = (char *)emalloc(strlen(normalised_path)+1+strlen(module_name)+1);
  339. *normalised_module_id = 0;
  340. if (strlen(normalised_path) > 0) {
  341. strcat(normalised_module_id, normalised_path);
  342. strcat(normalised_module_id, "/");
  343. }
  344. strcat(normalised_module_id, module_name);
  345. efree(module_name);
  346. // Check for module cyclic dependencies
  347. for (std::vector<char *>::iterator it = c->modules_stack.begin(); it != c->modules_stack.end(); ++it)
  348. {
  349. if (!strcmp(*it, normalised_module_id)) {
  350. efree(normalised_module_id);
  351. efree(normalised_path);
  352. info.GetReturnValue().Set(isolate->ThrowException(V8JS_SYM("Module cyclic dependency")));
  353. return;
  354. }
  355. }
  356. // If we have already loaded and cached this module then use it
  357. if (c->modules_loaded.count(normalised_module_id) > 0) {
  358. v8::Persistent<v8::Value> newobj;
  359. newobj.Reset(isolate, c->modules_loaded[normalised_module_id]);
  360. // TODO store v8::Global in c->modules_loaded directly!?
  361. info.GetReturnValue().Set(v8::Global<v8::Value>(isolate, newobj));
  362. efree(normalised_module_id);
  363. efree(normalised_path);
  364. return;
  365. }
  366. // Callback to PHP to load the module code
  367. zval module_code;
  368. int call_result;
  369. zval params[1];
  370. {
  371. isolate->Exit();
  372. v8::Unlocker unlocker(isolate);
  373. zend_try {
  374. ZVAL_STRING(&params[0], normalised_module_id);
  375. call_result = call_user_function_ex(EG(function_table), NULL, &c->module_loader, &module_code, 1, params, 0, NULL);
  376. }
  377. zend_catch {
  378. v8js_terminate_execution(isolate);
  379. V8JSG(fatal_error_abort) = 1;
  380. }
  381. zend_end_try();
  382. }
  383. isolate->Enter();
  384. if (V8JSG(fatal_error_abort)) {
  385. call_result = FAILURE;
  386. }
  387. else if (call_result == FAILURE) {
  388. info.GetReturnValue().Set(isolate->ThrowException(V8JS_SYM("Module loader callback failed")));
  389. }
  390. zval_ptr_dtor(&params[0]);
  391. if (call_result == FAILURE) {
  392. efree(normalised_module_id);
  393. efree(normalised_path);
  394. return;
  395. }
  396. // Check if an exception was thrown
  397. if (EG(exception)) {
  398. efree(normalised_module_id);
  399. efree(normalised_path);
  400. if (c->flags & V8JS_FLAG_PROPAGATE_PHP_EXCEPTIONS) {
  401. zval tmp_zv;
  402. ZVAL_OBJ(&tmp_zv, EG(exception));
  403. info.GetReturnValue().Set(isolate->ThrowException(zval_to_v8js(&tmp_zv, isolate)));
  404. zend_clear_exception();
  405. } else {
  406. v8js_terminate_execution(isolate);
  407. }
  408. return;
  409. }
  410. if(Z_TYPE(module_code) == IS_ARRAY) {
  411. v8::Local<v8::Value> newarray = zval_to_v8js(&module_code, isolate);
  412. c->modules_loaded[normalised_module_id].Reset(isolate, newarray);
  413. info.GetReturnValue().Set(newarray);
  414. efree(normalised_path);
  415. return;
  416. }
  417. if(Z_TYPE(module_code) == IS_OBJECT) {
  418. v8::Local<v8::Object> newobj = zval_to_v8js(&module_code, isolate)->ToObject(isolate->GetEnteredContext()).ToLocalChecked();
  419. c->modules_loaded[normalised_module_id].Reset(isolate, newobj);
  420. info.GetReturnValue().Set(newobj);
  421. efree(normalised_path);
  422. return;
  423. }
  424. // Convert the return value to string
  425. if (Z_TYPE(module_code) != IS_STRING) {
  426. convert_to_string(&module_code);
  427. }
  428. v8::Local<v8::Context> context = v8::Local<v8::Context>::New(isolate, c->context);
  429. // Catch JS exceptions
  430. v8::TryCatch try_catch(isolate);
  431. v8::Locker locker(isolate);
  432. v8::Isolate::Scope isolate_scope(isolate);
  433. v8::HandleScope handle_scope(isolate);
  434. // Enter the module context
  435. v8::Context::Scope scope(context);
  436. // Set script identifier
  437. v8::Local<v8::String> sname = V8JS_STR(normalised_module_id);
  438. v8::ScriptOrigin origin(sname);
  439. if (Z_STRLEN(module_code) > std::numeric_limits<int>::max()) {
  440. zend_throw_exception(php_ce_v8js_exception,
  441. "Module code size exceeds maximum supported length", 0);
  442. return;
  443. }
  444. v8::Local<v8::String> source = V8JS_ZSTR(Z_STR(module_code));
  445. zval_ptr_dtor(&module_code);
  446. source = v8::String::Concat(isolate, V8JS_SYM("(function (exports, module, require) {"), source);
  447. source = v8::String::Concat(isolate, source, V8JS_SYM("\n});"));
  448. // Create and compile script
  449. v8::MaybeLocal<v8::Script> script = v8::Script::Compile(context, source, &origin);
  450. // The script will be empty if there are compile errors
  451. if (script.IsEmpty()) {
  452. efree(normalised_module_id);
  453. efree(normalised_path);
  454. info.GetReturnValue().Set(isolate->ThrowException(V8JS_SYM("Module script compile failed")));
  455. return;
  456. }
  457. v8::Local<v8::String> base_path = V8JS_STR(normalised_path);
  458. v8::MaybeLocal<v8::Function> require_fn = v8::FunctionTemplate::New(isolate, V8JS_MN(require), base_path)->GetFunction(context);
  459. if (require_fn.IsEmpty()) {
  460. efree(normalised_path);
  461. efree(normalised_module_id);
  462. info.GetReturnValue().Set(isolate->ThrowException(V8JS_SYM("Failed to create require method")));
  463. return;
  464. }
  465. // Add this module and path to the stack
  466. c->modules_stack.push_back(normalised_module_id);
  467. // Run script to evaluate closure
  468. v8::MaybeLocal<v8::Value> module_function = script.ToLocalChecked()->Run(context);
  469. // Prepare exports & module object
  470. v8::Local<v8::Object> exports = v8::Object::New(isolate);
  471. v8::Local<v8::Object> module = v8::Object::New(isolate);
  472. module->Set(context, V8JS_SYM("id"), V8JS_STR(normalised_module_id));
  473. module->Set(context, V8JS_SYM("exports"), exports);
  474. if (!module_function.IsEmpty() && module_function.ToLocalChecked()->IsFunction()) {
  475. v8::Local<v8::Value> *jsArgv = static_cast<v8::Local<v8::Value> *>(alloca(3 * sizeof(v8::Local<v8::Value>)));
  476. new(&jsArgv[0]) v8::Local<v8::Value>;
  477. jsArgv[0] = exports;
  478. new(&jsArgv[1]) v8::Local<v8::Value>;
  479. jsArgv[1] = module;
  480. new(&jsArgv[2]) v8::Local<v8::Value>;
  481. jsArgv[2] = require_fn.ToLocalChecked();
  482. // actually call the module
  483. v8::Local<v8::Function>::Cast(module_function.ToLocalChecked())->Call(context, exports, 3, jsArgv);
  484. }
  485. // Remove this module and path from the stack
  486. c->modules_stack.pop_back();
  487. efree(normalised_path);
  488. if (module_function.IsEmpty() || !module_function.ToLocalChecked()->IsFunction()) {
  489. info.GetReturnValue().Set(isolate->ThrowException(V8JS_SYM("Wrapped module script failed to return function")));
  490. efree(normalised_module_id);
  491. return;
  492. }
  493. // Script possibly terminated, return immediately
  494. if (!try_catch.CanContinue()) {
  495. info.GetReturnValue().Set(isolate->ThrowException(V8JS_SYM("Module script compile failed")));
  496. efree(normalised_module_id);
  497. return;
  498. }
  499. // Handle runtime JS exceptions
  500. if (try_catch.HasCaught()) {
  501. // Rethrow the exception back to JS
  502. info.GetReturnValue().Set(try_catch.ReThrow());
  503. efree(normalised_module_id);
  504. return;
  505. }
  506. v8::Local<v8::Value> newobj;
  507. // Cache the module so it doesn't need to be compiled and run again
  508. // Ensure compatibility with CommonJS implementations such as NodeJS by playing nicely with module.exports and exports
  509. v8::Local<v8::String> sym_exports = V8JS_SYM("exports");
  510. if (module->Has(context, sym_exports).FromMaybe(false))
  511. {
  512. module->Get(context, sym_exports).ToLocal(&newobj);
  513. }
  514. c->modules_loaded[normalised_module_id].Reset(isolate, newobj);
  515. info.GetReturnValue().Set(newobj);
  516. }
  517. void v8js_register_methods(v8::Local<v8::ObjectTemplate> global, v8js_ctx *c) /* {{{ */
  518. {
  519. v8::Isolate *isolate = c->isolate;
  520. global->Set(V8JS_SYM("exit"), v8::FunctionTemplate::New(isolate, V8JS_MN(exit)), v8::ReadOnly);
  521. global->Set(V8JS_SYM("sleep"), v8::FunctionTemplate::New(isolate, V8JS_MN(sleep)), v8::ReadOnly);
  522. global->Set(V8JS_SYM("print"), v8::FunctionTemplate::New(isolate, V8JS_MN(print)), v8::ReadOnly);
  523. global->Set(V8JS_SYM("var_dump"), v8::FunctionTemplate::New(isolate, V8JS_MN(var_dump)), v8::ReadOnly);
  524. v8::Local<v8::String> base_path = V8JS_STRL("", 0);
  525. global->Set(V8JS_SYM("require"), v8::FunctionTemplate::New(isolate, V8JS_MN(require), base_path), v8::ReadOnly);
  526. }
  527. /* }}} */
  528. /*
  529. * Local variables:
  530. * tab-width: 4
  531. * c-basic-offset: 4
  532. * indent-tabs-mode: t
  533. * End:
  534. * vim600: noet sw=4 ts=4 fdm=marker
  535. * vim<600: noet sw=4 ts=4
  536. */