*
*/
-#ifdef DLL_EXPORT
-#define IN_LIBCIT
-#endif
-
#include "sysdep.h"
#include <stdlib.h>
#include <unistd.h>
filename[a] = '_';
}
}
- snprintf(pathname, sizeof pathname, "./files/%s/%s",
- CC->room.QRdirname, filename);
+ snprintf(pathname, sizeof pathname,
+ "%s/%s/%s",
+ ctdl_file_dir,
+ CC->room.QRdirname, filename);
a = unlink(pathname);
if (a == 0) {
cprintf("%d File '%s' deleted.\n", CIT_OK, pathname);
return;
}
snprintf(outfile, sizeof outfile,
- "%s/network/spoolin/nsf.%04lx.%04x",
- CTDLDIR, (long)getpid(), ++seq);
+ "%s/nsf.%04lx.%04x",
+ ctdl_netin_dir,
+ (long)getpid(), ++seq);
ofp = fopen(outfile, "a");
if (ofp == NULL) {
cprintf("%d internal error\n", ERROR + INTERNAL_ERROR);
fclose(ofp);
snprintf(buf, sizeof buf,
- "cd ./files/%s; uuencode %s <%s 2>/dev/null >>%s",
- CC->room.QRdirname, filename, filename, outfile);
+ "cd %s/%s; uuencode %s <%s 2>/dev/null >>%s",
+ ctdl_file_dir,
+ /* FIXME: detect uuencode while installation? or inline */
+ CC->room.QRdirname, filename, filename, outfile);
system(buf);
ofp = fopen(outfile, "a");
}
snprintf(pathname, sizeof pathname,
- "./files/%s/%s", CC->room.QRdirname, filename);
+ "%s/%s/%s",
+ ctdl_file_dir,
+ CC->room.QRdirname, filename);
CC->download_fp = fopen(pathname, "r");
if (CC->download_fp == NULL) {
ERROR + NO_SUCH_USER);
return;
}
- snprintf(pathname, sizeof pathname, "./userpics/%ld.gif",
- usbuf.usernum);
+ snprintf(pathname, sizeof pathname,
+ "%s/%ld.gif",
+ ctdl_usrpic_dir,
+ usbuf.usernum);
} else if (!strcasecmp(filename, "_floorpic_")) {
which_floor = extract_int(cmdbuf, 1);
snprintf(pathname, sizeof pathname,
- "./images/floor.%d.gif", which_floor);
+ "%s/floor.%d.gif",
+ ctdl_image_dir, which_floor);
} else if (!strcasecmp(filename, "_roompic_")) {
- assoc_file_name(pathname, sizeof pathname, &CC->room, "images");
+ assoc_file_name(pathname, sizeof pathname, &CC->room, ctdl_image_dir);
} else {
for (a = 0; a < strlen(filename); ++a) {
filename[a] = tolower(filename[a]);
filename[a] = '_';
}
}
- snprintf(pathname, sizeof pathname, "./images/%s.gif",
- filename);
+ snprintf(pathname, sizeof pathname,
+ "%s/%s.gif",
+ ctdl_image_dir,
+ filename);
}
CC->download_fp = fopen(pathname, "rb");
CC->upl_file[a] = '_';
}
}
- snprintf(CC->upl_path, sizeof CC->upl_path, "./files/%s/%s",
- CC->room.QRdirname, CC->upl_file);
+ snprintf(CC->upl_path, sizeof CC->upl_path,
+ "%s/%s/%s",
+ ctdl_file_dir,
+ CC->room.QRdirname, CC->upl_file);
snprintf(CC->upl_filedir, sizeof CC->upl_filedir,
- "./files/%s/filedir", CC->room.QRdirname);
+ "%s/%s/filedir",
+ ctdl_file_dir,
+ CC->room.QRdirname);
CC->upload_fp = fopen(CC->upl_path, "r");
if (CC->upload_fp != NULL) {
}
if (CC->user.axlevel >= 6) {
- snprintf(CC->upl_path, sizeof CC->upl_path, "./images/%s",
- basenm);
+ snprintf(CC->upl_path, sizeof CC->upl_path,
+ "%s/%s",
+ ctdl_image_dir,
+ basenm);
}
if (!strcasecmp(basenm, "_userpic_")) {
snprintf(CC->upl_path, sizeof CC->upl_path,
- "./userpics/%ld.gif", CC->user.usernum);
+ "%s/%ld.gif",
+ ctdl_usrpic_dir,
+ CC->user.usernum);
}
if ((!strcasecmp(basenm, "_floorpic_"))
&& (CC->user.axlevel >= 6)) {
which_floor = extract_int(cmdbuf, 2);
snprintf(CC->upl_path, sizeof CC->upl_path,
- "./images/floor.%d.gif", which_floor);
+ "%s/floor.%d.gif",
+ ctdl_image_dir,
+ which_floor);
}
if ((!strcasecmp(basenm, "_roompic_")) && (is_room_aide())) {
- assoc_file_name(CC->upl_path, sizeof CC->upl_path, &CC->room, "images");
+ assoc_file_name(CC->upl_path, sizeof CC->upl_path, &CC->room, ctdl_image_dir);
}
if (strlen(CC->upl_path) == 0) {
if (CC->dl_is_net == 1) {
CC->dl_is_net = 0;
- snprintf(buf, sizeof buf, "%s/network/spoolout/%s", CTDLDIR,
- CC->net_node);
+ snprintf(buf, sizeof buf,
+ "%s/%s",
+ ctdl_netout_dir,
+ CC->net_node);
unlink(buf);
}
return;
}
- snprintf(pathname, sizeof pathname, "%s/network/spoolout/%s",
- CTDLDIR, CC->net_node);
+ snprintf(pathname, sizeof pathname,
+ "%s/%s",
+ ctdl_netout_dir,
+ CC->net_node);
/* first open the file in append mode in order to create a
* zero-length file if it doesn't already exist
}
snprintf(CC->upl_path, sizeof CC->upl_path,
- "%s/network/spoolin/%s.%04lx.%04x",
- CTDLDIR, CC->net_node, (long)getpid(), ++seq);
+ "%s/%s.%04lx.%04x",
+ ctdl_netin_dir,
+ CC->net_node,
+ (long)getpid(),
+ ++seq);
CC->upload_fp = fopen(CC->upl_path, "r");
if (CC->upload_fp != NULL) {