Filesys-SamFS
view release on metacpan or search on metacpan
OUTPUT:
RETVAL
void
sam_stat(path)
char *path
PREINIT:
struct sam_stat statbuf;
int retval;
int i;
PPCODE:
retval = sam_stat(path, &statbuf, sizeof statbuf);
if (retval == 0) {
EXTEND(SP, 22+MAX_ARCHIVE);
/* 0 */ PUSHs(sv_2mortal(newSViv(statbuf.st_dev)));
/* 1 */ PUSHs(sv_2mortal(newSViv(statbuf.st_ino)));
/* 2 */ PUSHs(sv_2mortal(newSViv(statbuf.st_mode)));
/* 3 */ PUSHs(sv_2mortal(newSViv(statbuf.st_nlink)));
/* 4 */ PUSHs(sv_2mortal(newSViv(statbuf.st_uid)));
/* 5 */ PUSHs(sv_2mortal(newSViv(statbuf.st_gid)));
/* 6 */ PUSHs(sv_2mortal(newSViv(statbuf.rdev)));
}
}
void
sam_lstat(path)
char *path
PREINIT:
struct sam_stat statbuf;
int retval;
int i;
PPCODE:
retval = sam_lstat(path, &statbuf, sizeof statbuf);
if (retval == 0) {
EXTEND(SP, 22+MAX_ARCHIVE);
/* 0 */ PUSHs(sv_2mortal(newSViv(statbuf.st_dev)));
/* 1 */ PUSHs(sv_2mortal(newSViv(statbuf.st_ino)));
/* 2 */ PUSHs(sv_2mortal(newSViv(statbuf.st_mode)));
/* 3 */ PUSHs(sv_2mortal(newSViv(statbuf.st_nlink)));
/* 4 */ PUSHs(sv_2mortal(newSViv(statbuf.st_uid)));
/* 5 */ PUSHs(sv_2mortal(newSViv(statbuf.st_gid)));
/* 6 */ PUSHs(sv_2mortal(newSViv(statbuf.rdev)));
#ifndef OLD_SAMFS
void
sam_stat_scalars(path)
char *path
PREINIT:
struct sam_stat statbuf;
int retval;
int i;
AV *copies;
PPCODE:
retval = sam_stat(path, &statbuf, sizeof statbuf);
if (retval == 0) {
EXTEND(SP, 29);
/* 0 */ PUSHs(sv_2mortal(newSViv(statbuf.st_dev)));
/* 1 */ PUSHs(sv_2mortal(newSViv(statbuf.st_ino)));
/* 2 */ PUSHs(sv_2mortal(newSViv(statbuf.st_mode)));
/* 3 */ PUSHs(sv_2mortal(newSViv(statbuf.st_nlink)));
/* 4 */ PUSHs(sv_2mortal(newSViv(statbuf.st_uid)));
/* 5 */ PUSHs(sv_2mortal(newSViv(statbuf.st_gid)));
/* 6 */ PUSHs(sv_2mortal(newSViv(statbuf.rdev)));
}
void
sam_lstat_scalars(path)
char *path
PREINIT:
struct sam_stat statbuf;
int retval;
int i;
AV *copies;
PPCODE:
retval = sam_lstat(path, &statbuf, sizeof statbuf);
if (retval == 0) {
EXTEND(SP, 29);
/* 0 */ PUSHs(sv_2mortal(newSViv(statbuf.st_dev)));
/* 1 */ PUSHs(sv_2mortal(newSViv(statbuf.st_ino)));
/* 2 */ PUSHs(sv_2mortal(newSViv(statbuf.st_mode)));
/* 3 */ PUSHs(sv_2mortal(newSViv(statbuf.st_nlink)));
/* 4 */ PUSHs(sv_2mortal(newSViv(statbuf.st_uid)));
/* 5 */ PUSHs(sv_2mortal(newSViv(statbuf.st_gid)));
/* 6 */ PUSHs(sv_2mortal(newSViv(statbuf.rdev)));
struct sam_vsn_stat {
struct sam_section section[MAX_VOLUMES];
};
#define CAST (struct sam_section*)
#else
#define CAST
#endif
struct sam_vsn_stat statbuf;
int retval;
int i;
PPCODE:
retval = sam_vsn_stat(path, copy, CAST &statbuf, sizeof statbuf);
if (retval == 0) {
EXTEND(SP, MAX_VSNS);
for (i=0; i<MAX_VSNS; i++) {
AV *av = newAV();
av_extend(av, 4);
PUSHs(sv_2mortal(newRV_noinc((SV*)av)));
av_store(av, 0, newSVpv(statbuf.section[i].vsn, 0));
av_store(av, 1, newSVpv(ull2s(statbuf.section[i].length), 0));
av_store(av, 2, newSVpv(ull2s(statbuf.section[i].position), 0));
#else
void
sam_vsn_stat(path, copy)
char * path
int copy
PREINIT:
struct sam_section statbuf;
int retval;
int i;
PPCODE:
retval = sam_vsn_stat(path, copy, &statbuf, sizeof statbuf);
if (retval == 0) {
EXTEND(SP, 1);
AV *av = newAV();
av_extend(av, 4);
PUSHs(sv_2mortal(newRV_noinc((SV*)av)));
av_store(av, 0, newSVpv(statbuf.vsn, 0));
av_store(av, 1, newSVpv(ull2s(statbuf.length), 0));
av_store(av, 2, newSVpv(ull2s(statbuf.position), 0));
av_store(av, 3, newSVpv(ull2s(statbuf.offset), 0));
#ifndef OLD_SAMFS
int
sam_segment_vsn_stat(path, copy, segment_index)
char * path
int copy
int segment_index
PREINIT:
struct sam_section statbuf;
int retval;
int i;
PPCODE:
retval = sam_segment_vsn_stat(path, copy, segment_index, &statbuf, sizeof statbuf);
if (retval == 0) {
EXTEND(SP, 1);
AV *av = newAV();
av_extend(av, 4);
PUSHs(sv_2mortal(newRV_noinc((SV*)av)));
av_store(av, 0, newSVpv(statbuf.vsn, 0));
av_store(av, 1, newSVpv(ull2s(statbuf.length), 0));
av_store(av, 2, newSVpv(ull2s(statbuf.position), 0));
av_store(av, 3, newSVpv(ull2s(statbuf.offset), 0));
int
sam_segment_stat(path)
char * path
PREINIT:
struct sam_stat file_info;
struct sam_stat *data_seg_info_ptr;
int number_of_data_segments;
int retval;
int i;
PPCODE:
retval = sam_stat(path, &file_info, sizeof file_info);
if (retval == 0) {
if (SS_ISSEGMENT_F(file_info.attr)) {
number_of_data_segments = NUM_SEGS(&file_info);
Newxz(data_seg_info_ptr, number_of_data_segments,
struct sam_stat);
retval = sam_segment_stat(path, data_seg_info_ptr,
number_of_data_segments *
sizeof(struct sam_stat));
if (retval == 0) {
int
sam_segment_lstat(path)
char * path
PREINIT:
struct sam_stat file_info;
struct sam_stat *data_seg_info_ptr;
int number_of_data_segments;
int retval;
int i;
PPCODE:
retval = sam_lstat(path, &file_info, sizeof file_info);
if (retval == 0) {
if (SS_ISSEGMENT_F(file_info.attr)) {
number_of_data_segments = NUM_SEGS(&file_info);
Newxz(data_seg_info_ptr, number_of_data_segments,
struct sam_stat);
retval = sam_segment_lstat(path, data_seg_info_ptr,
number_of_data_segments *
sizeof(struct sam_stat));
if (retval == 0) {
RETVAL = sam_attrtoa(attr, NULL);
OUTPUT:
RETVAL
void
sam_devstat(eq)
int eq
PREINIT:
struct sam_devstat statbuf;
int retval;
PPCODE:
retval = sam_devstat(eq, &statbuf, sizeof statbuf);
if (retval == 0) {
EXTEND(SP, 7);
/* 0 */ PUSHs(sv_2mortal(newSViv(statbuf.type)));
/* 1 */ PUSHs(sv_2mortal(newSVpv(statbuf.name, 0)));
/* 2 */ PUSHs(sv_2mortal(newSVpv(statbuf.vsn, 0)));
/* 3 */ PUSHs(sv_2mortal(newSVpv(dev_state[statbuf.state], 0)));
/* 4 */ PUSHs(sv_2mortal(newSViv(statbuf.status)));
/* 5 */ PUSHs(sv_2mortal(newSViv(statbuf.space)));
/* 6 */ PUSHs(sv_2mortal(newSViv(statbuf.capacity)));
}
void
sam_ndevstat(eq)
int eq
PREINIT:
struct sam_ndevstat statbuf;
int retval;
PPCODE:
retval = sam_ndevstat(eq, &statbuf, sizeof statbuf);
if (retval == 0) {
EXTEND(SP, 7);
/* 0 */ PUSHs(sv_2mortal(newSViv(statbuf.type)));
/* 1 */ PUSHs(sv_2mortal(newSVpv(statbuf.name, 0)));
/* 2 */ PUSHs(sv_2mortal(newSVpv(statbuf.vsn, 0)));
/* 3 */ PUSHs(sv_2mortal(newSVpv(dev_state[statbuf.state], 0)));
/* 4 */ PUSHs(sv_2mortal(newSViv(statbuf.status)));
/* 5 */ PUSHs(sv_2mortal(newSViv(statbuf.space)));
/* 6 */ PUSHs(sv_2mortal(newSViv(statbuf.capacity)));
RETVAL = sam_devstr(status);
OUTPUT:
RETVAL
void
sam_opencat(path)
char * path
PREINIT:
struct sam_cat_tbl catbuf;
int retval;
PPCODE:
retval = sam_opencat(path, &catbuf, sizeof catbuf);
if (retval >= 0) {
EXTEND(SP, 4);
/* 0 */ PUSHs(sv_2mortal(newSViv(retval)));
/* 1 */ PUSHs(sv_2mortal(newSViv(catbuf.audit_time)));
/* 2 */ PUSHs(sv_2mortal(newSViv(catbuf.version)));
/* 3 */ PUSHs(sv_2mortal(newSViv(catbuf.count)));
/* 4 */ PUSHs(sv_2mortal(newSVpv(catbuf.media, 0)));
}
sam_closecat(cat_handle)
int cat_handle
void
sam_getcatalog(cat_handle, slot)
int cat_handle
int slot
PREINIT:
struct sam_cat_ent catbuf;
int retval;
PPCODE:
retval = sam_getcatalog(cat_handle, slot, slot, &catbuf, sizeof catbuf);
if (retval >= 0) {
EXTEND(SP, 11);
/* 0 */ PUSHs(sv_2mortal(newSViv(catbuf.type)));
/* 1 */ PUSHs(sv_2mortal(newSViv(catbuf.status)));
/* 2 */ PUSHs(sv_2mortal(newSVpv(catbuf.media, 0)));
/* 3 */ PUSHs(sv_2mortal(newSVpv(catbuf.vsn, 0)));
/* 4 */ PUSHs(sv_2mortal(newSViv(catbuf.access)));
/* 5 */ PUSHs(sv_2mortal(newSViv(catbuf.capacity)));
/* 6 */ PUSHs(sv_2mortal(newSViv(catbuf.space)));
const-xs.inc view on Meta::CPAN
dTARGET;
#endif
STRLEN len;
int type;
IV iv;
/* NV nv; Uncomment this if you need to return NVs */
/* const char *pv; Uncomment this if you need to return PVs */
INPUT:
SV * sv;
const char * s = SvPV(sv, len);
PPCODE:
/* Change this to constant(aTHX_ s, len, &iv, &nv);
if you need to return both NVs and IVs */
type = constant(aTHX_ s, len, &iv);
/* Return 1 or 2 items. First is error message, or undef if no error.
Second, if present, is found value */
switch (type) {
case PERL_constant_NOTFOUND:
sv = sv_2mortal(newSVpvf("%s is not a valid Filesys::SamFS macro", s));
PUSHs(sv);
break;
( run in 0.945 second using v1.01-cache-2.11-cpan-5511b514fd6 )