mirror of https://github.com/python/cpython
ANSI-fication
This commit is contained in:
parent
7d0c71ac8c
commit
39e0e5a180
|
@ -26,8 +26,7 @@ extern int yp_get_default_domain();
|
|||
static PyObject *NisError;
|
||||
|
||||
static PyObject *
|
||||
nis_error (err)
|
||||
int err;
|
||||
nis_error (int err)
|
||||
{
|
||||
PyErr_SetString(NisError, yperr_string(err));
|
||||
return NULL;
|
||||
|
@ -50,9 +49,7 @@ static struct nis_map {
|
|||
};
|
||||
|
||||
static char *
|
||||
nis_mapname (map, pfix)
|
||||
char *map;
|
||||
int *pfix;
|
||||
nis_mapname (char *map, int *pfix)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -79,13 +76,8 @@ struct ypcallback_data {
|
|||
};
|
||||
|
||||
static int
|
||||
nis_foreach (instatus, inkey, inkeylen, inval, invallen, indata)
|
||||
int instatus;
|
||||
char *inkey;
|
||||
int inkeylen;
|
||||
char *inval;
|
||||
int invallen;
|
||||
struct ypcallback_data *indata;
|
||||
nis_foreach (int instatus, char *inkey, int inkeylen, char *inval,
|
||||
int invallen, struct ypcallback_data *indata)
|
||||
{
|
||||
if (instatus == YP_TRUE) {
|
||||
PyObject *key;
|
||||
|
@ -118,9 +110,7 @@ nis_foreach (instatus, inkey, inkeylen, inval, invallen, indata)
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
nis_match (self, args)
|
||||
PyObject *self;
|
||||
PyObject *args;
|
||||
nis_match (PyObject *self, PyObject *args)
|
||||
{
|
||||
char *match;
|
||||
char *domain;
|
||||
|
@ -150,9 +140,7 @@ nis_match (self, args)
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
nis_cat (self, args)
|
||||
PyObject *self;
|
||||
PyObject *args;
|
||||
nis_cat (PyObject *self, PyObject *args)
|
||||
{
|
||||
char *domain;
|
||||
char *map;
|
||||
|
@ -228,9 +216,7 @@ static struct timeval TIMEOUT = { 25, 0 };
|
|||
|
||||
static
|
||||
bool_t
|
||||
nis_xdr_domainname(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
domainname *objp;
|
||||
nis_xdr_domainname(XDR *xdrs, domainname *objp)
|
||||
{
|
||||
if (!xdr_string(xdrs, objp, YPMAXDOMAIN)) {
|
||||
return (FALSE);
|
||||
|
@ -240,9 +226,7 @@ nis_xdr_domainname(xdrs, objp)
|
|||
|
||||
static
|
||||
bool_t
|
||||
nis_xdr_mapname(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
mapname *objp;
|
||||
nis_xdr_mapname(XDR *xdrs, mapname *objp)
|
||||
{
|
||||
if (!xdr_string(xdrs, objp, YPMAXMAP)) {
|
||||
return (FALSE);
|
||||
|
@ -252,9 +236,7 @@ nis_xdr_mapname(xdrs, objp)
|
|||
|
||||
static
|
||||
bool_t
|
||||
nis_xdr_ypmaplist(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
nismaplist *objp;
|
||||
nis_xdr_ypmaplist(XDR *xdrs, nismaplist *objp)
|
||||
{
|
||||
if (!nis_xdr_mapname(xdrs, &objp->map)) {
|
||||
return (FALSE);
|
||||
|
@ -269,9 +251,7 @@ nis_xdr_ypmaplist(xdrs, objp)
|
|||
|
||||
static
|
||||
bool_t
|
||||
nis_xdr_ypstat(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
nisstat *objp;
|
||||
nis_xdr_ypstat(XDR *xdrs, nisstat *objp)
|
||||
{
|
||||
if (!xdr_enum(xdrs, (enum_t *)objp)) {
|
||||
return (FALSE);
|
||||
|
@ -282,9 +262,7 @@ nis_xdr_ypstat(xdrs, objp)
|
|||
|
||||
static
|
||||
bool_t
|
||||
nis_xdr_ypresp_maplist(xdrs, objp)
|
||||
XDR *xdrs;
|
||||
nisresp_maplist *objp;
|
||||
nis_xdr_ypresp_maplist(XDR *xdrs, nisresp_maplist *objp)
|
||||
{
|
||||
if (!nis_xdr_ypstat(xdrs, &objp->stat)) {
|
||||
return (FALSE);
|
||||
|
@ -300,9 +278,7 @@ nis_xdr_ypresp_maplist(xdrs, objp)
|
|||
|
||||
static
|
||||
nisresp_maplist *
|
||||
nisproc_maplist_2(argp, clnt)
|
||||
domainname *argp;
|
||||
CLIENT *clnt;
|
||||
nisproc_maplist_2(domainname *argp, CLIENT *clnt)
|
||||
{
|
||||
static nisresp_maplist res;
|
||||
|
||||
|
@ -362,9 +338,7 @@ nis_maplist ()
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
nis_maps (self, args)
|
||||
PyObject *self;
|
||||
PyObject *args;
|
||||
nis_maps (PyObject *self, PyObject *args)
|
||||
{
|
||||
nismaplist *maps;
|
||||
PyObject *list;
|
||||
|
|
|
@ -60,8 +60,7 @@ staticforward PyTypeObject Pcre_Type;
|
|||
#define STRING 9
|
||||
|
||||
static PcreObject *
|
||||
newPcreObject(arg)
|
||||
PyObject *arg;
|
||||
newPcreObject(PyObject *args)
|
||||
{
|
||||
PcreObject *self;
|
||||
self = PyObject_New(PcreObject, &Pcre_Type);
|
||||
|
@ -75,8 +74,7 @@ newPcreObject(arg)
|
|||
/* Pcre methods */
|
||||
|
||||
static void
|
||||
PyPcre_dealloc(self)
|
||||
PcreObject *self;
|
||||
PyPcre_dealloc(PcreObject *self)
|
||||
{
|
||||
if (self->regex) (pcre_free)(self->regex);
|
||||
if (self->regex_extra) (pcre_free)(self->regex_extra);
|
||||
|
@ -85,9 +83,7 @@ PyPcre_dealloc(self)
|
|||
|
||||
|
||||
static PyObject *
|
||||
PyPcre_exec(self, args)
|
||||
PcreObject *self;
|
||||
PyObject *args;
|
||||
PyPcre_exec(PcreObject *self, PyObject *args)
|
||||
{
|
||||
char *string;
|
||||
int stringlen, pos = 0, options=0, endpos = -1, i, count;
|
||||
|
@ -139,9 +135,7 @@ static PyMethodDef Pcre_methods[] = {
|
|||
};
|
||||
|
||||
static PyObject *
|
||||
PyPcre_getattr(self, name)
|
||||
PcreObject *self;
|
||||
char *name;
|
||||
PyPcre_getattr(PcreObject *self, char *name)
|
||||
{
|
||||
return Py_FindMethod(Pcre_methods, (PyObject *)self, name);
|
||||
}
|
||||
|
@ -168,9 +162,7 @@ staticforward PyTypeObject Pcre_Type = {
|
|||
/* --------------------------------------------------------------------- */
|
||||
|
||||
static PyObject *
|
||||
PyPcre_compile(self, args)
|
||||
PyObject *self; /* Not used */
|
||||
PyObject *args;
|
||||
PyPcre_compile(PyObject *self, PyObject *args)
|
||||
{
|
||||
PcreObject *rv;
|
||||
PyObject *dictionary;
|
||||
|
@ -220,9 +212,8 @@ PyPcre_compile(self, args)
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
PyPcre_expand_escape(pattern, pattern_len, indexptr, typeptr)
|
||||
unsigned char *pattern;
|
||||
int pattern_len, *indexptr, *typeptr;
|
||||
PyPcre_expand_escape(unsigned char *pattern, int pattern_len,
|
||||
int *indexptr, int *typeptr)
|
||||
{
|
||||
unsigned char c;
|
||||
int index = *indexptr;
|
||||
|
@ -447,9 +438,7 @@ PyPcre_expand_escape(pattern, pattern_len, indexptr, typeptr)
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
PyPcre_expand(self, args)
|
||||
PyObject *self;
|
||||
PyObject *args;
|
||||
PyPcre_expand(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *results, *match_obj;
|
||||
PyObject *repl_obj, *newstring;
|
||||
|
@ -623,10 +612,7 @@ static PyMethodDef pcre_methods[] = {
|
|||
*/
|
||||
|
||||
static void
|
||||
insint(d, name, value)
|
||||
PyObject * d;
|
||||
char * name;
|
||||
int value;
|
||||
insint(PyObject *d, char *name, int value)
|
||||
{
|
||||
PyObject *v = PyInt_FromLong((long) value);
|
||||
if (v == NULL) {
|
||||
|
|
|
@ -27,8 +27,7 @@ exception is raised if the entry asked for cannot be found.";
|
|||
|
||||
|
||||
static PyObject *
|
||||
mkpwent(p)
|
||||
struct passwd *p;
|
||||
mkpwent(struct passwd *p)
|
||||
{
|
||||
#ifdef __BEOS__
|
||||
/* For faking the GECOS field. - [cjh] */
|
||||
|
@ -66,9 +65,7 @@ Return the password database entry for the given numeric user ID.\n\
|
|||
See pwd.__doc__ for more on password database entries.";
|
||||
|
||||
static PyObject *
|
||||
pwd_getpwuid(self, args)
|
||||
PyObject *self;
|
||||
PyObject *args;
|
||||
pwd_getpwuid(PyObject *self, PyObject *args)
|
||||
{
|
||||
int uid;
|
||||
struct passwd *p;
|
||||
|
@ -87,9 +84,7 @@ Return the password database entry for the given user name.\n\
|
|||
See pwd.__doc__ for more on password database entries.";
|
||||
|
||||
static PyObject *
|
||||
pwd_getpwnam(self, args)
|
||||
PyObject *self;
|
||||
PyObject *args;
|
||||
pwd_getpwnam(PyObject *self, PyObject *args)
|
||||
{
|
||||
char *name;
|
||||
struct passwd *p;
|
||||
|
@ -110,9 +105,7 @@ in arbitrary order.\n\
|
|||
See pwd.__doc__ for more on password database entries.";
|
||||
|
||||
static PyObject *
|
||||
pwd_getpwall(self, args)
|
||||
PyObject *self;
|
||||
PyObject *args;
|
||||
pwd_getpwall(PyObject *self, PyObject *args)
|
||||
{
|
||||
PyObject *d;
|
||||
struct passwd *p;
|
||||
|
|
Loading…
Reference in New Issue