forked from lijiext/lammps
remove unused and broken function
This commit is contained in:
parent
da0acd2790
commit
c28b9f100c
|
@ -84,29 +84,6 @@ bool utils::strmatch(std::string text, std::string pattern)
|
|||
return (pos >= 0);
|
||||
}
|
||||
|
||||
/* utility function to avoid code repetition when parsing args */
|
||||
int utils::cfvarg(std::string mode, const char *arg, char *&cfv_id)
|
||||
{
|
||||
int rv = utils::NONE;
|
||||
cfv_id = NULL;
|
||||
|
||||
if (!arg) return rv;
|
||||
|
||||
if (utils::strmatch(arg,std::string("^[") + mode + "]_")) {
|
||||
if (*arg == 'c') rv = utils::COMPUTE;
|
||||
else if (*arg == 'f') rv = utils::FIX;
|
||||
else if (*arg == 'v') rv = utils::VARIABLE;
|
||||
else return rv; // should not happen
|
||||
|
||||
arg += 2;
|
||||
int n = strlen(arg)+1;
|
||||
cfv_id = new char[n];
|
||||
strcpy(cfv_id,arg);
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
/** \brief try to detect pathname from FILE pointer. Currently only supported on Linux, otherwise will report "(unknown)".
|
||||
*
|
||||
* \param buf storage buffer for pathname. output will be truncated if not large enough
|
||||
|
|
19
src/utils.h
19
src/utils.h
|
@ -36,25 +36,6 @@ namespace LAMMPS_NS {
|
|||
*/
|
||||
bool strmatch(std::string text, std::string pattern);
|
||||
|
||||
/** Categories of special arguments for cfvarg() function
|
||||
*
|
||||
* Enum starts from 100 to avoid conflicts with other local define flags
|
||||
*/
|
||||
enum {NONE=100, /// does not match any category
|
||||
COMPUTE, /// processed a compute
|
||||
FIX, /// processed a fix
|
||||
VARIABLE /// processed a variable
|
||||
};
|
||||
|
||||
/** \brief Convenience function to process 'c_', 'f_', and 'v_' arguments
|
||||
*
|
||||
* \param mode types to search for. 1-3 char string from 'c', 'f', or 'v'
|
||||
* \param arg argument string to test against the prefixes
|
||||
* \param cfv_id name or ID of the compute, fix, or variable
|
||||
* \return utils::COMPUTE, utils::FIX, utils::VARIABLE or utils::NONE
|
||||
*/
|
||||
int cfvarg(std::string mode, const char *arg, char *&cfv_id);
|
||||
|
||||
/** \brief safe wrapper around fgets() which aborts on errors
|
||||
* or EOF and prints a suitable error message to help debugging
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue