Browse Source

Factor out default paths

master
Causal Agent 8 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) {
}

int main(int argc, char *argv[]) {
const char *sockPath = "torus.sock";
const char *sockPath = DefaultSockPath;
int opt;
while (0 < (opt = getopt(argc, argv, "hs:"))) {
switch (opt) {

+ 2
- 2
image.c View File

@@ -256,8 +256,8 @@ next:

int main(int argc, char *argv[]) {
bool kcgi = false;
const char *fontPath = "default8x16.psfu";
const char *dataPath = "torus.dat";
const char *fontPath = DefaultFontPath;
const char *dataPath = DefaultDataPath;
uint32_t tileX = TileInitX;
uint32_t tileY = TileInitY;


+ 2
- 2
server.c View File

@@ -372,8 +372,8 @@ static bool clientTele(struct Client *client, uint8_t port) {
int main(int argc, char *argv[]) {
int error;

const char *dataPath = "torus.dat";
const char *sockPath = "torus.sock";
const char *dataPath = DefaultDataPath;
const char *sockPath = DefaultSockPath;
const char *pidPath = NULL;
int opt;
while (0 < (opt = getopt(argc, argv, "d:p:s:"))) {

+ 4
- 0
torus.h View File

@@ -25,6 +25,10 @@

#define ARRAY_LEN(a) (sizeof(a) / sizeof((a)[0]))

static const char DefaultDataPath[] = "torus.dat";
static const char DefaultSockPath[] = "torus.sock";
static const char DefaultFontPath[] = "default8x16.psfu";

enum {
ColorBlack,
ColorRed,

Loading…
Cancel
Save