Algorithm-PageRank-XS

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN


  --version                   show version

  --patch=file                write one patch file with changes
  --copy=suffix               write changed copies with suffix
  --diff=program              use diff program and options

  --compat-version=version    provide compatibility with Perl version
  --cplusplus                 accept C++ comments

  --quiet                     don't output anything except fatal errors
  --nodiag                    don't show diagnostics
  --nohints                   don't show hints
  --nochanges                 don't suggest changes
  --nofilter                  don't filter input files

  --strip                     strip all script and doc functionality from
                              ppport.h

  --list-provided             list provided API
  --list-unsupported          list unsupported API

ppport.h  view on Meta::CPAN


=head2 --cplusplus

Usually, F<ppport.h> will detect C++ style comments and
replace them with C style comments for portability reasons.
Using this option instructs F<ppport.h> to leave C++
comments untouched.

=head2 --quiet

Be quiet. Don't print anything except fatal errors.

=head2 --nodiag

Don't output any diagnostic messages. Only portability
alerts will be printed.

=head2 --nohints

Don't output any hints. Hints often contain useful portability
notes. Warnings will still be displayed.

ppport.h  view on Meta::CPAN

PUSHmortal|5.009002||p
PUSHn|||
PUSHp|||
PUSHs|||
PUSHu|5.004000||p
PUTBACK|||
PerlIO_clearerr||5.007003|
PerlIO_close||5.007003|
PerlIO_context_layers||5.009004|
PerlIO_eof||5.007003|
PerlIO_error||5.007003|
PerlIO_fileno||5.007003|
PerlIO_fill||5.007003|
PerlIO_flush||5.007003|
PerlIO_get_base||5.007003|
PerlIO_get_bufsiz||5.007003|
PerlIO_get_cnt||5.007003|
PerlIO_get_ptr||5.007003|
PerlIO_read||5.007003|
PerlIO_seek||5.007003|
PerlIO_set_cnt||5.007003|

ppport.h  view on Meta::CPAN

ptr_table_free||5.009005|
ptr_table_new||5.009005|
ptr_table_split||5.009005|
ptr_table_store||5.009005|
push_scope|||
put_byte|||
pv_display||5.006000|
pv_escape||5.009004|
pv_pretty||5.009004|
pv_uni_display||5.007003|
qerror|||
qsortsvu|||
re_compile||5.009005|
re_croak2|||
re_dup_guts|||
re_intuit_start||5.009005|
re_intuit_string||5.006000|
readpipe_override|||
realloc||5.007002|n
reentrant_free|||
reentrant_init|||

ppport.h  view on Meta::CPAN

write_no_mem|||
write_to_stderr|||
xmldump_all|||
xmldump_attr|||
xmldump_eval|||
xmldump_form|||
xmldump_indent|||v
xmldump_packsubs|||
xmldump_sub|||
xmldump_vindent|||
yyerror|||
yylex|||
yyparse|||
yywarn|||
);

if (exists $opt{'list-unsupported'}) {
  my $f;
  for $f (sort { lc $a cmp lc $b } keys %API) {
    next unless $API{$f}{todo};
    print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n";

ppport.h  view on Meta::CPAN

  }

  my $s = $warnings != 1 ? 's' : '';
  my $warn = $warnings ? " ($warnings warning$s)" : '';
  info("Analysis completed$warn");

  if ($file{changes}) {
    if (exists $opt{copy}) {
      my $newfile = "$filename$opt{copy}";
      if (-e $newfile) {
        error("'$newfile' already exists, refusing to write copy of '$filename'");
      }
      else {
        local *F;
        if (open F, ">$newfile") {
          info("Writing copy of '$filename' with changes to '$newfile'");
          print F $c;
          close F;
        }
        else {
          error("Cannot open '$newfile' for writing: $!");
        }
      }
    }
    elsif (exists $opt{patch} || $opt{changes}) {
      if (exists $opt{patch}) {
        unless ($patch_opened) {
          if (open PATCH, ">$opt{patch}") {
            $patch_opened = 1;
          }
          else {
            error("Cannot open '$opt{patch}' for writing: $!");
            delete $opt{patch};
            $opt{changes} = 1;
            goto fallback;
          }
        }
        mydiff(\*PATCH, $filename, $c);
      }
      else {
fallback:
        info("Suggested changes:");

ppport.h  view on Meta::CPAN


  if (!defined $diff) {
    $diff = run_diff('diff -u', $file, $str);
  }

  if (!defined $diff) {
    $diff = run_diff('diff', $file, $str);
  }

  if (!defined $diff) {
    error("Cannot generate a diff. Please install Text::Diff or use --copy.");
    return;
  }

  print F $diff;
}

sub run_diff
{
  my($prog, $file, $str) = @_;
  my $tmp = 'dppptemp';

ppport.h  view on Meta::CPAN

        $diff .= $_;
      }
      close F;
      unlink $tmp;
      return $diff;
    }

    unlink $tmp;
  }
  else {
    error("Cannot open '$tmp' for writing: $!");
  }

  return undef;
}

sub rec_depend
{
  my($func, $seen) = @_;
  return () unless exists $depends{$func};
  $seen = {%{$seen||{}}};

ppport.h  view on Meta::CPAN

  $opt{quiet} and return;
  $opt{diag} and print @_, "\n";
}

sub warning
{
  $opt{quiet} and return;
  print "*** ", @_, "\n";
}

sub error
{
  print "*** ERROR: ", @_, "\n";
}

my %given_hints;
my %given_warnings;
sub hint
{
  $opt{quiet} and return;
  my $func = shift;

ppport.h  view on Meta::CPAN

#  endif
#endif

#define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10))
#define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION))

/* It is very unlikely that anyone will try to use this with Perl 6
   (or greater), but who knows.
 */
#if PERL_REVISION != 5
#  error ppport.h only works with Perl version 5
#endif /* PERL_REVISION != 5 */

#ifdef I_LIMITS
#  include <limits.h>
#endif

#ifndef PERL_UCHAR_MIN
#  define PERL_UCHAR_MIN ((unsigned char)0)
#endif

ppport.h  view on Meta::CPAN

#ifndef PERL_LOADMOD_IMPORT_OPS
#  define PERL_LOADMOD_IMPORT_OPS        0x4
#endif

/* Replace: 0 */

/* Replace perl_eval_pv with eval_pv */

#ifndef eval_pv
#if defined(NEED_eval_pv)
static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
static
#else
extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error);
#endif

#ifdef eval_pv
#  undef eval_pv
#endif
#define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b)
#define Perl_eval_pv DPPP_(my_eval_pv)

#if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL)

SV*
DPPP_(my_eval_pv)(char *p, I32 croak_on_error)
{
    dSP;
    SV* sv = newSVpv(p, 0);

    PUSHMARK(sp);
    eval_sv(sv, G_SCALAR);
    SvREFCNT_dec(sv);

    SPAGAIN;
    sv = POPs;
    PUTBACK;

    if (croak_on_error && SvTRUE(GvSV(errgv)))
	croak(SvPVx(GvSV(errgv), na));

    return sv;
}

#endif
#endif

#ifndef vload_module
#if defined(NEED_vload_module)

t/pr.t  view on Meta::CPAN

	       4 6
	       5 3
	       5 6
	       6 4
	       6 3
	       6 5
	       )]);

my $x = $pr->result();

# We truncate digits here to prevent small floating point errors
while (my ($key, $value) = each(%{$x})) {
    $x->{$key} = sprintf("%0.5f", $value);
}

# Compare it to the answer.
is_deeply($x, {
          '6' => '0.28078',
          '4' => '0.21922',
          '1' => '0.00000',
          '3' => '0.28078',

table.c  view on Meta::CPAN

#endif
#ifndef MAX
#define MAX(A, B)  ((A) > (B)) ? (A) : (B)
#endif

Array * array_init(float value)
{
        Array * result;

        if ((result = (Array *)malloc(sizeof(Array))) == NULL) {
                fprintf(stderr, "Memory error\n");
                exit(2);
        }

        if ((result->data = (NUM *)malloc(sizeof(NUM))) == NULL) {
                fprintf(stderr, "Memory error\n");
                exit(2);
        }

        result->data[0] = value;
        result->len = 1;
        return result;
}

void array_print(FILE * file, Array * arr)
{

table.c  view on Meta::CPAN


        return 0;
}


Array * array_push(Array * input, float value)
{
        input->len++;
        input->data = (NUM *) realloc(input->data, input->len * sizeof(NUM));
        if (input->data == NULL) {
                fprintf(stderr, "Memory error\n");
                exit(2);
        }
        input->data[input->len - 1] = value;
        return input;
}

int array_error()
{
        fprintf(stderr, "Array out of bounds!\n");
        exit(3);
}

int  array_delete(Array * array)
{
        if (array == NULL)
                return 1;

table.c  view on Meta::CPAN

}

void _table_expand(Table *tb, unsigned int i);

Table * table_init()
{
        Table * result;

        result = (Table *)malloc(sizeof(Table));
        if (result == NULL) {
                fprintf(stderr, "Memory error\n");
                exit(2);
        }

        result->order = 1;
        result->capacity = result->order = 0;
        result->rows = (Array **)malloc(sizeof(Array *));
        if (result->rows == NULL) {
                fprintf(stderr, "Memory error\n");
                exit(2);
        }
        result->rows[0] = NULL;

        _table_expand(result, 999);
        result->order = 0;

        return result;
}

table.c  view on Meta::CPAN


void _table_expand(Table *tb, unsigned int i)
{
        unsigned int j;

        if (i < tb->capacity)
                return;

        tb->rows = (Array **)realloc(tb->rows, (i + 1) * sizeof(Array *));
        if (tb->rows == NULL) {
                fprintf(stderr, "Memory error\n");
                exit(2);
        }

        for (j = tb->order; j <= i; j++) {
                tb->rows[j] = NULL;
        }

        tb->capacity = tb->order = i + 1;
}

table.h  view on Meta::CPAN

        unsigned int order;
        unsigned int capacity;
        Array ** rows;
} Table;



/* Public Array interface */
Array * array_init(NUM value);
Array * array_push(Array * input, NUM value);
int array_error();
int  array_delete(Array * array);
int array_copy(Array * dest, Array * src);
void array_print(FILE * file, Array * array);

#define array_get(A, i) ((i >= (A)->len) ? array_error() : (A)->data[(i)])
#define array_set(A, i, value) ((i >= (A)->len) ? array_error() : ((A)->data[(i)] = (value)))
#define array_len(A)    ((A)->len)
#define array_incr(A, i, amount) ((i >= (A)->len) ? array_error() : ((A)->data[(i)] += (amount)))

#define array_diveq(A, i, amount) ((i >= (A)->len) ? array_error() : ((A)->data[(i)] /= (amount)))


/* Public Table interface */
Table * table_init();
Array * table_add(Table * tb, unsigned int i, Array * row);
Array * table_get(Table * tb, unsigned int i);
/*Array * table_remove(Table * tb, unsigned int i);*/
int     table_delete(Table * tb);
void    table_print(FILE * file, Table * tb);
#define table_len(T)     (T)->order



( run in 0.570 second using v1.01-cache-2.11-cpan-65fba6d93b7 )