/**[txh]******************************************************************** Copyright (c) 2005 Juan Pablo D. Borgna Copyright (c) 2006-2007 Salvador E. Tropea Copyright (c) 2005-2007 Instituto Nacional de Tecnología Industrial This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA Description: Low level functions to output hexadecimal bitstreams. ***************************************************************************/ /***************************************************************************** Target: Any Language: C Compiler: gcc 3.3.5 (Debian GNU/Linux) Text editor: SETEdit 0.5.5 *****************************************************************************/ #include #include #include #include "global.h" #include "bitshandle.h" /* This function returns the inverted bits of its argument */ unsigned char inv_byte(unsigned char b) { int i; unsigned char t=0; for (i=0;i<7;i++) { t|= (b & 0x01); t = t << 1; b = b >> 1; } t|=b & 0x01; return t; } /* This function is used to generate a string with the hex value of the inverted bits of from */ void pbi(char *to, char *from,long nbytes) { int i; int j; char t[]="ZZ"; if (to==NULL) return; j=nbytes*2; for (i=0;i