Files
harbour-core/contrib/hbgt/charodd.c
vszakats 9687850865 2013-03-16 02:10 UTC+0100 Viktor Szakats (harbour syenar.net)
* (all files)
    * stripped svn header
    * minor cleanups
    ; use following command to find out the history of files:
       git log
       git log --follow
       git blame
       git annotate
2013-03-16 02:11:42 +01:00

33 lines
663 B
C

/*
* GT CLIPPER STANDARD HEADER
*
* Author....: Andy M Leighton
* BBS.......: The Dark Knight Returns
* Date......: 1993-05-24
*
* This is an original work by Andy Leighton and is placed in the
* public domain.
*/
#include "hbapi.h"
HB_FUNC( GT_CHARODD )
{
if( HB_ISCHAR( 1 ) )
{
const char * s1 = hb_parc( 1 );
char * s2;
HB_ISIZ len = hb_parclen( 1 );
HB_ISIZ i;
s2 = ( char * ) hb_xgrab( len / 2 + 1 ); /* grab us some mem to work with */
for( i = 0; i <= len; i += 2 )
s2[ i / 2 ] = s1[ i ] & 0x7f;
hb_retclen_buffer( s2, len / 2 );
}
else
hb_retc_null();
}