File.xs revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2002 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* File.xs contains XS code for exacct file manipulation.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <pwd.h>
#include "../exacct_common.xh"
/* Pull in the file generated by extract_defines. */
#include "FileDefs.xi"
/*
* The XS code exported to perl is below here. Note that the XS preprocessor
* has its own commenting syntax, so all comments from this point on are in
* that form.
*/
#
#
BOOT:
{
init_stashes();
}
#
#
char *class;
char *name;
int oflags;
int i;
/* Assume usernames are <= 32 chars (pwck(1M) assumes <= 8) */
char user[33];
int aflags = -1;
CODE:
/*
* Account for the mandatory parameters,
* and the rest must be an even number.
*/
i = items - 3;
if ((i % 2) != 0) {
croak("Usage: Sun::Solaris::Exacct::File::new"
"(class, name, oflags, ...)");
}
/* Process any optional parameters. */
} else {
}
}
/* Check and default the creator parameter. */
} else {
}
}
/* Check and default the aflags parameter. */
if (aflags == -1) {
} else {
}
}
}
void
CODE:
#
#
SV*
const char *creator;
CODE:
RETVAL = &PL_sv_undef;
} else {
}
#
#
SV*
const char *hostname;
CODE:
RETVAL = &PL_sv_undef;
} else {
}
#
#
void
previous = 1
const char *type_str;
static const char *const type_map[] =
{ "EO_NONE", "EO_GROUP", "EO_ITEM" };
if (ix == 0) {
} else {
}
/* Work out the call context. */
switch (GIMME_V) {
case G_SCALAR:
/* In a scalar context, just return the type. */
PUSHs(&PL_sv_undef);
} else {
}
break;
case G_ARRAY:
/* In a list contect, return the type and catalog. */
PUSHs(&PL_sv_undef);
PUSHs(&PL_sv_undef);
} else {
}
break;
case G_VOID:
default:
/* In a void context, return nothing. */
break;
}
#
#
SV*
CODE:
} else {
RETVAL = &PL_sv_undef;
}
#
#
SV*
int i;
CODE:
for (i = 1; i < items; i++) {
/* Check the value is either an ::Item or a ::Group. */
if (stash != Sun_Solaris_Exacct_Object_Item_stash &&
}
/* Deflate and write the object. */
}
}