Recgnize new box types by searchbox and findbox commands
[shigofumi.git] / src / data.h
blob5e0a1c6153e4f4e70a0355ab6f624e29438c0528
1 #ifndef __DATA_H__
2 #define __DATA_H__
4 #include <isds.h>
6 void print_bool(const _Bool *boolean);
7 void print_longint(const long int *number);
8 void print_DbState(const long int state);
9 void print_date(const struct tm *date);
10 void print_DbOwnerInfo(const struct isds_DbOwnerInfo *info);
11 void print_DbUserInfo(const struct isds_DbUserInfo *info);
12 void print_timeval(const struct timeval *time);
13 void print_hash(const struct isds_hash *hash);
14 void print_envelope(const struct isds_envelope *envelope);
15 void print_message(const struct isds_message *message);
16 void print_copies(const struct isds_list *copies);
18 void compare_hashes(const struct isds_hash *hash1,
19 const struct isds_hash *hash2);
20 int progressbar(double upload_total, double upload_current,
21 double download_total, double download_current,
22 void *data);
24 char *hash2string(const struct isds_hash *hash);
25 char *tm2string(const struct tm *date);
27 /* Convert string representation of full ISO 8601 or locale date to tm structure.
28 * Return NULL if error occurs
29 * XXX: Not all ISO formats are supported */
30 struct tm *datestring2tm(const char *string);
32 /* Convert string representation of box type to isds_DbType. Return false
33 * if the string was not recognized. Otherwise returns true. */
34 int string2isds_DbType(isds_DbType *type, const char *string);
36 /* Return static box state string or NULL if undefined */
37 const char *DbState2string(const long int *state);
39 /* Print formatted header if locale-encoded value is defined.
40 * @header is locale encoded header name
41 * @value is locale encoded header value */
42 void print_header(const char *header, const char *value);
44 /* Print formatted header if boolean value is defined.
45 * @header is locale encoded header name */
46 void print_header_bool(const char *header, const _Bool *value);
48 /* Print formatted header if long int value is defined.
49 * @header is locale encoded header name */
50 void print_header_longint(const char *header, const long int *value);
52 /* Print formatted header if unsigned long int value is defined.
53 * @header is locale encoded header name */
54 void print_header_ulongint(const char *header, const unsigned long int *value);
56 /* Print formatted header if time value is defined.
57 * @header is locale encoded header name */
58 void print_header_timeval(const char *header, const struct timeval *time);
60 /* Print formatted header if date value is defined.
61 * @header is locale encoded header name */
62 void print_header_tm(const char *header, const struct tm *date);
64 /* Print formatted header if UTF-8 value is defined.
65 * @header is locale encoded header name
66 * @value is UTF-8 encoded header value */
67 void print_header_utf8(const char *header, const char *value);
69 /* Print formatted header if long int CZK/100 currency value is defined.
70 * @header is locale encoded header name
71 * @value is pointer to value in hundredths of CZK */
72 void print_header_currency(const char *header, const long int *value);
74 void print_message_list(const struct isds_list *messages, _Bool outgoing);
75 void format_message(const struct isds_message *message);
77 /* Print formatted list of message copies */
78 void format_copies(const struct isds_list *copies);
80 void format_DbOwnerInfo(const struct isds_DbOwnerInfo *info);
82 /* Print formated details about a box found by a full-text */
83 void format_isds_fulltext_result(const struct isds_fulltext_result *result);
85 void format_DbUserInfo(const struct isds_DbUserInfo *info);
87 /* Print formated details about message sender */
88 void format_sender_info(const char *dbID, const isds_sender_type *type,
89 const char *raw_type, const char *name);
91 /* Print formated details about credit change event */
92 void format_credit_event(const struct isds_credit_event *event);
94 void format_commercial_permission(
95 const struct isds_commercial_permission *permission);
97 #endif