Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.
 
 
 
 
 
 

574 Zeilen
17 KiB

  1. /*
  2. * libcaca Colour ASCII-Art library
  3. * Copyright (c) 2002-2006 Sam Hocevar <sam@zoy.org>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  7. *
  8. * This library is free software. It comes without any warranty, to
  9. * the extent permitted by applicable law. You can redistribute it
  10. * and/or modify it under the terms of the Do What The Fuck You Want
  11. * To Public License, Version 2, as published by Sam Hocevar. See
  12. * http://sam.zoy.org/wtfpl/COPYING for more details.
  13. */
  14. /*
  15. * This file contains the libcaca SLang input and output driver
  16. */
  17. #include "config.h"
  18. #if defined(USE_SLANG)
  19. #if defined(HAVE_SLANG_SLANG_H)
  20. # include <slang/slang.h>
  21. #else
  22. # include <slang.h>
  23. #endif
  24. #include <stdlib.h>
  25. #include <string.h>
  26. #if defined(HAVE_SIGNAL_H)
  27. # include <signal.h>
  28. #endif
  29. #include "cucul.h"
  30. #include "caca.h"
  31. #include "caca_internals.h"
  32. /*
  33. * Global variables
  34. */
  35. /* Tables generated by tools/optipal.c */
  36. static int const slang_palette[2*16*16] =
  37. {
  38. 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0,
  39. 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, 14, 0, 15, 0, 0, 8,
  40. 8, 7, 7, 8, 15, 7, 7, 15, 15, 9, 9, 15, 1, 9, 9, 1,
  41. 7, 9, 9, 7, 8, 1, 1, 8, 0, 1, 15, 10, 10, 15, 2, 10,
  42. 10, 2, 7, 10, 10, 7, 8, 2, 2, 8, 0, 2, 15, 11, 11, 15,
  43. 3, 11, 11, 3, 7, 11, 11, 7, 8, 3, 3, 8, 0, 3, 15, 12,
  44. 12, 15, 4, 12, 12, 4, 7, 12, 12, 7, 8, 4, 4, 8, 0, 4,
  45. 15, 13, 13, 15, 5, 13, 13, 5, 7, 13, 13, 7, 8, 5, 5, 8,
  46. 0, 5, 15, 14, 14, 15, 6, 14, 14, 6, 7, 14, 14, 7, 8, 6,
  47. 6, 8, 0, 6, 4, 6, 6, 4, 12, 14, 14, 12, 6, 2, 2, 6,
  48. 14, 10, 10, 14, 2, 3, 3, 2, 10, 11, 11, 10, 3, 1, 1, 3,
  49. 11, 9, 9, 11, 1, 5, 5, 1, 9, 13, 13, 9, 5, 4, 4, 5,
  50. 13, 12, 12, 13, 4, 14, 6, 12, 12, 6, 14, 4, 6, 10, 2, 14,
  51. 14, 2, 10, 6, 2, 11, 3, 10, 10, 3, 11, 2, 3, 9, 1, 11,
  52. 11, 1, 9, 3, 1, 13, 5, 9, 9, 5, 13, 1, 5, 12, 4, 13,
  53. 13, 4, 12, 5, 0, 7, 0, 15, 15, 8, 8, 15, 15, 1, 7, 1,
  54. 1, 6, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 0, 0, 1, 1,
  55. 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 2, 2, 3, 3,
  56. 4, 4, 5, 5, 6, 6, 7, 7, 14, 9, 1, 15, 8, 9, 8, 8,
  57. 9, 9, 1, 7, 0, 9, 9, 8, 6, 9, 13, 10, 2, 15, 8, 10,
  58. 7, 2, 15, 2, 2, 7, 0, 10, 10, 8, 5, 10, 12, 11, 3, 15,
  59. 8, 11, 7, 3, 15, 3, 3, 7, 0, 11, 11, 8, 4, 11, 11, 12,
  60. 4, 15, 8, 12, 7, 4, 15, 4, 4, 7, 0, 12, 12, 8, 3, 12,
  61. 10, 13, 5, 15, 8, 13, 7, 5, 15, 5, 5, 7, 0, 13, 13, 8,
  62. 2, 13, 9, 14, 6, 15, 8, 14, 7, 6, 15, 6, 6, 7, 0, 14,
  63. 14, 8, 1, 14, 5, 6, 2, 4, 13, 14, 10, 12, 4, 2, 3, 6,
  64. 12, 10, 11, 14, 6, 3, 1, 2, 14, 11, 9, 10, 2, 1, 5, 3,
  65. 10, 9, 13, 11, 3, 5, 4, 1, 11, 13, 12, 9, 1, 4, 6, 5,
  66. 9, 12, 14, 13, 5, 14, 2, 12, 13, 6, 10, 4, 4, 10, 3, 14,
  67. 12, 2, 11, 6, 6, 11, 1, 10, 14, 3, 9, 2, 2, 9, 5, 11,
  68. 10, 1, 13, 3, 3, 13, 4, 9, 11, 5, 12, 1, 1, 12, 6, 13,
  69. 9, 4, 14, 5, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15,
  70. };
  71. static int const slang_assoc[16*16] =
  72. {
  73. 134, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
  74. 28, 135, 214, 86, 219, 91, 133, 127, 26, 23, 240, 112, 245, 117, 141, 126,
  75. 37, 211, 142, 83, 206, 132, 78, 160, 35, 237, 32, 109, 232, 140, 104, 161,
  76. 46, 87, 82, 143, 131, 215, 210, 169, 44, 113, 108, 41, 139, 241, 236, 170,
  77. 55, 222, 203, 130, 144, 94, 75, 178, 53, 248, 229, 138, 50, 120, 101, 179,
  78. 64, 90, 129, 218, 95, 145, 223, 187, 62, 116, 137, 244, 121, 59, 249, 188,
  79. 73, 128, 79, 207, 74, 202, 146, 196, 71, 136, 105, 233, 100, 228, 68, 197,
  80. 122, 153, 162, 171, 180, 189, 198, 147, 16, 25, 34, 43, 52, 61, 70, 18,
  81. 15, 27, 36, 45, 54, 63, 72, 17, 151, 155, 164, 173, 182, 191, 200, 124,
  82. 154, 22, 238, 110, 243, 115, 156, 24, 150, 152, 216, 88, 221, 93, 148, 20,
  83. 163, 235, 31, 107, 230, 165, 102, 33, 159, 213, 250, 85, 208, 157, 80, 29,
  84. 172, 111, 106, 40, 174, 239, 234, 42, 168, 89, 84, 251, 166, 217, 212, 38,
  85. 181, 246, 227, 183, 49, 118, 99, 51, 177, 224, 205, 175, 252, 96, 77, 47,
  86. 190, 114, 192, 242, 119, 58, 247, 60, 186, 92, 184, 220, 97, 253, 225, 56,
  87. 199, 201, 103, 231, 98, 226, 67, 69, 195, 193, 81, 209, 76, 204, 254, 65,
  88. 123, 149, 158, 167, 176, 185, 194, 19, 125, 21, 30, 39, 48, 57, 66, 255,
  89. };
  90. /*
  91. * Local functions
  92. */
  93. static void slang_init_palette(void);
  94. static void slang_write_utf32(uint32_t);
  95. #if defined(HAVE_SIGNAL)
  96. static RETSIGTYPE sigwinch_handler(int);
  97. static caca_display_t *sigwinch_d; /* FIXME: we ought to get rid of this */
  98. #endif
  99. #if defined(HAVE_GETENV) && defined(HAVE_PUTENV)
  100. static void slang_install_terminal(caca_display_t *);
  101. static void slang_uninstall_terminal(caca_display_t *);
  102. #endif
  103. struct driver_private
  104. {
  105. char *term;
  106. };
  107. static int slang_init_graphics(caca_display_t *dp)
  108. {
  109. dp->drv.p = malloc(sizeof(struct driver_private));
  110. #if defined(HAVE_GETENV) && defined(HAVE_PUTENV)
  111. slang_install_terminal(dp);
  112. #endif
  113. #if defined(HAVE_SIGNAL)
  114. sigwinch_d = dp;
  115. signal(SIGWINCH, sigwinch_handler);
  116. #endif
  117. _caca_set_term_title("caca for S-Lang");
  118. /* Initialise slang library */
  119. SLsig_block_signals();
  120. SLtt_get_terminfo();
  121. if(SLkp_init() == -1)
  122. {
  123. SLsig_unblock_signals();
  124. return -1;
  125. }
  126. SLang_init_tty(-1, 0, 1);
  127. if(SLsmg_init_smg() == -1)
  128. {
  129. SLsig_unblock_signals();
  130. return -1;
  131. }
  132. SLsig_unblock_signals();
  133. SLsmg_cls();
  134. SLtt_set_cursor_visibility(0);
  135. SLkp_define_keysym("\e[M", 1001);
  136. SLtt_set_mouse_mode(1, 0);
  137. SLsmg_refresh();
  138. /* Disable scrolling so that hashmap scrolling optimization code
  139. * does not cause ugly refreshes due to slow terminals */
  140. SLtt_Term_Cannot_Scroll = 1;
  141. slang_init_palette();
  142. #if defined(VMS) || defined(REAL_UNIX_SYSTEM)
  143. /* Disable alt charset support so that we get a chance to have all
  144. * 256 colour pairs */
  145. SLtt_Has_Alt_Charset = 0;
  146. #endif
  147. #ifdef HAVE_SLSMG_UTF8_ENABLE
  148. SLsmg_utf8_enable(1); /* 1 == force, 0 == disable, -1 == autodetect */
  149. SLtt_utf8_enable(1);
  150. #endif
  151. dp->resize.allow = 1;
  152. cucul_set_canvas_size(dp->cv, SLtt_Screen_Cols, SLtt_Screen_Rows);
  153. dp->resize.allow = 0;
  154. return 0;
  155. }
  156. static int slang_end_graphics(caca_display_t *dp)
  157. {
  158. _caca_set_term_title("");
  159. SLtt_set_mouse_mode(0, 0);
  160. SLtt_set_cursor_visibility(1);
  161. SLang_reset_tty();
  162. SLsmg_reset_smg();
  163. #if defined HAVE_GETENV && defined HAVE_PUTENV
  164. slang_uninstall_terminal(dp);
  165. #endif
  166. free(dp->drv.p);
  167. return 0;
  168. }
  169. static int slang_set_display_title(caca_display_t *dp, char const *title)
  170. {
  171. _caca_set_term_title(title);
  172. return 0;
  173. }
  174. static unsigned int slang_get_display_width(caca_display_t const *dp)
  175. {
  176. /* Fallback to a 6x10 font */
  177. return cucul_get_canvas_width(dp->cv) * 6;
  178. }
  179. static unsigned int slang_get_display_height(caca_display_t const *dp)
  180. {
  181. /* Fallback to a 6x10 font */
  182. return cucul_get_canvas_height(dp->cv) * 10;
  183. }
  184. static void slang_display(caca_display_t *dp)
  185. {
  186. uint32_t const *cvchars = (uint32_t const *)cucul_get_canvas_chars(dp->cv);
  187. uint32_t const *cvattrs = (uint32_t const *)cucul_get_canvas_attrs(dp->cv);
  188. unsigned int width = cucul_get_canvas_width(dp->cv);
  189. unsigned int height = cucul_get_canvas_height(dp->cv);
  190. int x, y;
  191. for(y = 0; y < (int)height; y++)
  192. {
  193. SLsmg_gotorc(y, 0);
  194. for(x = width; x--; )
  195. {
  196. uint32_t ch = *cvchars++;
  197. #if defined(OPTIMISE_SLANG_PALETTE)
  198. /* If foreground == background, just don't use this colour
  199. * pair, and print a space instead of the real character.
  200. * XXX: disabled, because I can't remember what it was
  201. * here for, and in cases where SLang does not render
  202. * bright backgrounds, it's just fucked up. */
  203. #if 0
  204. uint8_t fgcolor = cucul_attr_to_ansi_fg(*cvattrs);
  205. uint8_t bgcolor = cucul_attr_to_ansi_bg(*cvattrs);
  206. if(fgcolor >= 0x10)
  207. fgcolor = CUCUL_LIGHTGRAY;
  208. if(bgcolor >= 0x10)
  209. bgcolor = CUCUL_BLACK; /* FIXME: handle transparency */
  210. if(fgcolor == bgcolor)
  211. {
  212. if(fgcolor == CUCUL_BLACK)
  213. fgcolor = CUCUL_WHITE;
  214. else if(fgcolor == CUCUL_WHITE
  215. || fgcolor <= CUCUL_LIGHTGRAY)
  216. fgcolor = CUCUL_BLACK;
  217. else
  218. fgcolor = CUCUL_WHITE;
  219. SLsmg_set_color(slang_assoc[fgcolor + 16 * bgcolor]);
  220. SLsmg_write_char(' ');
  221. cvattrs++;
  222. }
  223. else
  224. #endif
  225. {
  226. SLsmg_set_color(slang_assoc[cucul_attr_to_ansi(*cvattrs++)]);
  227. slang_write_utf32(ch);
  228. }
  229. #else
  230. SLsmg_set_color(cucul_attr_to_ansi(*cvattrs++));
  231. slang_write_utf32(ch);
  232. #endif
  233. }
  234. }
  235. SLsmg_gotorc(cucul_get_cursor_y(dp->cv), cucul_get_cursor_x(dp->cv));
  236. SLsmg_refresh();
  237. }
  238. static void slang_handle_resize(caca_display_t *dp)
  239. {
  240. SLtt_get_screen_size();
  241. dp->resize.w = SLtt_Screen_Cols;
  242. dp->resize.h = SLtt_Screen_Rows;
  243. if(dp->resize.w != cucul_get_canvas_width(dp->cv)
  244. || dp->resize.h != cucul_get_canvas_height(dp->cv))
  245. SLsmg_reinit_smg();
  246. }
  247. static int slang_get_event(caca_display_t *dp, caca_privevent_t *ev)
  248. {
  249. int intkey;
  250. if(!SLang_input_pending(0))
  251. {
  252. ev->type = CACA_EVENT_NONE;
  253. return 0;
  254. }
  255. /* We first use SLang_getkey() to see whether Esc was pressed
  256. * alone, then (if it wasn't) we unget the key and use SLkp_getkey()
  257. * instead, so that escape sequences are interpreted. */
  258. intkey = SLang_getkey();
  259. if(intkey != 0x1b /* Esc */ || SLang_input_pending(0))
  260. {
  261. SLang_ungetkey(intkey);
  262. intkey = SLkp_getkey();
  263. }
  264. /* If the key was ASCII, return it immediately */
  265. if(intkey < 0x7f)
  266. {
  267. ev->type = CACA_EVENT_KEY_PRESS;
  268. ev->data.key.ch = intkey;
  269. ev->data.key.utf32 = intkey;
  270. ev->data.key.utf8[0] = intkey;
  271. ev->data.key.utf8[1] = '\0';
  272. return 1;
  273. }
  274. /* If the key was UTF-8, parse the whole sequence */
  275. if(intkey >= 0x80 && intkey < 0x100)
  276. {
  277. int keys[7]; /* Necessary for ungetkey(); */
  278. char utf8[7];
  279. uint32_t utf32;
  280. unsigned int i;
  281. size_t bytes = 0;
  282. keys[0] = intkey;
  283. utf8[0] = intkey;
  284. for(i = 1; i < 6; i++)
  285. {
  286. if(!SLang_input_pending(0))
  287. break;
  288. keys[i] = SLang_getkey();
  289. utf8[i] = (unsigned char)keys[i];
  290. }
  291. utf8[i] = '\0';
  292. utf32 = cucul_utf8_to_utf32(utf8, &bytes);
  293. while(i > bytes)
  294. SLang_ungetkey(keys[--i]);
  295. if(bytes)
  296. {
  297. ev->type = CACA_EVENT_KEY_PRESS;
  298. ev->data.key.ch = 0;
  299. ev->data.key.utf32 = utf32;
  300. strcpy(ev->data.key.utf8, utf8);
  301. return 1;
  302. }
  303. }
  304. if(intkey == 0x3e9)
  305. {
  306. int button = (SLang_getkey() - ' ' + 1) & 0xf;
  307. unsigned int x = SLang_getkey() - '!';
  308. unsigned int y = SLang_getkey() - '!';
  309. ev->data.mouse.button = button;
  310. ev->type = CACA_EVENT_MOUSE_PRESS;
  311. _push_event(dp, ev);
  312. ev->type = CACA_EVENT_MOUSE_RELEASE;
  313. _push_event(dp, ev);
  314. if(dp->mouse.x == x && dp->mouse.y == y)
  315. return _pop_event(dp, ev);
  316. dp->mouse.x = x;
  317. dp->mouse.y = y;
  318. ev->type = CACA_EVENT_MOUSE_MOTION;
  319. ev->data.mouse.x = dp->mouse.x;
  320. ev->data.mouse.y = dp->mouse.y;
  321. return 1;
  322. }
  323. switch(intkey)
  324. {
  325. case SL_KEY_UP: ev->data.key.ch = CACA_KEY_UP; break;
  326. case SL_KEY_DOWN: ev->data.key.ch = CACA_KEY_DOWN; break;
  327. case SL_KEY_LEFT: ev->data.key.ch = CACA_KEY_LEFT; break;
  328. case SL_KEY_RIGHT: ev->data.key.ch = CACA_KEY_RIGHT; break;
  329. case SL_KEY_IC: ev->data.key.ch = CACA_KEY_INSERT; break;
  330. case SL_KEY_DELETE: ev->data.key.ch = CACA_KEY_DELETE; break;
  331. case 0x7f:
  332. case SL_KEY_BACKSPACE: ev->data.key.ch = CACA_KEY_BACKSPACE; break;
  333. case SL_KEY_HOME: ev->data.key.ch = CACA_KEY_HOME; break;
  334. case SL_KEY_END: ev->data.key.ch = CACA_KEY_END; break;
  335. case SL_KEY_PPAGE: ev->data.key.ch = CACA_KEY_PAGEUP; break;
  336. case SL_KEY_NPAGE: ev->data.key.ch = CACA_KEY_PAGEDOWN; break;
  337. case SL_KEY_F(1): ev->data.key.ch = CACA_KEY_F1; break;
  338. case SL_KEY_F(2): ev->data.key.ch = CACA_KEY_F2; break;
  339. case SL_KEY_F(3): ev->data.key.ch = CACA_KEY_F3; break;
  340. case SL_KEY_F(4): ev->data.key.ch = CACA_KEY_F4; break;
  341. case SL_KEY_F(5): ev->data.key.ch = CACA_KEY_F5; break;
  342. case SL_KEY_F(6): ev->data.key.ch = CACA_KEY_F6; break;
  343. case SL_KEY_F(7): ev->data.key.ch = CACA_KEY_F7; break;
  344. case SL_KEY_F(8): ev->data.key.ch = CACA_KEY_F8; break;
  345. case SL_KEY_F(9): ev->data.key.ch = CACA_KEY_F9; break;
  346. case SL_KEY_F(10): ev->data.key.ch = CACA_KEY_F10; break;
  347. case SL_KEY_F(11): ev->data.key.ch = CACA_KEY_F11; break;
  348. case SL_KEY_F(12): ev->data.key.ch = CACA_KEY_F12; break;
  349. default:
  350. /* Unknown key */
  351. ev->type = CACA_EVENT_NONE; return 0;
  352. }
  353. ev->type = CACA_EVENT_KEY_PRESS;
  354. ev->data.key.utf32 = 0;
  355. ev->data.key.utf8[0] = '\0';
  356. return 1;
  357. }
  358. static void slang_set_cursor(caca_display_t *dp, int flags)
  359. {
  360. SLtt_set_cursor_visibility(flags ? 1 : 0);
  361. }
  362. /*
  363. * XXX: following functions are local
  364. */
  365. static void slang_init_palette(void)
  366. {
  367. /* See SLang ref., 5.4.4. */
  368. static char *slang_colors[16] =
  369. {
  370. /* Standard colours */
  371. "black",
  372. "blue",
  373. "green",
  374. "cyan",
  375. "red",
  376. "magenta",
  377. "brown",
  378. "lightgray",
  379. /* Bright colours */
  380. "gray",
  381. "brightblue",
  382. "brightgreen",
  383. "brightcyan",
  384. "brightred",
  385. "brightmagenta",
  386. "yellow",
  387. "white",
  388. };
  389. #if defined(OPTIMISE_SLANG_PALETTE)
  390. int i;
  391. for(i = 0; i < 16 * 16; i++)
  392. SLtt_set_color(i, NULL, slang_colors[slang_palette[i * 2]],
  393. slang_colors[slang_palette[i * 2 + 1]]);
  394. #else
  395. int fg, bg;
  396. for(bg = 0; bg < 16; bg++)
  397. for(fg = 0; fg < 16; fg++)
  398. {
  399. int i = fg + 16 * bg;
  400. SLtt_set_color(i, NULL, slang_colors[fg], slang_colors[bg]);
  401. }
  402. #endif
  403. }
  404. static void slang_write_utf32(uint32_t ch)
  405. {
  406. #ifdef HAVE_SLSMG_UTF8_ENABLE
  407. char buf[10];
  408. int bytes;
  409. #else
  410. char ascii;
  411. #endif
  412. if(ch == CUCUL_MAGIC_FULLWIDTH)
  413. return;
  414. #ifdef HAVE_SLSMG_UTF8_ENABLE
  415. bytes = cucul_utf32_to_utf8(buf, ch);
  416. buf[bytes] = '\0';
  417. SLsmg_write_string(buf);
  418. #else
  419. ascii = cucul_utf32_to_ascii(ch);
  420. SLsmg_write_char(ascii);
  421. if(cucul_utf32_is_fullwidth(ch))
  422. SLsmg_write_char(ascii);
  423. #endif
  424. }
  425. #if defined(HAVE_SIGNAL)
  426. static RETSIGTYPE sigwinch_handler(int sig)
  427. {
  428. sigwinch_d->resize.resized = 1;
  429. signal(SIGWINCH, sigwinch_handler);
  430. }
  431. #endif
  432. #if defined(HAVE_GETENV) && defined(HAVE_PUTENV)
  433. static void slang_install_terminal(caca_display_t *dp)
  434. {
  435. char *term, *colorterm;
  436. dp->drv.p->term = NULL;
  437. term = getenv("TERM");
  438. colorterm = getenv("COLORTERM");
  439. if(!term || strcmp(term, "xterm"))
  440. return;
  441. /* If we are using gnome-terminal, it's really a 16 colour terminal.
  442. * Ditto if we are using xfce4-terminal, or Konsole. */
  443. if((colorterm && (!strcmp(colorterm, "gnome-terminal")
  444. || !strcmp(colorterm, "Terminal")))
  445. || getenv("KONSOLE_DCOP_SESSION"))
  446. {
  447. (void)putenv("TERM=xterm-16color");
  448. dp->drv.p->term = strdup(term);
  449. return;
  450. }
  451. }
  452. static void slang_uninstall_terminal(caca_display_t *dp)
  453. {
  454. /* Needs to be persistent because we use putenv() */
  455. static char termenv[1024];
  456. if(!dp->drv.p->term)
  457. return;
  458. snprintf(termenv, 1023, "TERM=%s", dp->drv.p->term);
  459. free(dp->drv.p->term);
  460. (void)putenv(termenv);
  461. }
  462. #endif
  463. /*
  464. * Driver initialisation
  465. */
  466. int slang_install(caca_display_t *dp)
  467. {
  468. dp->drv.id = CACA_DRIVER_SLANG;
  469. dp->drv.driver = "slang";
  470. dp->drv.init_graphics = slang_init_graphics;
  471. dp->drv.end_graphics = slang_end_graphics;
  472. dp->drv.set_display_title = slang_set_display_title;
  473. dp->drv.get_display_width = slang_get_display_width;
  474. dp->drv.get_display_height = slang_get_display_height;
  475. dp->drv.display = slang_display;
  476. dp->drv.handle_resize = slang_handle_resize;
  477. dp->drv.get_event = slang_get_event;
  478. dp->drv.set_mouse = NULL;
  479. dp->drv.set_cursor = slang_set_cursor;
  480. return 0;
  481. }
  482. #endif /* USE_SLANG */