src/shared/util.h
author Tero Marttila <terom@qmsk.net>
Sat, 15 Jul 2017 11:42:22 +0300
changeset 183 1f56a81f0c69
parent 4 49362b34116c
permissions -rw-r--r--
Dockerfile.tileserver: tweak /srv/pngtile/images path
4
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     1
#ifndef SHARED_UTIL_H
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     2
#define SHARED_UTIL_H
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     3
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     4
#include <stddef.h>
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     5
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     6
/**
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     7
 * Replace the file extension in the given path buffer with the given extension, which should be of the form ".foo"
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     8
 */
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
     9
int chfext (char *path, size_t len, const char *newext);
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    10
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    11
/**
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    12
 * Copy filesystem path with new file extension
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    13
 */
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    14
int path_with_fext (const char *path, char *buf, size_t len, const char *newext);
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    15
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    16
49362b34116c open cache as .tmp, and rename to .cache when done
Tero Marttila <terom@fixme.fi>
parents:
diff changeset
    17
#endif