comparison src/pr-output.cc @ 1488:89c587478067

[project @ 1995-09-26 22:49:48 by jwe]
author jwe
date Tue, 26 Sep 1995 22:49:48 +0000
parents 19c10b8657d5
children 0d9e10d10bd7
comparison
equal deleted inserted replaced
1487:eaf4f68d3757 1488:89c587478067
870 #define PRINT_CHAR_BITS(os, c) \ 870 #define PRINT_CHAR_BITS(os, c) \
871 do \ 871 do \
872 { \ 872 { \
873 unsigned char ctmp = c; \ 873 unsigned char ctmp = c; \
874 char stmp[9]; \ 874 char stmp[9]; \
875 stmp[0] = (c & 0x80) ? '1' : '0'; \ 875 stmp[0] = (ctmp & 0x80) ? '1' : '0'; \
876 stmp[1] = (c & 0x40) ? '1' : '0'; \ 876 stmp[1] = (ctmp & 0x40) ? '1' : '0'; \
877 stmp[2] = (c & 0x20) ? '1' : '0'; \ 877 stmp[2] = (ctmp & 0x20) ? '1' : '0'; \
878 stmp[3] = (c & 0x10) ? '1' : '0'; \ 878 stmp[3] = (ctmp & 0x10) ? '1' : '0'; \
879 stmp[4] = (c & 0x08) ? '1' : '0'; \ 879 stmp[4] = (ctmp & 0x08) ? '1' : '0'; \
880 stmp[5] = (c & 0x04) ? '1' : '0'; \ 880 stmp[5] = (ctmp & 0x04) ? '1' : '0'; \
881 stmp[6] = (c & 0x02) ? '1' : '0'; \ 881 stmp[6] = (ctmp & 0x02) ? '1' : '0'; \
882 stmp[7] = (c & 0x01) ? '1' : '0'; \ 882 stmp[7] = (ctmp & 0x01) ? '1' : '0'; \
883 stmp[8] = '\0'; \ 883 stmp[8] = '\0'; \
884 os.form ("%s", stmp); \ 884 os.form ("%s", stmp); \
885 } \ 885 } \
886 while (0) 886 while (0)
887 887
888 #define PRINT_CHAR_BITS_SWAPPED(os, c) \ 888 #define PRINT_CHAR_BITS_SWAPPED(os, c) \
889 do \ 889 do \
890 { \ 890 { \
891 unsigned char ctmp = c; \ 891 unsigned char ctmp = c; \
892 char stmp[9]; \ 892 char stmp[9]; \
893 stmp[0] = (c & 0x01) ? '1' : '0'; \ 893 stmp[0] = (ctmp & 0x01) ? '1' : '0'; \
894 stmp[1] = (c & 0x02) ? '1' : '0'; \ 894 stmp[1] = (ctmp & 0x02) ? '1' : '0'; \
895 stmp[2] = (c & 0x04) ? '1' : '0'; \ 895 stmp[2] = (ctmp & 0x04) ? '1' : '0'; \
896 stmp[3] = (c & 0x08) ? '1' : '0'; \ 896 stmp[3] = (ctmp & 0x08) ? '1' : '0'; \
897 stmp[4] = (c & 0x10) ? '1' : '0'; \ 897 stmp[4] = (ctmp & 0x10) ? '1' : '0'; \
898 stmp[5] = (c & 0x20) ? '1' : '0'; \ 898 stmp[5] = (ctmp & 0x20) ? '1' : '0'; \
899 stmp[6] = (c & 0x40) ? '1' : '0'; \ 899 stmp[6] = (ctmp & 0x40) ? '1' : '0'; \
900 stmp[7] = (c & 0x80) ? '1' : '0'; \ 900 stmp[7] = (ctmp & 0x80) ? '1' : '0'; \
901 stmp[8] = '\0'; \ 901 stmp[8] = '\0'; \
902 os.form ("%s", stmp); \ 902 os.form ("%s", stmp); \
903 } \ 903 } \
904 while (0) 904 while (0)
905 905
1477 1477
1478 if (pr_as_read_syntax && nstr > 1) 1478 if (pr_as_read_syntax && nstr > 1)
1479 os << " ]"; 1479 os << " ]";
1480 } 1480 }
1481 1481
1482 DEFUN ("disp", Fdisp, Sdisp, 1, 1, 1482 DEFUN ("disp", Fdisp, Sdisp, 10,
1483 "disp (X): display value without name tag") 1483 "disp (X): display value without name tag")
1484 { 1484 {
1485 Octave_object retval; 1485 Octave_object retval;
1486 1486
1487 int nargin = args.length (); 1487 int nargin = args.length ();
1639 init_format_state (); 1639 init_format_state ();
1640 set_output_prec_and_fw (5, 10); 1640 set_output_prec_and_fw (5, 10);
1641 } 1641 }
1642 } 1642 }
1643 1643
1644 DEFUN_TEXT ("format", Fformat, Sformat, -1, 1, 1644 DEFUN_TEXT ("format", Fformat, Sformat, 10,
1645 "format [style]\n\ 1645 "format [style]\n\
1646 \n\ 1646 \n\
1647 set output formatting style") 1647 set output formatting style")
1648 { 1648 {
1649 Octave_object retval; 1649 Octave_object retval;