diff --git a/src/deprecated.cpp b/src/deprecated.cpp new file mode 100644 index 0000000000..ed9a9e6de4 --- /dev/null +++ b/src/deprecated.cpp @@ -0,0 +1,48 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing authors: Axel Kohlmeyer (Temple U), +------------------------------------------------------------------------- */ + +#include +#include "deprecated.h" +#include "comm.h" +#include "force.h" +#include "error.h" +#include "input.h" + +using namespace LAMMPS_NS; + +static void writemsg(LAMMPS *lmp, const char *msg, int abend=1) +{ + if (lmp->comm->me == 0) { + if (lmp->screen) fputs(msg,lmp->screen); + if (lmp->logfile) fputs(msg,lmp->logfile); + } + if (abend) + lmp->error->all(FLERR,"This command is no longer available"); +} + +/* ---------------------------------------------------------------------- */ + +void Deprecated::command(int narg, char **arg) +{ + if (strcmp(input->command,"deprecated") == 0) { + writemsg(lmp,"\nCommand 'deprecated' is a dummy command\n\n",0); + + } else if (strcmp(input->command,"XXX") == 0) { + writemsg(lmp, "\nCommand 'XXX' has been removed from LAMMPS " + "after the\n## XXX 20## stable release.\n\n"); + } +} diff --git a/src/deprecated.h b/src/deprecated.h new file mode 100644 index 0000000000..9835579245 --- /dev/null +++ b/src/deprecated.h @@ -0,0 +1,70 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef COMMAND_CLASS + +CommandStyle(deprecated,Deprecated) +CommandStyle(XXX,Deprecated) + +#else + +#ifndef LMP_DEPRECATED_H +#define LMP_DEPRECATED_H + +#include "pointers.h" + +namespace LAMMPS_NS { + +class Deprecated : protected Pointers { + public: + Deprecated(class LAMMPS *lmp) : Pointers(lmp) {}; + void command(int, char **); +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +W: Ignoring unknown or incorrect info command flag + +Self-explanatory. An unknown argument was given to the info command. +Compare your input with the documentation. + +E: Unknown name for info package category + +Self-explanatory. + +E: Unknown name for info newton category + +Self-explanatory. + +E: Unknown name for info pair category + +Self-explanatory. + +E: Unknown category for info is_active() + +Self-explanatory. + +E: Unknown category for info is_available() + +Self-explanatory. + +E: Unknown category for info is_defined() + +Self-explanatory. + +*/ diff --git a/src/input.h b/src/input.h index 80b3e8c7da..be320a41ec 100644 --- a/src/input.h +++ b/src/input.h @@ -24,6 +24,8 @@ namespace LAMMPS_NS { class Input : protected Pointers { friend class Info; friend class Error; + friend class Deprecated; + public: int narg; // # of command args char **arg; // parsed args for command @@ -38,9 +40,11 @@ class Input : protected Pointers { // substitute for variables in a string int expand_args(int, char **, int, char **&); // expand args due to wildcard + protected: + char *command; // ptr to current command + private: int me; // proc ID - char *command; // ptr to current command int maxarg; // max # of args in arg char *line,*copy,*work; // input line & copy and work string int maxline,maxcopy,maxwork; // max lengths of char strings diff --git a/src/pair_deprecated.cpp b/src/pair_deprecated.cpp index 9045b3f2a8..143cfd46f4 100644 --- a/src/pair_deprecated.cpp +++ b/src/pair_deprecated.cpp @@ -15,6 +15,7 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ +#include #include "pair_deprecated.h" #include "pair_hybrid.h" #include "comm.h"