/* Collection of code snippets by Arne Vajhøj */
/* (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) */
#ifndef VERSION_H
#define VERSION_H

const int MAX_VERSIONS = 100;
const int MAX_INFO_LEN = MAX_VERSIONS * 100;

class Version
{
   private:
      int noVersions;
      char **module;
      char **version;
      char **date;
      Version();
      static Version *instance;
   public:
      static Version *getInstance();
      void add(char *m, char *v, char *d);
      int getNoVersions() { return noVersions; };
      char *getModule(int ix) { return module[ix]; };
      char *getVersion(int ix) { return version[ix]; };
      char *getDate(int ix) { return date[ix]; };
};

class VersionDefine
{
   public:
      VersionDefine(char *m, char *v, char *d) { Version::getInstance()->add(m, v, d); };
      static char *getVersion(char *m);
      static char *getAllVersions();
};

#endif // VERSION_H
