jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.8KB

  1. /*
  2. Copyright (C) 2001 Paul Davis
  3. This program is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU Lesser General Public License as published by
  5. the Free Software Foundation; either version 2.1 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #ifndef __JackTools__
  16. #define __JackTools__
  17. #include "JackExports.h"
  18. #ifdef WIN32
  19. #include <windows.h>
  20. #else
  21. #include <sys/types.h>
  22. #include <unistd.h>
  23. #include <dirent.h>
  24. #endif
  25. #ifdef __APPLE__
  26. #include <sys/syslimits.h>
  27. #endif
  28. #include <string>
  29. #include <algorithm>
  30. #include <vector>
  31. #include "JackExports.h"
  32. namespace Jack
  33. {
  34. struct EXPORT JackTools
  35. {
  36. static int GetPID();
  37. static int GetUID();
  38. static char* UserDir();
  39. static char* ServerDir(const char* server_name, char* server_dir);
  40. static const char* DefaultServerName();
  41. static void CleanupFiles(const char* server_name);
  42. static int GetTmpdir();
  43. static void RewriteName(const char* name, char* new_name);
  44. };
  45. class EXPORT JackArgParser
  46. {
  47. private:
  48. std::string fArgString;
  49. int fNumArgv;
  50. int fArgc;
  51. char** fArgv;
  52. public:
  53. JackArgParser(const char* arg);
  54. ~JackArgParser();
  55. std::string GetArgString();
  56. int GetNumArgv();
  57. int GetArgc();
  58. const char** GetArgv();
  59. };
  60. }
  61. #endif