Browse Source

Define JACK_PATH_MAX for simpler portability.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2894 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
sletz 16 years ago
parent
commit
7723df5cd3
6 changed files with 11 additions and 11 deletions
  1. +1
    -1
      common/JackClient.cpp
  2. +1
    -1
      common/JackDriverLoader.cpp
  3. +1
    -1
      common/JackInternalClient.cpp
  4. +6
    -6
      common/JackTools.cpp
  5. +2
    -1
      common/driver_interface.h
  6. +0
    -1
      windows/JackSystemDeps_os.h

+ 1
- 1
common/JackClient.cpp View File

@@ -961,7 +961,7 @@ int JackClient::InternalClientLoad(const char* client_name, jack_options_t optio
return 0; return 0;
} }


if (va->load_name && (strlen(va->load_name) >= PATH_MAX)) {
if (va->load_name && (strlen(va->load_name) >= JACK_PATH_MAX)) {
jack_error("\"%s\" is too long for a shared object name.\n" jack_error("\"%s\" is too long for a shared object name.\n"
"Please use %lu characters or less.", "Please use %lu characters or less.",
va->load_name, PATH_MAX); va->load_name, PATH_MAX);


+ 1
- 1
common/JackDriverLoader.cpp View File

@@ -493,7 +493,7 @@ jack_get_descriptor (JSList * drivers, const char * sofile, const char * symbol)
} }
} }


strncpy(descriptor->file, filename, PATH_MAX);
strncpy(descriptor->file, filename, JACK_PATH_MAX);
free(filename); free(filename);
return descriptor; return descriptor;
} }


+ 1
- 1
common/JackInternalClient.cpp View File

@@ -173,7 +173,7 @@ JackClientControl* JackInternalClient::GetClientControl() const


void JackLoadableInternalClient::Init(const char* so_name) void JackLoadableInternalClient::Init(const char* so_name)
{ {
char path_to_so[PATH_MAX + 1];
char path_to_so[JACK_PATH_MAX + 1];
BuildClientPath(path_to_so, sizeof(path_to_so), so_name); BuildClientPath(path_to_so, sizeof(path_to_so), so_name);
fHandle = LoadJackModule(path_to_so); fHandle = LoadJackModule(path_to_so);


+ 6
- 6
common/JackTools.cpp View File

@@ -89,7 +89,7 @@ namespace Jack {
#else #else
char* JackTools::UserDir() char* JackTools::UserDir()
{ {
static char user_dir[PATH_MAX + 1] = "";
static char user_dir[JACK_PATH_MAX + 1] = "";


/* format the path name on the first call */ /* format the path name on the first call */
if (user_dir[0] == '\0') { if (user_dir[0] == '\0') {
@@ -107,9 +107,9 @@ namespace Jack {
char* JackTools::ServerDir(const char* server_name, char* server_dir) char* JackTools::ServerDir(const char* server_name, char* server_dir)
{ {
/* format the path name into the suppled server_dir char array, /* format the path name into the suppled server_dir char array,
* assuming that server_dir is at least as large as PATH_MAX+1 */
* assuming that server_dir is at least as large as JACK_PATH_MAX + 1 */


snprintf(server_dir, PATH_MAX + 1, "%s/%s", UserDir(), server_name);
snprintf(server_dir, JACK_PATH_MAX + 1, "%s/%s", UserDir(), server_name);
return server_dir; return server_dir;
} }


@@ -117,7 +117,7 @@ namespace Jack {
{ {
DIR* dir; DIR* dir;
struct dirent *dirent; struct dirent *dirent;
char dir_name[PATH_MAX + 1] = "";
char dir_name[JACK_PATH_MAX + 1] = "";
ServerDir(server_name, dir_name); ServerDir(server_name, dir_name);


/* On termination, we remove all files that jackd creates so /* On termination, we remove all files that jackd creates so
@@ -144,7 +144,7 @@ namespace Jack {
/* unlink all the files in this directory, they are mine */ /* unlink all the files in this directory, they are mine */
while ((dirent = readdir(dir)) != NULL) { while ((dirent = readdir(dir)) != NULL) {


char fullpath[PATH_MAX + 1];
char fullpath[JACK_PATH_MAX + 1];


if ((strcmp(dirent->d_name, ".") == 0) || (strcmp (dirent->d_name, "..") == 0)) { if ((strcmp(dirent->d_name, ".") == 0) || (strcmp (dirent->d_name, "..") == 0)) {
continue; continue;
@@ -175,7 +175,7 @@ namespace Jack {
int JackTools::GetTmpdir() { int JackTools::GetTmpdir() {
FILE* in; FILE* in;
size_t len; size_t len;
char buf[PATH_MAX + 2]; /* allow tmpdir to live anywhere, plus newline, plus null */
char buf[JACK_PATH_MAX + 2]; /* allow tmpdir to live anywhere, plus newline, plus null */


if ((in = popen("jackd -l", "r")) == NULL) { if ((in = popen("jackd -l", "r")) == NULL) {
return -1; return -1;


+ 2
- 1
common/driver_interface.h View File

@@ -35,6 +35,7 @@ extern "C"
#define JACK_DRIVER_PARAM_NAME_MAX 15 #define JACK_DRIVER_PARAM_NAME_MAX 15
#define JACK_DRIVER_PARAM_STRING_MAX 63 #define JACK_DRIVER_PARAM_STRING_MAX 63
#define JACK_DRIVER_PARAM_DESC 255 #define JACK_DRIVER_PARAM_DESC 255
#define JACK_PATH_MAX 511


/** Driver parameter types */ /** Driver parameter types */
typedef enum typedef enum
@@ -79,7 +80,7 @@ extern "C"
typedef struct { typedef struct {
char name[JACK_DRIVER_NAME_MAX + 1]; /**< The driver's canonical name */ char name[JACK_DRIVER_NAME_MAX + 1]; /**< The driver's canonical name */
char desc[JACK_DRIVER_PARAM_DESC + 1]; /**< The driver's extended description */ char desc[JACK_DRIVER_PARAM_DESC + 1]; /**< The driver's extended description */
char file[PATH_MAX + 1]; /**< The filename of the driver's shared object file */
char file[JACK_PATH_MAX + 1]; /**< The filename of the driver's shared object file */
uint32_t nparams; /**< The number of parameters the driver has */ uint32_t nparams; /**< The number of parameters the driver has */
jack_driver_param_desc_t * params; /**< An array of parameter descriptors */ jack_driver_param_desc_t * params; /**< An array of parameter descriptors */
} }


+ 0
- 1
windows/JackSystemDeps_os.h View File

@@ -24,7 +24,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


#pragma warning (disable : 4786) #pragma warning (disable : 4786)


#define PATH_MAX 1024
#define ENOBUFS 55 #define ENOBUFS 55


#endif #endif


Loading…
Cancel
Save