patch-2.4.2 linux/arch/cris/kernel/hexify.c
Next file: linux/arch/cris/kernel/irq.c
Previous file: linux/arch/cris/kernel/head.S
Back to the patch index
Back to the overall index
- Lines: 32
- Date:
Thu Feb 8 16:32:44 2001
- Orig file:
v2.4.1/linux/arch/cris/kernel/hexify.c
- Orig date:
Wed Dec 31 16:00:00 1969
diff -u --recursive --new-file v2.4.1/linux/arch/cris/kernel/hexify.c linux/arch/cris/kernel/hexify.c
@@ -0,0 +1,31 @@
+#include <stdio.h>
+
+
+void main()
+{
+ int c;
+ int comma=0;
+ int count=0;
+ while((c=getchar())!=EOF)
+ {
+ unsigned char x=c;
+ if(comma)
+ printf(",");
+ else
+ comma=1;
+ if(count==8)
+ {
+ count=0;
+ printf("\n");
+ }
+ if(count==0)
+ printf("\t");
+ printf("0x%02X",c);
+ count++;
+ }
+ if(count)
+ printf("\n");
+ exit(0);
+}
+
+
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)