Skip to content
Snippets Groups Projects
Commit 21b625f0 authored by rswindell's avatar rswindell
Browse files

New @-code format modifier: -D

When appended to an @-code, displays it double-wide using "fullwidth" Unicode
code points if possible, spaces between the characters otherwise.
parent 394e1759
No related branches found
No related tags found
No related merge requests found
...@@ -60,6 +60,7 @@ int sbbs_t::show_atcode(const char *instr) ...@@ -60,6 +60,7 @@ int sbbs_t::show_atcode(const char *instr)
bool centered=false; bool centered=false;
bool zero_padded=false; bool zero_padded=false;
bool truncated = true; bool truncated = true;
bool doubled = false;
const char *cp; const char *cp;
SAFECOPY(str,instr); SAFECOPY(str,instr);
...@@ -80,6 +81,8 @@ int sbbs_t::show_atcode(const char *instr) ...@@ -80,6 +81,8 @@ int sbbs_t::show_atcode(const char *instr)
padded_right=true; padded_right=true;
else if((p=strstr(sp,"-C"))!=NULL) else if((p=strstr(sp,"-C"))!=NULL)
centered=true; centered=true;
else if((p=strstr(sp,"-D"))!=NULL)
doubled=true;
else if((p=strstr(sp,"-Z"))!=NULL) else if((p=strstr(sp,"-Z"))!=NULL)
zero_padded=true; zero_padded=true;
else if((p=strstr(sp,"-W"))!=NULL) /* wrap */ else if((p=strstr(sp,"-W"))!=NULL) /* wrap */
...@@ -117,6 +120,8 @@ int sbbs_t::show_atcode(const char *instr) ...@@ -117,6 +120,8 @@ int sbbs_t::show_atcode(const char *instr)
bprintf("%*s%-*s", left, "", disp_len - left, cp); bprintf("%*s%-*s", left, "", disp_len - left, cp);
} else } else
bprintf("%.*s", disp_len, cp); bprintf("%.*s", disp_len, cp);
} else if(doubled) {
wide(cp);
} else if(zero_padded) { } else if(zero_padded) {
int vlen = strlen(cp); int vlen = strlen(cp);
if(vlen < disp_len) if(vlen < disp_len)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment