forked from gregkh/bti
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbti.h
98 lines (88 loc) · 2.18 KB
/
bti.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/*
* Copyright (C) 2008-2011 Greg Kroah-Hartman <[email protected]>
* Copyright (C) 2009 Bart Trojanowski <[email protected]>
* Copyright (C) 2009-2010 Amir Mohammad Saied <[email protected]>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __BTI_H
#define __BTI_H
enum host {
HOST_TWITTER = 0,
HOST_IDENTICA = 1,
HOST_CUSTOM = 2
};
enum action {
ACTION_UPDATE = 0,
ACTION_FRIENDS = 1,
ACTION_USER = 2,
ACTION_REPLIES = 4,
ACTION_PUBLIC = 8,
ACTION_GROUP = 16,
ACTION_RETWEET = 32,
ACTION_UNKNOWN = 64
};
struct session {
char *password;
char *account;
char *consumer_key;
char *consumer_secret;
char *access_token_key;
char *access_token_secret;
char *tweet;
char *proxy;
char *time;
char *homedir;
char *logfile;
char *user;
char *group;
char *hosturl;
char *hostname;
char *configfile;
char *replyto;
char *retweet;
int bash;
int background;
int interactive;
int shrink_urls;
int dry_run;
int page;
int no_oauth;
int guest;
int verbose;
int column_output;
enum host host;
enum action action;
void *readline_handle;
char *(*readline)(const char *);
};
struct bti_curl_buffer {
char *data;
struct session *session;
enum action action;
int length;
};
extern const char twitter_host[];
extern const char identica_host[];
extern const char twitter_name[];
extern const char identica_name[];
extern int debug;
extern void bti_parse_configfile(struct session *session);
#define dbg(format, arg...) \
do { \
if (debug) \
fprintf(stdout, "bti: %s: " format , __func__ , \
## arg); \
} while (0)
#endif