--- iprint-1.3.orig/i.1 +++ iprint-1.3/i.1 @@ -0,0 +1,26 @@ +.TH i 1 +.SH NAME +i \- trivial integer print utility +.SH SYNOPSIS +.B i +.I "arguments ..." +.SH "DESCRIPTION" +Given one or more arguments on the command line, it will print them in +decimal, hexadecimal, octal and as ASCII characters (if printable). If an +argument begins with 0x, it is assumed to be hexadecimal. Otherwise +if an argument begins with 0, it is assumed to be octal. Otherwise, +if an argument begins with 0b or 0B, it is assumed to be binary. Otherwise, +if an argument begins with a digit, it is assumed to be a decimal +number. Otherwise, the argument is treated as one ASCII character at +a time. +.SH OPTIONS +.B i +doesn't take any options, but invoking it it with any arbitrary text string, +such as "1234", "\-\-help", etc., would demonstrate how +the program functions. +.SH "SEE ALSO" +ascii(7) +.SH AUTHOR +This manual page was written by Paul Russell , +for the Debian GNU/Linux system (but may be used by others). + --- iprint-1.3.orig/i.c +++ iprint-1.3/i.c @@ -1,23 +1,70 @@ /* a surprising useful little program! (tridge@samba.org) */ #include #include +#include #include +static char escape[14] = {'0',0,0,0,0,0,0,'a','b','t','n','v','f','r'}; + +static void print_binary(unsigned long long v) +{ + unsigned long long bit; + + if (v == 0ULL) + printf(" 0b0"); + else + printf(" 0b"); + + for (bit = 1ULL<<63; bit; bit>>=1) + if (v >= bit) + printf("%c", (v & bit) ? '1' : '0'); +} + +static unsigned long long convert_binary(const char *s) +{ + unsigned long long v = 0; + + for (; *s; s++) { + v <<= 1; + if (*s == '1') + v |= 1; + } + return v; +} + static void print_one(unsigned long long v) { printf("%llu 0x%llX 0%llo", v, v, v); - if (v < 256 && isprint(v)) printf(" '%c'", (unsigned char)v); + print_binary(v); + + if (v < 256) { + if (isprint(v)) + printf(" '%c'", (unsigned char)v); + else if (v < 14 && escape[v] != 0) + printf(" '\\%c'", escape[v]); + } printf("\n"); } int main(int argc,char *argv[]) { int i; - for (i=1;i Sat, 10 Mar 2012 21:38:14 +0100 + +iprint (1.3-8) unstable; urgency=low + + * Clarify manpage (Closes: #394813). + + -- Thijs Kinkhorst Tue, 24 Oct 2006 19:21:47 +0200 + +iprint (1.3-7) unstable; urgency=low + + * Upgrade debhelper compatibility to the recommended level 5. + * Tweak copyright file. + * Checked for standards version 3.7.2, no changes necessary. + * Update maintainer address. + + -- Thijs Kinkhorst Tue, 4 Jul 2006 15:19:09 +0200 + +iprint (1.3-6) unstable; urgency=low + + * Adopt package (Closes: #312869). + * Tweak manual page. + + -- Thijs Kinkhorst Fri, 12 Aug 2005 14:46:29 +0200 + +iprint (1.3-5) unstable; urgency=low + + * QA upload. Switch to debhelper. + + -- Santiago Vila Wed, 3 Aug 2005 17:36:24 +0200 + +iprint (1.3-4) unstable; urgency=low + + * QA Group upload orphaning this package + + -- Andrew Pollock Mon, 4 Jul 2005 20:54:55 +1000 + +iprint (1.3-3) unstable; urgency=low + + * Change strtoll to strtoull (Closes: #203589) + * Apply binary and escape code patches (Closes: #172916) + + -- Paul Russell Fri, 26 Sep 2003 09:54:40 +0200 + +iprint (1.3-2) unstable; urgency=low + + * Build-Depends added debmake (closes: #117769) + + -- Paul Russell Sat, 3 Nov 2001 04:28:29 +0100 + +iprint (1.3-1) unstable; urgency=low + + * Initial release (closes: #117123) + * Added simple Makefile. + + -- Paul Russell Sun, 28 Oct 2001 09:39:54 +0100 --- iprint-1.3.orig/debian/control +++ iprint-1.3/debian/control @@ -0,0 +1,13 @@ +Source: iprint +Section: utils +Priority: optional +Maintainer: Thijs Kinkhorst +Standards-Version: 3.9.3 +Build-Depends: debhelper (>= 9) + +Package: iprint +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Trivial command-line integer print utility + iprint is a simple utility to print out the decimal, octal, hexadecimal, + and binary or ascii values of the characters fed to it on the command line. --- iprint-1.3.orig/debian/rules +++ iprint-1.3/debian/rules @@ -0,0 +1,3 @@ +#!/usr/bin/make -f +%: + dh $@ --- iprint-1.3.orig/debian/copyright +++ iprint-1.3/debian/copyright @@ -0,0 +1,16 @@ +This package was debianized by Paul Russell prussell@alderaan.franken.de on +Mon, 8 Oct 2001 18:00:19 +1000. Since Aug 2005, it is maintained by +Thijs Kinkhorst . + + +It was downloaded using rsync from samba.org::cvs/junkcode/i.c,v. + +Upstream Author: Andrew Tridgell + +This software is copyright (c) 2000,2001 by Andrew Tridgell + +You are free to distribute this software under the terms of the GNU +General Public License. + +On Debian systems, the complete text of the GNU General Public +License can be found in /usr/share/common-licenses/GPL file. --- iprint-1.3.orig/debian/compat +++ iprint-1.3/debian/compat @@ -0,0 +1 @@ +9 --- iprint-1.3.orig/debian/dirs +++ iprint-1.3/debian/dirs @@ -0,0 +1 @@ +usr/bin