improve docs also for related functions

This commit is contained in:
Axel Kohlmeyer
2021-04-24 22:08:28 -04:00
parent 7e7a448a08
commit b0cd6b3ef7
3 changed files with 16 additions and 9 deletions

View File

@ -15,8 +15,10 @@ I/O with status check
The the first two functions are wrappers around the corresponding C
library calls ``fgets()`` or ``fread()``. They will check if there
were errors on reading or an unexpected end-of-file state was reached.
In that case, the functions will stop the calculation with an error
message, indicating the name of the problematic file, if possible.
In that case, the functions will stop with an error message, indicating
the name of the problematic file, if possible unless the *error* argument
is a NULL pointer.
The :cpp:func:`read_lines_from_file` function will read the requested
number of lines of a maximum length into a buffer and will return 0
if successful or 1 if not. It also guarantees that all lines are

View File

@ -2282,6 +2282,7 @@ Ntype
ntypes
Ntypes
nucleotides
nullptr
num
numa
numactl

View File

@ -55,7 +55,7 @@ namespace LAMMPS_NS {
void logmesg(LAMMPS *lmp, const std::string &mesg);
/** return a string representing the current system error status
/** Return a string representing the current system error status
*
* This is a wrapper around calling strerror(errno).
*
@ -63,8 +63,10 @@ namespace LAMMPS_NS {
std::string getsyserror();
/** safe wrapper around fgets() which aborts on errors
* or EOF and prints a suitable error message to help debugging
/** Safe wrapper around fgets() which aborts on errors
* or EOF and prints a suitable error message to help debugging.
*
* Use nullptr as the error parameter to avoid the abort on EOF or error.
*
* \param srcname name of the calling source file (from FLERR macro)
* \param srcline line in the calling source file (from FLERR macro)
@ -72,13 +74,15 @@ namespace LAMMPS_NS {
* \param size size of buffer s (max number of bytes read by fgets())
* \param fp file pointer used by fgets()
* \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect)
* \param error pointer to Error class instance (for abort) */
* \param error pointer to Error class instance (for abort) or nullptr */
void sfgets(const char *srcname, int srcline, char *s, int size,
FILE *fp, const char *filename, Error *error);
/** safe wrapper around fread() which aborts on errors
* or EOF and prints a suitable error message to help debugging
/** Safe wrapper around fread() which aborts on errors
* or EOF and prints a suitable error message to help debugging.
*
* Use nullptr as the error parameter to avoid the abort on EOF or error.
*
* \param srcname name of the calling source file (from FLERR macro)
* \param srcline line in the calling source file (from FLERR macro)
@ -87,7 +91,7 @@ namespace LAMMPS_NS {
* \param num number of data elements read by fread()
* \param fp file pointer used by fread()
* \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect)
* \param error pointer to Error class instance (for abort) */
* \param error pointer to Error class instance (for abort) or nullptr */
void sfread(const char *srcname, int srcline, void *s, size_t size,
size_t num, FILE *fp, const char *filename, Error *error);