summaryrefslogtreecommitdiffabout
path: root/cgit.h
authorLars Hjemli <hjemli@gmail.com>2007-11-05 21:27:43 (UTC)
committer Jonathan Bastien-Filiatrault <joe@x2a.org>2007-11-05 23:13:31 (UTC)
commita2ebbd6948da96172108db5e9c02c141923ad05c (patch) (unidiff)
tree9c40233ffcd35f1b20bb07a04bdb8c23d649e1ee /cgit.h
parent7858a309d7671109950ec940f893c2d112d36b99 (diff)
downloadcgit-a2ebbd6948da96172108db5e9c02c141923ad05c.zip
cgit-a2ebbd6948da96172108db5e9c02c141923ad05c.tar.gz
cgit-a2ebbd6948da96172108db5e9c02c141923ad05c.tar.bz2
Use utf8::reencode_string from git
This replaces the iconv-support in cgit with similar functions already existing in git. Signed-off-by: Lars Hjemli <hjemli@gmai.com>
Diffstat (limited to 'cgit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cgit.h b/cgit.h
index 6c7a941..6291c58 100644
--- a/cgit.h
+++ b/cgit.h
@@ -1,114 +1,115 @@
1#ifndef CGIT_H 1#ifndef CGIT_H
2#define CGIT_H 2#define CGIT_H
3 3
4 4
5#include <git-compat-util.h> 5#include <git-compat-util.h>
6#include <cache.h> 6#include <cache.h>
7#include <grep.h> 7#include <grep.h>
8#include <object.h> 8#include <object.h>
9#include <tree.h> 9#include <tree.h>
10#include <commit.h> 10#include <commit.h>
11#include <tag.h> 11#include <tag.h>
12#include <diff.h> 12#include <diff.h>
13#include <diffcore.h> 13#include <diffcore.h>
14#include <refs.h> 14#include <refs.h>
15#include <revision.h> 15#include <revision.h>
16#include <log-tree.h> 16#include <log-tree.h>
17#include <archive.h> 17#include <archive.h>
18#include <xdiff/xdiff.h> 18#include <xdiff/xdiff.h>
19#include <utf8.h>
19 20
20 21
21/* 22/*
22 * The valid cgit repo-commands 23 * The valid cgit repo-commands
23 */ 24 */
24#define CMD_LOG 1 25#define CMD_LOG 1
25#define CMD_COMMIT 2 26#define CMD_COMMIT 2
26#define CMD_DIFF 3 27#define CMD_DIFF 3
27#define CMD_TREE 4 28#define CMD_TREE 4
28#define CMD_BLOB 5 29#define CMD_BLOB 5
29#define CMD_SNAPSHOT 6 30#define CMD_SNAPSHOT 6
30#define CMD_TAG 7 31#define CMD_TAG 7
31#define CMD_REFS 8 32#define CMD_REFS 8
32 33
33/* 34/*
34 * Dateformats used on misc. pages 35 * Dateformats used on misc. pages
35 */ 36 */
36#define FMT_LONGDATE "%Y-%m-%d %H:%M:%S" 37#define FMT_LONGDATE "%Y-%m-%d %H:%M:%S"
37#define FMT_SHORTDATE "%Y-%m-%d" 38#define FMT_SHORTDATE "%Y-%m-%d"
38 39
39 40
40/* 41/*
41 * Limits used for relative dates 42 * Limits used for relative dates
42 */ 43 */
43#define TM_MIN 60 44#define TM_MIN 60
44#define TM_HOUR (TM_MIN * 60) 45#define TM_HOUR (TM_MIN * 60)
45#define TM_DAY (TM_HOUR * 24) 46#define TM_DAY (TM_HOUR * 24)
46#define TM_WEEK (TM_DAY * 7) 47#define TM_WEEK (TM_DAY * 7)
47#define TM_YEAR (TM_DAY * 365) 48#define TM_YEAR (TM_DAY * 365)
48#define TM_MONTH (TM_YEAR / 12.0) 49#define TM_MONTH (TM_YEAR / 12.0)
49 50
50 51
51/* 52/*
52 * Default encoding 53 * Default encoding
53 */ 54 */
54#define PAGE_ENCODING "UTF-8" 55#define PAGE_ENCODING "UTF-8"
55 56
56typedef void (*configfn)(const char *name, const char *value); 57typedef void (*configfn)(const char *name, const char *value);
57typedef void (*filepair_fn)(struct diff_filepair *pair); 58typedef void (*filepair_fn)(struct diff_filepair *pair);
58typedef void (*linediff_fn)(char *line, int len); 59typedef void (*linediff_fn)(char *line, int len);
59 60
60struct cacheitem { 61struct cacheitem {
61 char *name; 62 char *name;
62 struct stat st; 63 struct stat st;
63 int ttl; 64 int ttl;
64 int fd; 65 int fd;
65}; 66};
66 67
67struct repoinfo { 68struct repoinfo {
68 char *url; 69 char *url;
69 char *name; 70 char *name;
70 char *path; 71 char *path;
71 char *desc; 72 char *desc;
72 char *owner; 73 char *owner;
73 char *defbranch; 74 char *defbranch;
74 char *group; 75 char *group;
75 char *module_link; 76 char *module_link;
76 char *readme; 77 char *readme;
77 int snapshots; 78 int snapshots;
78 int enable_log_filecount; 79 int enable_log_filecount;
79 int enable_log_linecount; 80 int enable_log_linecount;
80}; 81};
81 82
82struct repolist { 83struct repolist {
83 int length; 84 int length;
84 int count; 85 int count;
85 struct repoinfo *repos; 86 struct repoinfo *repos;
86}; 87};
87 88
88struct commitinfo { 89struct commitinfo {
89 struct commit *commit; 90 struct commit *commit;
90 char *author; 91 char *author;
91 char *author_email; 92 char *author_email;
92 unsigned long author_date; 93 unsigned long author_date;
93 char *committer; 94 char *committer;
94 char *committer_email; 95 char *committer_email;
95 unsigned long committer_date; 96 unsigned long committer_date;
96 char *subject; 97 char *subject;
97 char *msg; 98 char *msg;
98 char *msg_encoding; 99 char *msg_encoding;
99}; 100};
100 101
101struct taginfo { 102struct taginfo {
102 char *tagger; 103 char *tagger;
103 char *tagger_email; 104 char *tagger_email;
104 int tagger_date; 105 int tagger_date;
105 char *msg; 106 char *msg;
106}; 107};
107 108
108struct refinfo { 109struct refinfo {
109 const char *refname; 110 const char *refname;
110 struct object *object; 111 struct object *object;
111 union { 112 union {
112 struct taginfo *tag; 113 struct taginfo *tag;
113 struct commitinfo *commit; 114 struct commitinfo *commit;
114 }; 115 };