diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-07-11 22:20:14 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-07-11 22:20:14 +0200 |
commit | 7beb00cd8d28c3d5893ce3db907a828d64afdea9 (patch) | |
tree | 395a3dee2fe197b8284dee02c5f527889df78413 /spectro/instappsup.c | |
parent | e2d30e0583c047a4bedf4c8d0c86320f1b3fd8ed (diff) | |
parent | a0442ed58dee48a521ea053083ea967894507898 (diff) |
Update upstream source from tag 'upstream/2.0.1+repack'
Update to upstream version '2.0.1+repack'
with Debian dir 6edb5dd2df9aca152662fc4a8f72bd6d86f8552e
Diffstat (limited to 'spectro/instappsup.c')
-rwxr-xr-x | spectro/instappsup.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/spectro/instappsup.c b/spectro/instappsup.c index 6c3dd68..0cb5798 100755 --- a/spectro/instappsup.c +++ b/spectro/instappsup.c @@ -479,6 +479,7 @@ inst2_capability inst_show_disptype_options(FILE *fp, char *oline, icompaths *ic if (docbib && sels[j].cbid == 0) continue; /* Skip non cbid type */ + /* Break up selector chars/pairs with '|' */ m = pstart; for (k = 0; k < (INST_DTYPE_SEL_LEN-1); k++) { if (sels[j].sel[k] == '\000') @@ -486,6 +487,8 @@ inst2_capability inst_show_disptype_options(FILE *fp, char *oline, icompaths *ic if (m > pstart) buf[m++] = '|'; buf[m++] = sels[j].sel[k]; + if (sels[j].sel[k] == '_') + buf[m++] = sels[j].sel[++k]; } while (m < (olen+1)) /* Indent it by 1 */ buf[m++] = ' '; @@ -534,8 +537,9 @@ inst2_capability inst_show_disptype_options(FILE *fp, char *oline, icompaths *ic /* A helper function to turn a -y flag into a selection index */ /* If docbib is nz, then only allow base calibration display types */ +/* c will be 16 bits ('_' + 'X') if a 2 char selector */ /* Return -1 on error */ -int inst_get_disptype_index(inst *it, int c, int docbib) { +int inst_get_disptype_index(inst *it, int ditype, int docbib) { inst2_capability cap; int j, k; @@ -555,7 +559,14 @@ int inst_get_disptype_index(inst *it, int c, int docbib) { for (k = 0; k < (INST_DTYPE_SEL_LEN-1); k++) { if (sels[j].sel[k] == '\000') break; - if (sels[j].sel[k] == c) { + if (sels[j].sel[k] == '_') { /* 2 char selector */ + k++; + if (sels[j].sel[k-1] == (0xff & (ditype >> 8)) + && sels[j].sel[k] == (0xff & ditype)) { + return j; + } + } + if (sels[j].sel[k] == ditype) { return j; } } @@ -564,6 +575,21 @@ int inst_get_disptype_index(inst *it, int c, int docbib) { return -1; } +/* Return a static string of the ditype flag char(s) */ +char *inst_distr(int ditype) { + static char buf[5]; + + if ((ditype >> 8) & 0xff) { + buf[0] = (ditype >> 8) & 0xff; + buf[1] = ditype & 0xff; + buf[2] = '\000'; + } else { + buf[0] = ditype; + buf[1] = '\000'; + } + + return buf; +} /* ================================================================= */ |