Skip to content

Commit

Permalink
Move xyzo_to_meta into proper header file (#456)
Browse files Browse the repository at this point in the history
  • Loading branch information
hummeltech authored Jul 2, 2024
1 parent 3120d0b commit 9742572
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
1 change: 0 additions & 1 deletion includes/store_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ extern "C" {
#include "store.h"

struct storage_backend *init_storage_file(const char *tile_dir);
int xyzo_to_meta(char *path, size_t len, const char *tile_dir, const char *xmlconfig, const char *options, int x, int y, int z);

#ifdef __cplusplus
}
Expand Down
9 changes: 5 additions & 4 deletions includes/store_file_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,18 @@ extern "C" {
*/
int mkdirp(const char *path);

/* File path hashing. Used by both mod_tile and render daemon
* The two must both agree on the file layout for meta-tiling
* to work
*/
int path_to_xyz(const char *tilepath, const char *path, char *xmlconfig, int *px, int *py, int *pz);

#ifdef METATILE
/* New meta-tile storage functions */
/* Returns the path to the meta-tile and the offset within the meta-tile */
int xyzo_to_meta(char *path, size_t len, const char *tile_dir, const char *xmlconfig, const char *options, int x, int y, int z);
int xyz_to_meta(char *path, size_t len, const char *tile_dir, const char *xmlconfig, int x, int y, int z);
#else
/* File path hashing. Used by both mod_tile and render daemon
* The two must both agree on the file layout for meta-tiling
* to work
*/
void xyz_to_path(char *path, size_t len, const char *tile_dir, const char *xmlconfig, int x, int y, int z);
#endif

Expand Down
12 changes: 6 additions & 6 deletions src/store_file_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,6 @@ int path_to_xyz(const char *tilepath, const char *path, char *xmlconfig, int *px
}

#ifdef METATILE
// Returns the path to the meta-tile and the offset within the meta-tile
int xyz_to_meta(char *path, size_t len, const char *tile_dir, const char *xmlconfig, int x, int y, int z)
{
return xyzo_to_meta(path, len, tile_dir, xmlconfig, "", x, y, z);
}

// Returns the path to the meta-tile and the offset within the meta-tile
int xyzo_to_meta(char *path, size_t len, const char *tile_dir, const char *xmlconfig, const char *options, int x, int y, int z)
{
Expand Down Expand Up @@ -214,6 +208,12 @@ int xyzo_to_meta(char *path, size_t len, const char *tile_dir, const char *xmlco
#endif // DIRECTORY_HASH
return offset;
}

// Returns the path to the meta-tile and the offset within the meta-tile
int xyz_to_meta(char *path, size_t len, const char *tile_dir, const char *xmlconfig, int x, int y, int z)
{
return xyzo_to_meta(path, len, tile_dir, xmlconfig, "", x, y, z);
}
#else // METATILE
void xyz_to_path(char *path, size_t len, const char *tile_dir, const char *xmlconfig, int x, int y, int z)
{
Expand Down

0 comments on commit 9742572

Please sign in to comment.