Add commercialcredit command
[shigofumi.git] / src / data.h
bloba4c2da217ccae89bd26c2ea5edf80691d1b6cfa5
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 /* Return static box state string or NULL if undefined */
33 const char *DbState2string(const long int *state);
35 /* Print formatted header if locale-encoded value is defined.
36 * @header is locale encoded header name
37 * @value is locale encoded header value */
38 void print_header(const char *header, const char *value);
40 /* Print formatted header if boolean value is defined.
41 * @header is locale encoded header name */
42 void print_header_bool(const char *header, const _Bool *value);
44 /* Print formatted header if long int value is defined.
45 * @header is locale encoded header name */
46 void print_header_longint(const char *header, const long int *value);
48 /* Print formatted header if unsigned long int value is defined.
49 * @header is locale encoded header name */
50 void print_header_ulongint(const char *header, const unsigned long int *value);
52 /* Print formatted header if time value is defined.
53 * @header is locale encoded header name */
54 void print_header_timeval(const char *header, const struct timeval *time);
56 /* Print formatted header if date value is defined.
57 * @header is locale encoded header name */
58 void print_header_tm(const char *header, const struct tm *date);
60 /* Print formatted header if UTF-8 value is defined.
61 * @header is locale encoded header name
62 * @value is UTF-8 encoded header value */
63 void print_header_utf8(const char *header, const char *value);
65 void print_message_list(const struct isds_list *messages, _Bool outgoing);
66 void format_message(const struct isds_message *message);
68 /* Print formatted list of message copies */
69 void format_copies(const struct isds_list *copies);
71 void format_DbOwnerInfo(const struct isds_DbOwnerInfo *info);
72 void format_DbUserInfo(const struct isds_DbUserInfo *info);
74 /* Print formated details about message sender */
75 void format_sender_info(const char *dbID, const isds_sender_type *type,
76 const char *raw_type, const char *name);
78 /* Print formated details about credit change event */
79 void format_credit_event(const struct isds_credit_event *event);
81 void format_commercial_permission(
82 const struct isds_commercial_permission *permission);
84 #endif