APIEmulation.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __APIEMULATION_H__
00019 #define __APIEMULATION_H__
00020
00021 #include <stdio.h>
00022 #include <stdlib.h>
00023
00024
00025
00026 #undef jp_logf
00027
00028 #include "libplugin.h"
00029
00030 #define PREF_RCFILE 0
00031 #define PREF_TIME 1
00032 #define PREF_SHORTDATE 2
00033 #define PREF_LONGDATE 3
00034 #define PREF_FDOW 4
00035 #define PREF_SHOW_DELETED 5
00036 #define PREF_SHOW_MODIFIED 6
00037 #define PREF_HIDE_COMPLETED 7
00038 #define PREF_HIGHLIGHT 8
00039 #define PREF_PORT 9
00040 #define PREF_RATE 10
00041 #define PREF_USER 11
00042 #define PREF_USER_ID 12
00043 #define PREF_PC_ID 13
00044 #define PREF_NUM_BACKUPS 14
00045 #define PREF_WINDOW_WIDTH 15
00046 #define PREF_WINDOW_HEIGHT 16
00047 #define PREF_DATEBOOK_PANE 17
00048 #define PREF_ADDRESS_PANE 18
00049 #define PREF_TODO_PANE 19
00050 #define PREF_MEMO_PANE 20
00051 #define PREF_USE_DB3 21
00052 #define PREF_LAST_APP 22
00053 #define PREF_PRINT_THIS_MANY 23
00054 #define PREF_PRINT_ONE_PER_PAGE 24
00055 #define PREF_NUM_BLANK_LINES 25
00056 #define PREF_PRINT_COMMAND 26
00057 #define PREF_CHAR_SET 27
00058 #define PREF_SYNC_DATEBOOK 28
00059 #define PREF_SYNC_ADDRESS 29
00060 #define PREF_SYNC_TODO 30
00061 #define PREF_SYNC_MEMO 31
00062 #define PREF_SYNC_MEMO32 32
00063 #define PREF_ADDRESS_NOTEBOOK_PAGE 33
00064 #define PREF_OUTPUT_HEIGHT 34
00065 #define PREF_OPEN_ALARM_WINDOWS 35
00066 #define PREF_DO_ALARM_COMMAND 36
00067 #define PREF_ALARM_COMMAND 37
00068 #define PREF_REMIND_IN 38
00069 #define PREF_REMIND_UNITS 39
00070 #define PREF_PASSWORD 40
00071 #define PREF_MEMO32_MODE 41
00072 #define PREF_PAPER_SIZE 42
00073 #define PREF_DATEBOOK_EXPORT_FILENAME 43
00074 #define PREF_DATEBOOK_IMPORT_PATH 44
00075 #define PREF_ADDRESS_EXPORT_FILENAME 45
00076 #define PREF_ADDRESS_IMPORT_PATH 46
00077 #define PREF_TODO_EXPORT_FILENAME 47
00078 #define PREF_TODO_IMPORT_PATH 48
00079 #define PREF_MEMO_EXPORT_FILENAME 49
00080 #define PREF_MEMO_IMPORT_PATH 50
00081
00082 #define NUM_PREFS 51
00083
00084 #define MAX_PREF_NUM_BACKUPS 99
00085
00086 #define PREF_MDY 0
00087 #define PREF_DMY 1
00088 #define PREF_YMD 2
00089
00090 #define CHAR_SET_ENGLISH 0
00091 #define CHAR_SET_JAPANESE 1
00092 #define CHAR_SET_1250 2
00093 #define CHAR_SET_1251 3
00094 #define CHAR_SET_1251_B 4
00095 #define CHAR_SET_TRADITIONAL_CHINESE 5
00096 #define CHAR_SET_KOREAN 6
00097 #define NUM_CHAR_SETS 7
00098
00099 #define MAX_PREF_VALUE 80
00100
00101 #define INTTYPE 1
00102 #define CHARTYPE 2
00103
00104 typedef struct {
00105 char *name;
00106 int usertype;
00107 int filetype;
00108 long ivalue;
00109 char *svalue;
00110 int svalue_size;
00111 } prefType;
00112
00113
00114 int jpilot_logf(int level, char *format, ...);
00115 int jp_logf(int level, char *format, ...);
00116
00117
00118
00119
00120
00121
00122
00123 int get_home_file_name(char *file, char *full_name, int max_size);
00124
00125 FILE *jp_open_home_file(char *filename, char *mode);
00126
00127 int jp_get_pref (prefType prefs[], int which, long *n, const char **ret);
00128 int jp_set_pref (prefType prefs[], int which, long n, const char *string);
00129
00130 void jp_pref_init(prefType prefs[], int count);
00131 char *pref_lstrncpy_realloc(char **dest, const char *src, int *size, int max_size);
00132
00133 int jp_pref_read_rc_file(char *filename, prefType prefs[], int num_prefs);
00134 int jp_pref_write_rc_file(char *filename, prefType prefs[], int num_prefs);
00135
00136
00137
00138
00139 #define charset_j2p(buf, max_len, char_set) {\
00140 if (char_set == CHAR_SET_JAPANESE) Euc2Sjis(buf, max_len);\
00141 if (char_set == CHAR_SET_1250) Lat2Win(buf,max_len);\
00142 if (char_set == CHAR_SET_1251) koi8_to_win1251(buf, max_len);\
00143 if (char_set == CHAR_SET_1251_B) win1251_to_koi8(buf, max_len);}
00144 #define charset_p2j(buf, max_len, char_set) {\
00145 if (char_set == CHAR_SET_JAPANESE) Sjis2Euc(buf, max_len);\
00146 if (char_set == CHAR_SET_1250) Win2Lat(buf,max_len);\
00147 if (char_set == CHAR_SET_1251) win1251_to_koi8(buf, max_len);\
00148 if (char_set == CHAR_SET_1251_B) koi8_to_win1251(buf, max_len);}
00149
00150 void jp_charset_p2j(unsigned char *buf, int max_len);
00151 void jp_charset_j2p(unsigned char *buf, int max_len);
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181 #endif
This file is part of the documentation for kpilot Library Version 3.2.2.