projects
/
blerg.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add some missing includes
[blerg.git]
/
database
/
tags.c
diff --git
a/database/tags.c
b/database/tags.c
index
0d7a27f
..
3e3b14f
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) {
@@
-58,10
+59,11
@@
tag_scan_start:
tag_add(author, taglist[i], record);
free(taglist[i]);
}
tag_add(author, taglist[i], record);
free(taglist[i]);
}
+ return 1;
}
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
+72,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
+100,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
+116,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
+177,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
+189,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);