version 1.117, 2020/01/19 16:44:50 |
version 1.120, 2022/04/13 13:19:34 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
|
* Copyright (c) 2011-2015, 2017-2022 Ingo Schwarze <schwarze@openbsd.org> |
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv> |
* Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org> |
|
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
Line 74 mandoc_font(const char *cp, int sz) |
|
Line 74 mandoc_font(const char *cp, int sz) |
|
case 'C': |
case 'C': |
switch (cp[1]) { |
switch (cp[1]) { |
case 'B': |
case 'B': |
return ESCAPE_FONTBOLD; |
return ESCAPE_FONTCB; |
case 'I': |
case 'I': |
return ESCAPE_FONTITALIC; |
return ESCAPE_FONTCI; |
case 'R': |
case 'R': |
case 'W': |
case 'W': |
return ESCAPE_FONTCW; |
return ESCAPE_FONTCR; |
default: |
default: |
return ESCAPE_ERROR; |
return ESCAPE_ERROR; |
} |
} |
Line 114 mandoc_escape(const char **end, const char **start, in |
|
Line 114 mandoc_escape(const char **end, const char **start, in |
|
* it only makes a difference in copy mode. |
* it only makes a difference in copy mode. |
*/ |
*/ |
|
|
if (**end == 'E') |
while (**end == 'E') |
++*end; |
++*end; |
|
|
/* |
/* |
Line 203 mandoc_escape(const char **end, const char **start, in |
|
Line 203 mandoc_escape(const char **end, const char **start, in |
|
case 'O': |
case 'O': |
case 'V': |
case 'V': |
case 'Y': |
case 'Y': |
gly = (*start)[-1] == 'f' ? ESCAPE_FONT : ESCAPE_IGNORE; |
case '*': |
|
switch ((*start)[-1]) { |
|
case 'f': |
|
gly = ESCAPE_FONT; |
|
break; |
|
case '*': |
|
gly = ESCAPE_DEVICE; |
|
break; |
|
default: |
|
gly = ESCAPE_IGNORE; |
|
break; |
|
} |
switch (**start) { |
switch (**start) { |
case '(': |
case '(': |
if ((*start)[-1] == 'O') |
if ((*start)[-1] == 'O') |
Line 238 mandoc_escape(const char **end, const char **start, in |
|
Line 249 mandoc_escape(const char **end, const char **start, in |
|
break; |
break; |
} |
} |
break; |
break; |
case '*': |
|
if (strncmp(*start, "(.T", 3) != 0) |
|
abort(); |
|
gly = ESCAPE_DEVICE; |
|
*start = ++*end; |
|
*sz = 2; |
|
break; |
|
|
|
/* |
/* |
* These escapes are of the form \X'Y', where 'X' is the trigger |
* These escapes are of the form \X'Y', where 'X' is the trigger |
Line 458 mandoc_escape(const char **end, const char **start, in |
|
Line 462 mandoc_escape(const char **end, const char **start, in |
|
if ((int)strspn(*start + 1, "0123456789ABCDEFabcdef") |
if ((int)strspn(*start + 1, "0123456789ABCDEFabcdef") |
+ 1 == *sz) |
+ 1 == *sz) |
gly = ESCAPE_UNICODE; |
gly = ESCAPE_UNICODE; |
|
break; |
|
case ESCAPE_DEVICE: |
|
assert(*sz == 2 && (*start)[0] == '.' && (*start)[1] == 'T'); |
break; |
break; |
default: |
default: |
break; |
break; |