mirror of
https://github.com/python/cpython.git
synced 2025-12-11 11:31:05 +00:00
Doc strings by Chris Petrilli.
This commit is contained in:
parent
c16149b17b
commit
185ead6f37
1 changed files with 44 additions and 6 deletions
|
|
@ -95,6 +95,15 @@ fcntl_fcntl(self, args)
|
||||||
return PyInt_FromLong((long)ret);
|
return PyInt_FromLong((long)ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char fcntl_doc [] =
|
||||||
|
|
||||||
|
"fcntl(fd, opt, [arg])\n\
|
||||||
|
\n\
|
||||||
|
Perform the requested operation on file descriptor fd. The operation\n\
|
||||||
|
is defined by op and is operating system dependent. Typically these\n\
|
||||||
|
codes can be retrieved from the library module FCNTL. The argument arg\n\
|
||||||
|
is optional, and defaults to 0; it may be an int or a string.";
|
||||||
|
|
||||||
|
|
||||||
/* ioctl(fd, opt, [arg]) */
|
/* ioctl(fd, opt, [arg]) */
|
||||||
|
|
||||||
|
|
@ -146,6 +155,14 @@ fcntl_ioctl(self, args)
|
||||||
return PyInt_FromLong((long)ret);
|
return PyInt_FromLong((long)ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char ioctl_doc [] =
|
||||||
|
"ioctl(fd, opt, [arg])\n\
|
||||||
|
\n\
|
||||||
|
Perform the requested operation on file descriptor fd. The operation\n\
|
||||||
|
is defined by op and is operating system dependent. Typically these\n\
|
||||||
|
codes can be retrieved from the library module IOCTL. The argument arg\n\
|
||||||
|
is optional, and defaults to 0; it may be an int or a string.";
|
||||||
|
|
||||||
|
|
||||||
/* flock(fd, operation) */
|
/* flock(fd, operation) */
|
||||||
|
|
||||||
|
|
@ -198,6 +215,14 @@ fcntl_flock(self, args)
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char flock_doc [] =
|
||||||
|
"flock(fd, operation)\n\
|
||||||
|
\n\
|
||||||
|
Perform the lock operation op on file descriptor fd. See the Unix \n\
|
||||||
|
manual flock(3) for details. (On some systems, this function is\n\
|
||||||
|
emulated using fcntl().)";
|
||||||
|
|
||||||
|
|
||||||
/* lockf(fd, operation) */
|
/* lockf(fd, operation) */
|
||||||
static PyObject *
|
static PyObject *
|
||||||
fcntl_lockf(self, args)
|
fcntl_lockf(self, args)
|
||||||
|
|
@ -244,17 +269,30 @@ fcntl_lockf(self, args)
|
||||||
return Py_None;
|
return Py_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static char lockf_doc [] =
|
||||||
|
"lockf (fd, operation)\n\
|
||||||
|
\n\
|
||||||
|
This is a wrapper around the FCNTL.F_SETLK and FCNTL.F_SETLKW fcntl()\n\
|
||||||
|
calls. See the Unix manual for details.";
|
||||||
|
|
||||||
/* List of functions */
|
/* List of functions */
|
||||||
|
|
||||||
static PyMethodDef fcntl_methods[] = {
|
static PyMethodDef fcntl_methods[] = {
|
||||||
{"fcntl", fcntl_fcntl},
|
{"fcntl", fcntl_fcntl, 0, fcntl_doc},
|
||||||
{"ioctl", fcntl_ioctl},
|
{"ioctl", fcntl_ioctl, 0, ioctl_doc},
|
||||||
{"flock", fcntl_flock},
|
{"flock", fcntl_flock, 0, flock_doc},
|
||||||
{"lockf", fcntl_lockf, 1},
|
{"lockf", fcntl_lockf, 1, lockf_doc},
|
||||||
{NULL, NULL} /* sentinel */
|
{NULL, NULL} /* sentinel */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static char module_doc [] =
|
||||||
|
|
||||||
|
"This module performs file control and I/O control on file \n\
|
||||||
|
descriptors. It is an interface to the fcntl() and ioctl() Unix\n\
|
||||||
|
routines. File descriptors can be obtained with the fileno() method of\n\
|
||||||
|
a file or socket object.";
|
||||||
|
|
||||||
/* Module initialisation */
|
/* Module initialisation */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
@ -287,8 +325,8 @@ initfcntl()
|
||||||
{
|
{
|
||||||
PyObject *m, *d;
|
PyObject *m, *d;
|
||||||
|
|
||||||
/* Create the module and add the functions */
|
/* Create the module and add the functions and documentation */
|
||||||
m = Py_InitModule("fcntl", fcntl_methods);
|
m = Py_InitModule3("fcntl", fcntl_methods, module_doc);
|
||||||
|
|
||||||
/* Add some symbolic constants to the module */
|
/* Add some symbolic constants to the module */
|
||||||
d = PyModule_GetDict(m);
|
d = PyModule_GetDict(m);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue