X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Ftinfo%2Flib_tparm.c;h=4f18859f7e43d247bb205867f1d2566954cf1edc;hp=bca90c8cbeb15dadcbbb5774cfa9d1a1d150e4e2;hb=a3725e39272393790e32a083fd7391aad607828d;hpb=34d602f272c394e9a980438e636e1ce4d355f83b diff --git a/ncurses/tinfo/lib_tparm.c b/ncurses/tinfo/lib_tparm.c index bca90c8c..4f18859f 100644 --- a/ncurses/tinfo/lib_tparm.c +++ b/ncurses/tinfo/lib_tparm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 1998-2014,2015 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,7 +42,7 @@ #include #include -MODULE_ID("$Id: lib_tparm.c,v 1.92 2014/05/23 00:33:45 tom Exp $") +MODULE_ID("$Id: lib_tparm.c,v 1.94 2015/07/17 01:03:35 tom Exp $") /* * char * @@ -253,6 +253,9 @@ parse_format(const char *s, char *format, int *len) case 'x': /* FALLTHRU */ case 'X': /* FALLTHRU */ case 's': +#ifdef EXP_XTERM_1005 + case 'u': +#endif *format++ = *s; done = TRUE; break; @@ -372,6 +375,9 @@ _nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) case 'x': /* FALLTHRU */ case 'X': /* FALLTHRU */ case 'c': /* FALLTHRU */ +#ifdef EXP_XTERM_1005 + case 'u': +#endif if (lastpop <= 0) number++; lastpop = -1; @@ -567,6 +573,20 @@ tparam_internal(int use_TPARM_ARG, const char *string, va_list ap) save_char(npop()); break; +#ifdef EXP_XTERM_1005 + case 'u': + { + unsigned char target[10]; + unsigned source = (unsigned) npop(); + int rc = _nc_conv_to_utf8(target, source, (unsigned) + sizeof(target)); + int n; + for (n = 0; n < rc; ++n) { + save_char(target[n]); + } + } + break; +#endif case 'l': npush((int) strlen(spop())); break; @@ -652,11 +672,15 @@ tparam_internal(int use_TPARM_ARG, const char *string, va_list ap) break; case 'A': - npush(npop() && npop()); + y = npop(); + x = npop(); + npush(y && x); break; case 'O': - npush(npop() || npop()); + y = npop(); + x = npop(); + npush(y || x); break; case '&':