projects
/
blerg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use blergconf for paths
[blerg.git]
/
database
/
tags.c
diff --git
a/database/tags.c
b/database/tags.c
index
0d7a27f
..
07aa0e9
100644
(file)
--- a/
database/tags.c
+++ b/
database/tags.c
@@
-14,6
+14,7
@@
#include "util.h"
#include "database.h"
#include "config.h"
#include "util.h"
#include "database.h"
#include "config.h"
+#include "configuration.h"
int tag_scan(const char *author, const char *data, int len, uint64_t record) {
int tag_scan(const char *author, const char *data, int len, uint64_t record) {
@@
-61,7
+62,7
@@
tag_scan_start:
}
int tag_add(const char *author, const char *tag, uint64_t record) {
}
int tag_add(const char *author, const char *tag, uint64_t record) {
- char filename[
512
];
+ char filename[
FILENAME_MAX
];
struct blergref t;
memset(t.author, 0, 32);
struct blergref t;
memset(t.author, 0, 32);
@@
-70,10
+71,10
@@
int tag_add(const char *author, const char *tag, uint64_t record) {
switch(tag[0]) {
case '#':
switch(tag[0]) {
case '#':
- snprintf(filename,
512, "%s/%s", HASH_TAGS_PATH
, tag + 1);
+ snprintf(filename,
FILENAME_MAX, "%s/%s", blergconf.hash_tags_path
, tag + 1);
break;
case '@':
break;
case '@':
- snprintf(filename,
512, "%s/%s", REF_TAGS_PATH
, tag + 1);
+ snprintf(filename,
FILENAME_MAX, "%s/%s", blergconf.ref_tags_path
, tag + 1);
break;
default:
fprintf(stderr, "Invalid tag type: %s\n", tag);
break;
default:
fprintf(stderr, "Invalid tag type: %s\n", tag);
@@
-98,7
+99,7
@@
int tag_add(const char *author, const char *tag, uint64_t record) {
}
struct blergref * tag_list(const char *tag, uint64_t offset, int *count, int direction) {
}
struct blergref * tag_list(const char *tag, uint64_t offset, int *count, int direction) {
- char filename[
512
];
+ char filename[
FILENAME_MAX
];
struct stat st;
struct blergref *taglist;
struct blergref *retlist;
struct stat st;
struct blergref *taglist;
struct blergref *retlist;
@@
-114,10
+115,10
@@
struct blergref * tag_list(const char *tag, uint64_t offset, int *count, int dir
switch(tag[0]) {
case '#':
switch(tag[0]) {
case '#':
- snprintf(filename,
512, "%s/%s", HASH_TAGS_PATH
, tag + 1);
+ snprintf(filename,
FILENAME_MAX, "%s/%s", blergconf.hash_tags_path
, tag + 1);
break;
case '@':
break;
case '@':
- snprintf(filename,
512, "%s/%s", REF_TAGS_PATH
, tag + 1);
+ snprintf(filename,
FILENAME_MAX, "%s/%s", blergconf.ref_tags_path
, tag + 1);
break;
default:
fprintf(stderr, "Invalid tag type: %s\n", tag);
break;
default:
fprintf(stderr, "Invalid tag type: %s\n", tag);
@@
-175,7
+176,7
@@
tag_list_open_failed:
}
int tag_exists(const char *tag) {
}
int tag_exists(const char *tag) {
- char filename[
512
];
+ char filename[
FILENAME_MAX
];
if (!valid_tag_name(tag + 1))
return 0;
if (!valid_tag_name(tag + 1))
return 0;
@@
-187,10
+188,10
@@
int tag_exists(const char *tag) {
switch(tag[0]) {
case '#':
switch(tag[0]) {
case '#':
- snprintf(filename,
512, "%s/%s", HASH_TAGS_PATH
, tag + 1);
+ snprintf(filename,
FILENAME_MAX, "%s/%s", blergconf.hash_tags_path
, tag + 1);
break;
case '@':
break;
case '@':
- snprintf(filename,
512, "%s/%s", REF_TAGS_PATH
, tag + 1);
+ snprintf(filename,
FILENAME_MAX, "%s/%s", blergconf.ref_tags_path
, tag + 1);
break;
default:
fprintf(stderr, "Invalid tag type: %s\n", tag);
break;
default:
fprintf(stderr, "Invalid tag type: %s\n", tag);