remove unused and broken function

This commit is contained in:
Axel Kohlmeyer 2020-03-18 15:38:29 -04:00
parent da0acd2790
commit c28b9f100c
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
2 changed files with 0 additions and 42 deletions

View File

@ -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

View File

@ -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
*