Subversion Repositories SvarDOS

Rev

Rev 2217 | Rev 2225 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2217 Rev 2218
Line 534... Line 534...
534
 
534
 
535
 
535
 
536
static void dir_print_summary_files(char *buff64, unsigned short uint32maxlen, unsigned long summary_totsz, unsigned long summary_fcount, unsigned short *availrows, unsigned char flags, const struct nls_patterns *nls) {
536
static void dir_print_summary_files(char *buff64, unsigned short uint32maxlen, unsigned long summary_totsz, unsigned long summary_fcount, unsigned short *availrows, unsigned char flags, const struct nls_patterns *nls) {
537
  unsigned short i;
537
  unsigned short i;
538
  /* x file(s) (maximum of files in a FAT-32 directory is 65'535) */
538
  /* x file(s) (maximum of files in a FAT-32 directory is 65'535) */
539
  memset(buff64, ' ', 8);
539
  sv_memset(buff64, ' ', 8);
540
  i = nls_format_number(buff64 + 8, summary_fcount, nls);
540
  i = nls_format_number(buff64 + 8, summary_fcount, nls);
541
  sprintf(buff64 + 8 + i, " %s ", svarlang_str(37,22)/*"file(s)"*/);
541
  sprintf(buff64 + 8 + i, " %s ", svarlang_str(37,22)/*"file(s)"*/);
542
  output(buff64 + i);
542
  output(buff64 + i);
543
  /* xxxx bytes */
543
  /* xxxx bytes */
544
  memset(buff64, ' ', 14);
544
  sv_memset(buff64, ' ', 14);
545
  i = nls_format_number(buff64 + uint32maxlen, summary_totsz, nls);
545
  i = nls_format_number(buff64 + uint32maxlen, summary_totsz, nls);
546
  output(buff64 + i + 1);
546
  output(buff64 + i + 1);
547
  output(" ");
547
  output(" ");
548
  nls_outputnl(37,23); /* "bytes" */
548
  nls_outputnl(37,23); /* "bytes" */
549
  if (flags & DIR_FLAG_PAUSE) dir_pagination(availrows);
549
  if (flags & DIR_FLAG_PAUSE) dir_pagination(availrows);
Line 844... Line 844...
844
    if (filter_attribs(dta, req.attrfilter_must, req.attrfilter_may) == 0) goto NEXT_ENTRY;
844
    if (filter_attribs(dta, req.attrfilter_must, req.attrfilter_may) == 0) goto NEXT_ENTRY;
845
 
845
 
846
    /* /B hides . and .. entries */
846
    /* /B hides . and .. entries */
847
    if ((req.format == DIR_OUTPUT_BARE) && (dta->fname[0] == '.')) continue;
847
    if ((req.format == DIR_OUTPUT_BARE) && (dta->fname[0] == '.')) continue;
848
 
848
 
849
    /* turn string lcase (/L) */
849
    /* turn string lcase (/L) - naive method, only low-ascii */
850
    if (req.flags & DIR_FLAG_LCASE) _strlwr(dta->fname); /* OpenWatcom extension, probably does not care about NLS so results may be odd with non-A-Z characters... */
850
    if (req.flags & DIR_FLAG_LCASE) {
-
 
851
      char *s = dta->fname;
-
 
852
      while (*s != 0) {
-
 
853
        if ((*s >= 'A') && (*s <= 'Z')) *s |= 0x20;
-
 
854
        s++;
-
 
855
      }
-
 
856
    }
851
 
857
 
852
    summary_fcount++;
858
    summary_fcount++;
853
    if ((dta->attr & DOS_ATTR_DIR) == 0) summary_totsz += dta->size;
859
    if ((dta->attr & DOS_ATTR_DIR) == 0) summary_totsz += dta->size;
854
 
860
 
855
    switch (req.format) {
861
    switch (req.format) {
Line 868... Line 874...
868
        output(" ");
874
        output(" ");
869
        /* either <DIR> or right aligned 13 or 10 chars byte size, depending
875
        /* either <DIR> or right aligned 13 or 10 chars byte size, depending
870
         * on the presence of a thousands delimiter (max 2'000'000'000) */
876
         * on the presence of a thousands delimiter (max 2'000'000'000) */
871
        {
877
        {
872
          unsigned short szlen = 10 + (sv_strlen(buf->nls.thousep) * 3);
878
          unsigned short szlen = 10 + (sv_strlen(buf->nls.thousep) * 3);
873
          memset(buf->buff64, ' ', 16);
879
          sv_memset(buf->buff64, ' ', 16);
874
          if (dta->attr & DOS_ATTR_DIR) {
880
          if (dta->attr & DOS_ATTR_DIR) {
875
            sv_strcpy(buf->buff64 + szlen, svarlang_str(37,21));
881
            sv_strcpy(buf->buff64 + szlen, svarlang_str(37,21));
876
          } else {
882
          } else {
877
            nls_format_number(buf->buff64 + 12, dta->size, &(buf->nls));
883
            nls_format_number(buf->buff64 + 12, dta->size, &(buf->nls));
878
          }
884
          }
Line 1007... Line 1013...
1007
      }
1013
      }
1008
    }
1014
    }
1009
    /* xxxx bytes free */
1015
    /* xxxx bytes free */
1010
    i = cmd_dir_df(&summary_totsz, drv);
1016
    i = cmd_dir_df(&summary_totsz, drv);
1011
    if (i != 0) nls_outputnl_doserr(i);
1017
    if (i != 0) nls_outputnl_doserr(i);
1012
    memset(buf->buff64, ' ', summary_alignpos + 8 + uint32maxlen); /* align the freebytes value to same column as totbytes */
1018
    sv_memset(buf->buff64, ' ', summary_alignpos + 8 + uint32maxlen); /* align the freebytes value to same column as totbytes */
1013
    i = nls_format_number(buf->buff64 + summary_alignpos + 8 + uint32maxlen, summary_totsz, &(buf->nls));
1019
    i = nls_format_number(buf->buff64 + summary_alignpos + 8 + uint32maxlen, summary_totsz, &(buf->nls));
1014
    output(buf->buff64 + i + 1);
1020
    output(buf->buff64 + i + 1);
1015
    output(" ");
1021
    output(" ");
1016
    nls_outputnl(37,24); /* "bytes free" */
1022
    nls_outputnl(37,24); /* "bytes free" */
1017
    if (req.flags & DIR_FLAG_PAUSE) dir_pagination(&availrows);
1023
    if (req.flags & DIR_FLAG_PAUSE) dir_pagination(&availrows);