+++ /dev/null
-/* putnum.c -- put a hex number on the output device.\r
- * \r
- * Copyright (c) 1995 Cygnus Support\r
- *\r
- * The authors hereby grant permission to use, copy, modify, distribute,\r
- * and license this software and its documentation for any purpose, provided\r
- * that existing copyright notices are retained in all copies and that this\r
- * notice is included verbatim in any distributions. No written agreement,\r
- * license, or royalty fee is required for any of the authorized uses.\r
- * Modifications to this software may be copyrighted by their authors\r
- * and need not follow the licensing terms described here, provided that\r
- * the new terms are clearly indicated on the first page of each file where\r
- * they apply.\r
- */\r
-#include "glue.h"\r
-void print(char *str);\r
-/*\r
- * putnum -- print a 32 bit number in hex\r
- */\r
-void\r
-_DEFUN (putnum, (num),\r
- unsigned int num)\r
-{\r
- char buf[9];\r
- int cnt;\r
- char *ptr;\r
- int digit;\r
- \r
- ptr = buf;\r
- for (cnt = 7 ; cnt >= 0 ; cnt--) {\r
- digit = (num >> (cnt * 4)) & 0xf;\r
- \r
- if (digit <= 9)\r
- *ptr++ = (char) ('0' + digit);\r
- else\r
- *ptr++ = (char) ('a' - 10 + digit);\r
- }\r
-\r
- *ptr = (char) 0;\r
- print (buf);\r
-}\r