Commit 7723df5c authored by sletz's avatar sletz
Browse files

Define JACK_PATH_MAX for simpler portability.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2894 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 0cd5d18e
......@@ -961,7 +961,7 @@ int JackClient::InternalClientLoad(const char* client_name, jack_options_t optio
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"
"Please use %lu characters or less.",
va->load_name, PATH_MAX);
......
......@@ -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);
return descriptor;
}
......
......@@ -173,7 +173,7 @@ JackClientControl* JackInternalClient::GetClientControl() const
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);
fHandle = LoadJackModule(path_to_so);
......
......@@ -89,7 +89,7 @@ namespace Jack {
#else
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 */
if (user_dir[0] == '\0') {
......@@ -107,9 +107,9 @@ namespace Jack {
char* JackTools::ServerDir(const char* server_name, char* server_dir)
{
/* 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;
}
......@@ -117,7 +117,7 @@ namespace Jack {
{
DIR* dir;
struct dirent *dirent;
char dir_name[PATH_MAX + 1] = "";
char dir_name[JACK_PATH_MAX + 1] = "";
ServerDir(server_name, dir_name);
/* 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 */
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)) {
continue;
......@@ -175,7 +175,7 @@ namespace Jack {
int JackTools::GetTmpdir() {
FILE* in;
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) {
return -1;
......
......@@ -35,6 +35,7 @@ extern "C"
#define JACK_DRIVER_PARAM_NAME_MAX 15
#define JACK_DRIVER_PARAM_STRING_MAX 63
#define JACK_DRIVER_PARAM_DESC 255
#define JACK_PATH_MAX 511
/** Driver parameter types */
typedef enum
......@@ -79,7 +80,7 @@ extern "C"
typedef struct {
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 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 */
jack_driver_param_desc_t * params; /**< An array of parameter descriptors */
}
......
......@@ -24,7 +24,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#pragma warning (disable : 4786)
#define PATH_MAX 1024
#define ENOBUFS 55
#endif
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment