const UCHAR *cmd_list(const char *cmd) { UCHAR s[68]; const UCHAR *p = dir0; unsigned int i; if ((flag & 0x03) == 0) errend(31); /* list command error */ do { if (*p == '\0') break; if (*p != 0xe5 && (p[11] & 0x08) == 0) { *(int *) &s[0] = *(int *) &p[0]; *(int *) &s[4] = *(int *) &p[4]; *(int *) &s[8] = (*(int *) &p[8]) << 8 | ' '; i = 0x20202020; *(int *) &s[16] = *(int *) &s[12] = i; *(int *) &s[32] = *(int *) &s[28] = i; *(int *) &s[40] = *(int *) &s[36] = i; *(int *) &s[48] = *(int *) &s[44] = i; *(int *) &s[56] = *(int *) &s[52] = i; *(int *) &s[64] = 0x000a2020; *(int *) &s[24] = *(int *) &s[20] = 0x2d2d2d2d; s[19] = '['; s[28] = ']'; if (p[11] & 0x10) { *(int *) &s[12] = 0x49443c20; *(short *) &s[12] = 0x3e52; s[23] = 'd'; } if (p[11] & 0x80) s[20] = '?'; if (p[11] & 0x40) s[21] = '?'; if (p[11] & 0x20) s[22] = 'a'; if (p[11] & 0x04) s[25] = 's'; if (p[11] & 0x02) s[26] = 'h'; if (p[11] & 0x01) s[27] = 'r'; setdec(&s[38], *(int *) &p[28], 9); if ((i = *(unsigned short *) &p[24]) != 0) { setdec(&s[42], (i >> 9) + 80, 2); s[43] = '-'; setdec(&s[45], ((i >> 5) & 0x0f) + 100, 2); s[46] = '-'; setdec(&s[48], (i & 0x1f) + 100, 2); i = *(unsigned short *) &p[22]; setdec(&s[51], i >> 11, 2); s[52] = ':'; setdec(&s[54], ((i >> 5) & 0x3f) + 100, 2); s[55] = ':'; setdec(&s[57], ((i & 0x1f) << 1) + 100, 2); } s[60] = '#'; setdec(&s[65], 100000 + *(unsigned short *) &p[26], 5); fputs(s, stdout); }
void Putcellinfo(int x, int y, struct CSV_INFO *csvinfo) /* セル番地の表示 */ { int i; char s[TBOX_X + 1]; for (i = 0; i < TBOX_X; i++) {s[i] = ' ';} s[0] = '('; s[9] = ')'; s[TBOX_X] = '\0'; i = setdec(y + 1, s, 7); // これは行番号 s[i--] = 0x41 + (x % 26); // ここから列番号 if (x > 25) s[i] = 0x40 + (x / 26); api_boxfilwin(win, 6, 26, 6 + TBOX_X * 8, 41, 8); api_putstrwin(win, 6, 26, 0, TBOX_X, s); // 表示1 i = GetCellData(s, csvinfo, csvinfo->comma[y][x], TBOX_X-12); if (i >= 0) { s[i] = 0; api_putstrwin(win, 86, 26, 0, i, s); // 表示2 } return; }
float getdec(char *ident, int *status) { varentry_t *var = lookupvar(ident, decimal); float out; *status = ERROR_NONE; if(var == NULL) { out = setdec(ident, "0", status); } else { out = var->val.decimal; } return out; }
void PutCell(int bx, int by, struct CSV_INFO *csvinfo) { int i, tx = bx, ty = by, y; char s[11]; s[10] = '\0'; for (i = 0; i < 10; i++) {s[i] = ' ';} for (i=1; i<maxell_y;i++) { setdec(ty, s, 5); ty++; putstr(2, CELLSIZ_Y*i+2, 7, 12, 10, s); } for (i = 0; i < 10; i++) {s[i] = ' ';} i = 1; for (;;) { tx = bx + i - 2; if (tx > 25) s[4] = 0x40 + (tx / 26); s[5] = 0x41 + (tx % 26); putstr(CELLSIZ_X*i+2, 2, 7, 12, 10, s); i++; if (i >= maxell_x) break; } /* Read file */ for (y = 1; y < maxell_y; y++) { int x; for (x = 1; x < maxell_x; x++) { tx = bx+x-2; // tx, tyをリサイクル ty = by+y-2; for (i = 0; i < 10; i++) {s[i] = ' ';} putstr(CELLSIZ_X*x+2, CELLSIZ_Y*y+2, 0, 7, 10, s); i = GetCellData(s, csvinfo, csvinfo->comma[ty][tx], 10); if (i >= 0) { putstr(CELLSIZ_X*x+2, CELLSIZ_Y*y+2, 0, 7, 10, s); } } } return; }