Browse Source

Factor out default paths

Causal Agent 4 months ago
parent
commit
92ee655e2e
Signed by: Curtis McEnroe <june@causal.agency> GPG Key ID: CEA2F97ADCFCD77C
4 changed files with 9 additions and 5 deletions
  1. 1
    1
      client.c
  2. 2
    2
      image.c
  3. 2
    2
      server.c
  4. 4
    0
      torus.h

+ 1
- 1
client.c View File

@@ -679,7 +679,7 @@ static void readInput(void) {
679 679
 }
680 680
 
681 681
 int main(int argc, char *argv[]) {
682
-	const char *sockPath = "torus.sock";
682
+	const char *sockPath = DefaultSockPath;
683 683
 	int opt;
684 684
 	while (0 < (opt = getopt(argc, argv, "hs:"))) {
685 685
 		switch (opt) {

+ 2
- 2
image.c View File

@@ -256,8 +256,8 @@ next:
256 256
 
257 257
 int main(int argc, char *argv[]) {
258 258
 	bool kcgi = false;
259
-	const char *fontPath = "default8x16.psfu";
260
-	const char *dataPath = "torus.dat";
259
+	const char *fontPath = DefaultFontPath;
260
+	const char *dataPath = DefaultDataPath;
261 261
 	uint32_t tileX = TileInitX;
262 262
 	uint32_t tileY = TileInitY;
263 263
 

+ 2
- 2
server.c View File

@@ -372,8 +372,8 @@ static bool clientTele(struct Client *client, uint8_t port) {
372 372
 int main(int argc, char *argv[]) {
373 373
 	int error;
374 374
 
375
-	const char *dataPath = "torus.dat";
376
-	const char *sockPath = "torus.sock";
375
+	const char *dataPath = DefaultDataPath;
376
+	const char *sockPath = DefaultSockPath;
377 377
 	const char *pidPath = NULL;
378 378
 	int opt;
379 379
 	while (0 < (opt = getopt(argc, argv, "d:p:s:"))) {

+ 4
- 0
torus.h View File

@@ -25,6 +25,10 @@
25 25
 
26 26
 #define ARRAY_LEN(a) (sizeof(a) / sizeof((a)[0]))
27 27
 
28
+static const char DefaultDataPath[] = "torus.dat";
29
+static const char DefaultSockPath[] = "torus.sock";
30
+static const char DefaultFontPath[] = "default8x16.psfu";
31
+
28 32
 enum {
29 33
 	ColorBlack,
30 34
 	ColorRed,

Loading…
Cancel
Save