AFS

 view release on metacpan or  search on metacpan

LICENCES/IBM-LICENCE  view on Meta::CPAN

   
   EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
   PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
   WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
   OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
   responsible for determining the appropriateness of using and
   distributing the Program and assumes all risks associated with its
   exercise of rights under this Agreement, including but not limited to
   the risks and costs of program errors, compliance with applicable
   laws, damage to or loss of data, programs or equipment, and
   unavailability or interruption of operations.
   
   6. DISCLAIMER OF LIABILITY
   
   EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
   ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
   WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR

MANIFEST  view on Meta::CPAN

src/Utils/t/Utils.t
src/Utils/Utils.pm
src/VLDB/Makefile.PL
src/VLDB/t/VLDB.t
src/VLDB/VLDB.pm
src/VOS/Makefile.PL
src/VOS/t/VOS.t
src/VOS/VOS.pm
test_ptype
TODO
META.yml                                 Module YAML meta-data (added by MakeMaker)
META.json                                Module JSON meta-data (added by MakeMaker)

examples/v2/kas/SingleServerConn  view on Meta::CPAN


my $host  = shift;
my $princ = AFS::KTC_PRINCIPAL->new(shift);
my $user  = AFS::KTC_PRINCIPAL->new(shift);
my $key   = AFS::KTC_EKEY->ReadPassword("Admin Password:");
my $token = AFS::KTC_TOKEN->GetAdminToken($princ, $key, 300);
my $kas   = AFS::KAS->SingleServerConn($host, $token, &AFS::KA_MAINTENANCE_SERVICE);

my $entry = $kas->getentry($user->name, $user->instance);

print "\n\nUser data for ", $user->name, $user->instance, ": \n";
foreach my $tp_key (sort keys %$entry) {
  printf("%20s  %s\n",$tp_key, $$entry{$tp_key});

}

examples/v2/kas/create  view on Meta::CPAN

checkafs('AdminToken');

my $kas = AFS::KAS->AuthServerConn($token, &AFS::KA_MAINTENANCE_SERVICE);
checkafs('AuthServerConn');
#my $ok = $kas->create($user->name, $user->instance, $nkey);
my $ok = $kas->KAM_CreateUser($user->name, $user->instance, $nkey);
printf("KAS created: %s \n", $ok ? 'yes' : 'no');
checkafs('Create');

my $entry = $kas->getentry($user->name, $user->instance);
print "\n\nUser data for ", $user->name, $user->instance, ": \n";
foreach my $tp_key (sort keys %$entry) {
    printf("%20s  %s\n",$tp_key, $$entry{$tp_key});
}

examples/v2/kas/examine  view on Meta::CPAN

my $cell = shift;  #  'notebook';

my $princ  = AFS::KTC_PRINCIPAL->new($adm, '', $cell);
my $string = AFS::KTC_EKEY->UserReadPassword('Password:');
my $key    = AFS::KTC_EKEY->StringToKey($string, $cell);
my $token  = AFS::KTC_TOKEN->GetAdminToken($princ, $key, 300);
my $kas    = AFS::KAS->AuthServerConn($token, &AFS::KA_MAINTENANCE_SERVICE, $cell);
my $user   = AFS::KTC_PRINCIPAL->new($usr);
my $entry  = $kas->getentry($user->name, $user->instance);

print "\nUser data for ", $user->name, $user->instance, "\n";

if ($$entry{'keyCheckSum'} == 0) {
    print "\t key version is $$entry{'key_version'} ";
}
else {
    print "\t key ($$entry{'key_version'}) cksum is $$entry{'keyCheckSum'}, ";
}

my $cpw_time = $$entry{'change_password_time'};
chomp(my $cpw_date = strftime('%a %b %d %T %Y', localtime($cpw_time)));

examples/v2/kas/getentry  view on Meta::CPAN

my $token = AFS::KTC_TOKEN->GetAdminToken($princ, $key, 300, 1, $reason);
$Debug && print "AFS::CODE 3 = $AFS::CODE \n";
$Debug && print "Reason = $reason \n";
my $kas   = AFS::KAS->AuthServerConn($token, &AFS::KA_MAINTENANCE_SERVICE, $cell);
$Debug && print "AFS::CODE 4 = $AFS::CODE \n";

my $user = AFS::KTC_PRINCIPAL->new($usr);
$Debug && print "AFS::CODE 5 = $AFS::CODE \n";
my $entry = $kas->getentry($user->name, $user->instance);
$Debug && print "AFS::CODE 6 = $AFS::CODE \n";
print "\n\ngetentry:\n User data for ", $user->name, $user->instance, ": \n";
foreach my $tp_key (sort keys %$entry) {
    printf("%20s  %s\n",$tp_key, $$entry{$tp_key});
    if ($tp_key =~ 'misc_auth_bytes') {
        if ($$entry{$tp_key}) {
            my $packed    = $$entry{$tp_key};
            my $pwexpire  = (($packed >> 24) & 0xff);
            my $is_locked = (($packed >> 16) & 0xff);
            my $nfail     = (($packed >>  8) & 0xff);
            my $locktime  = (($packed >>  0) & 0xff);
            print "\t\t pwexpire  $pwexpire\n";

examples/v2/kas/getentry  view on Meta::CPAN

            print "\t\t is_locked $is_locked\n";
        }
    }
    if ($tp_key =~ 'passwd_reuse') {
        my $reused = $$entry{'passwd_reuse'} - 0x12340000;
        print "\t\t permit password reuse $reused \n";
    }
}

$entry = $kas->KAM_GetEntry($user->name, $user->instance);
print "\n\nKAM_GetEntry:\n User data for ", $user->name, $user->instance, ": \n";
foreach my $tp_key (sort keys %$entry) {
    printf("%20s  %s\n",$tp_key, $$entry{$tp_key});
}

examples/v2/kas/setfields  view on Meta::CPAN


my $reason = '';
my $token = AFS::KTC_TOKEN->GetAdminToken($admin, $key, 300, 1, $reason);
if ($reason) { print "reason = $reason\n"; }
checkafs('AdminToken');

my $kas = AFS::KAS->AuthServerConn($token, &AFS::KA_MAINTENANCE_SERVICE);
checkafs('AuthServerConn');

my $entry = $kas->getentry($user->name, $user->instance);
print "\n\nUser data for ", $user->name, $user->instance, ": \n";
foreach my $tp_key (sort keys %$entry) {
    printf("%20s  %s\n",$tp_key, $$entry{$tp_key});
}

my $flags    = 1;        # (1 = normal, 4 = admin)
my $expire   = 925715000;# 03 May 1999 07:03
my $maxassoc = 0;
my $lifetime = 48*60*60; # unit is secs; => 48 hrs
my $pwexpire = 10;       # number of days
my $pw_reuse = 2;        # pwreuse allowed: [1 = yes], [2 = no], [0 = not changed]

examples/v2/kas/setfields  view on Meta::CPAN

$nfail++;
$locktime++;

my $packed= (($pwexpire << 24) | ($pw_reuse  << 16) | ($nfail << 8) | $locktime );
#my $ok = $kas->setfields($user->name, $user->instance, $flags, $expire, $lifetime, $maxassoc, $packed);
my $ok = $kas->KAM_SetFields($user->name, $user->instance, $flags, $expire, $lifetime, $maxassoc, $packed);
printf("KAS setfields: %s \n", $ok ? 'yes' : 'no');
checkafs('SetFields');

$entry = $kas->getentry($user->name, $user->instance);
print "\n\nUser data for ", $user->name, $user->instance, ": \n";
foreach my $tp_key (sort keys %$entry) {
    printf("%20s  %s\n",$tp_key, $$entry{$tp_key});
    if ($tp_key =~ 'misc_auth_bytes') {
        if ($$entry{$tp_key}) {
            my $packed    = $$entry{$tp_key};
            my $pwexpire  = (($packed >> 24) & 0xff);
            my $is_locked = (($packed >> 16) & 0xff);
            my $nfail     = (($packed >>  8) & 0xff);
            my $locktime  = (($packed >>  0) & 0xff);
            print "\t\t pwexpire  $pwexpire\n";

pod/v2/afsperlbos.pod  view on Meta::CPAN


Returns the current I<restricted mode> of the BOS server. Return value
1 means I<restriced mode> enabled, 0 means disabled. This method is
only available under OpenAFS if the AFS system libraries were compiled
with the I<Restricted Mode Option>.  It calls the AFS system library
function I<BOZO_GetRestrictedMode>.

=item B<($CELL, $HOSTS) = $bos-E<gt>listhosts;>

Returns the name of the CELL and an array reference HOSTS
containing the list of database server machines.  It calls the AFS
system library function I<BOZO_Listhost>.

You can find an example how to print the entire content of the array
reference C<$HOSTS> in the C<examples/v2/bos> directory.

=item B<my($DATE, $KEYS) = $bos-E<gt>listkeys([SHOW]);>

Returns the DATE when a key was last added to the local C<KeyFile>
file and the hash reference KEYS containing the server encryption keys.
The hash keys are the key version numbers.  Set SHOW to 1 (default

pod/v2/afsperlbos.pod  view on Meta::CPAN

Set ALL to 1 (default 0) to remove all three types of files at once.

If none of these flags are set, no files are removed, but a warning
message is displayed.  It calls the AFS system library function
I<BOZO_Prune>.

=item B<$ok = $bos-E<gt>removehost(HOST);>

=item B<$ok = $bos-E<gt>removehost(\@HOST);>

Removes the database server machine HOST from the local C<CellServDB>
file.  HOST is either a scalar value or a reference to an array of
names.  It calls the AFS system library function
I<BOZO_DeleteCellHost>.

=item B<$ok = $bos-E<gt>removekey(KVNO);>

=item B<$ok = $bos-E<gt>removekey(\@KVNO);>

B<NOT YET RELEASED>

pod/v2/afsperlcell.pod  view on Meta::CPAN

=item B<$cellname = expandcell(CELL);>

Expands CELL to the fully qualified cellname. Returns undef on error.

=cut

# does not work properly, return value $cell is not set properly ???

# =item B<($cell, @servers)  = getcell(INDEX [,IP]);>

# Displays the list of the database server machines that the Cache Manager
# stores in kernel memory for its home cell and foreign cells.

# Iterates through the Cache Manager's internal cell configuration,
# using INDEX as an index. The index starts at 0. $AFS::CODE will
# be set to a non-zero value when passed an invalid index. If IP is
# set to 1 then IP addresses will be returned instead of hostnames.
# Displays each database server machine's IP address rather than hostname.

=item B<($cell @servers) = getcellinfo([CELL [,IP]]);>

Gets information on CELL (default NULL) using CellServDB. If IP (default
0) is set to 1 then IP addresses will be returned instead of hostnames.

=item B<$cellname = localcell;>

Returns the cellname of the local cell. Returns undef on error.

pod/v2/afsperlcm.pod  view on Meta::CPAN

 ($max, $inuse) = getcacheparms;
  $ok = setcachesize(10000);

  my $crypt_flg = getcrypt;
  $ok = setcrypt('on');

=head1 DESCRIPTION

This module provides several functions to administer the B<AFS Cache
Manager>. It is used to customize the cache size. You can force the
update of cached data.  And you can determine if a client machine can
run SETUID programs.  Any function required must by explicitly listed
by the C<use> statement to be exported into the calling package.

Some of these functions have the optional argument FOLLOW.  FOLLOW
determines which file should be used should PATH be a symbolic link.  If
FOLLOW be set to 1, then the symbolic link is followed to its target.
If FOLLOW is set to 0, then the function applies to the symbolic link
itself.  If not specified FOLLOW defaults to 1.

=head1 COMPATIBILITY

pod/v2/afsperlcm.pod  view on Meta::CPAN

=item B<$ok = flush(PATH [, FOLLOW]);>

Forces the Cache Manager to discard PATH.

=item B<$ok = flushcb(PATH [, FOLLOW]);>

Forces the Cache Manager to flush only the callback for PATH.

=item B<$ok = flushvolume(PATH [, FOLLOW]);>

Forces the Cache Manager to discard all cached data from the volume
containing PATH.

=item B<($max, $inuse) = getcacheparms;>

Returns the current size of the cache and the amount being used.

=item B<$setuid = getcellstatus([CELL]);>

Determines whether the local Cache Manager allows SETUID programs to run
or not.  Returns 1 if SETUID programs are allowed for given CELL

pod/v2/afsperlkas.pod  view on Meta::CPAN

    key_version             max_ticket_lifetime    minor_version
    misc_auth_bytes         modification_time      modification_user
    user_expiration

It calls the AFS system library function 'KAM_GetEntry'.

=item B<($num_admins, $kasstats, $kadstats) = $kas-E<gt>getstats;>

=item B<($num_admins, $kasstats, $kadstats) = $kas-E<gt>KAM_GetStats(VERSION);>

Returns statistics about the AuthServer and its database. If VERSION
does not match that used by the server, the call returns an error
code. The return values are references to the hash tables containing
the values from the C structures C<kasstats> and C<kadstats>.  This
call requires a connection encrypted with an AdminTicket.  Possible
values for VERSION are

   &AFS::KAMAJORVERSION

It calls the AFS system library function 'KAM_Getstats'.

pod/v2/afsperlkas.pod  view on Meta::CPAN

ticket lifetime is specified by STIME and ETIME (given in 5 minute
intervals). AUTH_TOKEN must be a ticket for the ticket­granting
service (an instance of AFS::KTC_TOKEN) in the cell AUTH_CELL (default
null). It assumes that a connection to the AuthServer has already been
established.  It calls the AFS system library function 'ka_GetToken'.

=item B<($name, $inst) = $kas-E<gt>listentry(PREV, INDX, COUNT);>

=item B<($name, $inst) = $kas-E<gt>KAM_ListEntry(PREV, INDX, COUNT);>

Returns the name and instance of an entry in the database.  It provides
a way to step through all the entries in the database. The first call
should be made with previous index PREV set to zero. The method updates
COUNT, which is an estimate of the number of entries remaining to be
returned, and INDX, which should be passed in as previous index on the
next call. A negative COUNT or a non­zero return code indicates that an
error occurred.  A zero INDX means there were no more entries. A zero
COUNT means the last entry has been returned. This call requires a
connection encrypted with an AdminTicket.  It calls the AFS system
library function 'KAM_ListEntry'.

=item B<$rkey = $kas-E<gt>randomkey;>

pod/v2/afsperlktct.pod  view on Meta::CPAN

=item B<sessionKey>

Session encryption key of the token.

=item B<kvno>

Key version number associated with the Session encryption key.

=item B<ticketLen>

The length in bytes of the data stored in the attribute 'ticket'.

=item B<ticket>

The server ticket to use for the principal.

=back

=head1 METHODS

=over 4

pod/v2/afsperlpts.pod  view on Meta::CPAN


  print "Convert(nog): ", $pts->id('nog'), "\n";

=head1 DESCRIPTION

This class is used to communicate with the B<AFS Protection Server> in
order to maintain and to administer the Protection Database maintained
by the Protection Server.  The Protection Database stores information
about AFS users, client machines, and groups which the File Server
process uses to determine whether clients are authorized to access AFS
data.

This class provides methods to map back and forth between user account
names and their internal numerical AFS identifiers. It also manages
the creation, manipulation, and update of user-defined groups suitable
for use on ACLs.  It has methods to query the information held for any
given AFS user or group and to create, modify, and delete the records
in the PDB where the above information is held.

Before you can access any PDB records you must establish a connection
to the Protection Server.  This is done by the constructor method

pod/v2/afsperlpts.pod  view on Meta::CPAN

a new numerical ID may be specified for the given entry in NEWID. If
this is set to zero, then the entry's ID will not be altered.

=item B<$ok = $pts-E<gt>PR_Delete(ID);>

Deletes the PDB entry for the user or group whose id is ID.

=item B<$entry = $pts-E<gt>PR_DumpEntry(POS);>

Returns the contents of the PDB entry located at byte offset POS
within the database, and is intended to be used only for debugging.

=item B<@ids = $pts-E<gt>PR_GetCPS(ID, OVER);>

Generate the Current Protection Subdomain, or CPS, for the AFS user with
the given numerical ID. Basically, the CPS is the closure of all
identities that the given ID can use.  This list of groups and special
AFS ids (e.g. ANYUSERID and AUTHUSERID) to which the specified user
belongs is returned.  The user's own ID also appears on this list. If
the size of the list has overflowed the maximum list size, PR_MAXGROUPS
(5,000), then the OVER argument is set to a non­zero value.

pod/v2/afsperlvos.pod  view on Meta::CPAN

  my $stat = $vos->status('serv1', '/vicepa');
  print "Status is: $stat\n";

  $ok = $vos->rename('oldvol', 'newvol');

  $ok = $vos->setquota('volume', 6500, 1);

  $volid = $vos->zap('serv1', '/vicepa', 'volume');

  my ($tBack, $tFail) = $vos->backupsys('home', 'serv', '/vicepc');
  ($tBack, $tFail) = $vos->backupsys(['home', 'data'], 'serv', '/vicepc');

  my @parts = $vos->listpart('serv1');

  my $vols = $vos->listvol('serv1', '/vicepa');

  my $partinfo = $vos->partinfo('volume');

=head1 DESCRIPTION

This class is used to communicate with the B<AFS Volume Server>, which

src/AFS.xs  view on Meta::CPAN

      case VL_NAMEEXIST:
          sprintf(buffer, "VLDB: volume entry exists in the vldb\n");
          break;
      case VL_CREATEFAIL:
          sprintf(buffer, "VLDB: internal creation failure\n");
          break;
      case VL_NOENT:
          sprintf(buffer, "VLDB: no such entry\n");
          break;
      case VL_EMPTY:
          sprintf(buffer, "VLDB: vldb database is empty\n");
          break;
      case VL_ENTDELETED:
          sprintf(buffer, "VLDB: entry is deleted (soft delete)\n");
          break;
      case VL_BADNAME:
          sprintf(buffer, "VLDB: volume name is illegal\n");
          break;
      case VL_BADINDEX:
          sprintf(buffer, "VLDB: index was out of range\n");
          break;

src/AFS.xs  view on Meta::CPAN

        if (rx_Write(call, buffer, nbytes) != nbytes) {
            error = -1;
            break;
        }
    }
    if (buffer)
        free(buffer);
    return error;
}

/* function invoked by UV_RestoreVolume, reads the data from rx_trx_stream and
 * writes it out to the volume. */
afs_int32 WriteData(call, rock)
    struct rx_call *call;
    char *rock;
{
    char *filename;
    usd_handle_t ufd;
    long blksize;
    afs_int32 error, code;
    int ufdIsOpen = 0;

src/AFS.xs  view on Meta::CPAN

            sprintf(buffer, "Could not close dump file %s\n",
                    (filename && *filename) ? filename : "STDOUT");
            VSETCODE(code, buffer);
            if (!error)
                error = code;
        }
    }
    return error;
}

/* Receive data from <call> stream into file associated
 * with <fd> <blksize>
 */
int ReceiveFile(ufd, call, blksize)
    usd_handle_t ufd;
    struct rx_call *call;
    long blksize;
{
    char *buffer = (char *) 0;
    afs_int32 bytesread;
    afs_uint32 bytesleft, w;

src/AFS.xs  view on Meta::CPAN

        return NULL;
    }

    struct afsconf_cell info;

    /* next call expands cell name abbrevs for us and handles looking up
     * local cell */
    *code = internal_GetCellInfo(tname, (char *) 0, &info);
    if (*code) {
        char buffer[256];
        sprintf(buffer, "AFS::BOS %d (can't find cell '%s' in cell database)",
                *code, (tname ? tname : "<default>"));
        BSETCODE(code, buffer);
        /*             printf("bos DEBUG-5\n"); */
        return NULL;
    }

    strcpy(sname.cell, info.name);
    sname.instance[0] = 0;
    strcpy(sname.name, "afs");
    sc[0] = (struct rx_securityClass *) rxnull_NewClientSecurityObject();

src/AFS.xs  view on Meta::CPAN

    /* fprintf(stderr, "AFS::BOS: salvage completed\n"); */
    if (aoutName || showlog) {
        fprintf(outFile, "SalvageLog:\n");
        tcall = rx_NewCall(aconn);
        /* MUST pass canonical (wire-format) salvager log path to bosserver */
        code = StartBOZO_GetLog(tcall, AFSDIR_CANONICAL_SERVER_SLVGLOG_FILEPATH);
        if (code) {
            rx_EndCall(tcall, code);
            goto done;
        }
        /* copy data */
        while (1) {
            code = rx_Read(tcall, &buffer, 1);
            if (code != 1)
                break;
            putc(buffer, outFile);
            if (buffer == 0)
                break;          /* the end delimeter */
        }
        code = rx_EndCall(tcall, 0);
        /* fall through into cleanup code */

src/AFS.xs  view on Meta::CPAN

        tcall = rx_NewCall(self);
        code = StartBOZO_GetLog(tcall, file);
        if (code) {
            char buffer[256];
            rx_EndCall(tcall, code);
            sprintf(buffer, "AFS::BOS error %d (while reading log)\n", code);
            BSETCODE(code, buffer);
            XSRETURN_UNDEF;
        }

            /* copy data */
        error = 0;
        while (1) {
            code = rx_Read(tcall, &buf, 1);
            if (code != 1) {
                error = EIO;
                break;
            }
            if (buf == 0)
                break;                  /* the end delimeter */
            /* putchar(buf); */

src/KTC_EKEY/KTC_EKEY.pm  view on Meta::CPAN

}

sub des_string_to_key {
    my $class   = shift;

    AFS::ka_des_string_to_key(@_);
}


# struct ktc_encryptionKey {
#     char data[8];
# };

1;

src/Makefile.PL  view on Meta::CPAN

}

if ($v_numb gt v1.4.7 and $v_string =~ /openafs/) {
    $d_flag .= ' -DOpenAFS_1_4_64';
}

if ($v_numb gt v1.4.11 and $v_string =~ /openafs/) {
    $d_flag .= ' -DOpenAFS_1_4_12';
}

# print out a summary of determined data
print "AFS Version = $v_string v$v_numb \n";
print "Your AFS system libraries are located at:  $AFSPath \n";
print "                  their major version is:  $m_version \n";
print "                  and their type is:       \"pthreaded\"\n" if ($Config{usethreads});
print "Your AFS system type seems to be:          $alpha_sys \n\n";
print "The Compile Flags are set to:              $a_flag \n";
print "                                           $d_flag \n";
print "                                           $e_flag \n";
print "                                           $p_flag\n\n";

src/inc/version/vpp.pm  view on Meta::CPAN

	elsif (!$d || $d eq ';' || isSPACE($d) || $d eq '}') {
	    if ( $d == $s ) {
		# found nothing
		return BADVERSION($s,$errstr,"Invalid version format (version required)");
	    }
	    # found just an integer
	    goto version_prescan_finish;
	}
	elsif ( $d == $s ) {
	    # didn't find either integer or period
	    return BADVERSION($s,$errstr,"Invalid version format (non-numeric data)");
	}
	elsif ($d eq '_') {
	    # underscore can't come after integer part
	    if ($strict) {
		return BADVERSION($s,$errstr,"Invalid version format (no underscores)");
	    }
	    elsif (isDIGIT($d+1)) {
		return BADVERSION($s,$errstr,"Invalid version format (alpha without decimal)");
	    }
	    else {
		return BADVERSION($s,$errstr,"Invalid version format (misplaced underscore)");
	    }
	}
	elsif ($d) {
	    # anything else after integer part is just invalid data
	    return BADVERSION($s,$errstr,"Invalid version format (non-numeric data)");
	}

	# scan the fractional part after the decimal point
	if ($d && !isDIGIT($d) && ($strict || ! ($d eq ';' || isSPACE($d) || $d eq '}') )) {
		# $strict or lax-but-not-the-end
		return BADVERSION($s,$errstr,"Invalid version format (fractional part required)");
	}

	while (isDIGIT($d)) {
	    $d++;

src/inc/version/vpp.pm  view on Meta::CPAN

	    }
	}
    }

version_prescan_finish:
    while (isSPACE($d)) {
	$d++;
    }

    if ($d && !isDIGIT($d) && (! ($d eq ';' || $d eq '}') )) {
	# trailing non-numeric data
	return BADVERSION($s,$errstr,"Invalid version format (non-numeric data)");
    }

    if (defined $sqv) {
	$$sqv = $qv;
    }
    if (defined $swidth) {
	$$swidth = $width;
    }
    if (defined $ssaw_decimal) {
	$$ssaw_decimal = $saw_decimal;

src/inc/version/vpp.pm  view on Meta::CPAN


	# exponential notation
	if ( $value =~ /\d+.?\d*e[-+]?\d+/ ) {
	    $value = sprintf("%.9f",$value);
	    $value =~ s/(0+)$//; # trim trailing zeros
	}

	my $s = scan_version($value, \$self, $qv);

	if ($s) { # must be something left over
	    warn("Version string '%s' contains invalid data; "
                       ."ignoring: '%s'", $value, $s);
	}

	return ($self);
}

*parse = \&new;

sub numify
{

src/ppport.h  view on Meta::CPAN

PERL_MAGIC_glob|5.019002||p
PERL_MAGIC_isaelem|5.007002||p
PERL_MAGIC_isa|5.007002||p
PERL_MAGIC_mutex|5.019002||p
PERL_MAGIC_nkeys|5.007002||p
PERL_MAGIC_overload_elem|5.019002||p
PERL_MAGIC_overload_table|5.007002||p
PERL_MAGIC_overload|5.019002||p
PERL_MAGIC_pos|5.007002||p
PERL_MAGIC_qr|5.007002||p
PERL_MAGIC_regdata|5.007002||p
PERL_MAGIC_regdatum|5.007002||p
PERL_MAGIC_regex_global|5.007002||p
PERL_MAGIC_shared_scalar|5.007003||p
PERL_MAGIC_shared|5.007003||p
PERL_MAGIC_sigelem|5.007002||p
PERL_MAGIC_sig|5.007002||p
PERL_MAGIC_substr|5.007002||p
PERL_MAGIC_sv|5.007002||p
PERL_MAGIC_taint|5.007002||p
PERL_MAGIC_tiedelem|5.007002||p

src/ppport.h  view on Meta::CPAN

_to_utf8_title_flags||5.015006|
_to_utf8_upper_flags||5.015006|
aMY_CXT_|5.007003||p
aMY_CXT|5.007003||p
aTHXR_|5.019002||p
aTHXR|5.019002||p
aTHX_|5.006000||p
aTHX|5.006000||p
aassign_common_vars|||
add_cp_to_invlist|||
add_data|||n
add_utf16_textfilter|||
addmad|||
adjust_size_and_find_bucket|||n
adjust_stack_on_leave|||
alloc_maybe_populate_EXACT|||
alloccopstash|||
allocmy|||
amagic_call|||
amagic_cmp_locale|||
amagic_cmp|||

src/ppport.h  view on Meta::CPAN

magic_getsubstr|||
magic_gettaint|||
magic_getuvar|||
magic_getvec|||
magic_get|||
magic_killbackrefs|||
magic_methcall1|||
magic_methcall|||v
magic_methpack|||
magic_nextpack|||
magic_regdata_cnt|||
magic_regdatum_get|||
magic_regdatum_set|||
magic_scalarpack|||
magic_set_all_env|||
magic_setarylen|||
magic_setcollxfrm|||
magic_setdbline|||
magic_setdefelem|||
magic_setenv|||
magic_sethint|||

src/ppport.h  view on Meta::CPAN

mode_from_discipline|||
modkids|||
more_bodies|||
more_sv|||
moreswitches|||
mro_clean_isarev|||
mro_gather_and_rename|||
mro_get_from_name||5.010001|
mro_get_linear_isa_dfs|||
mro_get_linear_isa||5.009005|
mro_get_private_data||5.010001|
mro_isa_changed_in|||
mro_meta_dup|||
mro_meta_init|||
mro_method_changed_in||5.009005|
mro_package_moved|||
mro_register||5.010001|
mro_set_mro||5.010001|
mro_set_private_data||5.010001|
mul128|||
mulexp10|||n
my_atof2||5.007002|
my_atof||5.006000|
my_attrs|||
my_bcopy|||n
my_bzero|||n
my_chsize|||
my_clearenv|||
my_cxt_index|||

src/ppport.h  view on Meta::CPAN

        PL_hints = oldhints;
        PL_curcop->cop_stash = old_cop_stash;
        PL_curstash = old_curstash;
        PL_curcop->cop_line = oldline;
}
#endif
#endif

/*
 * Boilerplate macros for initializing and accessing interpreter-local
 * data from C.  All statics in extensions should be reworked to use
 * this, if you want to make the extension thread-safe.  See ext/re/re.xs
 * for an example of the use of these macros.
 *
 * Code that uses these macros is responsible for the following:
 * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts"
 * 2. Declare a typedef named my_cxt_t that is a structure that contains
 *    all the data that needs to be interpreter-local.
 * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t.
 * 4. Use the MY_CXT_INIT macro such that it is called exactly once
 *    (typically put in the BOOT: section).
 * 5. Use the members of the my_cxt_t structure everywhere as
 *    MY_CXT.member.
 * 6. Use the dMY_CXT macro (a declaration) in all the functions that
 *    access MY_CXT.
 */

#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \
    defined(PERL_CAPI)    || defined(PERL_IMPLICIT_CONTEXT)

#ifndef START_MY_CXT

/* This must appear in all extensions that define a my_cxt_t structure,
 * right after the definition (i.e. at file scope).  The non-threads
 * case below uses it to declare the data as static. */
#define START_MY_CXT

#if (PERL_BCDVERSION < 0x5004068)
/* Fetches the SV that keeps the per-interpreter data. */
#define dMY_CXT_SV \
        SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
#else /* >= perl5.004_68 */
#define dMY_CXT_SV \
        SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY,             \
                                  sizeof(MY_CXT_KEY)-1, TRUE)
#endif /* < perl5.004_68 */

/* This declaration should be used within all functions that use the
 * interpreter-local data. */
#define dMY_CXT \
        dMY_CXT_SV;                                                     \
        my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))

/* Creates and zeroes the per-interpreter data.
 * (We allocate my_cxtp in a Perl SV so that it will be released when
 * the interpreter goes away.) */
#define MY_CXT_INIT \
        dMY_CXT_SV;                                                     \
        /* newSV() allocates one more than needed */                    \
        my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
        Zero(my_cxtp, 1, my_cxt_t);                                     \
        sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))

/* This macro must be used to access members of the my_cxt_t structure.
 * e.g. MYCXT.some_data */
#define MY_CXT          (*my_cxtp)

/* Judicious use of these macros can reduce the number of times dMY_CXT
 * is used.  Use is similar to pTHX, aTHX etc. */
#define pMY_CXT         my_cxt_t *my_cxtp
#define pMY_CXT_        pMY_CXT,
#define _pMY_CXT        ,pMY_CXT
#define aMY_CXT         my_cxtp
#define aMY_CXT_        aMY_CXT,
#define _aMY_CXT        ,aMY_CXT

#endif /* START_MY_CXT */

#ifndef MY_CXT_CLONE
/* Clones the per-interpreter data. */
#define MY_CXT_CLONE \
        dMY_CXT_SV;                                                     \
        my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\
        Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\
        sv_setuv(my_cxt_sv, PTR2UV(my_cxtp))
#endif

#else /* single interpreter */

#ifndef START_MY_CXT

src/ppport.h  view on Meta::CPAN

#endif

#endif

#if (PERL_BCDVERSION < 0x5006000)
# define D_PPP_CONSTPV_ARG(x)  ((char *) (x))
#else
# define D_PPP_CONSTPV_ARG(x)  (x)
#endif
#ifndef newSVpvn
#  define newSVpvn(data,len)             ((data)                                              \
                                    ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \
                                    : newSV(0))
#endif
#ifndef newSVpvn_utf8
#  define newSVpvn_utf8(s, len, u)       newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0)
#endif
#ifndef SVf_UTF8
#  define SVf_UTF8                       0
#endif

#ifndef newSVpvn_flags

src/ppport.h  view on Meta::CPAN

#endif

#ifndef PERL_MAGIC_overload_table
#  define PERL_MAGIC_overload_table      'c'
#endif

#ifndef PERL_MAGIC_bm
#  define PERL_MAGIC_bm                  'B'
#endif

#ifndef PERL_MAGIC_regdata
#  define PERL_MAGIC_regdata             'D'
#endif

#ifndef PERL_MAGIC_regdatum
#  define PERL_MAGIC_regdatum            'd'
#endif

#ifndef PERL_MAGIC_env
#  define PERL_MAGIC_env                 'E'
#endif

src/ppport.h  view on Meta::CPAN

    if (radix && IN_LOCALE) {
        STRLEN len = strlen(radix);
        if (*sp + len <= send && memEQ(*sp, radix, len)) {
            *sp += len;
            return TRUE;
        }
    }
#endif
#endif /* USE_LOCALE_NUMERIC */
    /* always try "." if numeric radix didn't match because
     * we may have data from different locales mixed */
    if (*sp < send && **sp == '.') {
        ++*sp;
        return TRUE;
    }
    return FALSE;
}
#endif
#endif

#ifndef grok_number



( run in 0.473 second using v1.01-cache-2.11-cpan-8d75d55dd25 )