CodeBase

 view release on metacpan or  search on metacpan

CodeBase.pm  view on Meta::CPAN

502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
=item recall_record [RECNO]
 
Recalls the record specified or the current record if called without a
record number.  (Not yet implemented).
 
 
=item flush [TRIES]
 
Flushes to file any outstanding changes (made by C<set_field()>.
Records need to be locked while changes are written.  C<TRIES> is the
number of attempts that should be made to aquire the lock.  Subsequent
attempts are made with a one second interval.
 
 
=item pack COMPRESS-MEMO-FLAG
 
Packs the database file removing deleted records.  If flag parameter
is specified as true then memo fields are compressed at the same time:
 
    $fh->pack(1);

CodeBase.xs  view on Meta::CPAN

894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
        XSRETURN_UNDEF;
    }
    CB_TRACE(1, ("recsize returns %d\n", RETVAL));
 
 OUTPUT:
    RETVAL
 
 
# $file->flush([$tries])
#       flushes the data file an its index and memo files to disk
#       calls d4flush, which returns 0, r4locked or r4unique.
void
flush(self, ...)
    CodeBase::File      *self
 
 PREINIT:
 /* int         tries; */
 
 CODE:
    CB_TRACE(1, ("flush(\"%s\")\n",  SELF));
    cb_errno = d4flush(self->data4);

CodeBase.xs  view on Meta::CPAN

1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
        CB_TRACE(1, ("unlock returns (errno = %d)\n", cb_errno));
        XSRETURN_UNDEF;
    }
    CB_TRACE(1, ("unlock returns OK\n"));
    XSRETURN_YES;
 
 
# $file->pack([$compress_memo])
#       Pack removes all deleted reocords from the data file
#       and also reindexes open index files. an its index and memo files to disk
#       Calls d4pack, which returns 0, r4locked, r4unique or an error code < 0.
void
pack(self, compress_memo = FALSE)
    CodeBase::File      *self
    Boolean     compress_memo
 
 CODE:
    CB_TRACE(1, ("pack(\"%s\", %s)\n",  SELF, compress_memo ? "TRUE" : "FALSE"));
    cb_errno = CB_SUCCESS;
    if (   (d4pack(self->data4) != 0)
        || (compress_memo

CodeBase.xs  view on Meta::CPAN

2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
        CB_TRACE(1, ("open_index error %d\n", cb_errno));
        XSRETURN_UNDEF;
    }
 
    CB_TRACE(1, ("open_index returns OK\n"));
    XSRETURN_YES;
 
 
# $file->check_indexes()
#       Reindexes all index files open for the file.
#       Calls d4reindex, which returns 0, r4locked, r4unique or an error code < 0.
void
check_indexes(self)
    CodeBase::File      *self
 
 CODE:
    CB_TRACE(1, ("check_indexes(\"%s\")\n",  SELF));
    cb_errno = CB_SUCCESS;
    if (d4check(self->data4) != 0)
    {
        CB_TRACE(1, ("check_indexes returns error %d\n", cb_errno));
        XSRETURN_UNDEF;
    }
    CB_TRACE(1, ("check_indexes returns OK\n"));
    XSRETURN_YES;
 
 
# $file->reindex()
#       Reindexes all index files open for the file.
#       Calls d4reindex, which returns 0, r4locked, r4unique or an error code < 0.
void
reindex(self)
    CodeBase::File      *self
 
 CODE:
    CB_TRACE(1, ("reindex(\"%s\")\n",  SELF));
    cb_errno = CB_SUCCESS;
    if (d4reindex(self->data4) != 0)
    {
        CB_TRACE(1, ("reindex returns error %d\n", cb_errno));



( run in 0.427 second using v1.01-cache-2.11-cpan-87723dcf8b7 )