if (NULL == fp)
exit(EXIT_FAILURE);
- do{
+ do {
c = fgetc(fp);
switch (c) {
case '\n':
while ('\n' != c && EOF != c)
c = fgetc(fp);
printf("\\\n");
+ } else {
+ printf("-%c", c);
}
- else printf("-%c",c);
break;
case EOF:
break;
default:
- printf("%c",c);
+ printf("%c", c);
break;
}
- }while (EOF != c);
+ } while (EOF != c);
exit(EXIT_SUCCESS);
}
DBG("uri[%s]", uri); \
int is_schedule = 0; \
do { \
- if (CAL_STRING_EQUAL == strncmp(uri, CALENDAR_VIEW_EVENT, strlen(CALENDAR_VIEW_EVENT))) \
- { \
+ if (CAL_STRING_EQUAL == strncmp(uri, CALENDAR_VIEW_EVENT, strlen(CALENDAR_VIEW_EVENT))) { \
is_schedule = 1; \
struct timeval hold = {0}; \
struct timeval diff = {0}; \
gettimeofday(&hold, NULL); \
timersub(&hold, &__g_release_time, &diff); \
DBG("%ld.%ld sec", diff.tv_sec, diff.tv_usec); \
- if (diff.tv_sec / 1000 == 0 && diff.tv_usec < __CAL_CLIENT_ALLOW_USEC) \
- { \
- if (__g_access_count < __CAL_CLIENT_ACCESS_MAX) \
- { \
+ if (diff.tv_sec / 1000 == 0 && diff.tv_usec < __CAL_CLIENT_ALLOW_USEC) { \
+ if (__g_access_count < __CAL_CLIENT_ACCESS_MAX) { \
__g_access_count++; \
DBG("--count (%d)", __g_access_count); \
- } \
- else \
- { \
+ } else { \
DBG("--sleep"); \
usleep(200000); \
__g_access_count = 0; \
timerclear(&__g_release_time); \
} \
- } \
- else \
- { \
+ } else { \
DBG("--reset"); \
__g_access_count = 0; \
timerclear(&__g_release_time); \
#define CAL_LIMIT_ACCESS_BACK \
do { \
- if (is_schedule) \
- { \
+ if (is_schedule) { \
gettimeofday(&__g_release_time, NULL); \
} \
} while (0)
if (CALENDAR_ERROR_NO_DATA == ret) {
ret = cal_client_handle_create(id, &handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_create() Fail(%d)", ret);
- }
- else if (CALENDAR_ERROR_NONE != ret) {
+ } else if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
}
ret = cal_client_handle_get_p_with_id(id, &handle);
if (CALENDAR_ERROR_NO_DATA == ret) {
return CALENDAR_ERROR_NONE;
- }
- else if (CALENDAR_ERROR_NONE != ret) {
+ } else if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
}
if (CALENDAR_ERROR_NO_DATA == ret) {
ret = cal_client_handle_create(id, &handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_create() Fail(%d)", ret);
- }
- else if (CALENDAR_ERROR_NONE != ret) {
+ } else if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
}
ret = cal_client_handle_get_p_with_id(id, &handle);
if (CALENDAR_ERROR_NO_DATA == ret) {
return CALENDAR_ERROR_NONE;
- }
- else if (CALENDAR_ERROR_NONE != ret) {
+ } else if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
}
if (CALENDAR_ERROR_NO_DATA == ret) {
ret = cal_client_handle_create(id, &handle);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_client_handle_create() Fail(%d)", ret);
- }
- else if (CALENDAR_ERROR_NONE != ret) {
+ } else if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_client_handle_get_p_with_id() Fail(%d)", ret);
return ret;
}
cal_mutex_lock(CAL_MUTEX_CONNECTION);
cal_s *h = (cal_s *)handle;
- if (0 == h->connection_count) {
-
- }
-
h->connection_count++;
DBG("[Connection count:handle] (%d)", h->connection_count);
if (0 == *connection_count) { /* total connection */
-#if !GLIB_CHECK_VERSION(2,35,0)
+#if !GLIB_CHECK_VERSION(2, 35, 0)
g_type_init(); /* for alarmmgr */
#endif
ret = cal_inotify_init();
}
cal_view_initialize();
- }
- else if (0 < *connection_count) {
+ } else if (0 < *connection_count) {
DBG("[System] calendar service is already connected");
}
- if (1 == h->connection_count) {
-
- }
-
(*connection_count)++;
if (0 == reference_count)
cal_mutex_lock(CAL_MUTEX_CONNECTION);
cal_s *h = (cal_s *)handle;
- if (1 == h->connection_count) {
-
- }
-
h->connection_count--;
DBG("[Disonnection count:handle] (%d)", h->connection_count);
DBG("[System] disconnected successfully");
cal_view_finalize();
cal_inotify_deinit();
- }
- else if (1 < *connection_count) {
+ } else if (1 < *connection_count) {
DBG("[System] connection count(%d)", *connection_count);
- }
- else {
+ } else {
DBG("[System] calendar_connect() is needed");
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return CALENDAR_ERROR_INVALID_PARAMETER;
com_filter = (cal_composite_filter_s*)filter;
ret = _cal_filter_create_attribute(com_filter, property_id, match, CAL_FILTER_STR, &str_filter);
- RETVM_IF(CALENDAR_ERROR_NONE !=ret, ret, "property_id(%d), match(%d), match_value(%s)", property_id, match, match_value);
+ RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "property_id(%d), match(%d), match_value(%s)", property_id, match, match_value);
str_filter->value.s = cal_strdup(match_value);
return CALENDAR_ERROR_NONE;
com_filter = (cal_composite_filter_s*)filter;
ret = _cal_filter_create_attribute(com_filter, property_id, match, CAL_FILTER_INT, &int_filter);
- RETVM_IF(CALENDAR_ERROR_NONE !=ret, ret, "property_id(%d), match(%d), match_value(%d)", property_id, match, match_value);
+ RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "property_id(%d), match(%d), match_value(%d)", property_id, match, match_value);
int_filter->value.i = match_value;
com_filter = (cal_composite_filter_s*)filter;
ret = _cal_filter_create_attribute(com_filter, property_id, match, CAL_FILTER_DOUBLE, &int_filter);
- RETVM_IF(CALENDAR_ERROR_NONE !=ret, ret, "property_id(%d), match(%d), match_value(%d)", property_id, match, match_value);
+ RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "property_id(%d), match(%d), match_value(%d)", property_id, match, match_value);
int_filter->value.d = match_value;
com_filter = (cal_composite_filter_s*)filter;
ret = _cal_filter_create_attribute(com_filter, property_id, match, CAL_FILTER_LLI, &int_filter);
- RETVM_IF(CALENDAR_ERROR_NONE !=ret, ret, "property_id(%d), match(%d), match_value(%d)", property_id, match, match_value);
+ RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "property_id(%d), match(%d), match_value(%d)", property_id, match, match_value);
int_filter->value.lli = match_value;
com_filter = (cal_composite_filter_s*)filter;
ret = _cal_filter_create_attribute(com_filter, property_id, match, CAL_FILTER_CALTIME, &int_filter);
- RETVM_IF(CALENDAR_ERROR_NONE !=ret, ret, "property_id(%d), match(%d), match_value(%d)", property_id, match, match_value);
+ RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "property_id(%d), match(%d), match_value(%d)", property_id, match, match_value);
int_filter->value.caltime = match_value;
GSList *cursor = NULL;
RETV_IF(NULL == filter, CALENDAR_ERROR_INVALID_PARAMETER);
- for(cursor=filter->filters;cursor;cursor=cursor->next) {
+ for (cursor = filter->filters; cursor; cursor = cursor->next) {
cal_filter_s *src = (cal_filter_s *)cursor->data;
if (NULL == src)
continue;
- if (src->filter_type == CAL_FILTER_COMPOSITE) {
+ if (src->filter_type == CAL_FILTER_COMPOSITE)
_cal_filter_destroy_composite((cal_composite_filter_s*)src);
- }
- else {
+ else
_cal_filter_destroy_attribute((cal_attribute_filter_s*)src);
- }
-
}
CAL_FREE(filter->view_uri);
g_slist_free(filter->filters);
{
RETV_IF(NULL == filter, CALENDAR_ERROR_INVALID_PARAMETER);
- if (filter->filter_type == CAL_FILTER_STR) {
+ if (filter->filter_type == CAL_FILTER_STR)
CAL_FREE(filter->value.s);
- }
+
CAL_FREE(filter);
return CALENDAR_ERROR_NONE;
}
ret = calendar_filter_create(filter->view_uri, (calendar_filter_h *)&out);
RETV_IF(CALENDAR_ERROR_NONE != ret, CALENDAR_ERROR_OUT_OF_MEMORY);
- for(cursor=filter->filters; cursor ; cursor=cursor->next) {
+ for (cursor = filter->filters; cursor ; cursor = cursor->next) {
cal_filter_s *src = (cal_filter_s *)cursor->data;
cal_filter_s *dest = NULL;
if (src->filter_type == CAL_FILTER_COMPOSITE) {
ret = _cal_filter_clone_composite((cal_composite_filter_s *)src,
(cal_composite_filter_s **)&dest);
- }
- else {
+ } else {
ret = _cal_filter_clone_attribute((cal_attribute_filter_s *)src,
(cal_attribute_filter_s **)&dest);
}
if (CALENDAR_ERROR_NONE == ret) {
out->filters = g_slist_append(out->filters, dest);
- }
- else {
+ } else {
calendar_filter_destroy((calendar_filter_h)out);
return ret;
}
noti = (noti_info_s *)cursor->data;
if (noti->wd == wd) {
if ((mask & IN_CLOSE_WRITE) && noti->cb) {
- switch(noti->noti_type) {
+ switch (noti->noti_type) {
case CAL_NOTI_TYPE_CALENDAR:
noti->cb(CALENDAR_VIEW_CALENDAR, noti->cb_data);
break;
_handle_callback(_noti_list, ie.wd, ie.mask);
while (0 != ie.len) {
- ret = read(fd, name, (ie.len<sizeof(name))?ie.len:sizeof(name));
+ ret = read(fd, name, (ie.len < sizeof(name)) ? ie.len : sizeof(name));
if (-1 == ret) {
if (EINTR == errno)
continue;
else
ie.len -= ret;
}
- }
- else {
+ } else {
while (ret < sizeof(ie)) {
int read_size;
read_size = read(fd, name, sizeof(ie)-ret);
calendar_inoti_count++;
if (1 < calendar_inoti_count) {
- DBG("inotify count =%d",calendar_inoti_count);
+ DBG("inotify count =%d", calendar_inoti_count);
cal_mutex_unlock(CAL_MUTEX_INOTIFY);
return CALENDAR_ERROR_NONE;
}
- DBG("inotify count =%d",calendar_inoti_count);
+ DBG("inotify count =%d", calendar_inoti_count);
cal_mutex_unlock(CAL_MUTEX_INOTIFY);
#endif
_inoti_fd = inotify_init();
int ret;
ret = inotify_add_watch(fd, notipath, IN_CLOSE_WRITE);
- if (ret < 0)
- {
+ if (ret < 0) {
ERR("Failed to add watch(ret:%d)", ret);
- return -1; // CALENDAR_ERROR_FAILED_INOTIFY
+ return -1; /* CALENDAR_ERROR_FAILED_INOTIFY */
}
return CALENDAR_ERROR_NONE;
cursor = g_slist_next(cursor);
continue;
}
- if (info->wd == wd && info->cb == cb && info->cb_data == cb_data) {
+
+ if (info->wd == wd && info->cb == cb && info->cb_data == cb_data)
has_noti = true;
- }
+
cursor = g_slist_next(cursor);
}
return has_noti;
free(noti);
del_cnt++;
continue;
- }
- else {
+ } else {
remain_cnt++;
}
}
calendar_inoti_count--;
if (0 < calendar_inoti_count) {
- DBG("inotify count =%d",calendar_inoti_count);
+ DBG("inotify count =%d", calendar_inoti_count);
cal_mutex_unlock(CAL_MUTEX_INOTIFY);
return ;
}
- DBG("inotify count =%d",calendar_inoti_count);
+ DBG("inotify count =%d", calendar_inoti_count);
cal_mutex_unlock(CAL_MUTEX_INOTIFY);
#endif
if (inoti_handler) {
inoti_handler = 0;
}
- if (_noti_list)
- {
+ if (_noti_list) {
g_slist_foreach(_noti_list, __clear_nslot_list, NULL);
g_slist_free(_noti_list);
_noti_list = NULL;
RETV_IF(NULL == out_list, CALENDAR_ERROR_INVALID_PARAMETER);
ret = calendar_list_get_count(list, &count);
- if (CALENDAR_ERROR_NONE != ret) {
+ if (CALENDAR_ERROR_NONE != ret)
return ret;
- }
ret = calendar_list_first(list);
- if (CALENDAR_ERROR_NONE != ret) {
+ if (CALENDAR_ERROR_NONE != ret)
return ret;
- }
ret = calendar_list_create(&l);
- if (CALENDAR_ERROR_NONE != ret) {
+ if (CALENDAR_ERROR_NONE != ret)
return ret;
- }
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
calendar_record_h record = NULL;
calendar_record_h clone_record = NULL;
ret = calendar_list_get_current_record_p(list, &record);
{
int i;
- for (i=0;i<count;i++) {
+ for (i = 0; i < count; i++) {
cal_property_info_s *p = (cal_property_info_s*)&(properties[i]);
- if (property_id == p->property_id) {
+ if (property_id == p->property_id)
return true;
- }
}
return false;
}
que = (cal_query_s *)query;
- for (i=0;i<count;i++) {
+ for (i = 0; i < count; i++) {
find = _cal_query_property_check(que->properties, que->property_count, property_ids[i]);
RETVM_IF(false == find, CALENDAR_ERROR_INVALID_PARAMETER,
"Invalid parameter : property_id(%d) is not supported on view_uri(%s)", property_ids[i], que->view_uri);
return CALENDAR_ERROR_NO_DATA;
}
- ret = cal_filter_clone(filter,&new_filter);
- RETV_IF(ret!=CALENDAR_ERROR_NONE, ret);
+ ret = cal_filter_clone(filter, &new_filter);
+ RETV_IF(ret != CALENDAR_ERROR_NONE, ret);
- if (que->filter) {
+ if (que->filter)
calendar_filter_destroy((calendar_filter_h)que->filter);
- }
que->filter = (cal_composite_filter_s*)new_filter;
RETV_IF(NULL == query, CALENDAR_ERROR_INVALID_PARAMETER);
que = (cal_query_s *)query;
- if (que->filter) {
+ if (que->filter)
calendar_filter_destroy((calendar_filter_h)que->filter);
- }
CAL_FREE(que->view_uri);
CAL_FREE(que->projection);
#include "cal_record.h"
#define __CHECK_READ_ONLY_PROPERTY() \
- if (CAL_PROPERTY_CHECK_FLAGS(property_id, CAL_PROPERTY_FLAGS_READ_ONLY) == true) \
-{ \
- ERR("Invalid parameter: Don't try to change read-only property."); \
- return CALENDAR_ERROR_NOT_PERMITTED; \
-}
+ if (CAL_PROPERTY_CHECK_FLAGS(property_id, CAL_PROPERTY_FLAGS_READ_ONLY) == true) { \
+ ERR("Invalid parameter: Don't try to change read-only property."); \
+ return CALENDAR_ERROR_NOT_PERMITTED; \
+ }
extern cal_record_plugin_cb_s cal_record_calendar_plugin_cb;
extern cal_record_plugin_cb_s cal_record_event_plugin_cb;
if (NULL == _record->properties_flags) {
int count = 0;
- cal_view_get_property_info(_record->view_uri,&count);
+ cal_view_get_property_info(_record->view_uri, &count);
if (0 < count) {
_record->properties_flags = calloc(count, sizeof(char));
ERR("calloc() Fail");
return ;
}
- }
- else {
+ } else {
ERR("get property_info_Fail");
return ;
}
_record->properties_max_count = properties_max_count;
- for (i = 0; i < projection_count; i++) {
+ for (i = 0; i < projection_count; i++)
_cal_record_set_property_flag(record, projection[i], CAL_PROPERTY_FLAG_PROJECTION);
- }
return CALENDAR_ERROR_NONE;
}
RETV_IF(NULL == view_uri, CALENDAR_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == out_record, CALENDAR_ERROR_INVALID_PARAMETER);
- type =cal_view_get_type(view_uri);
+ type = cal_view_get_type(view_uri);
DBG("----------------------[%s]", view_uri);
RETV_IF(CAL_RECORD_TYPE_INVALID == type, CALENDAR_ERROR_INVALID_PARAMETER);
ret = plugin_cb->create(out_record);
- if (CALENDAR_ERROR_NONE == ret) {
+ if (CALENDAR_ERROR_NONE == ret)
CAL_RECORD_INIT_COMMON((cal_record_s*)*out_record, type, plugin_cb, cal_view_get_uri(view_uri));
- }
return ret;
}
RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
ret = temp->plugin_cb->set_str(record, property_id, value);
- if (CALENDAR_ERROR_NONE == ret) {
- _cal_record_set_property_flag(record,property_id, CAL_PROPERTY_FLAG_DIRTY);
- }
+ if (CALENDAR_ERROR_NONE == ret)
+ _cal_record_set_property_flag(record, property_id, CAL_PROPERTY_FLAG_DIRTY);
+
return ret;
}
RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
ret = temp->plugin_cb->set_int(record, property_id, value);
- if (CALENDAR_ERROR_NONE == ret) {
- _cal_record_set_property_flag(record,property_id, CAL_PROPERTY_FLAG_DIRTY);
- }
+ if (CALENDAR_ERROR_NONE == ret)
+ _cal_record_set_property_flag(record, property_id, CAL_PROPERTY_FLAG_DIRTY);
+
return ret;
}
RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
ret = temp->plugin_cb->set_double(record, property_id, value);
- if (CALENDAR_ERROR_NONE == ret) {
- _cal_record_set_property_flag(record,property_id, CAL_PROPERTY_FLAG_DIRTY);
- }
+ if (CALENDAR_ERROR_NONE == ret)
+ _cal_record_set_property_flag(record, property_id, CAL_PROPERTY_FLAG_DIRTY);
+
return ret;
}
RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
ret = temp->plugin_cb->set_lli(record, property_id, value);
- if (CALENDAR_ERROR_NONE == ret) {
- _cal_record_set_property_flag(record,property_id, CAL_PROPERTY_FLAG_DIRTY);
- }
+ if (CALENDAR_ERROR_NONE == ret)
+ _cal_record_set_property_flag(record, property_id, CAL_PROPERTY_FLAG_DIRTY);
+
return ret;
}
RETVM_IF(false == cal_record_check_property_flag(record, property_id, CAL_PROPERTY_FLAG_PROJECTION), CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
ret = temp->plugin_cb->set_caltime(record, property_id, value);
- if (CALENDAR_ERROR_NONE == ret) {
- _cal_record_set_property_flag(record,property_id, CAL_PROPERTY_FLAG_DIRTY);
- }
+ if (CALENDAR_ERROR_NONE == ret)
+ _cal_record_set_property_flag(record, property_id, CAL_PROPERTY_FLAG_DIRTY);
+
return ret;
}
static void _cal_record_alarm_struct_init(cal_alarm_s *record)
{
- memset(record,0, sizeof(cal_alarm_s));
+ memset(record, 0, sizeof(cal_alarm_s));
}
static int _cal_record_alarm_create(calendar_record_h* out_record)
{
cal_alarm_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_alarm_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
*out_str = cal_strdup(rec->alarm_attach);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_str = (rec->alarm_attach);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (rec->alarm_action);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = rec->alarm;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return CALENDAR_ERROR_NONE;
rec->alarm_attach = cal_strdup(value);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
cal_alarm_s *rec = (cal_alarm_s*)(record);
switch (property_id) {
case CAL_PROPERTY_ALARM_TICK:
- (rec->remind_tick)=value;
+ rec->remind_tick = value;
break;
case CAL_PROPERTY_ALARM_TICK_UNIT:
switch (value) {
case CALENDAR_ALARM_TIME_UNIT_HOUR:
case CALENDAR_ALARM_TIME_UNIT_DAY:
case CALENDAR_ALARM_TIME_UNIT_WEEK:
- (rec->remind_tick_unit)=value;
+ rec->remind_tick_unit = value;
break;
default:
ERR("invalid parameter (value:%d)", value);
}
break;
case CAL_PROPERTY_ALARM_PARENT_ID:
- (rec->parent_id) = value;
+ rec->parent_id = value;
break;
case CAL_PROPERTY_ALARM_ACTION:
switch (value) {
case CALENDAR_ALARM_ACTION_AUDIO:
case CALENDAR_ALARM_ACTION_DISPLAY:
case CALENDAR_ALARM_ACTION_EMAIL:
- (rec->alarm_action) = value;
+ rec->alarm_action = value;
break;
default:
ERR("invalid parameter (value:%d)", value);
}
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->alarm = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return CALENDAR_ERROR_NONE;
static int _cal_record_attendee_create(calendar_record_h* out_record)
{
cal_attendee_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_attendee_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
*out_str = cal_strdup(rec->attendee_member);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_str = (rec->attendee_member);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (rec->parent_id);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->attendee_member = cal_strdup(value);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->parent_id) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
static void _cal_record_calendar_struct_init(cal_book_s *record)
{
- memset(record,0, sizeof(cal_book_s));
+ memset(record, 0, sizeof(cal_book_s));
record->index = -1;
record->visibility = true;
record->account_id = LOCAL_ACCOUNT_ID;
static int _cal_record_calendar_create(calendar_record_h* out_record)
{
cal_book_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_book_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
*out_str = cal_strdup(cal_rec->sync_data4);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_str = (cal_rec->sync_data4);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (cal_rec->mode);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
cal_rec->sync_data4 = cal_strdup(value);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(cal_rec->mode) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
static void _cal_record_event_struct_init(cal_event_s *record)
{
- memset(record,0, sizeof(cal_event_s));
+ memset(record, 0, sizeof(cal_event_s));
record->meeting_status = CALENDAR_MEETING_STATUS_NOTMEETING;
record->calendar_id = DEFAULT_EVENT_CALENDAR_BOOK_ID;
record->busy_status = 2;
record->summary = NULL;
record->description = NULL;
- record->location= NULL;
+ record->location = NULL;
record->categories = NULL;
record->exdate = NULL;
record->organizer_email = NULL;
record->organizer_name = NULL;
- record->uid= NULL;
+ record->uid = NULL;
record->original_event_id = CAL_INVALID_ID;
record->event_status = CALENDAR_EVENT_STATUS_NONE;
static int _cal_record_event_create(calendar_record_h* out_record)
{
cal_event_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_event_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
*out_str = cal_strdup(rec->end_tzid);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_str = (rec->end_tzid);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (rec->longitude);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = rec->until;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->end_tzid = cal_strdup(value);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->is_allday) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->longitude) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->created_time) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return CALENDAR_ERROR_NONE;
rec->until = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
ret = calendar_list_add((calendar_list_h)rec->extended_list, child_record);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
ret = calendar_list_remove((calendar_list_h)rec->extended_list, child_record);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return ret;
ret = calendar_list_get_count((calendar_list_h)rec->extended_list, (int *)count);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return ret;
ret = cal_list_get_nth_record_p(rec->extended_list, index, child_record);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return ret;
static void _cal_record_extended_struct_init(cal_extended_s *record)
{
- memset(record,0, sizeof(cal_extended_s));
+ memset(record, 0, sizeof(cal_extended_s));
}
static int _cal_record_extended_create(calendar_record_h* out_record)
{
cal_extended_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_extended_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
*out_str = cal_strdup(rec->value);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_str = (rec->value);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (rec->record_type);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->value = cal_strdup(value);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->record_type) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
static void _cal_record_instance_allday_struct_init(cal_instance_allday_s* record)
{
- memset(record,0, sizeof(cal_instance_allday_s));
+ memset(record, 0, sizeof(cal_instance_allday_s));
record->event_status = CALENDAR_EVENT_STATUS_NONE;
record->calendar_id = DEFAULT_EVENT_CALENDAR_BOOK_ID;
record->busy_status = 2;
record->summary = NULL;
record->description = NULL;
- record->location= NULL;
+ record->location = NULL;
record->latitude = 1000; /* set default 1000 out of range(-180 ~ 180) */
record->longitude = 1000; /* set default 1000 out of range(-180 ~ 180) */
static int _cal_record_instance_allday_create(calendar_record_h* out_record)
{
cal_instance_allday_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_instance_allday_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
*out_str = cal_strdup(rec->sync_data1);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_str = (rec->sync_data1);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (rec->is_allday);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (rec->longitude);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = rec->end;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->sync_data1 = cal_strdup(value);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->original_event_id) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->longitude) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->end = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
static void _cal_record_instance_allday_extended_struct_init(cal_instance_allday_extended_s* record)
{
- memset(record,0, sizeof(cal_instance_allday_extended_s));
+ memset(record, 0, sizeof(cal_instance_allday_extended_s));
record->event_status = CALENDAR_EVENT_STATUS_NONE;
record->calendar_id = DEFAULT_EVENT_CALENDAR_BOOK_ID;
record->busy_status = 2;
record->summary = NULL;
record->description = NULL;
- record->location= NULL;
+ record->location = NULL;
record->latitude = 1000; /* set default 1000 out of range(-180 ~ 180) */
record->longitude = 1000; /* set default 1000 out of range(-180 ~ 180) */
static int _cal_record_instance_allday_extended_create(calendar_record_h* out_record)
{
cal_instance_allday_extended_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_instance_allday_extended_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
*out_str = cal_strdup(rec->sync_data4);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_str = (rec->sync_data4);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = rec->end;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->sync_data4 = cal_strdup(value);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->has_attendee) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->end = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
static void _cal_record_instance_normal_struct_init(cal_instance_normal_s* record)
{
- memset(record,0, sizeof(cal_instance_normal_s));
+ memset(record, 0, sizeof(cal_instance_normal_s));
record->event_status = CALENDAR_EVENT_STATUS_NONE;
record->calendar_id = DEFAULT_EVENT_CALENDAR_BOOK_ID;
record->busy_status = 2;
record->summary = NULL;
record->description = NULL;
- record->location= NULL;
+ record->location = NULL;
record->latitude = 1000; /* set default 1000 out of range(-180 ~ 180) */
record->longitude = 1000; /* set default 1000 out of range(-180 ~ 180) */
static int _cal_record_instance_normal_create(calendar_record_h* out_record)
{
cal_instance_normal_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_instance_normal_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
*out_str = cal_strdup(rec->sync_data1);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_str = (rec->sync_data1);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (rec->original_event_id);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = rec->end;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->sync_data1 = cal_strdup(value);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->original_event_id) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->end = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
static void _cal_record_instance_normal_extended_struct_init(cal_instance_normal_extended_s* record)
{
- memset(record,0, sizeof(cal_instance_normal_extended_s));
+ memset(record, 0, sizeof(cal_instance_normal_extended_s));
record->event_status = CALENDAR_EVENT_STATUS_NONE;
record->calendar_id = DEFAULT_EVENT_CALENDAR_BOOK_ID;
record->busy_status = 2;
record->summary = NULL;
record->description = NULL;
- record->location= NULL;
+ record->location = NULL;
record->latitude = 1000; /* set default 1000 out of range(-180 ~ 180) */
record->longitude = 1000; /* set default 1000 out of range(-180 ~ 180) */
static int _cal_record_instance_normal_extended_create(calendar_record_h* out_record)
{
cal_instance_normal_extended_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_instance_normal_extended_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
*out_str = cal_strdup(rec->sync_data4);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_str = (rec->sync_data4);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (rec->has_attendee);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = rec->end;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->sync_data4 = cal_strdup(value);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->has_attendee) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->end = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
static int _cal_record_search_create(calendar_record_h* out_record)
{
cal_search_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_search_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
cal_search_s *temp = (cal_search_s*)(record);
- for(cursor = temp->values;cursor;cursor=cursor->next) {
+ for (cursor = temp->values; cursor; cursor = cursor->next) {
cal_search_value_s *data = cursor->data;
- if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
+ if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_STR) == true)
CAL_FREE(data->value.s);
- }
+
CAL_FREE(data);
}
CAL_RECORD_COPY_COMMON(&(out_data->common), &(src_data->common));
- for(cursor = src_data->values;cursor;cursor=cursor->next) {
+ for (cursor = src_data->values; cursor; cursor = cursor->next) {
cal_search_value_s *src = cursor->data;
cal_search_value_s *dest = calloc(1, sizeof(cal_search_value_s));
if (NULL == dest) {
dest->property_id = src->property_id;
if (CAL_PROPERTY_CHECK_DATA_TYPE(src->property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
dest->value.s = cal_strdup(src->value.s);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(src->property_id, CAL_PROPERTY_DATA_TYPE_INT) == true) {
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(src->property_id, CAL_PROPERTY_DATA_TYPE_INT) == true) {
dest->value.i = src->value.i;
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(src->property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(src->property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
dest->value.d = src->value.d;
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(src->property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(src->property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
dest->value.lli = src->value.lli;
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(src->property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(src->property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
dest->value.caltime = src->value.caltime;
- }
- else {
+ } else {
CAL_FREE(dest);
continue;
}
cal_search_s *rec = (cal_search_s*)(record);
GSList *cursor;
- for(cursor = rec->values;cursor;cursor=cursor->next) {
+ for (cursor = rec->values; cursor; cursor = cursor->next) {
cal_search_value_s *data = cursor->data;
if (data->property_id == property_id) {
if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
*out_str = cal_strdup(data->value.s);
break;
- }
- else {
- ERR("invalid parameter (property:%d)",data->property_id);
+ } else {
+ ERR("invalid parameter (property:%d)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
}
cal_search_s *rec = (cal_search_s*)(record);
GSList *cursor;
- for(cursor = rec->values;cursor;cursor=cursor->next) {
+ for (cursor = rec->values; cursor; cursor = cursor->next) {
cal_search_value_s *data = cursor->data;
if (data->property_id == property_id) {
if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
*out_str = (data->value.s);
break;
- }
- else {
- ERR("invalid parameter (property:%d)",data->property_id);
+ } else {
+ ERR("invalid parameter (property:%d)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
}
cal_search_s *rec = (cal_search_s*)(record);
GSList *cursor;
- for(cursor = rec->values;cursor;cursor=cursor->next) {
+ for (cursor = rec->values; cursor; cursor = cursor->next) {
cal_search_value_s *data = cursor->data;
if (data->property_id == property_id) {
if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_INT) == true) {
*out_value = (data->value.i);
break;
- }
- else {
- ERR("invalid parameter (property:%d)",data->property_id);
+ } else {
+ ERR("invalid parameter (property:%d)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
}
cal_search_s *rec = (cal_search_s*)(record);
GSList *cursor;
- for(cursor = rec->values;cursor;cursor=cursor->next) {
+ for (cursor = rec->values; cursor; cursor = cursor->next) {
cal_search_value_s *data = cursor->data;
if (data->property_id == property_id) {
if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
*out_value = (data->value.d);
break;
- }
- else {
- ERR("invalid parameter (property:%d)",data->property_id);
+ } else {
+ ERR("invalid parameter (property:%d)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
}
cal_search_s *rec = (cal_search_s*)(record);
GSList *cursor;
- for(cursor = rec->values;cursor;cursor=cursor->next) {
+ for (cursor = rec->values; cursor; cursor = cursor->next) {
cal_search_value_s *data = cursor->data;
if (data->property_id == property_id) {
if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
*out_value = (data->value.lli);
break;
- }
- else {
- ERR("invalid parameter (property:%d)",data->property_id);
+ } else {
+ ERR("invalid parameter (property:%d)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
}
cal_search_s *rec = (cal_search_s*)(record);
GSList *cursor;
- for(cursor = rec->values;cursor;cursor=cursor->next) {
+ for (cursor = rec->values; cursor; cursor = cursor->next) {
cal_search_value_s *data = cursor->data;
if (data->property_id == property_id) {
if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
*out_value = (data->value.caltime);
break;
- }
- else {
- ERR("invalid parameter (property:%d)",data->property_id);
+ } else {
+ ERR("invalid parameter (property:%d)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
}
GSList *cursor;
cal_search_value_s *data = NULL;
- for(cursor = rec->values;cursor;cursor=cursor->next) {
+ for (cursor = rec->values; cursor; cursor = cursor->next) {
data = cursor->data;
if (data->property_id == property_id) {
if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
CAL_FREE(data->value.s);
(data->value.s) = cal_strdup(value);
return CALENDAR_ERROR_NONE;
- }
- else {
- ERR("invalid parameter (property:%d)",data->property_id);
+ } else {
+ ERR("invalid parameter (property:%d)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
}
GSList *cursor;
cal_search_value_s *data = NULL;
- for(cursor = rec->values;cursor;cursor=cursor->next) {
+ for (cursor = rec->values; cursor; cursor = cursor->next) {
data = cursor->data;
if (data->property_id == property_id) {
if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_INT) == true) {
(data->value.i) = value;
return CALENDAR_ERROR_NONE;
- }
- else {
- ERR("invalid parameter (property:%d)",data->property_id);
+ } else {
+ ERR("invalid parameter (property:%d)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
}
GSList *cursor;
cal_search_value_s *data = NULL;
- for(cursor = rec->values;cursor;cursor=cursor->next) {
+ for (cursor = rec->values; cursor; cursor = cursor->next) {
data = cursor->data;
if (data->property_id == property_id) {
if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
(data->value.d) = value;
return CALENDAR_ERROR_NONE;
- }
- else {
- ERR("invalid parameter (property:%d)",data->property_id);
+ } else {
+ ERR("invalid parameter (property:%d)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
}
GSList *cursor;
cal_search_value_s *data = NULL;
- for(cursor = rec->values;cursor;cursor=cursor->next) {
+ for (cursor = rec->values; cursor; cursor = cursor->next) {
data = cursor->data;
if (data->property_id == property_id) {
if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
(data->value.lli) = value;
return CALENDAR_ERROR_NONE;
- }
- else {
- ERR("invalid parameter (property:%d)",data->property_id);
+ } else {
+ ERR("invalid parameter (property:%d)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
}
GSList *cursor;
cal_search_value_s *data = NULL;
- for(cursor = rec->values;cursor;cursor=cursor->next) {
+ for (cursor = rec->values; cursor; cursor = cursor->next) {
data = cursor->data;
if (data->property_id == property_id) {
if (CAL_PROPERTY_CHECK_DATA_TYPE(data->property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
(data->value.caltime) = value;
return CALENDAR_ERROR_NONE;
- }
- else {
- ERR("invalid parameter (property:%d)",data->property_id);
+ } else {
+ ERR("invalid parameter (property:%d)", data->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
}
static void _cal_record_timezone_struct_init(cal_timezone_s *record)
{
- memset(record,0, sizeof(cal_timezone_s));
+ memset(record, 0, sizeof(cal_timezone_s));
record->calendar_id = DEFAULT_EVENT_CALENDAR_BOOK_ID;
}
static int _cal_record_timezone_create(calendar_record_h* out_record)
{
cal_timezone_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_timezone_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
*out_str = cal_strdup(rec->day_light_name);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_str = (rec->day_light_name);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (rec->calendar_id);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
rec->day_light_name = cal_strdup(value);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->calendar_id) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
static void _cal_record_todo_struct_init(cal_todo_s *record)
{
- memset(record,0, sizeof(cal_todo_s));
+ memset(record, 0, sizeof(cal_todo_s));
record->todo_status = CALENDAR_TODO_STATUS_NONE;
record->calendar_id = DEFAULT_TODO_CALENDAR_BOOK_ID;
record->index = CAL_INVALID_ID;
record->summary = NULL;
record->description = NULL;
- record->location= NULL;
+ record->location = NULL;
record->categories = NULL;
- record->uid= NULL;
+ record->uid = NULL;
record->is_deleted = 0;
record->latitude = CALENDAR_RECORD_NO_COORDINATE; /* set default 1000 out of range(-180 ~ 180) */
record->longitude = CALENDAR_RECORD_NO_COORDINATE; /* set default 1000 out of range(-180 ~ 180) */
static int _cal_record_todo_create(calendar_record_h* out_record)
{
cal_todo_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_todo_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
*out_str = cal_strdup(rec->organizer_email);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_str = (rec->organizer_email);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (rec->is_allday);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (rec->longitude);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = (rec->completed_time);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
*out_value = rec->until;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->is_allday) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->longitude) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->created_time) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->until) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
ret = calendar_list_add((calendar_list_h)rec->extended_list, child_record);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return ret;
ret = calendar_list_remove((calendar_list_h)rec->extended_list, child_record);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return ret;
ret = calendar_list_get_count((calendar_list_h)rec->extended_list, (int *)count);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return ret;
ret = cal_list_get_nth_record_p(rec->extended_list, index, child_record);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return ret;
static int _cal_record_updated_info_create(calendar_record_h* out_record)
{
cal_updated_info_s *temp = NULL;
- int ret= CALENDAR_ERROR_NONE;
+ int ret = CALENDAR_ERROR_NONE;
temp = calloc(1, sizeof(cal_updated_info_s));
RETVM_IF(NULL == temp, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
*out_value = (rec->version);
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
(rec->version) = value;
break;
default:
- ERR("invalid parameter (property:%d)",property_id);
+ ERR("invalid parameter (property:%d)", property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
while (fgets(buf, sizeof(buf), file)) {
if (len + sizeof(buf) < buf_size) {
len += snprintf(stream + len, strlen(buf) +1, "%s", buf);
- }
- else {
+ } else {
char *new_stream;
buf_size *= 2;
new_stream = realloc(stream, buf_size);
if (new_stream) {
stream = new_stream;
- }
- else {
+ } else {
free(stream);
fclose(file);
free(foreach_data);
VCAL_VER_2 = 2,
};
-typedef enum
-{
- EVENT_ATTENDEE_REQ_PARTICIPANT_ROLE=0,
+typedef enum {
+ EVENT_ATTENDEE_REQ_PARTICIPANT_ROLE = 0,
EVENT_ATTENDEE_OPT_PARTICIPANT_ROLE,
EVENT_ATTENDEE_NON_PARTICIPANT_ROLE,
EVENT_ATTENDEE_CHAIR_ROLE,
} cal_event_attendee_role_type_t;
-typedef enum
-{
- EVENT_ATTENDEE_NEEDS_ACTION_AT_STATUS=0,
+typedef enum {
+ EVENT_ATTENDEE_NEEDS_ACTION_AT_STATUS = 0,
EVENT_ATTENDEE_ACCEPTED_AT_STATUS,
EVENT_ATTENDEE_DECLINED_AT_STATUS,
EVENT_ATTENDEE_TENTATIVE_AT_STATUS,
cal_make_s *b;
b = calloc(1, sizeof(cal_make_s));
- if (!b) {
+ if (!b)
return NULL;
- }
b->data = calloc(1, sizeof(char));
if (!b->data) {
if (NULL == tzid || '\0' == *tzid) {
cal_time_get_local_datetime(NULL, t->time.utime, &y, &m, &d, &h, &n, &s);
snprintf(buf, sizeof(buf), ":"CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSSZ, y, m, d, h, n, s);
- }
- else {
+ } else {
cal_time_get_local_datetime(tzid, t->time.utime, &y, &m, &d, &h, &n, &s);
snprintf(buf, sizeof(buf), ";TZID=%s:"CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSS, tzid, y, m, d, h, n, s);
}
*buf = '-';
i++;
- }
- else {
+ } else {
tick = -tick;
}
_cal_vcalendar_make_printf(b, "TRIGGER;VALUE=DATE-TIME:", datetime);
free(datetime);
- }
- else {
+ } else {
char datetime[CAL_STR_SHORT_LEN32] = {0};
snprintf(datetime, sizeof(datetime), CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSS,
at.time.date.year, at.time.date.month, at.time.date.mday,
_cal_vcalendar_make_printf(b, "TRIGGER;VALUE=DATE-TIME:", datetime);
}
- }
- else {
+ } else {
int tick = 0;
ret = calendar_record_get_int(alarm, _calendar_alarm.tick, &tick);
WARN_IF(CALENDAR_ERROR_NONE != ret, "failed to get tick");
snprintf(datetime, sizeof(datetime), "%s;;;", buf);
free(buf);
- }
- else {
+ } else {
snprintf(datetime, sizeof(datetime), CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSS";;;",
at.time.date.year, at.time.date.month, at.time.date.mday,
at.time.date.hour, at.time.date.minute, at.time.date.second);
}
- }
- else {
+ } else {
/* has tick, unit */
int tick = 0;
ret = calendar_record_get_int(alarm, _calendar_alarm.tick, &tick);
ret = calendar_record_get_caltime(record, _calendar_event.start_time, &st);
RETM_IF(CALENDAR_ERROR_NONE != ret, "calendar_record_get_caltime() Fail(%d)", ret);
- }
- else if (CAL_STRING_EQUAL == strncmp(uri, _calendar_todo._uri, strlen(_calendar_todo._uri))) {
+ } else if (CAL_STRING_EQUAL == strncmp(uri, _calendar_todo._uri, strlen(_calendar_todo._uri))) {
ret = calendar_record_get_caltime(record, _calendar_todo.due_time, &st);
RETM_IF(CALENDAR_ERROR_NONE != ret, "calendar_record_get_caltime() Fail(%d)", ret);
}
free(buf);
DBG("aalarm: [%s] = (%lld) - (tick(%d) * unit(%d))", datetime, st.time.utime, tick, unit);
- }
- else {
+ } else {
struct tm tm = {0};
tm.tm_year = st.time.date.year - 1900;
tm.tm_mon = st.time.date.month - 1;
continue;
int num = atoi(t[i]);
- ret += snprintf(buf +len +ret, buf_len -len -ret, "%d%s", num, 0 < num? " ": "- ");
+ ret += snprintf(buf +len +ret, buf_len -len -ret, "%d%s", num, 0 < num ? " " : "- ");
}
g_strfreev(t);
blen += snprintf(buf +blen, buf_len -blen, "%d%s ", setpos * (setpos < 0 ? -1 : 1), setpos < 0 ? "-" : "+");
}
g_strfreev(t);
- }
- else {
+ } else {
/* in ver2.0, 3TH should be changed to setpos:3, byday:TH */
char *byday = NULL;
ret = calendar_record_get_str_p(record, _calendar_event.byday, &byday);
if ('1' <= byday[i] && byday[i] <= '9') {
is_working = false;
digit++;
- }
- else if ('+' == byday[i]) {
+ } else if ('+' == byday[i]) {
is_working = false;
sign = 1;
- }
- else if ('-' == byday[i]) {
+ } else if ('-' == byday[i]) {
is_working = false;
sign = -1;
- }
- else {
+ } else {
if (false == is_working) {
is_extracted = true;
is_working = true;
char num[CAL_STR_SHORT_LEN32] = {0};
snprintf(num, digit +1, "%s", byday +i -digit);
- if (NULL == strstr(buf, num)) {
- blen += snprintf(buf +blen, buf_len -blen, "%s%c ", num, (-1 == sign) ? '-': '+');
- }
+ if (NULL == strstr(buf, num))
+ blen += snprintf(buf +blen, buf_len -blen, "%s%c ", num, (-1 == sign) ? '-' : '+');
+
digit = 0;
sign = 0;
}
if (0 < j) {
if (CALENDAR_RECURRENCE_WEEKLY == rrule_type) {
num_past = num;
- }
- else {
+ } else {
if (*p == '-') {
snprintf(buf_temp, j + 1, "%s", p + 1);
num = atoi(buf_temp);
num_past = num;
len += snprintf(buf +len, buf_len -len, "%s- ", buf_temp);
}
- }
- else {
+ } else {
snprintf(buf_temp, j + 1, "%s", p);
num = atoi(buf_temp);
if (0 == i) {
}
}
}
- if (num_past == num) {
+ if (num_past == num)
len += snprintf(buf +len, buf_len -len, "%s ", p +j);
- }
- else {
+ else
ERR("Out of 1.0 spec");
- }
+
DBG("%d num(%d) val[%s]", i, num, p + j);
- }
- else {
+ } else {
len += snprintf(buf +len, buf_len -len, "%s ", p);
}
DBG("[%s]", buf);
if (bymonth && *bymonth) {
DBG("bymonth[%s]", bymonth);
len += snprintf(buf +len, sizeof(buf) -len, "YM%d ", interval);
- len +=_cal_vcalendar_make_rrule_append_mday(buf, sizeof(buf), bymonth);
+ len += _cal_vcalendar_make_rrule_append_mday(buf, sizeof(buf), bymonth);
if (byday && *byday) {
DBG("byday");
len += snprintf(buf +len, sizeof(buf) -len, "MP%d ", interval);
_cal_vcalendar_make_rrule_append_setpos(record, buf, sizeof(buf));
_cal_vcalendar_make_rrule_append_text_wday(CALENDAR_RECURRENCE_MONTHLY, buf, sizeof(buf), byday);
- }
- else if (bymonthday && *bymonthday) {
+ } else if (bymonthday && *bymonthday) {
DBG("bymonthday");
/* ex> YM1 2 MD 1 */
len += snprintf(buf +len, sizeof(buf) -len, "MD%d ", interval);
_cal_vcalendar_make_rrule_append_mday(buf, sizeof(buf), bymonthday);
- }
- else {
+ } else {
ERR("Out of scope");
__make_rrule_ver1_default(record, freq, interval, buf, sizeof(buf));
}
- }
- else if (byyearday && *byyearday) {
+ } else if (byyearday && *byyearday) {
DBG("byyearday");
snprintf(buf, sizeof(buf), "YD%d ", interval);
_cal_vcalendar_make_rrule_append_mday(buf, sizeof(buf), byyearday);
- }
- else {
+ } else {
ERR("Out of scope");
__make_rrule_ver1_default(record, freq, interval, buf, sizeof(buf));
}
snprintf(buf, sizeof(buf), "MP%d ", interval);
_cal_vcalendar_make_rrule_append_setpos(record, buf, sizeof(buf));
_cal_vcalendar_make_rrule_append_text_wday(CALENDAR_RECURRENCE_MONTHLY, buf, sizeof(buf), byday);
- }
- else if (bymonthday && *bymonthday) {
+ } else if (bymonthday && *bymonthday) {
DBG("bymonthday");
snprintf(buf, sizeof(buf), "MD%d ", interval);
_cal_vcalendar_make_rrule_append_mday(buf, sizeof(buf), bymonthday);
- }
- else {
+ } else {
ERR("Out of scope, so set as bymonthday");
__make_rrule_ver1_default(record, freq, interval, buf, sizeof(buf));
}
snprintf(tmp, sizeof(tmp), ";UNTIL=%s", tmp_tzid);
CAL_FREE(tmp_tzid);
}
- }
- else {
+ } else {
snprintf(tmp, sizeof(tmp), ";UNTIL="CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSSZ,
caltime.time.date.year,
caltime.time.date.month,
CAL_FN_CALL();
char *uid = NULL;
- // search if original_event_id > 0.
+ /* search if original_event_id > 0.*/
int original_event_id = 0;
calendar_record_get_int(record, _calendar_event.original_event_id, &original_event_id);
char *recurrence_id = NULL;
_cal_vcalendar_make_printf(b, "UID:", uid);
free(uid);
}
- if (VCAL_VER_1 == b->version) // ver 1.0 does not support: recurrence-id
+ if (VCAL_VER_1 == b->version) /* ver 1.0 does not support: recurrence-id */
return;
calendar_record_get_str_p(record, _calendar_event.recurrence_id, &recurrence_id);
return;
}
- // if original_event_id > 0, get parent uid.
+ /* if original_event_id > 0, get parent uid. */
uid = __get_parent_uid(original_event_id);
if (NULL == uid || '\0' == *uid) {
uid = __get_new_uid();
__set_child_uid(record, uid);
_cal_vcalendar_make_printf(b, "UID:", uid);
- if (VCAL_VER_1 == b->version) // ver 1.0 does not support: recurrence-id
+ if (VCAL_VER_1 == b->version) /* ver 1.0 does not support: recurrence-id */
return;
if (*recurrence_id >= '0' && *recurrence_id <= '9')
__make_priority(b, record);
__make_dtstamp(b, record);
__make_categories(b, record);
- __make_exdate(b, record); // only event
+ __make_exdate(b, record); /* only event */
__make_attendee(b, record);
__make_alarm(b, record);
__make_extended(b, record);
/* new start of vcalendar */
__make_tz(b, tzid, created);
b->timezone_tzid = strdup(tzid);
- }
- else {
+ } else {
/* not first vcalendar */
if (0 != strncmp(b->timezone_tzid, tzid, strlen(tzid))) {
/* different tzid */
if (b->timezone_tzid)
free(b->timezone_tzid);
b->timezone_tzid = strdup(tzid);
- }
- else {
+ } else {
DBG("same as before, skip");
}
}
__devide_vcalendar_with_header(b, record);
_cal_vcalendar_make_schedule(b, record);
- }
- else if (CAL_STRING_EQUAL == strcmp(uri, _calendar_todo._uri)) {
+ } else if (CAL_STRING_EQUAL == strcmp(uri, _calendar_todo._uri)) {
b->type = CALENDAR_BOOK_TYPE_TODO;
__devide_vcalendar_with_header(b, record);
_cal_vcalendar_make_schedule(b, record);
- }
- else if (CAL_STRING_EQUAL == strcmp(uri, _calendar_extended_property._uri)) {
+ } else if (CAL_STRING_EQUAL == strcmp(uri, _calendar_extended_property._uri)) {
cal_extended_s *extended = (cal_extended_s *)record;
if (CAL_STRING_EQUAL == strncmp(extended->key, "VERSION", strlen("VERSION"))) continue;
DBG("extended key[%s] value[%s]", extended->key, extended->value);
- }
- else if (CAL_STRING_EQUAL == strcmp(uri, _calendar_timezone._uri)) {
+ } else if (CAL_STRING_EQUAL == strcmp(uri, _calendar_timezone._uri)) {
DBG("Not support timezone");
- }
- else if (CAL_STRING_EQUAL == strcmp(uri, _calendar_book._uri)) {
+ } else if (CAL_STRING_EQUAL == strcmp(uri, _calendar_book._uri)) {
DBG("Not support calendar");
- }
- else {
+ } else {
DBG("Unable to understand uri[%s]", uri);
}
{
RETV_IF(NULL == p, NULL);
while (VCAL_LF != *p) {
- if ('\0' == *p) {
+ if ('\0' == *p)
return NULL;
- }
+
p++;
}
return p +1;
*(cursor++) == 'U' &&
*(cursor++) == 'L' &&
*(cursor++) == 'E' &&
- *(cursor++) == ':' ) {
+ *(cursor++) == ':') {
return true;
- }
- else if (*(cursor-1) == 'E' &&
+ } else if (*(cursor-1) == 'E' &&
*(cursor++) == 'N' &&
*(cursor++) == 'D' &&
*(cursor++) == ':' &&
*(cursor++) == 'T') {
break;
}
- else {
- }
}
}
return ret;
s->time.date.second);
*diff = lli - a->time.utime;
DBG("Convert start localtime with tz[%s] and get(%lld)", tz, lli);
- }
- else {
+ } else {
lli = cal_time_convert_itol(tz, a->time.date.year, a->time.date.month,
a->time.date.mday, a->time.date.hour, a->time.date.minute,
a->time.date.second);
static void _get_tick_unit(int t, int *tick, int *unit)
{
- if (0 == t) {
+ if (0 == t)
return;
- }
if (0 == (t % CALENDAR_ALARM_TIME_UNIT_WEEK)) {
*tick = t / CALENDAR_ALARM_TIME_UNIT_WEEK;
*unit = CALENDAR_ALARM_TIME_UNIT_WEEK;
- }
- else if (0 == (t % CALENDAR_ALARM_TIME_UNIT_DAY)) {
+ } else if (0 == (t % CALENDAR_ALARM_TIME_UNIT_DAY)) {
*tick = t / CALENDAR_ALARM_TIME_UNIT_DAY;
*unit = CALENDAR_ALARM_TIME_UNIT_DAY;
- }
- else if (0 == (t % CALENDAR_ALARM_TIME_UNIT_HOUR)) {
+ } else if (0 == (t % CALENDAR_ALARM_TIME_UNIT_HOUR)) {
*tick = t / CALENDAR_ALARM_TIME_UNIT_HOUR;
*unit = CALENDAR_ALARM_TIME_UNIT_HOUR;
- }
- else if (0 == (t % CALENDAR_ALARM_TIME_UNIT_MINUTE)) {
+ } else if (0 == (t % CALENDAR_ALARM_TIME_UNIT_MINUTE)) {
*tick = t / CALENDAR_ALARM_TIME_UNIT_MINUTE;
*unit = CALENDAR_ALARM_TIME_UNIT_MINUTE;
- }
- else {
+ } else {
*tick = t;
*unit = CALENDAR_ALARM_TIME_UNIT_SPECIFIC;
}
/* offset: length until ';' or ':' */
int offset = 0;
- while (':' != *(cursor + offset) && ';' != *(cursor + offset)) {
+ while (':' != *(cursor + offset) && ';' != *(cursor + offset))
offset++;
- }
int i = 0;
while (VCAL_LF != *(cursor + offset + i)) {
- if ('\0' == *(cursor + offset + i)) {
+ if ('\0' == *(cursor + offset + i))
return NULL;
- }
+
i++;
}
char *p = calloc(i + 1, sizeof(char));
RETVM_IF(NULL == p, NULL, "calloc() Fail");
- if (VCAL_CR == *(cursor + offset + i -1)) {
+ if (VCAL_CR == *(cursor + offset + i -1))
memcpy(p, cursor + offset, i -1);
-
- }
- else {
+ else
memcpy(p, cursor + offset, i);
- }
+
*value = p;
DBG("offset(%d) len(%d) value[%s]", offset, i, *value);
int i = 0;
while (*(p +i)) {
if ('-' == *(p +i)) {
- if ('1' <= *(p +i +1) && *(p +i +1) <= '9') {
+ if ('1' <= *(p +i +1) && *(p +i +1) <= '9')
i++;
- }
- else {
+ else
*(p +i) = '/';
- }
}
i++;
}
p++;
break;
}
- }
- else {
+ } else {
*q = *p;
}
q++;
while (p[i]) {
if (p[i] == '=') {
if (p[i+1] == 0x09 || p[i+1] == 0x20) {
- i +=3;
-
- }
- else if (p[i+1] == '\r' || p[i+1] == '\n') {
- i +=3;
-
- }
- else {
+ i += 3;
+ } else if (p[i+1] == '\r' || p[i+1] == '\n') {
+ i += 3;
+ } else {
if (p[i+1] == '0' && tolower(p[i+2]) == 'd' &&
p[i+3] == '=' && p[i+4] == '0' && tolower(p[i+5]) == 'a') {
p[j] = '\n';
j++;
i += 6;
- }
- else {
+ } else {
ch = __decode_hexa(p +i +1);
p[j] = ch;
j++;
i += 3;
}
}
- }
- else {
+ } else {
p[j] = p[i];
j++;
i++;
/* check enough space */
for (src = dst = out_p; *src; src++, dst++) {
- if (*src & 0x80) {
+ if (*src & 0x80)
++dst;
- }
}
while (dst > src) {
if (*src & 0x80) {
*dst-- = 0x80 | (*src & 0x3f);
*dst-- = 0xc0 | (*((unsigned char *)src--) >> 6);
- }
- else {
+ } else {
*dst-- = *src--;
}
}
charset = VCAL_CHARSET_ISO_8859_1;
else
WARN("Not support charset[%s]", s[i] + key_len);
- }
- else if (CAL_STRING_EQUAL == strncmp(s[i], "ENCODING=", strlen("ENCODING="))) {
+ } else if (CAL_STRING_EQUAL == strncmp(s[i], "ENCODING=", strlen("ENCODING="))) {
int key_len = strlen("ENCODING=");
if (CAL_STRING_EQUAL == strcmp(s[i] + key_len, "BASE64"))
encoding = VCAL_ENCODING_BASE64;
encoding = VCAL_ENCODING_QUOTED_PRINTABLE;
else
WARN("Not support encoding[%s]", s[i] + key_len);
- }
- else {
+ } else {
WARN("[%s]", s[i]);
}
}
break;
}
DBG("set datetime_tzid[%s] as timezone_tzid", ud->datetime_tzid);
- }
- else {
+ } else {
ERR("INVALID tzid");
}
break;
if (VCAL_VER_1 == ud->version) {
caltime->type = CALENDAR_TIME_LOCALTIME;
- }
- else {
+ } else {
if (NULL == ud->datetime_tzid || '\0' == *ud->datetime_tzid) {
if (NULL == ud->timezone_tzid || '\0' == *ud->timezone_tzid) {
/* Without tzid is localtime */
DBG(CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSS,
caltime->time.date.year, caltime->time.date.month, caltime->time.date.mday,
caltime->time.date.hour, caltime->time.date.minute, caltime->time.date.second);
- }
- else {
+ } else {
/* No 'Z' with tzid means utime */
caltime->type = CALENDAR_TIME_UTIME;
caltime->time.utime = cal_time_convert_itol(ud->timezone_tzid,
caltime->time.date.hour, caltime->time.date.minute, caltime->time.date.second);
DBG("timezone_tzid[%s] (%lld)", ud->timezone_tzid, caltime->time.utime);
}
- }
- else {
+ } else {
/* No 'Z' with tzid means utime */
caltime->type = CALENDAR_TIME_UTIME;
caltime->time.utime = cal_time_convert_itol(ud->datetime_tzid,
DBG(CAL_DATETIME_FORMAT_YYYYMMDDTHHMMSS,
caltime->time.date.year, caltime->time.date.month, caltime->time.date.mday,
caltime->time.date.hour, caltime->time.date.minute, caltime->time.date.second);
- }
- else {
+ } else {
caltime->type = CALENDAR_TIME_UTIME;
caltime->time.utime = cal_time_convert_lli(p);
DBG("(%lld)", caltime->time.utime);
char buf[8] = {0};
if (sign) {
snprintf(buf, strlen(t[0]), "%s", t[0] + 1);
- }
- else {
+ } else {
sign = 1;
snprintf(buf, strlen(t[0]) + 1, "%s", t[0]);
}
__parse_tz(value +1, &h, &m); /* +1 to skip ':' */
char buf[CAL_STR_SHORT_LEN32] = {0};
- if (0 == m) {
+ if (0 == m)
snprintf(buf, sizeof(buf), "Etc/GMT%c%d", h < 0 ? '+' : '-', h);
-
- }
- else {
+ else
cal_time_get_registered_tzid_with_offset(h * 3600 + m * 60, buf, sizeof(buf));
- }
+
DBG("set tzid [%s]", buf);
*tz = strdup(buf);
int status = 0;
switch (ud->type) {
case CALENDAR_BOOK_TYPE_EVENT:
- if (CAL_STRING_EQUAL == strncmp(value, ":TENTATIVE", strlen(":TENTATIVE"))) {
+ if (CAL_STRING_EQUAL == strncmp(value, ":TENTATIVE", strlen(":TENTATIVE")))
status = CALENDAR_EVENT_STATUS_TENTATIVE;
- }
- else if (CAL_STRING_EQUAL == strncmp(value, ":CONFIRMED", strlen(":CONFIRMED"))) {
+ else if (CAL_STRING_EQUAL == strncmp(value, ":CONFIRMED", strlen(":CONFIRMED")))
status = CALENDAR_EVENT_STATUS_CONFIRMED;
- }
- else if (CAL_STRING_EQUAL == strncmp(value, ":CANCELLED", strlen(":CANCELLED"))) {
+ else if (CAL_STRING_EQUAL == strncmp(value, ":CANCELLED", strlen(":CANCELLED")))
status = CALENDAR_EVENT_STATUS_CANCELLED;
- }
- else {
+ else
status = CALENDAR_EVENT_STATUS_NONE;
- }
+
ret = cal_record_set_int(record, _calendar_event.event_status, status);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
break;
has_by = true;
if (week_index) {
int j = 0;
- for (j = 0; j < week_index; j++) {
+ for (j = 0; j < week_index; j++)
len_str += snprintf(bystr + len_str, sizeof(bystr) - len_str, "%d%s,", week[j], t[i]);
- }
- }
- else {
+
+ } else {
len_str += snprintf(bystr + len_str, sizeof(bystr) - len_str, "%s,", t[i]);
}
DBG("[%s] week_index(%d)", bystr, week_index);
- }
- else if ('L' == *t[i] && 'D' == *(t[i] +1)) { /* last day */
+ } else if ('L' == *t[i] && 'D' == *(t[i] +1)) { /* last day */
has_by = true;
len_str += snprintf(bystr + len_str, sizeof(bystr) - len_str, "%s,", "-1");
- }
- else if ('W' == *t[i] && 'K' == *(t[i] +1) && 'S' == *(t[i] +2) && 'T' == *(t[i] +3)) { /* +4 is '=' */
+ } else if ('W' == *t[i] && 'K' == *(t[i] +1) && 'S' == *(t[i] +2) && 'T' == *(t[i] +3)) { /* +4 is '=' */
if ('S' == *(t[i] +5) && 'U' == *(t[i] +6))
ret = cal_record_set_int(record, _calendar_event.wkst, CALENDAR_SUNDAY);
else if ('M' == *(t[i] +5))
ERR("Invalid parameter[%s]", t[i]);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
- }
- else if (true == __is_digit(t[i])) {
+ } else if (true == __is_digit(t[i])) {
char buf[8] = {0};
bool exit_loop = false;
switch (freq_mode) {
case VCAL_RECURRENCE_MONTHLY_BYDAY:
case VCAL_RECURRENCE_WEEKLY:
- if (true == has_by) {
+ if (true == has_by)
week_index = 0;
- }
+
while (*(t[i] +j)) {
switch (*(t[i] +j)) {
case '+':
len_str += snprintf(bystr + len_str, sizeof(bystr) - len_str, "%d,", (atoi(buf) * sign));
break;
}
- }
- else {
+ } else {
if (true == has_by) {
__set_bystr(freq_mode, record, bystr);
week_index = 0;
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
DBG("frequency[%d] interval(%d)", frequency, interval);
}
- }
- else {
+ } else {
if ('0' <= *t[i] && *t[i] <= '9' && strlen("YYYYMMDDTHHMMSS") <= strlen(t[i])) {
DBG("until");
calendar_time_s caltime = {0};
ret = cal_record_set_caltime(record, _calendar_event.until_time, caltime);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_caltime() Fail(%d)", ret);
- }
- else if ('#' == *t[i]) {
+ } else if ('#' == *t[i]) {
/* count */
if (true == __is_digit(t[i] +1)) {
if (0 == atoi(t[i] +1)) {
DBG("endless");
ret = cal_record_set_int(record, _calendar_event.range_type, CALENDAR_RANGE_NONE);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
- }
- else {
+ } else {
DBG("count (%d)", atoi(t[i] +1));
ret = cal_record_set_int(record, _calendar_event.range_type, CALENDAR_RANGE_COUNT);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
ret = cal_record_set_int(record, _calendar_event.count, atoi(t[i] +1));
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
}
- }
- else {
+ } else {
ERR("Unable to parse count[%s]", t[i]);
}
- }
- else {
+ } else {
DBG("Invalid");
}
}
}
}
- if (true == has_by) {
+ if (true == has_by)
__set_bystr(freq_mode, record, bystr);
- }
g_strfreev(t);
}
ret = cal_record_set_int(record, _calendar_event.freq, frequency);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
- }
- else if (CAL_STRING_EQUAL == strncmp(t[i], "UNTIL=", strlen("UNTIL="))) {
+ } else if (CAL_STRING_EQUAL == strncmp(t[i], "UNTIL=", strlen("UNTIL="))) {
calendar_time_s caltime = {0};
_get_caltime(t[i] + strlen("UNTIL="), &caltime, ud);
ret = cal_record_set_caltime(record, _calendar_event.until_time, caltime);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_caltime() Fail(%d)", ret);
ret = cal_record_set_int(record, _calendar_event.range_type, CALENDAR_RANGE_UNTIL);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
- }
- else if (CAL_STRING_EQUAL == strncmp(t[i], "COUNT=", strlen("COUNT="))) {
+ } else if (CAL_STRING_EQUAL == strncmp(t[i], "COUNT=", strlen("COUNT="))) {
int count = atoi(t[i] + strlen("COUNT="));
if (count < 1) count = 1;
ret = cal_record_set_int(record, _calendar_event.count, count);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
ret = cal_record_set_int(record, _calendar_event.range_type, CALENDAR_RANGE_COUNT);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
- }
- else if (CAL_STRING_EQUAL == strncmp(t[i], "INTERVAL=", strlen("INTERVAL="))) {
+ } else if (CAL_STRING_EQUAL == strncmp(t[i], "INTERVAL=", strlen("INTERVAL="))) {
int interval = atoi(t[i] + strlen("INTERVAL="));
if (interval < 1) interval = 1;
ret = cal_record_set_int(record, _calendar_event.interval, interval);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
- }
- else if (CAL_STRING_EQUAL == strncmp(t[i], "BYYEARDAY=", strlen("BYYEARDAY="))) {
+ } else if (CAL_STRING_EQUAL == strncmp(t[i], "BYYEARDAY=", strlen("BYYEARDAY="))) {
ret = cal_record_set_str(record, _calendar_event.byyearday, t[i] + strlen("BYYEARDAY="));
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_str() Fail(%d)", ret);
- }
- else if (CAL_STRING_EQUAL == strncmp(t[i], "BYWEEKNO=", strlen("BYWEEKNO="))) {
+ } else if (CAL_STRING_EQUAL == strncmp(t[i], "BYWEEKNO=", strlen("BYWEEKNO="))) {
ret = cal_record_set_str(record, _calendar_event.byweekno, t[i] + strlen("BYWEEKNO="));
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_str() Fail(%d)", ret);
- }
- else if (CAL_STRING_EQUAL == strncmp(t[i], "BYMONTH=", strlen("BYMONTH="))) {
+ } else if (CAL_STRING_EQUAL == strncmp(t[i], "BYMONTH=", strlen("BYMONTH="))) {
ret = cal_record_set_str(record, _calendar_event.bymonth, t[i] + strlen("BYMONTH="));
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_str() Fail(%d)", ret);
- }
- else if (CAL_STRING_EQUAL == strncmp(t[i], "BYMONTHDAY=", strlen("BYMONTHDAY="))) {
+ } else if (CAL_STRING_EQUAL == strncmp(t[i], "BYMONTHDAY=", strlen("BYMONTHDAY="))) {
ret = cal_record_set_str(record, _calendar_event.bymonthday, t[i] + strlen("BYMONTHDAY="));
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_str() Fail(%d)", ret);
- }
- else if (CAL_STRING_EQUAL == strncmp(t[i], "BYDAY=", strlen("BYDAY="))) {
+ } else if (CAL_STRING_EQUAL == strncmp(t[i], "BYDAY=", strlen("BYDAY="))) {
ret = cal_record_set_str(record, _calendar_event.byday, t[i] + strlen("BYDAY="));
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_str() Fail(%d)", ret);
- }
- else if (CAL_STRING_EQUAL == strncmp(t[i], "BYSETPOS=", strlen("BYSETPOS="))) {
+ } else if (CAL_STRING_EQUAL == strncmp(t[i], "BYSETPOS=", strlen("BYSETPOS="))) {
ret = cal_record_set_str(record, _calendar_event.bysetpos, t[i] + strlen("BYSETPOS="));
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_str() Fail(%d)", ret);
- }
- else if (CAL_STRING_EQUAL == strncmp(t[i], "WKST=", strlen("WKST="))) {
+ } else if (CAL_STRING_EQUAL == strncmp(t[i], "WKST=", strlen("WKST="))) {
if (CAL_STRING_EQUAL == strncmp(t[i] + strlen("WKST="), "SU", strlen("SU")))
ret = cal_record_set_int(record, _calendar_event.wkst, CALENDAR_SUNDAY);
else if (CAL_STRING_EQUAL == strncmp(t[i] + strlen("WKST="), "MO", strlen("MO")))
DBG("Unable to parse[%s]", t[i]);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
- }
- else {
+ } else {
DBG("Unable to parse[%s]", t[i]);
}
}
ret = cal_record_set_int(attendee, _calendar_attendee.cutype, CALENDAR_ATTENDEE_ROLE_REQ_PARTICIPANT);
if (strlen(value) > strlen("REQ-PARTICIPANT"))
prop = "REQ-PARTICIPANT";
- }
- else if (CAL_STRING_EQUAL == strncmp(value, "OPT-PARTICIPANT", strlen("OPT-PARTICIPANT"))) {
+ } else if (CAL_STRING_EQUAL == strncmp(value, "OPT-PARTICIPANT", strlen("OPT-PARTICIPANT"))) {
ret = cal_record_set_int(attendee, _calendar_attendee.cutype, CALENDAR_ATTENDEE_ROLE_OPT_PARTICIPANT);
if (strlen(value) > strlen("OPT-PARTICIPANT"))
prop = "OPT-PARTICIPANT";
- }
- else if (CAL_STRING_EQUAL == strncmp(value, "NON-PARTICIPANT", strlen("NON-PARTICIPANT"))) {
+ } else if (CAL_STRING_EQUAL == strncmp(value, "NON-PARTICIPANT", strlen("NON-PARTICIPANT"))) {
ret = cal_record_set_int(attendee, _calendar_attendee.cutype, CALENDAR_ATTENDEE_ROLE_NON_PARTICIPANT);
if (strlen(value) > strlen("NON-PARTICIPANT"))
prop = "NON-PARTICIPANT";
- }
- else if (CAL_STRING_EQUAL == strncmp(value, "CHAIR", strlen("CHAIR"))) {
+ } else if (CAL_STRING_EQUAL == strncmp(value, "CHAIR", strlen("CHAIR"))) {
ret = cal_record_set_int(attendee, _calendar_attendee.cutype, CALENDAR_ATTENDEE_ROLE_CHAIR);
if (strlen(value) > strlen("CHAIR"))
prop = "CHAIR";
- }
- else {
+ } else {
ERR("Invalid value[%s]", value);
}
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_caltime() Fail(%d)", ret);
ret = cal_record_set_int(alarm, _calendar_alarm.tick_unit, CALENDAR_ALARM_TIME_UNIT_SPECIFIC);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
- }
- else if (0 == diff) {
+ } else if (0 == diff) {
DBG("set alarm in start time");
ret = cal_record_set_int(alarm, _calendar_alarm.tick, 0);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
ret = cal_record_set_int(alarm, _calendar_alarm.tick_unit, CALENDAR_ALARM_TIME_UNIT_HOUR);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
- }
- else {
+ } else {
int tick = 0;
int unit = 0;
_get_tick_unit(diff, &tick, &unit);
} else {
_set_alarm_tick_unit(alarm, alarm_time, -1); /* -1 goes to specific time */
}
- }
- else if (VCAL_VER_10_DALARM_DISPLAY_STRING == index) { /* displayString */
+ } else if (VCAL_VER_10_DALARM_DISPLAY_STRING == index) { /* displayString */
DBG("displayString [%s]", t[i]);
ret = cal_record_set_str(alarm, _calendar_alarm.summary, t[i]);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_str() Fail(%d)", ret);
- }
- else {
+ } else {
/* TYPE, VALUE */
}
}
} else {
_set_alarm_tick_unit(alarm, alarm_time, -1); /* -1 goes to specific time */
}
- }
- else if (VCAL_VER_10_MALARM_ADDRESS_STRING == index) { /* addressString */
+ } else if (VCAL_VER_10_MALARM_ADDRESS_STRING == index) { /* addressString */
DBG("addressString [%s]", t[i]);
ret = cal_record_set_str(alarm, _calendar_alarm.attach, t[i]);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_str() Fail(%d)", ret);
- }
- else if (VCAL_VER_10_MALARM_NOTE_STRING == index) { /* noteString */
+ } else if (VCAL_VER_10_MALARM_NOTE_STRING == index) { /* noteString */
DBG("noteString [%s]", t[i]);
ret = cal_record_set_str(alarm, _calendar_alarm.description, t[i]);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_str() Fail(%d)", ret);
- }
- else {
+ } else {
/* TYPE, VALUE */
}
}
} else {
_set_alarm_tick_unit(alarm, alarm_time, -1); /* -1 goes to specific time */
}
- }
- else if (VCAL_VER_10_AALARM_AUDIO_CONTENT == index) {
+ } else if (VCAL_VER_10_AALARM_AUDIO_CONTENT == index) {
/* audioContent */
DBG("Content [%s]", t[i]);
ret = cal_record_set_str(alarm, _calendar_alarm.attach, t[i]);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_str() Fail(%d)", ret);
- }
- else {
+ } else {
/* TYPE, VALUE */
}
}
related = VCAL_RELATED_END;
else
ERR("Invalid related:[%s]", t[i]);
- }
- else if (CAL_STRING_EQUAL == strncmp(t[i], "VALUE", strlen("VALUE"))) {
+ } else if (CAL_STRING_EQUAL == strncmp(t[i], "VALUE", strlen("VALUE"))) {
/* do nothing */
- }
- else {
+ } else {
if ('0' <= *t[i] && *t[i] <= '9' && strlen("YYYYDDMM") <= strlen(t[i])) {
calendar_time_s caltime = {0};
_get_caltime(t[i], &caltime, ud);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_caltime() Fail(%d)", ret);
ret = cal_record_set_int(alarm, _calendar_alarm.tick_unit, CALENDAR_ALARM_TIME_UNIT_SPECIFIC);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
- }
- else {
+ } else {
int unit = 0;
int tick = 0;
__decode_duration(t[i], strlen(t[i]), &tick, &unit);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_caltime() Fail(%d)", ret);
ret = cal_record_set_int(alarm, _calendar_alarm.tick_unit, CALENDAR_ALARM_TIME_UNIT_SPECIFIC);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
- }
- else {
+ } else {
ret = cal_record_set_int(alarm, _calendar_alarm.tick, (-1 * tick));
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_record_set_int() Fail(%d)", ret);
ret = cal_record_set_int(alarm, _calendar_alarm.tick_unit, unit);
cursor = __get_value(p, &value);
__adjust_tzid(value);
DBG("tzid[%s]", value +1);
- if (true == cal_time_is_available_tzid(value +1)) {
+ if (true == cal_time_is_available_tzid(value +1))
ud->timezone_tzid = strdup(value +1);
- }
- else {
+ else
DBG("Invalid tzid string[%s]", value +1);
- }
+
free(value);
- }
- else if (CAL_STRING_EQUAL == strncmp(cursor, "BEGIN:STANDARD", strlen("BEGIN:STANDARD"))) {
+ } else if (CAL_STRING_EQUAL == strncmp(cursor, "BEGIN:STANDARD", strlen("BEGIN:STANDARD"))) {
cursor = __work_component_vtimezone_standard(cursor, record, ud);
- }
- else if (CAL_STRING_EQUAL == strncmp(cursor, "BEGIN:DAYLIGHT", strlen("BEGIN:DAYLIGHT"))) {
+ } else if (CAL_STRING_EQUAL == strncmp(cursor, "BEGIN:DAYLIGHT", strlen("BEGIN:DAYLIGHT"))) {
cursor = __work_component_vtimezone_daylight(cursor, record, ud);
- }
- else if (CAL_STRING_EQUAL == strncmp(cursor, "END", strlen("END"))) {
+ } else if (CAL_STRING_EQUAL == strncmp(cursor, "END", strlen("END"))) {
cursor = __crlf(cursor);
break;
- }
- else {
+ } else {
DBG("Unable to parse");
__print_cursor(cursor, __LINE__);
cursor = __crlf(cursor);
#include "cal_view.h"
#include "cal_mutex.h"
-API const _calendar_book_property_ids _calendar_book =
-{
+API const _calendar_book_property_ids _calendar_book = {
._uri = CALENDAR_VIEW_CALENDAR,
.id = CAL_PROPERTY_CALENDAR_ID,
.uid = CAL_PROPERTY_CALENDAR_UID,
.mode = CAL_PROPERTY_CALENDAR_MODE
};
-API const _calendar_event_property_ids _calendar_event =
-{
+API const _calendar_event_property_ids _calendar_event = {
._uri = CALENDAR_VIEW_EVENT,
.id = CAL_PROPERTY_EVENT_ID,
.calendar_book_id = CAL_PROPERTY_EVENT_CALENDAR_ID,
.is_allday = CAL_PROPERTY_EVENT_IS_ALLDAY
};
-API const _calendar_todo_property_ids _calendar_todo =
-{
+API const _calendar_todo_property_ids _calendar_todo = {
._uri = CALENDAR_VIEW_TODO,
.id = CAL_PROPERTY_TODO_ID,
.calendar_book_id = CAL_PROPERTY_TODO_CALENDAR_ID,
.is_allday = CAL_PROPERTY_TODO_IS_ALLDAY
};
-API const _calendar_timezone_property_ids _calendar_timezone =
-{
+API const _calendar_timezone_property_ids _calendar_timezone = {
._uri = CALENDAR_VIEW_TIMEZONE,
.id = CAL_PROPERTY_TIMEZONE_ID,
.calendar_book_id = CAL_PROPERTY_TIMEZONE_CALENDAR_ID,
.day_light_bias = CAL_PROPERTY_TIMEZONE_DAY_LIGHT_BIAS
};
-API const _calendar_attendee_property_ids _calendar_attendee =
-{
+API const _calendar_attendee_property_ids _calendar_attendee = {
._uri = CALENDAR_VIEW_ATTENDEE,
.parent_id = CAL_PROPERTY_ATTENDEE_PARENT_ID,
.number = CAL_PROPERTY_ATTENDEE_NUMBER,
.member = CAL_PROPERTY_ATTENDEE_MEMBER
};
-API const _calendar_alarm_property_ids _calendar_alarm =
-{
+API const _calendar_alarm_property_ids _calendar_alarm = {
._uri = CALENDAR_VIEW_ALARM,
.parent_id = CAL_PROPERTY_ALARM_PARENT_ID,
.tick = CAL_PROPERTY_ALARM_TICK,
.alarm_time = CAL_PROPERTY_ALARM_ALARM,
};
-API const _calendar_updated_info_property_ids _calendar_updated_info =
-{
+API const _calendar_updated_info_property_ids _calendar_updated_info = {
._uri = CALENDAR_VIEW_UPDATED_INFO,
.id = CAL_PROPERTY_UPDATED_INFO_ID,
.calendar_book_id = CAL_PROPERTY_UPDATED_INFO_CALENDAR_ID,
.version = CAL_PROPERTY_UPDATED_INFO_VERSION
};
-API const _calendar_event_calendar_book_property_ids _calendar_event_calendar_book =
-{
+API const _calendar_event_calendar_book_property_ids _calendar_event_calendar_book = {
._uri = CALENDAR_VIEW_EVENT_CALENDAR,
.event_id = CAL_PROPERTY_EVENT_ID,
.calendar_book_id = CAL_PROPERTY_EVENT_CALENDAR_ID,
.calendar_book_account_id = CAL_PROPERTY_CALENDAR_ACCOUNT_ID | CAL_PROPERTY_FLAGS_FILTER
};
-API const _calendar_todo_calendar_book_property_ids _calendar_todo_calendar_book =
-{
+API const _calendar_todo_calendar_book_property_ids _calendar_todo_calendar_book = {
._uri = CALENDAR_VIEW_TODO_CALENDAR,
.todo_id = CAL_PROPERTY_TODO_ID,
.calendar_book_id = CAL_PROPERTY_TODO_CALENDAR_ID,
.calendar_book_account_id = CAL_PROPERTY_CALENDAR_ACCOUNT_ID | CAL_PROPERTY_FLAGS_FILTER
};
-API const _calendar_event_calendar_book_attendee_property_ids _calendar_event_calendar_book_attendee =
-{
+API const _calendar_event_calendar_book_attendee_property_ids _calendar_event_calendar_book_attendee = {
._uri = CALENDAR_VIEW_EVENT_CALENDAR_ATTENDEE,
.event_id = CAL_PROPERTY_EVENT_ID,
.calendar_book_id = CAL_PROPERTY_EVENT_CALENDAR_ID,
.attendee_member = CAL_PROPERTY_ATTENDEE_MEMBER | CAL_PROPERTY_FLAGS_FILTER
};
-API const _calendar_instance_utime_calendar_book_property_ids _calendar_instance_utime_calendar_book =
-{
+API const _calendar_instance_utime_calendar_book_property_ids _calendar_instance_utime_calendar_book = {
._uri = CALENDAR_VIEW_INSTANCE_UTIME_CALENDAR,
.event_id = CAL_PROPERTY_INSTANCE_NORMAL_EVENT_ID,
.start_time = CAL_PROPERTY_INSTANCE_NORMAL_START,
.sync_data1 = CAL_PROPERTY_INSTANCE_NORMAL_SYNC_DATA1
};
-API const _calendar_instance_localtime_calendar_book_property_ids _calendar_instance_localtime_calendar_book =
-{
+API const _calendar_instance_localtime_calendar_book_property_ids _calendar_instance_localtime_calendar_book = {
._uri = CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR,
.event_id = CAL_PROPERTY_INSTANCE_ALLDAY_EVENT_ID,
.start_time = CAL_PROPERTY_INSTANCE_ALLDAY_START,
.is_allday = CAL_PROPERTY_INSTANCE_ALLDAY_IS_ALLDAY
};
-API const _calendar_instance_utime_calendar_book_extended_property_ids _calendar_instance_utime_calendar_book_extended =
-{
+API const _calendar_instance_utime_calendar_book_extended_property_ids _calendar_instance_utime_calendar_book_extended = {
._uri = CALENDAR_VIEW_INSTANCE_UTIME_CALENDAR_EXTENDED,
.event_id = CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_EVENT_ID,
.start_time = CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_START,
.sync_data4 = CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_SYNC_DATA4
};
-API const _calendar_instance_localtime_calendar_book_extended_property_ids _calendar_instance_localtime_calendar_book_extended =
-{
+API const _calendar_instance_localtime_calendar_book_extended_property_ids _calendar_instance_localtime_calendar_book_extended = {
._uri = CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR_EXTENDED,
.event_id = CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_EVENT_ID,
.start_time = CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_START,
.calendar_book_account_id = CAL_PROPERTY_CALENDAR_ACCOUNT_ID | CAL_PROPERTY_FLAGS_FILTER,
.last_modified_time = CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_LAST_MODIFIED_TIME,
.sync_data1 = CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_SYNC_DATA1,
- .organizer_name= CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_ORGANIZER_NAME,
+ .organizer_name = CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_ORGANIZER_NAME,
.categories = CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_CATEGORIES,
.has_attendee = CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_HAS_ATTENDEE,
.sync_data2 = CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_SYNC_DATA2,
.is_allday = CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_IS_ALLDAY
};
-API const _calendar_extended_property_property_ids _calendar_extended_property =
-{
+API const _calendar_extended_property_property_ids _calendar_extended_property = {
._uri = CALENDAR_VIEW_EXTENDED,
.id = CAL_PROPERTY_EXTENDED_ID,
.record_id = CAL_PROPERTY_EXTENDED_RECORD_ID,
{CAL_PROPERTY_CALENDAR_MODE, "mode"},
};
-const cal_property_info_s __property_event[] =
-{
+const cal_property_info_s __property_event[] = {
{CAL_PROPERTY_EVENT_ID, "id"},
{CAL_PROPERTY_EVENT_CALENDAR_ID, "calendar_id"},
{CAL_PROPERTY_EVENT_SUMMARY, "summary"},
{CAL_PROPERTY_EVENT_IS_ALLDAY, "is_allday"},
};
-const cal_property_info_s __property_todo[] =
-{
+const cal_property_info_s __property_todo[] = {
{CAL_PROPERTY_TODO_ID, "id"},
{CAL_PROPERTY_TODO_CALENDAR_ID, "calendar_id"},
{CAL_PROPERTY_TODO_SUMMARY, "summary"},
{CAL_PROPERTY_TODO_IS_ALLDAY, "dtend_type"},
};
-const cal_property_info_s __property_timezone[] =
-{
+const cal_property_info_s __property_timezone[] = {
{CAL_PROPERTY_TIMEZONE_ID, "id"},
{CAL_PROPERTY_TIMEZONE_TZ_OFFSET_FROM_GMT, "tz_offset_from_gmt"},
{CAL_PROPERTY_TIMEZONE_STANDARD_NAME, "standard_name"},
{CAL_PROPERTY_TIMEZONE_CALENDAR_ID, "calendar_id"},
};
-const cal_property_info_s __property_attendee[] =
-{
+const cal_property_info_s __property_attendee[] = {
{CAL_PROPERTY_ATTENDEE_NUMBER, "attendee_number"},
{CAL_PROPERTY_ATTENDEE_CUTYPE, "attendee_cutype"},
{CAL_PROPERTY_ATTENDEE_CT_INDEX, "attendee_ct_index"},
{CAL_PROPERTY_ATTENDEE_PARENT_ID, "event_id"},
};
-const cal_property_info_s __property_alarm[] =
-{
+const cal_property_info_s __property_alarm[] = {
{CAL_PROPERTY_ALARM_TICK, "remind_tick"},
{CAL_PROPERTY_ALARM_TICK_UNIT, "remind_tick_unit"},
{CAL_PROPERTY_ALARM_DESCRIPTION, "alarm_description"},
{CAL_PROPERTY_ALARM_ALARM, "alarm_type,alarm_utime,alarm_datetime"},
};
-const cal_property_info_s __property_updated_info[] =
-{
+const cal_property_info_s __property_updated_info[] = {
{CAL_PROPERTY_UPDATED_INFO_ID, "id"},
{CAL_PROPERTY_UPDATED_INFO_CALENDAR_ID, "calendar_id"},
{CAL_PROPERTY_UPDATED_INFO_TYPE, "type"},
{CAL_PROPERTY_UPDATED_INFO_VERSION, "ver"},
};
-const cal_property_info_s __property_search_event_calendar[] =
-{
+const cal_property_info_s __property_search_event_calendar[] = {
{CAL_PROPERTY_EVENT_ID, "id"},
{CAL_PROPERTY_EVENT_CALENDAR_ID, "calendar_id"},
{CAL_PROPERTY_EVENT_SUMMARY, "summary"},
{(CAL_PROPERTY_CALENDAR_ACCOUNT_ID|CAL_PROPERTY_FLAGS_FILTER), "account_id"},
};
-const cal_property_info_s __property_search_todo_calendar[] =
-{
+const cal_property_info_s __property_search_todo_calendar[] = {
{CAL_PROPERTY_TODO_ID, "id"},
{CAL_PROPERTY_TODO_CALENDAR_ID, "calendar_id"},
{CAL_PROPERTY_TODO_SUMMARY, "summary"},
{(CAL_PROPERTY_CALENDAR_ACCOUNT_ID|CAL_PROPERTY_FLAGS_FILTER), "account_id"},
};
-const cal_property_info_s __property_search_event_calendar_attendee[] =
-{
+const cal_property_info_s __property_search_event_calendar_attendee[] = {
{CAL_PROPERTY_EVENT_ID, "id"},
{CAL_PROPERTY_EVENT_CALENDAR_ID, "calendar_id"},
{CAL_PROPERTY_EVENT_SUMMARY, "summary"},
{(CAL_PROPERTY_ATTENDEE_MEMBER|CAL_PROPERTY_FLAGS_FILTER), "attendee_member"},
};
-const cal_property_info_s __property_search_instance_utime_calendar[] =
-{
+const cal_property_info_s __property_search_instance_utime_calendar[] = {
{CAL_PROPERTY_INSTANCE_NORMAL_EVENT_ID, "event_id"},
{CAL_PROPERTY_INSTANCE_NORMAL_START, "dtstart_type,dtstart_utime,dtstart_datetime"},
{CAL_PROPERTY_INSTANCE_NORMAL_END, "dtend_type,dtend_utime,dtend_datetime"},
{CAL_PROPERTY_INSTANCE_NORMAL_SYNC_DATA1, "sync_data1"},
};
-const cal_property_info_s __property_search_instance_localtime_calendar[] =
-{
+const cal_property_info_s __property_search_instance_localtime_calendar[] = {
{CAL_PROPERTY_INSTANCE_ALLDAY_EVENT_ID, "event_id"},
{CAL_PROPERTY_INSTANCE_ALLDAY_START, "dtstart_type,dtstart_utime,dtstart_datetime"},
{CAL_PROPERTY_INSTANCE_ALLDAY_END, "dtend_type,dtend_utime,dtend_datetime"},
{CAL_PROPERTY_INSTANCE_ALLDAY_IS_ALLDAY, "is_allday"},
};
-const cal_property_info_s __property_search_instance_utime_calendar_extended[] =
-{
+const cal_property_info_s __property_search_instance_utime_calendar_extended[] = {
{CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_EVENT_ID, "event_id"},
{CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_START, "dtstart_type,dtstart_utime,dtstart_datetime"},
{CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_END, "dtend_type,dtend_utime,dtend_datetime"},
};
-const cal_property_info_s __property_search_instance_localtime_calendar_extended[] =
-{
+const cal_property_info_s __property_search_instance_localtime_calendar_extended[] = {
{CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_EVENT_ID, "event_id"},
{CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_START, "dtstart_type,dtstart_utime,dtstart_datetime"},
{CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_END, "dtend_type,dtend_utime,dtend_datetime"},
{CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_IS_ALLDAY, "is_allday"},
};
-const cal_property_info_s __property_extended[] =
-{
+const cal_property_info_s __property_extended[] = {
{CAL_PROPERTY_EXTENDED_ID, "id"},
{CAL_PROPERTY_EXTENDED_RECORD_ID, "record_id"},
{CAL_PROPERTY_EXTENDED_RECORD_TYPE, "record_type"},
cal_record_type_e type;
cal_property_info_s *properties;
int property_count;
-}cal_view_uri_info_s;
+} cal_view_uri_info_s;
#define PTR_COUNT(X) (void*)(X), sizeof(X)/sizeof(cal_property_info_s)
cal_view_uri_info_s* view_uri_info = NULL;
cal_record_type_e type = CAL_RECORD_TYPE_INVALID;
- if (cal_uri_property_hash){
+ if (cal_uri_property_hash) {
view_uri_info = g_hash_table_lookup(cal_uri_property_hash, view_uri);
- if (view_uri_info) {
+ if (view_uri_info)
type = view_uri_info->type;
- }
- else {
+ else
ERR("g_hash_table_lookup() Fail");
- }
- }
- else {
+ } else {
ERR("Unable to get cal_uri_property_hash[%s]", view_uri);
}
cal_property_info_s* tmp = NULL;
cal_view_uri_info_s* view_uri_info = NULL;
- if (cal_uri_property_hash){
+ if (cal_uri_property_hash) {
view_uri_info = g_hash_table_lookup(cal_uri_property_hash, view_uri);
if (view_uri_info) {
tmp = view_uri_info->properties;
{
cal_view_uri_info_s* view_uri_info = NULL;
- if (cal_uri_property_hash){
+ if (cal_uri_property_hash) {
view_uri_info = g_hash_table_lookup(cal_uri_property_hash, view_uri);
- if (view_uri_info) {
+ if (view_uri_info)
return view_uri_info->view_uri;
- }
}
return NULL;
+++ /dev/null
-/*
- * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
- *
- * The license of this code is the same as for the source it was derived from.
- */
-
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "cal_dbus.h"
-
-#include <string.h>
-#ifdef G_OS_UNIX
-# include <gio/gunixfdlist.h>
-#endif
-
-typedef struct
-{
- GDBusArgInfo parent_struct;
- gboolean use_gvariant;
-} _ExtendedGDBusArgInfo;
-
-typedef struct
-{
- GDBusMethodInfo parent_struct;
- const gchar *signal_name;
- gboolean pass_fdlist;
-} _ExtendedGDBusMethodInfo;
-
-typedef struct
-{
- GDBusSignalInfo parent_struct;
- const gchar *signal_name;
-} _ExtendedGDBusSignalInfo;
-
-typedef struct
-{
- GDBusPropertyInfo parent_struct;
- const gchar *hyphen_name;
- gboolean use_gvariant;
-} _ExtendedGDBusPropertyInfo;
-
-typedef struct
-{
- GDBusInterfaceInfo parent_struct;
- const gchar *hyphen_name;
-} _ExtendedGDBusInterfaceInfo;
-
-typedef struct
-{
- const _ExtendedGDBusPropertyInfo *info;
- guint prop_id;
- GValue orig_value; /* the value before the change */
-} ChangedProperty;
-
-static void
-_changed_property_free (ChangedProperty *data)
-{
- g_value_unset (&data->orig_value);
- g_free (data);
-}
-
-static gboolean
-_g_strv_equal0 (gchar **a, gchar **b)
-{
- gboolean ret = FALSE;
- guint n;
- if (a == NULL && b == NULL)
- {
- ret = TRUE;
- goto out;
- }
- if (a == NULL || b == NULL)
- goto out;
- if (g_strv_length (a) != g_strv_length (b))
- goto out;
- for (n = 0; a[n] != NULL; n++)
- if (g_strcmp0 (a[n], b[n]) != 0)
- goto out;
- ret = TRUE;
-out:
- return ret;
-}
-
-static gboolean
-_g_variant_equal0 (GVariant *a, GVariant *b)
-{
- gboolean ret = FALSE;
- if (a == NULL && b == NULL)
- {
- ret = TRUE;
- goto out;
- }
- if (a == NULL || b == NULL)
- goto out;
- ret = g_variant_equal (a, b);
-out:
- return ret;
-}
-
-G_GNUC_UNUSED static gboolean
-_g_value_equal (const GValue *a, const GValue *b)
-{
- gboolean ret = FALSE;
- g_assert (G_VALUE_TYPE (a) == G_VALUE_TYPE (b));
- switch (G_VALUE_TYPE (a))
- {
- case G_TYPE_BOOLEAN:
- ret = (g_value_get_boolean (a) == g_value_get_boolean (b));
- break;
- case G_TYPE_UCHAR:
- ret = (g_value_get_uchar (a) == g_value_get_uchar (b));
- break;
- case G_TYPE_INT:
- ret = (g_value_get_int (a) == g_value_get_int (b));
- break;
- case G_TYPE_UINT:
- ret = (g_value_get_uint (a) == g_value_get_uint (b));
- break;
- case G_TYPE_INT64:
- ret = (g_value_get_int64 (a) == g_value_get_int64 (b));
- break;
- case G_TYPE_UINT64:
- ret = (g_value_get_uint64 (a) == g_value_get_uint64 (b));
- break;
- case G_TYPE_DOUBLE:
- {
- /* Avoid -Wfloat-equal warnings by doing a direct bit compare */
- gdouble da = g_value_get_double (a);
- gdouble db = g_value_get_double (b);
- ret = memcmp (&da, &db, sizeof (gdouble)) == 0;
- }
- break;
- case G_TYPE_STRING:
- ret = (g_strcmp0 (g_value_get_string (a), g_value_get_string (b)) == 0);
- break;
- case G_TYPE_VARIANT:
- ret = _g_variant_equal0 (g_value_get_variant (a), g_value_get_variant (b));
- break;
- default:
- if (G_VALUE_TYPE (a) == G_TYPE_STRV)
- ret = _g_strv_equal0 (g_value_get_boxed (a), g_value_get_boxed (b));
- else
- g_critical ("_g_value_equal() does not handle type %s", g_type_name (G_VALUE_TYPE (a)));
- break;
- }
- return ret;
-}
-
-/* ------------------------------------------------------------------------
- * Code for interface org.tizen.calendar_service.dbus
- * ------------------------------------------------------------------------
- */
-
-/**
- * SECTION:calDbus
- * @title: calDbus
- * @short_description: Generated C code for the org.tizen.calendar_service.dbus D-Bus interface
- *
- * This section contains code for working with the <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link> D-Bus interface in C.
- */
-
-/* ---- Introspection data for org.tizen.calendar_service.dbus ---- */
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_register_resource_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_register_resource_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_register_resource_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_register_resource =
-{
- {
- -1,
- (gchar *) "register_resource",
- NULL,
- (GDBusArgInfo **) &_cal_dbus_method_info_register_resource_OUT_ARG_pointers,
- NULL
- },
- "handle-register-resource",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_unregister_resource_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_unregister_resource_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_unregister_resource_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_unregister_resource =
-{
- {
- -1,
- (gchar *) "unregister_resource",
- NULL,
- (GDBusArgInfo **) &_cal_dbus_method_info_unregister_resource_OUT_ARG_pointers,
- NULL
- },
- "handle-unregister-resource",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_record_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_record_IN_ARG_record =
-{
- {
- -1,
- (gchar *) "record",
- (gchar *) "(iv)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_insert_record_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_insert_record_IN_ARG_handle,
- &_cal_dbus_method_info_insert_record_IN_ARG_record,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_record_OUT_ARG_id =
-{
- {
- -1,
- (gchar *) "id",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_record_OUT_ARG_version =
-{
- {
- -1,
- (gchar *) "version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_record_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_insert_record_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_insert_record_OUT_ARG_id,
- &_cal_dbus_method_info_insert_record_OUT_ARG_version,
- &_cal_dbus_method_info_insert_record_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_insert_record =
-{
- {
- -1,
- (gchar *) "insert_record",
- (GDBusArgInfo **) &_cal_dbus_method_info_insert_record_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_insert_record_OUT_ARG_pointers,
- NULL
- },
- "handle-insert-record",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_record_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_record_IN_ARG_record =
-{
- {
- -1,
- (gchar *) "record",
- (gchar *) "(iv)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_update_record_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_update_record_IN_ARG_handle,
- &_cal_dbus_method_info_update_record_IN_ARG_record,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_record_OUT_ARG_version =
-{
- {
- -1,
- (gchar *) "version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_record_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_update_record_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_update_record_OUT_ARG_version,
- &_cal_dbus_method_info_update_record_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_update_record =
-{
- {
- -1,
- (gchar *) "update_record",
- (GDBusArgInfo **) &_cal_dbus_method_info_update_record_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_update_record_OUT_ARG_pointers,
- NULL
- },
- "handle-update-record",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_record_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_record_IN_ARG_view_uri =
-{
- {
- -1,
- (gchar *) "view_uri",
- (gchar *) "s",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_record_IN_ARG_id =
-{
- {
- -1,
- (gchar *) "id",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_delete_record_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_delete_record_IN_ARG_handle,
- &_cal_dbus_method_info_delete_record_IN_ARG_view_uri,
- &_cal_dbus_method_info_delete_record_IN_ARG_id,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_record_OUT_ARG_version =
-{
- {
- -1,
- (gchar *) "version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_record_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_delete_record_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_delete_record_OUT_ARG_version,
- &_cal_dbus_method_info_delete_record_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_delete_record =
-{
- {
- -1,
- (gchar *) "delete_record",
- (GDBusArgInfo **) &_cal_dbus_method_info_delete_record_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_delete_record_OUT_ARG_pointers,
- NULL
- },
- "handle-delete-record",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_record_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_record_IN_ARG_record =
-{
- {
- -1,
- (gchar *) "record",
- (gchar *) "(iv)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_record_IN_ARG_id =
-{
- {
- -1,
- (gchar *) "id",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_replace_record_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_replace_record_IN_ARG_handle,
- &_cal_dbus_method_info_replace_record_IN_ARG_record,
- &_cal_dbus_method_info_replace_record_IN_ARG_id,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_record_OUT_ARG_version =
-{
- {
- -1,
- (gchar *) "version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_record_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_replace_record_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_replace_record_OUT_ARG_version,
- &_cal_dbus_method_info_replace_record_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_replace_record =
-{
- {
- -1,
- (gchar *) "replace_record",
- (GDBusArgInfo **) &_cal_dbus_method_info_replace_record_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_replace_record_OUT_ARG_pointers,
- NULL
- },
- "handle-replace-record",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_records_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_records_IN_ARG_list =
-{
- {
- -1,
- (gchar *) "list",
- (gchar *) "(iv)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_insert_records_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_insert_records_IN_ARG_handle,
- &_cal_dbus_method_info_insert_records_IN_ARG_list,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_records_OUT_ARG_ids =
-{
- {
- -1,
- (gchar *) "ids",
- (gchar *) "ai",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_records_OUT_ARG_count =
-{
- {
- -1,
- (gchar *) "count",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_records_OUT_ARG_version =
-{
- {
- -1,
- (gchar *) "version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_records_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_insert_records_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_insert_records_OUT_ARG_ids,
- &_cal_dbus_method_info_insert_records_OUT_ARG_count,
- &_cal_dbus_method_info_insert_records_OUT_ARG_version,
- &_cal_dbus_method_info_insert_records_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_insert_records =
-{
- {
- -1,
- (gchar *) "insert_records",
- (GDBusArgInfo **) &_cal_dbus_method_info_insert_records_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_insert_records_OUT_ARG_pointers,
- NULL
- },
- "handle-insert-records",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_records_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_records_IN_ARG_list =
-{
- {
- -1,
- (gchar *) "list",
- (gchar *) "(iv)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_update_records_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_update_records_IN_ARG_handle,
- &_cal_dbus_method_info_update_records_IN_ARG_list,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_records_OUT_ARG_version =
-{
- {
- -1,
- (gchar *) "version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_update_records_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_update_records_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_update_records_OUT_ARG_version,
- &_cal_dbus_method_info_update_records_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_update_records =
-{
- {
- -1,
- (gchar *) "update_records",
- (GDBusArgInfo **) &_cal_dbus_method_info_update_records_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_update_records_OUT_ARG_pointers,
- NULL
- },
- "handle-update-records",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_records_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_records_IN_ARG_view_uri =
-{
- {
- -1,
- (gchar *) "view_uri",
- (gchar *) "s",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_records_IN_ARG_ids =
-{
- {
- -1,
- (gchar *) "ids",
- (gchar *) "ai",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_records_IN_ARG_count =
-{
- {
- -1,
- (gchar *) "count",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_delete_records_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_delete_records_IN_ARG_handle,
- &_cal_dbus_method_info_delete_records_IN_ARG_view_uri,
- &_cal_dbus_method_info_delete_records_IN_ARG_ids,
- &_cal_dbus_method_info_delete_records_IN_ARG_count,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_records_OUT_ARG_version =
-{
- {
- -1,
- (gchar *) "version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_delete_records_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_delete_records_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_delete_records_OUT_ARG_version,
- &_cal_dbus_method_info_delete_records_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_delete_records =
-{
- {
- -1,
- (gchar *) "delete_records",
- (GDBusArgInfo **) &_cal_dbus_method_info_delete_records_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_delete_records_OUT_ARG_pointers,
- NULL
- },
- "handle-delete-records",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_records_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_records_IN_ARG_list =
-{
- {
- -1,
- (gchar *) "list",
- (gchar *) "(iv)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_records_IN_ARG_ids =
-{
- {
- -1,
- (gchar *) "ids",
- (gchar *) "ai",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_records_IN_ARG_count =
-{
- {
- -1,
- (gchar *) "count",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_replace_records_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_replace_records_IN_ARG_handle,
- &_cal_dbus_method_info_replace_records_IN_ARG_list,
- &_cal_dbus_method_info_replace_records_IN_ARG_ids,
- &_cal_dbus_method_info_replace_records_IN_ARG_count,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_records_OUT_ARG_version =
-{
- {
- -1,
- (gchar *) "version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_records_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_replace_records_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_replace_records_OUT_ARG_version,
- &_cal_dbus_method_info_replace_records_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_replace_records =
-{
- {
- -1,
- (gchar *) "replace_records",
- (GDBusArgInfo **) &_cal_dbus_method_info_replace_records_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_replace_records_OUT_ARG_pointers,
- NULL
- },
- "handle-replace-records",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_record_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_record_IN_ARG_view_uri =
-{
- {
- -1,
- (gchar *) "view_uri",
- (gchar *) "s",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_record_IN_ARG_id =
-{
- {
- -1,
- (gchar *) "id",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_record_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_record_IN_ARG_handle,
- &_cal_dbus_method_info_get_record_IN_ARG_view_uri,
- &_cal_dbus_method_info_get_record_IN_ARG_id,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_record_OUT_ARG_record =
-{
- {
- -1,
- (gchar *) "record",
- (gchar *) "(iv)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_record_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_record_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_record_OUT_ARG_record,
- &_cal_dbus_method_info_get_record_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_record =
-{
- {
- -1,
- (gchar *) "get_record",
- (GDBusArgInfo **) &_cal_dbus_method_info_get_record_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_get_record_OUT_ARG_pointers,
- NULL
- },
- "handle-get-record",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_all_records_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_all_records_IN_ARG_view_uri =
-{
- {
- -1,
- (gchar *) "view_uri",
- (gchar *) "s",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_all_records_IN_ARG_offset =
-{
- {
- -1,
- (gchar *) "offset",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_all_records_IN_ARG_limit =
-{
- {
- -1,
- (gchar *) "limit",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_all_records_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_all_records_IN_ARG_handle,
- &_cal_dbus_method_info_get_all_records_IN_ARG_view_uri,
- &_cal_dbus_method_info_get_all_records_IN_ARG_offset,
- &_cal_dbus_method_info_get_all_records_IN_ARG_limit,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_all_records_OUT_ARG_list =
-{
- {
- -1,
- (gchar *) "list",
- (gchar *) "(iv)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_all_records_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_all_records_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_all_records_OUT_ARG_list,
- &_cal_dbus_method_info_get_all_records_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_all_records =
-{
- {
- -1,
- (gchar *) "get_all_records",
- (GDBusArgInfo **) &_cal_dbus_method_info_get_all_records_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_get_all_records_OUT_ARG_pointers,
- NULL
- },
- "handle-get-all-records",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_records_with_query_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_records_with_query_IN_ARG_query =
-{
- {
- -1,
- (gchar *) "query",
- (gchar *) "(siviviii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_records_with_query_IN_ARG_offset =
-{
- {
- -1,
- (gchar *) "offset",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_records_with_query_IN_ARG_limit =
-{
- {
- -1,
- (gchar *) "limit",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_records_with_query_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_records_with_query_IN_ARG_handle,
- &_cal_dbus_method_info_get_records_with_query_IN_ARG_query,
- &_cal_dbus_method_info_get_records_with_query_IN_ARG_offset,
- &_cal_dbus_method_info_get_records_with_query_IN_ARG_limit,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_records_with_query_OUT_ARG_list =
-{
- {
- -1,
- (gchar *) "list",
- (gchar *) "(iv)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_records_with_query_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_records_with_query_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_records_with_query_OUT_ARG_list,
- &_cal_dbus_method_info_get_records_with_query_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_records_with_query =
-{
- {
- -1,
- (gchar *) "get_records_with_query",
- (GDBusArgInfo **) &_cal_dbus_method_info_get_records_with_query_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_get_records_with_query_OUT_ARG_pointers,
- NULL
- },
- "handle-get-records-with-query",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_IN_ARG_view_uri =
-{
- {
- -1,
- (gchar *) "view_uri",
- (gchar *) "s",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_count_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_count_IN_ARG_handle,
- &_cal_dbus_method_info_get_count_IN_ARG_view_uri,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_OUT_ARG_count =
-{
- {
- -1,
- (gchar *) "count",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_count_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_count_OUT_ARG_ret,
- &_cal_dbus_method_info_get_count_OUT_ARG_count,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_count =
-{
- {
- -1,
- (gchar *) "get_count",
- (GDBusArgInfo **) &_cal_dbus_method_info_get_count_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_get_count_OUT_ARG_pointers,
- NULL
- },
- "handle-get-count",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_with_query_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_with_query_IN_ARG_query =
-{
- {
- -1,
- (gchar *) "query",
- (gchar *) "(siviviii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_count_with_query_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_count_with_query_IN_ARG_handle,
- &_cal_dbus_method_info_get_count_with_query_IN_ARG_query,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_with_query_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_count_with_query_OUT_ARG_count =
-{
- {
- -1,
- (gchar *) "count",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_count_with_query_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_count_with_query_OUT_ARG_ret,
- &_cal_dbus_method_info_get_count_with_query_OUT_ARG_count,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_count_with_query =
-{
- {
- -1,
- (gchar *) "get_count_with_query",
- (GDBusArgInfo **) &_cal_dbus_method_info_get_count_with_query_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_get_count_with_query_OUT_ARG_pointers,
- NULL
- },
- "handle-get-count-with-query",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_current_version_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_current_version_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_current_version_IN_ARG_handle,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_current_version_OUT_ARG_version =
-{
- {
- -1,
- (gchar *) "version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_current_version_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_current_version_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_current_version_OUT_ARG_version,
- &_cal_dbus_method_info_get_current_version_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_current_version =
-{
- {
- -1,
- (gchar *) "get_current_version",
- (GDBusArgInfo **) &_cal_dbus_method_info_get_current_version_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_get_current_version_OUT_ARG_pointers,
- NULL
- },
- "handle-get-current-version",
- FALSE
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_add_changed_cb =
-{
- {
- -1,
- (gchar *) "add_changed_cb",
- NULL,
- NULL,
- NULL
- },
- "handle-add-changed-cb",
- FALSE
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_remove_changed_cb =
-{
- {
- -1,
- (gchar *) "remove_changed_cb",
- NULL,
- NULL,
- NULL
- },
- "handle-remove-changed-cb",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_IN_ARG_view_uri =
-{
- {
- -1,
- (gchar *) "view_uri",
- (gchar *) "s",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_IN_ARG_book_id =
-{
- {
- -1,
- (gchar *) "book_id",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_IN_ARG_db_version =
-{
- {
- -1,
- (gchar *) "db_version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_changes_by_version_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_changes_by_version_IN_ARG_handle,
- &_cal_dbus_method_info_get_changes_by_version_IN_ARG_view_uri,
- &_cal_dbus_method_info_get_changes_by_version_IN_ARG_book_id,
- &_cal_dbus_method_info_get_changes_by_version_IN_ARG_db_version,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_OUT_ARG_list =
-{
- {
- -1,
- (gchar *) "list",
- (gchar *) "(iv)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_OUT_ARG_version =
-{
- {
- -1,
- (gchar *) "version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_by_version_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_changes_by_version_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_changes_by_version_OUT_ARG_list,
- &_cal_dbus_method_info_get_changes_by_version_OUT_ARG_version,
- &_cal_dbus_method_info_get_changes_by_version_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_changes_by_version =
-{
- {
- -1,
- (gchar *) "get_changes_by_version",
- (GDBusArgInfo **) &_cal_dbus_method_info_get_changes_by_version_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_get_changes_by_version_OUT_ARG_pointers,
- NULL
- },
- "handle-get-changes-by-version",
- FALSE
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_last_change_version =
-{
- {
- -1,
- (gchar *) "get_last_change_version",
- NULL,
- NULL,
- NULL
- },
- "handle-get-last-change-version",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_view_uri =
-{
- {
- -1,
- (gchar *) "view_uri",
- (gchar *) "s",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_parent_id =
-{
- {
- -1,
- (gchar *) "parent_id",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_db_version =
-{
- {
- -1,
- (gchar *) "db_version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_handle,
- &_cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_view_uri,
- &_cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_parent_id,
- &_cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_db_version,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_exception_by_version_OUT_ARG_list =
-{
- {
- -1,
- (gchar *) "list",
- (gchar *) "(iv)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_get_changes_exception_by_version_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_get_changes_exception_by_version_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_get_changes_exception_by_version_OUT_ARG_list,
- &_cal_dbus_method_info_get_changes_exception_by_version_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_get_changes_exception_by_version =
-{
- {
- -1,
- (gchar *) "get_changes_exception_by_version",
- (GDBusArgInfo **) &_cal_dbus_method_info_get_changes_exception_by_version_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_get_changes_exception_by_version_OUT_ARG_pointers,
- NULL
- },
- "handle-get-changes-exception-by-version",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_clean_after_sync_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_clean_after_sync_IN_ARG_book_id =
-{
- {
- -1,
- (gchar *) "book_id",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_clean_after_sync_IN_ARG_db_version =
-{
- {
- -1,
- (gchar *) "db_version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_clean_after_sync_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_clean_after_sync_IN_ARG_handle,
- &_cal_dbus_method_info_clean_after_sync_IN_ARG_book_id,
- &_cal_dbus_method_info_clean_after_sync_IN_ARG_db_version,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_clean_after_sync_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_clean_after_sync_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_clean_after_sync_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_clean_after_sync =
-{
- {
- -1,
- (gchar *) "clean_after_sync",
- (GDBusArgInfo **) &_cal_dbus_method_info_clean_after_sync_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_clean_after_sync_OUT_ARG_pointers,
- NULL
- },
- "handle-clean-after-sync",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_vcalendars_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_vcalendars_IN_ARG_stream =
-{
- {
- -1,
- (gchar *) "stream",
- (gchar *) "s",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_insert_vcalendars_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_insert_vcalendars_IN_ARG_handle,
- &_cal_dbus_method_info_insert_vcalendars_IN_ARG_stream,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_vcalendars_OUT_ARG_ids =
-{
- {
- -1,
- (gchar *) "ids",
- (gchar *) "ai",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_vcalendars_OUT_ARG_count =
-{
- {
- -1,
- (gchar *) "count",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_vcalendars_OUT_ARG_version =
-{
- {
- -1,
- (gchar *) "version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_insert_vcalendars_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_insert_vcalendars_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_insert_vcalendars_OUT_ARG_ids,
- &_cal_dbus_method_info_insert_vcalendars_OUT_ARG_count,
- &_cal_dbus_method_info_insert_vcalendars_OUT_ARG_version,
- &_cal_dbus_method_info_insert_vcalendars_OUT_ARG_ret,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_insert_vcalendars =
-{
- {
- -1,
- (gchar *) "insert_vcalendars",
- (GDBusArgInfo **) &_cal_dbus_method_info_insert_vcalendars_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_insert_vcalendars_OUT_ARG_pointers,
- NULL
- },
- "handle-insert-vcalendars",
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_vcalendars_IN_ARG_handle =
-{
- {
- -1,
- (gchar *) "handle",
- (gchar *) "(ii)",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_vcalendars_IN_ARG_stream =
-{
- {
- -1,
- (gchar *) "stream",
- (gchar *) "s",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_vcalendars_IN_ARG_ids =
-{
- {
- -1,
- (gchar *) "ids",
- (gchar *) "ai",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_vcalendars_IN_ARG_count =
-{
- {
- -1,
- (gchar *) "count",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_replace_vcalendars_IN_ARG_pointers[] =
-{
- &_cal_dbus_method_info_replace_vcalendars_IN_ARG_handle,
- &_cal_dbus_method_info_replace_vcalendars_IN_ARG_stream,
- &_cal_dbus_method_info_replace_vcalendars_IN_ARG_ids,
- &_cal_dbus_method_info_replace_vcalendars_IN_ARG_count,
- NULL
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_vcalendars_OUT_ARG_ret =
-{
- {
- -1,
- (gchar *) "ret",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo _cal_dbus_method_info_replace_vcalendars_OUT_ARG_version =
-{
- {
- -1,
- (gchar *) "version",
- (gchar *) "i",
- NULL
- },
- FALSE
-};
-
-static const _ExtendedGDBusArgInfo * const _cal_dbus_method_info_replace_vcalendars_OUT_ARG_pointers[] =
-{
- &_cal_dbus_method_info_replace_vcalendars_OUT_ARG_ret,
- &_cal_dbus_method_info_replace_vcalendars_OUT_ARG_version,
- NULL
-};
-
-static const _ExtendedGDBusMethodInfo _cal_dbus_method_info_replace_vcalendars =
-{
- {
- -1,
- (gchar *) "replace_vcalendars",
- (GDBusArgInfo **) &_cal_dbus_method_info_replace_vcalendars_IN_ARG_pointers,
- (GDBusArgInfo **) &_cal_dbus_method_info_replace_vcalendars_OUT_ARG_pointers,
- NULL
- },
- "handle-replace-vcalendars",
- FALSE
-};
-
-static const _ExtendedGDBusMethodInfo * const _cal_dbus_method_info_pointers[] =
-{
- &_cal_dbus_method_info_register_resource,
- &_cal_dbus_method_info_unregister_resource,
- &_cal_dbus_method_info_insert_record,
- &_cal_dbus_method_info_update_record,
- &_cal_dbus_method_info_delete_record,
- &_cal_dbus_method_info_replace_record,
- &_cal_dbus_method_info_insert_records,
- &_cal_dbus_method_info_update_records,
- &_cal_dbus_method_info_delete_records,
- &_cal_dbus_method_info_replace_records,
- &_cal_dbus_method_info_get_record,
- &_cal_dbus_method_info_get_all_records,
- &_cal_dbus_method_info_get_records_with_query,
- &_cal_dbus_method_info_get_count,
- &_cal_dbus_method_info_get_count_with_query,
- &_cal_dbus_method_info_get_current_version,
- &_cal_dbus_method_info_add_changed_cb,
- &_cal_dbus_method_info_remove_changed_cb,
- &_cal_dbus_method_info_get_changes_by_version,
- &_cal_dbus_method_info_get_last_change_version,
- &_cal_dbus_method_info_get_changes_exception_by_version,
- &_cal_dbus_method_info_clean_after_sync,
- &_cal_dbus_method_info_insert_vcalendars,
- &_cal_dbus_method_info_replace_vcalendars,
- NULL
-};
-
-static const _ExtendedGDBusInterfaceInfo _cal_dbus_interface_info =
-{
- {
- -1,
- (gchar *) "org.tizen.calendar_service.dbus",
- (GDBusMethodInfo **) &_cal_dbus_method_info_pointers,
- NULL,
- NULL,
- NULL
- },
- "dbus",
-};
-
-
-/**
- * cal_dbus_interface_info:
- *
- * Gets a machine-readable description of the <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link> D-Bus interface.
- *
- * Returns: (transfer none): A #GDBusInterfaceInfo. Do not free.
- */
-GDBusInterfaceInfo *
-cal_dbus_interface_info (void)
-{
- return (GDBusInterfaceInfo *) &_cal_dbus_interface_info.parent_struct;
-}
-
-/**
- * cal_dbus_override_properties:
- * @klass: The class structure for a #GObject<!-- -->-derived class.
- * @property_id_begin: The property id to assign to the first overridden property.
- *
- * Overrides all #GObject properties in the #calDbus interface for a concrete class.
- * The properties are overridden in the order they are defined.
- *
- * Returns: The last property id.
- */
-guint
-cal_dbus_override_properties (GObjectClass *klass, guint property_id_begin)
-{
- return property_id_begin - 1;
-}
-
-
-
-/**
- * calDbus:
- *
- * Abstract interface type for the D-Bus interface <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link>.
- */
-
-/**
- * calDbusIface:
- * @parent_iface: The parent interface.
- * @handle_add_changed_cb: Handler for the #calDbus::handle-add-changed-cb signal.
- * @handle_clean_after_sync: Handler for the #calDbus::handle-clean-after-sync signal.
- * @handle_delete_record: Handler for the #calDbus::handle-delete-record signal.
- * @handle_delete_records: Handler for the #calDbus::handle-delete-records signal.
- * @handle_get_all_records: Handler for the #calDbus::handle-get-all-records signal.
- * @handle_get_changes_by_version: Handler for the #calDbus::handle-get-changes-by-version signal.
- * @handle_get_changes_exception_by_version: Handler for the #calDbus::handle-get-changes-exception-by-version signal.
- * @handle_get_count: Handler for the #calDbus::handle-get-count signal.
- * @handle_get_count_with_query: Handler for the #calDbus::handle-get-count-with-query signal.
- * @handle_get_current_version: Handler for the #calDbus::handle-get-current-version signal.
- * @handle_get_last_change_version: Handler for the #calDbus::handle-get-last-change-version signal.
- * @handle_get_record: Handler for the #calDbus::handle-get-record signal.
- * @handle_get_records_with_query: Handler for the #calDbus::handle-get-records-with-query signal.
- * @handle_insert_record: Handler for the #calDbus::handle-insert-record signal.
- * @handle_insert_records: Handler for the #calDbus::handle-insert-records signal.
- * @handle_insert_vcalendars: Handler for the #calDbus::handle-insert-vcalendars signal.
- * @handle_register_resource: Handler for the #calDbus::handle-register-resource signal.
- * @handle_remove_changed_cb: Handler for the #calDbus::handle-remove-changed-cb signal.
- * @handle_replace_record: Handler for the #calDbus::handle-replace-record signal.
- * @handle_replace_records: Handler for the #calDbus::handle-replace-records signal.
- * @handle_replace_vcalendars: Handler for the #calDbus::handle-replace-vcalendars signal.
- * @handle_unregister_resource: Handler for the #calDbus::handle-unregister-resource signal.
- * @handle_update_record: Handler for the #calDbus::handle-update-record signal.
- * @handle_update_records: Handler for the #calDbus::handle-update-records signal.
- *
- * Virtual table for the D-Bus interface <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link>.
- */
-
-typedef calDbusIface calDbusInterface;
-G_DEFINE_INTERFACE (calDbus, cal_dbus, G_TYPE_OBJECT);
-
-static void
-cal_dbus_default_init (calDbusIface *iface)
-{
- /* GObject signals for incoming D-Bus method calls: */
- /**
- * calDbus::handle-register-resource:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.register_resource">register_resource()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_register_resource() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-register-resource",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_register_resource),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
-
- /**
- * calDbus::handle-unregister-resource:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.unregister_resource">unregister_resource()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_unregister_resource() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-unregister-resource",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_unregister_resource),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
-
- /**
- * calDbus::handle-insert-record:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_record: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_record">insert_record()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_insert_record() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-insert-record",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_insert_record),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);
-
- /**
- * calDbus::handle-update-record:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_record: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_record">update_record()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_update_record() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-update-record",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_update_record),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);
-
- /**
- * calDbus::handle-delete-record:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_view_uri: Argument passed by remote caller.
- * @arg_id: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_record">delete_record()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_delete_record() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-delete-record",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_delete_record),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 4,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_INT);
-
- /**
- * calDbus::handle-replace-record:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_record: Argument passed by remote caller.
- * @arg_id: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_record">replace_record()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_replace_record() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-replace-record",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_replace_record),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 4,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT, G_TYPE_INT);
-
- /**
- * calDbus::handle-insert-records:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_list: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_records">insert_records()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_insert_records() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-insert-records",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_insert_records),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);
-
- /**
- * calDbus::handle-update-records:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_list: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_records">update_records()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_update_records() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-update-records",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_update_records),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);
-
- /**
- * calDbus::handle-delete-records:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_view_uri: Argument passed by remote caller.
- * @arg_ids: Argument passed by remote caller.
- * @arg_count: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_records">delete_records()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_delete_records() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-delete-records",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_delete_records),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 5,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_INT);
-
- /**
- * calDbus::handle-replace-records:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_list: Argument passed by remote caller.
- * @arg_ids: Argument passed by remote caller.
- * @arg_count: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_records">replace_records()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_replace_records() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-replace-records",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_replace_records),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 5,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT, G_TYPE_VARIANT, G_TYPE_INT);
-
- /**
- * calDbus::handle-get-record:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_view_uri: Argument passed by remote caller.
- * @arg_id: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_record">get_record()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_record() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-get-record",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_get_record),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 4,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_INT);
-
- /**
- * calDbus::handle-get-all-records:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_view_uri: Argument passed by remote caller.
- * @arg_offset: Argument passed by remote caller.
- * @arg_limit: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_all_records">get_all_records()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_all_records() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-get-all-records",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_get_all_records),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 5,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT);
-
- /**
- * calDbus::handle-get-records-with-query:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_query: Argument passed by remote caller.
- * @arg_offset: Argument passed by remote caller.
- * @arg_limit: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_records_with_query">get_records_with_query()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_records_with_query() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-get-records-with-query",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_get_records_with_query),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 5,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT, G_TYPE_INT, G_TYPE_INT);
-
- /**
- * calDbus::handle-get-count:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_view_uri: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count">get_count()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_count() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-get-count",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_get_count),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING);
-
- /**
- * calDbus::handle-get-count-with-query:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_query: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count_with_query">get_count_with_query()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_count_with_query() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-get-count-with-query",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_get_count_with_query),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_VARIANT);
-
- /**
- * calDbus::handle-get-current-version:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_current_version">get_current_version()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_current_version() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-get-current-version",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_get_current_version),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT);
-
- /**
- * calDbus::handle-add-changed-cb:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.add_changed_cb">add_changed_cb()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_add_changed_cb() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-add-changed-cb",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_add_changed_cb),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
-
- /**
- * calDbus::handle-remove-changed-cb:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.remove_changed_cb">remove_changed_cb()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_remove_changed_cb() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-remove-changed-cb",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_remove_changed_cb),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
-
- /**
- * calDbus::handle-get-changes-by-version:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_view_uri: Argument passed by remote caller.
- * @arg_book_id: Argument passed by remote caller.
- * @arg_db_version: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_by_version">get_changes_by_version()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_changes_by_version() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-get-changes-by-version",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_get_changes_by_version),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 5,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT);
-
- /**
- * calDbus::handle-get-last-change-version:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_last_change_version">get_last_change_version()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_last_change_version() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-get-last-change-version",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_get_last_change_version),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
-
- /**
- * calDbus::handle-get-changes-exception-by-version:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_view_uri: Argument passed by remote caller.
- * @arg_parent_id: Argument passed by remote caller.
- * @arg_db_version: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_exception_by_version">get_changes_exception_by_version()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_get_changes_exception_by_version() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-get-changes-exception-by-version",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_get_changes_exception_by_version),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 5,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT);
-
- /**
- * calDbus::handle-clean-after-sync:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_book_id: Argument passed by remote caller.
- * @arg_db_version: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.clean_after_sync">clean_after_sync()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_clean_after_sync() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-clean-after-sync",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_clean_after_sync),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 4,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_INT, G_TYPE_INT);
-
- /**
- * calDbus::handle-insert-vcalendars:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_stream: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_vcalendars">insert_vcalendars()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_insert_vcalendars() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-insert-vcalendars",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_insert_vcalendars),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING);
-
- /**
- * calDbus::handle-replace-vcalendars:
- * @object: A #calDbus.
- * @invocation: A #GDBusMethodInvocation.
- * @arg_handle: Argument passed by remote caller.
- * @arg_stream: Argument passed by remote caller.
- * @arg_ids: Argument passed by remote caller.
- * @arg_count: Argument passed by remote caller.
- *
- * Signal emitted when a remote caller is invoking the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_vcalendars">replace_vcalendars()</link> D-Bus method.
- *
- * If a signal handler returns %TRUE, it means the signal handler will handle the invocation (e.g. take a reference to @invocation and eventually call cal_dbus_complete_replace_vcalendars() or e.g. g_dbus_method_invocation_return_error() on it) and no order signal handlers will run. If no signal handler handles the invocation, the %G_DBUS_ERROR_UNKNOWN_METHOD error is returned.
- *
- * Returns: %TRUE if the invocation was handled, %FALSE to let other signal handlers run.
- */
- g_signal_new ("handle-replace-vcalendars",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (calDbusIface, handle_replace_vcalendars),
- g_signal_accumulator_true_handled,
- NULL,
- g_cclosure_marshal_generic,
- G_TYPE_BOOLEAN,
- 5,
- G_TYPE_DBUS_METHOD_INVOCATION, G_TYPE_VARIANT, G_TYPE_STRING, G_TYPE_VARIANT, G_TYPE_INT);
-
-}
-
-/**
- * cal_dbus_call_register_resource:
- * @proxy: A #calDbusProxy.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.register_resource">register_resource()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_register_resource_finish() to get the result of the operation.
- *
- * See cal_dbus_call_register_resource_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_register_resource (
- calDbus *proxy,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "register_resource",
- g_variant_new ("()"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_register_resource_finish:
- * @proxy: A #calDbusProxy.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_register_resource().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_register_resource().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_register_resource_finish (
- calDbus *proxy,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(i)",
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_register_resource_sync:
- * @proxy: A #calDbusProxy.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.register_resource">register_resource()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_register_resource() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_register_resource_sync (
- calDbus *proxy,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "register_resource",
- g_variant_new ("()"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(i)",
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_unregister_resource:
- * @proxy: A #calDbusProxy.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.unregister_resource">unregister_resource()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_unregister_resource_finish() to get the result of the operation.
- *
- * See cal_dbus_call_unregister_resource_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_unregister_resource (
- calDbus *proxy,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "unregister_resource",
- g_variant_new ("()"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_unregister_resource_finish:
- * @proxy: A #calDbusProxy.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_unregister_resource().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_unregister_resource().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_unregister_resource_finish (
- calDbus *proxy,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(i)",
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_unregister_resource_sync:
- * @proxy: A #calDbusProxy.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.unregister_resource">unregister_resource()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_unregister_resource() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_unregister_resource_sync (
- calDbus *proxy,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "unregister_resource",
- g_variant_new ("()"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(i)",
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_insert_record:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_record: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_record">insert_record()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_insert_record_finish() to get the result of the operation.
- *
- * See cal_dbus_call_insert_record_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_insert_record (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_record,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "insert_record",
- g_variant_new ("(@(ii)@(iv))",
- arg_handle,
- arg_record),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_insert_record_finish:
- * @proxy: A #calDbusProxy.
- * @out_id: (out): Return location for return parameter or %NULL to ignore.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_insert_record().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_insert_record().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_insert_record_finish (
- calDbus *proxy,
- gint *out_id,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(iii)",
- out_id,
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_insert_record_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_record: Argument to pass with the method invocation.
- * @out_id: (out): Return location for return parameter or %NULL to ignore.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_record">insert_record()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_insert_record() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_insert_record_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_record,
- gint *out_id,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "insert_record",
- g_variant_new ("(@(ii)@(iv))",
- arg_handle,
- arg_record),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(iii)",
- out_id,
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_update_record:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_record: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_record">update_record()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_update_record_finish() to get the result of the operation.
- *
- * See cal_dbus_call_update_record_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_update_record (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_record,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "update_record",
- g_variant_new ("(@(ii)@(iv))",
- arg_handle,
- arg_record),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_update_record_finish:
- * @proxy: A #calDbusProxy.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_update_record().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_update_record().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_update_record_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_update_record_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_record: Argument to pass with the method invocation.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_record">update_record()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_update_record() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_update_record_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_record,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "update_record",
- g_variant_new ("(@(ii)@(iv))",
- arg_handle,
- arg_record),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_delete_record:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @arg_id: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_record">delete_record()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_delete_record_finish() to get the result of the operation.
- *
- * See cal_dbus_call_delete_record_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_delete_record (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_id,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "delete_record",
- g_variant_new ("(@(ii)si)",
- arg_handle,
- arg_view_uri,
- arg_id),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_delete_record_finish:
- * @proxy: A #calDbusProxy.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_delete_record().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_delete_record().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_delete_record_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_delete_record_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @arg_id: Argument to pass with the method invocation.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_record">delete_record()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_delete_record() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_delete_record_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_id,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "delete_record",
- g_variant_new ("(@(ii)si)",
- arg_handle,
- arg_view_uri,
- arg_id),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_replace_record:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_record: Argument to pass with the method invocation.
- * @arg_id: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_record">replace_record()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_replace_record_finish() to get the result of the operation.
- *
- * See cal_dbus_call_replace_record_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_replace_record (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_record,
- gint arg_id,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "replace_record",
- g_variant_new ("(@(ii)@(iv)i)",
- arg_handle,
- arg_record,
- arg_id),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_replace_record_finish:
- * @proxy: A #calDbusProxy.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_replace_record().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_replace_record().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_replace_record_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_replace_record_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_record: Argument to pass with the method invocation.
- * @arg_id: Argument to pass with the method invocation.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_record">replace_record()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_replace_record() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_replace_record_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_record,
- gint arg_id,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "replace_record",
- g_variant_new ("(@(ii)@(iv)i)",
- arg_handle,
- arg_record,
- arg_id),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_insert_records:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_list: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_records">insert_records()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_insert_records_finish() to get the result of the operation.
- *
- * See cal_dbus_call_insert_records_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_insert_records (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_list,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "insert_records",
- g_variant_new ("(@(ii)@(iv))",
- arg_handle,
- arg_list),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_insert_records_finish:
- * @proxy: A #calDbusProxy.
- * @out_ids: (out): Return location for return parameter or %NULL to ignore.
- * @out_count: (out): Return location for return parameter or %NULL to ignore.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_insert_records().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_insert_records().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_insert_records_finish (
- calDbus *proxy,
- GVariant **out_ids,
- gint *out_count,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@aiiii)",
- out_ids,
- out_count,
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_insert_records_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_list: Argument to pass with the method invocation.
- * @out_ids: (out): Return location for return parameter or %NULL to ignore.
- * @out_count: (out): Return location for return parameter or %NULL to ignore.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_records">insert_records()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_insert_records() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_insert_records_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_list,
- GVariant **out_ids,
- gint *out_count,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "insert_records",
- g_variant_new ("(@(ii)@(iv))",
- arg_handle,
- arg_list),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@aiiii)",
- out_ids,
- out_count,
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_update_records:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_list: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_records">update_records()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_update_records_finish() to get the result of the operation.
- *
- * See cal_dbus_call_update_records_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_update_records (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_list,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "update_records",
- g_variant_new ("(@(ii)@(iv))",
- arg_handle,
- arg_list),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_update_records_finish:
- * @proxy: A #calDbusProxy.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_update_records().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_update_records().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_update_records_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_update_records_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_list: Argument to pass with the method invocation.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_records">update_records()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_update_records() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_update_records_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_list,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "update_records",
- g_variant_new ("(@(ii)@(iv))",
- arg_handle,
- arg_list),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_delete_records:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @arg_ids: Argument to pass with the method invocation.
- * @arg_count: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_records">delete_records()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_delete_records_finish() to get the result of the operation.
- *
- * See cal_dbus_call_delete_records_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_delete_records (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- GVariant *arg_ids,
- gint arg_count,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "delete_records",
- g_variant_new ("(@(ii)s@aii)",
- arg_handle,
- arg_view_uri,
- arg_ids,
- arg_count),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_delete_records_finish:
- * @proxy: A #calDbusProxy.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_delete_records().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_delete_records().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_delete_records_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_delete_records_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @arg_ids: Argument to pass with the method invocation.
- * @arg_count: Argument to pass with the method invocation.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_records">delete_records()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_delete_records() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_delete_records_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- GVariant *arg_ids,
- gint arg_count,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "delete_records",
- g_variant_new ("(@(ii)s@aii)",
- arg_handle,
- arg_view_uri,
- arg_ids,
- arg_count),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_replace_records:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_list: Argument to pass with the method invocation.
- * @arg_ids: Argument to pass with the method invocation.
- * @arg_count: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_records">replace_records()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_replace_records_finish() to get the result of the operation.
- *
- * See cal_dbus_call_replace_records_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_replace_records (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_list,
- GVariant *arg_ids,
- gint arg_count,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "replace_records",
- g_variant_new ("(@(ii)@(iv)@aii)",
- arg_handle,
- arg_list,
- arg_ids,
- arg_count),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_replace_records_finish:
- * @proxy: A #calDbusProxy.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_replace_records().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_replace_records().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_replace_records_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_replace_records_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_list: Argument to pass with the method invocation.
- * @arg_ids: Argument to pass with the method invocation.
- * @arg_count: Argument to pass with the method invocation.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_records">replace_records()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_replace_records() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_replace_records_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_list,
- GVariant *arg_ids,
- gint arg_count,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "replace_records",
- g_variant_new ("(@(ii)@(iv)@aii)",
- arg_handle,
- arg_list,
- arg_ids,
- arg_count),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_record:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @arg_id: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_record">get_record()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_get_record_finish() to get the result of the operation.
- *
- * See cal_dbus_call_get_record_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_get_record (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_id,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "get_record",
- g_variant_new ("(@(ii)si)",
- arg_handle,
- arg_view_uri,
- arg_id),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_get_record_finish:
- * @proxy: A #calDbusProxy.
- * @out_record: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_record().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_get_record().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_record_finish (
- calDbus *proxy,
- GVariant **out_record,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@(iv)i)",
- out_record,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_record_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @arg_id: Argument to pass with the method invocation.
- * @out_record: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_record">get_record()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_get_record() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_record_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_id,
- GVariant **out_record,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "get_record",
- g_variant_new ("(@(ii)si)",
- arg_handle,
- arg_view_uri,
- arg_id),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@(iv)i)",
- out_record,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_all_records:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @arg_offset: Argument to pass with the method invocation.
- * @arg_limit: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_all_records">get_all_records()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_get_all_records_finish() to get the result of the operation.
- *
- * See cal_dbus_call_get_all_records_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_get_all_records (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_offset,
- gint arg_limit,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "get_all_records",
- g_variant_new ("(@(ii)sii)",
- arg_handle,
- arg_view_uri,
- arg_offset,
- arg_limit),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_get_all_records_finish:
- * @proxy: A #calDbusProxy.
- * @out_list: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_all_records().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_get_all_records().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_all_records_finish (
- calDbus *proxy,
- GVariant **out_list,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@(iv)i)",
- out_list,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_all_records_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @arg_offset: Argument to pass with the method invocation.
- * @arg_limit: Argument to pass with the method invocation.
- * @out_list: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_all_records">get_all_records()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_get_all_records() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_all_records_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_offset,
- gint arg_limit,
- GVariant **out_list,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "get_all_records",
- g_variant_new ("(@(ii)sii)",
- arg_handle,
- arg_view_uri,
- arg_offset,
- arg_limit),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@(iv)i)",
- out_list,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_records_with_query:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_query: Argument to pass with the method invocation.
- * @arg_offset: Argument to pass with the method invocation.
- * @arg_limit: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_records_with_query">get_records_with_query()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_get_records_with_query_finish() to get the result of the operation.
- *
- * See cal_dbus_call_get_records_with_query_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_get_records_with_query (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_query,
- gint arg_offset,
- gint arg_limit,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "get_records_with_query",
- g_variant_new ("(@(ii)@(siviviii)ii)",
- arg_handle,
- arg_query,
- arg_offset,
- arg_limit),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_get_records_with_query_finish:
- * @proxy: A #calDbusProxy.
- * @out_list: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_records_with_query().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_get_records_with_query().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_records_with_query_finish (
- calDbus *proxy,
- GVariant **out_list,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@(iv)i)",
- out_list,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_records_with_query_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_query: Argument to pass with the method invocation.
- * @arg_offset: Argument to pass with the method invocation.
- * @arg_limit: Argument to pass with the method invocation.
- * @out_list: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_records_with_query">get_records_with_query()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_get_records_with_query() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_records_with_query_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_query,
- gint arg_offset,
- gint arg_limit,
- GVariant **out_list,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "get_records_with_query",
- g_variant_new ("(@(ii)@(siviviii)ii)",
- arg_handle,
- arg_query,
- arg_offset,
- arg_limit),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@(iv)i)",
- out_list,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_count:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count">get_count()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_get_count_finish() to get the result of the operation.
- *
- * See cal_dbus_call_get_count_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_get_count (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "get_count",
- g_variant_new ("(@(ii)s)",
- arg_handle,
- arg_view_uri),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_get_count_finish:
- * @proxy: A #calDbusProxy.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @out_count: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_count().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_get_count().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_count_finish (
- calDbus *proxy,
- gint *out_ret,
- gint *out_count,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_ret,
- out_count);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_count_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @out_count: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count">get_count()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_get_count() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_count_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint *out_ret,
- gint *out_count,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "get_count",
- g_variant_new ("(@(ii)s)",
- arg_handle,
- arg_view_uri),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_ret,
- out_count);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_count_with_query:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_query: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count_with_query">get_count_with_query()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_get_count_with_query_finish() to get the result of the operation.
- *
- * See cal_dbus_call_get_count_with_query_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_get_count_with_query (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_query,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "get_count_with_query",
- g_variant_new ("(@(ii)@(siviviii))",
- arg_handle,
- arg_query),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_get_count_with_query_finish:
- * @proxy: A #calDbusProxy.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @out_count: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_count_with_query().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_get_count_with_query().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_count_with_query_finish (
- calDbus *proxy,
- gint *out_ret,
- gint *out_count,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_ret,
- out_count);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_count_with_query_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_query: Argument to pass with the method invocation.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @out_count: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count_with_query">get_count_with_query()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_get_count_with_query() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_count_with_query_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_query,
- gint *out_ret,
- gint *out_count,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "get_count_with_query",
- g_variant_new ("(@(ii)@(siviviii))",
- arg_handle,
- arg_query),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_ret,
- out_count);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_current_version:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_current_version">get_current_version()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_get_current_version_finish() to get the result of the operation.
- *
- * See cal_dbus_call_get_current_version_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_get_current_version (
- calDbus *proxy,
- GVariant *arg_handle,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "get_current_version",
- g_variant_new ("(@(ii))",
- arg_handle),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_get_current_version_finish:
- * @proxy: A #calDbusProxy.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_current_version().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_get_current_version().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_current_version_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_current_version_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_current_version">get_current_version()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_get_current_version() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_current_version_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "get_current_version",
- g_variant_new ("(@(ii))",
- arg_handle),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_add_changed_cb:
- * @proxy: A #calDbusProxy.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.add_changed_cb">add_changed_cb()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_add_changed_cb_finish() to get the result of the operation.
- *
- * See cal_dbus_call_add_changed_cb_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_add_changed_cb (
- calDbus *proxy,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "add_changed_cb",
- g_variant_new ("()"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_add_changed_cb_finish:
- * @proxy: A #calDbusProxy.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_add_changed_cb().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_add_changed_cb().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_add_changed_cb_finish (
- calDbus *proxy,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "()");
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_add_changed_cb_sync:
- * @proxy: A #calDbusProxy.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.add_changed_cb">add_changed_cb()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_add_changed_cb() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_add_changed_cb_sync (
- calDbus *proxy,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "add_changed_cb",
- g_variant_new ("()"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "()");
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_remove_changed_cb:
- * @proxy: A #calDbusProxy.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.remove_changed_cb">remove_changed_cb()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_remove_changed_cb_finish() to get the result of the operation.
- *
- * See cal_dbus_call_remove_changed_cb_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_remove_changed_cb (
- calDbus *proxy,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "remove_changed_cb",
- g_variant_new ("()"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_remove_changed_cb_finish:
- * @proxy: A #calDbusProxy.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_remove_changed_cb().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_remove_changed_cb().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_remove_changed_cb_finish (
- calDbus *proxy,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "()");
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_remove_changed_cb_sync:
- * @proxy: A #calDbusProxy.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.remove_changed_cb">remove_changed_cb()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_remove_changed_cb() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_remove_changed_cb_sync (
- calDbus *proxy,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "remove_changed_cb",
- g_variant_new ("()"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "()");
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_changes_by_version:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @arg_book_id: Argument to pass with the method invocation.
- * @arg_db_version: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_by_version">get_changes_by_version()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_get_changes_by_version_finish() to get the result of the operation.
- *
- * See cal_dbus_call_get_changes_by_version_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_get_changes_by_version (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_book_id,
- gint arg_db_version,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "get_changes_by_version",
- g_variant_new ("(@(ii)sii)",
- arg_handle,
- arg_view_uri,
- arg_book_id,
- arg_db_version),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_get_changes_by_version_finish:
- * @proxy: A #calDbusProxy.
- * @out_list: (out): Return location for return parameter or %NULL to ignore.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_changes_by_version().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_get_changes_by_version().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_changes_by_version_finish (
- calDbus *proxy,
- GVariant **out_list,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@(iv)ii)",
- out_list,
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_changes_by_version_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @arg_book_id: Argument to pass with the method invocation.
- * @arg_db_version: Argument to pass with the method invocation.
- * @out_list: (out): Return location for return parameter or %NULL to ignore.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_by_version">get_changes_by_version()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_get_changes_by_version() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_changes_by_version_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_book_id,
- gint arg_db_version,
- GVariant **out_list,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "get_changes_by_version",
- g_variant_new ("(@(ii)sii)",
- arg_handle,
- arg_view_uri,
- arg_book_id,
- arg_db_version),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@(iv)ii)",
- out_list,
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_last_change_version:
- * @proxy: A #calDbusProxy.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_last_change_version">get_last_change_version()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_get_last_change_version_finish() to get the result of the operation.
- *
- * See cal_dbus_call_get_last_change_version_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_get_last_change_version (
- calDbus *proxy,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "get_last_change_version",
- g_variant_new ("()"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_get_last_change_version_finish:
- * @proxy: A #calDbusProxy.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_last_change_version().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_get_last_change_version().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_last_change_version_finish (
- calDbus *proxy,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "()");
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_last_change_version_sync:
- * @proxy: A #calDbusProxy.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_last_change_version">get_last_change_version()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_get_last_change_version() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_last_change_version_sync (
- calDbus *proxy,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "get_last_change_version",
- g_variant_new ("()"),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "()");
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_changes_exception_by_version:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @arg_parent_id: Argument to pass with the method invocation.
- * @arg_db_version: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_exception_by_version">get_changes_exception_by_version()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_get_changes_exception_by_version_finish() to get the result of the operation.
- *
- * See cal_dbus_call_get_changes_exception_by_version_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_get_changes_exception_by_version (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_parent_id,
- gint arg_db_version,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "get_changes_exception_by_version",
- g_variant_new ("(@(ii)sii)",
- arg_handle,
- arg_view_uri,
- arg_parent_id,
- arg_db_version),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_get_changes_exception_by_version_finish:
- * @proxy: A #calDbusProxy.
- * @out_list: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_get_changes_exception_by_version().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_get_changes_exception_by_version().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_changes_exception_by_version_finish (
- calDbus *proxy,
- GVariant **out_list,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@(iv)i)",
- out_list,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_get_changes_exception_by_version_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_view_uri: Argument to pass with the method invocation.
- * @arg_parent_id: Argument to pass with the method invocation.
- * @arg_db_version: Argument to pass with the method invocation.
- * @out_list: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_exception_by_version">get_changes_exception_by_version()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_get_changes_exception_by_version() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_get_changes_exception_by_version_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_parent_id,
- gint arg_db_version,
- GVariant **out_list,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "get_changes_exception_by_version",
- g_variant_new ("(@(ii)sii)",
- arg_handle,
- arg_view_uri,
- arg_parent_id,
- arg_db_version),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@(iv)i)",
- out_list,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_clean_after_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_book_id: Argument to pass with the method invocation.
- * @arg_db_version: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.clean_after_sync">clean_after_sync()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_clean_after_sync_finish() to get the result of the operation.
- *
- * See cal_dbus_call_clean_after_sync_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_clean_after_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- gint arg_book_id,
- gint arg_db_version,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "clean_after_sync",
- g_variant_new ("(@(ii)ii)",
- arg_handle,
- arg_book_id,
- arg_db_version),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_clean_after_sync_finish:
- * @proxy: A #calDbusProxy.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_clean_after_sync().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_clean_after_sync().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_clean_after_sync_finish (
- calDbus *proxy,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(i)",
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_clean_after_sync_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_book_id: Argument to pass with the method invocation.
- * @arg_db_version: Argument to pass with the method invocation.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.clean_after_sync">clean_after_sync()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_clean_after_sync() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_clean_after_sync_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- gint arg_book_id,
- gint arg_db_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "clean_after_sync",
- g_variant_new ("(@(ii)ii)",
- arg_handle,
- arg_book_id,
- arg_db_version),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(i)",
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_insert_vcalendars:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_stream: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_vcalendars">insert_vcalendars()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_insert_vcalendars_finish() to get the result of the operation.
- *
- * See cal_dbus_call_insert_vcalendars_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_insert_vcalendars (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_stream,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "insert_vcalendars",
- g_variant_new ("(@(ii)s)",
- arg_handle,
- arg_stream),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_insert_vcalendars_finish:
- * @proxy: A #calDbusProxy.
- * @out_ids: (out): Return location for return parameter or %NULL to ignore.
- * @out_count: (out): Return location for return parameter or %NULL to ignore.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_insert_vcalendars().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_insert_vcalendars().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_insert_vcalendars_finish (
- calDbus *proxy,
- GVariant **out_ids,
- gint *out_count,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@aiiii)",
- out_ids,
- out_count,
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_insert_vcalendars_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_stream: Argument to pass with the method invocation.
- * @out_ids: (out): Return location for return parameter or %NULL to ignore.
- * @out_count: (out): Return location for return parameter or %NULL to ignore.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_vcalendars">insert_vcalendars()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_insert_vcalendars() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_insert_vcalendars_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_stream,
- GVariant **out_ids,
- gint *out_count,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "insert_vcalendars",
- g_variant_new ("(@(ii)s)",
- arg_handle,
- arg_stream),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(@aiiii)",
- out_ids,
- out_count,
- out_version,
- out_ret);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_replace_vcalendars:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_stream: Argument to pass with the method invocation.
- * @arg_ids: Argument to pass with the method invocation.
- * @arg_count: Argument to pass with the method invocation.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied or %NULL.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_vcalendars">replace_vcalendars()</link> D-Bus method on @proxy.
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_call_replace_vcalendars_finish() to get the result of the operation.
- *
- * See cal_dbus_call_replace_vcalendars_sync() for the synchronous, blocking version of this method.
- */
-void
-cal_dbus_call_replace_vcalendars (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_stream,
- GVariant *arg_ids,
- gint arg_count,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_dbus_proxy_call (G_DBUS_PROXY (proxy),
- "replace_vcalendars",
- g_variant_new ("(@(ii)s@aii)",
- arg_handle,
- arg_stream,
- arg_ids,
- arg_count),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- callback,
- user_data);
-}
-
-/**
- * cal_dbus_call_replace_vcalendars_finish:
- * @proxy: A #calDbusProxy.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_call_replace_vcalendars().
- * @error: Return location for error or %NULL.
- *
- * Finishes an operation started with cal_dbus_call_replace_vcalendars().
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_replace_vcalendars_finish (
- calDbus *proxy,
- gint *out_ret,
- gint *out_version,
- GAsyncResult *res,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_finish (G_DBUS_PROXY (proxy), res, error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_ret,
- out_version);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_call_replace_vcalendars_sync:
- * @proxy: A #calDbusProxy.
- * @arg_handle: Argument to pass with the method invocation.
- * @arg_stream: Argument to pass with the method invocation.
- * @arg_ids: Argument to pass with the method invocation.
- * @arg_count: Argument to pass with the method invocation.
- * @out_ret: (out): Return location for return parameter or %NULL to ignore.
- * @out_version: (out): Return location for return parameter or %NULL to ignore.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL.
- *
- * Synchronously invokes the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_vcalendars">replace_vcalendars()</link> D-Bus method on @proxy. The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_call_replace_vcalendars() for the asynchronous version of this method.
- *
- * Returns: (skip): %TRUE if the call succeded, %FALSE if @error is set.
- */
-gboolean
-cal_dbus_call_replace_vcalendars_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_stream,
- GVariant *arg_ids,
- gint arg_count,
- gint *out_ret,
- gint *out_version,
- GCancellable *cancellable,
- GError **error)
-{
- GVariant *_ret;
- _ret = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
- "replace_vcalendars",
- g_variant_new ("(@(ii)s@aii)",
- arg_handle,
- arg_stream,
- arg_ids,
- arg_count),
- G_DBUS_CALL_FLAGS_NONE,
- -1,
- cancellable,
- error);
- if (_ret == NULL)
- goto _out;
- g_variant_get (_ret,
- "(ii)",
- out_ret,
- out_version);
- g_variant_unref (_ret);
-_out:
- return _ret != NULL;
-}
-
-/**
- * cal_dbus_complete_register_resource:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.register_resource">register_resource()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_register_resource (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(i)",
- ret));
-}
-
-/**
- * cal_dbus_complete_unregister_resource:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.unregister_resource">unregister_resource()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_unregister_resource (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(i)",
- ret));
-}
-
-/**
- * cal_dbus_complete_insert_record:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @id: Parameter to return.
- * @version: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_record">insert_record()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_insert_record (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint id,
- gint version,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(iii)",
- id,
- version,
- ret));
-}
-
-/**
- * cal_dbus_complete_update_record:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @version: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_record">update_record()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_update_record (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(ii)",
- version,
- ret));
-}
-
-/**
- * cal_dbus_complete_delete_record:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @version: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_record">delete_record()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_delete_record (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(ii)",
- version,
- ret));
-}
-
-/**
- * cal_dbus_complete_replace_record:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @version: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_record">replace_record()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_replace_record (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(ii)",
- version,
- ret));
-}
-
-/**
- * cal_dbus_complete_insert_records:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @ids: Parameter to return.
- * @count: Parameter to return.
- * @version: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_records">insert_records()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_insert_records (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *ids,
- gint count,
- gint version,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(@aiiii)",
- ids,
- count,
- version,
- ret));
-}
-
-/**
- * cal_dbus_complete_update_records:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @version: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.update_records">update_records()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_update_records (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(ii)",
- version,
- ret));
-}
-
-/**
- * cal_dbus_complete_delete_records:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @version: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.delete_records">delete_records()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_delete_records (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(ii)",
- version,
- ret));
-}
-
-/**
- * cal_dbus_complete_replace_records:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @version: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_records">replace_records()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_replace_records (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(ii)",
- version,
- ret));
-}
-
-/**
- * cal_dbus_complete_get_record:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @record: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_record">get_record()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_get_record (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *record,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(@(iv)i)",
- record,
- ret));
-}
-
-/**
- * cal_dbus_complete_get_all_records:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @list: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_all_records">get_all_records()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_get_all_records (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *list,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(@(iv)i)",
- list,
- ret));
-}
-
-/**
- * cal_dbus_complete_get_records_with_query:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @list: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_records_with_query">get_records_with_query()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_get_records_with_query (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *list,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(@(iv)i)",
- list,
- ret));
-}
-
-/**
- * cal_dbus_complete_get_count:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @ret: Parameter to return.
- * @count: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count">get_count()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_get_count (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint ret,
- gint count)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(ii)",
- ret,
- count));
-}
-
-/**
- * cal_dbus_complete_get_count_with_query:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @ret: Parameter to return.
- * @count: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_count_with_query">get_count_with_query()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_get_count_with_query (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint ret,
- gint count)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(ii)",
- ret,
- count));
-}
-
-/**
- * cal_dbus_complete_get_current_version:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @version: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_current_version">get_current_version()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_get_current_version (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(ii)",
- version,
- ret));
-}
-
-/**
- * cal_dbus_complete_add_changed_cb:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.add_changed_cb">add_changed_cb()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_add_changed_cb (
- calDbus *object,
- GDBusMethodInvocation *invocation)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("()"));
-}
-
-/**
- * cal_dbus_complete_remove_changed_cb:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.remove_changed_cb">remove_changed_cb()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_remove_changed_cb (
- calDbus *object,
- GDBusMethodInvocation *invocation)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("()"));
-}
-
-/**
- * cal_dbus_complete_get_changes_by_version:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @list: Parameter to return.
- * @version: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_by_version">get_changes_by_version()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_get_changes_by_version (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *list,
- gint version,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(@(iv)ii)",
- list,
- version,
- ret));
-}
-
-/**
- * cal_dbus_complete_get_last_change_version:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_last_change_version">get_last_change_version()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_get_last_change_version (
- calDbus *object,
- GDBusMethodInvocation *invocation)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("()"));
-}
-
-/**
- * cal_dbus_complete_get_changes_exception_by_version:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @list: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.get_changes_exception_by_version">get_changes_exception_by_version()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_get_changes_exception_by_version (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *list,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(@(iv)i)",
- list,
- ret));
-}
-
-/**
- * cal_dbus_complete_clean_after_sync:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.clean_after_sync">clean_after_sync()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_clean_after_sync (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(i)",
- ret));
-}
-
-/**
- * cal_dbus_complete_insert_vcalendars:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @ids: Parameter to return.
- * @count: Parameter to return.
- * @version: Parameter to return.
- * @ret: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.insert_vcalendars">insert_vcalendars()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_insert_vcalendars (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *ids,
- gint count,
- gint version,
- gint ret)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(@aiiii)",
- ids,
- count,
- version,
- ret));
-}
-
-/**
- * cal_dbus_complete_replace_vcalendars:
- * @object: A #calDbus.
- * @invocation: (transfer full): A #GDBusMethodInvocation.
- * @ret: Parameter to return.
- * @version: Parameter to return.
- *
- * Helper function used in service implementations to finish handling invocations of the <link linkend="gdbus-method-org-tizen-calendar_service-dbus.replace_vcalendars">replace_vcalendars()</link> D-Bus method. If you instead want to finish handling an invocation by returning an error, use g_dbus_method_invocation_return_error() or similar.
- *
- * This method will free @invocation, you cannot use it afterwards.
- */
-void
-cal_dbus_complete_replace_vcalendars (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint ret,
- gint version)
-{
- g_dbus_method_invocation_return_value (invocation,
- g_variant_new ("(ii)",
- ret,
- version));
-}
-
-/* ------------------------------------------------------------------------ */
-
-/**
- * calDbusProxy:
- *
- * The #calDbusProxy structure contains only private data and should only be accessed using the provided API.
- */
-
-/**
- * calDbusProxyClass:
- * @parent_class: The parent class.
- *
- * Class structure for #calDbusProxy.
- */
-
-struct _calDbusProxyPrivate
-{
- GData *qdata;
-};
-
-static void cal_dbus_proxy_iface_init (calDbusIface *iface);
-
-#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
-G_DEFINE_TYPE_WITH_CODE (calDbusProxy, cal_dbus_proxy, G_TYPE_DBUS_PROXY,
- G_ADD_PRIVATE (calDbusProxy)
- G_IMPLEMENT_INTERFACE (CAL_TYPE_DBUS, cal_dbus_proxy_iface_init));
-
-#else
-G_DEFINE_TYPE_WITH_CODE (calDbusProxy, cal_dbus_proxy, G_TYPE_DBUS_PROXY,
- G_IMPLEMENT_INTERFACE (CAL_TYPE_DBUS, cal_dbus_proxy_iface_init));
-
-#endif
-static void
-cal_dbus_proxy_finalize (GObject *object)
-{
- calDbusProxy *proxy = CAL_DBUS_PROXY (object);
- g_datalist_clear (&proxy->priv->qdata);
- G_OBJECT_CLASS (cal_dbus_proxy_parent_class)->finalize (object);
-}
-
-static void
-cal_dbus_proxy_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec G_GNUC_UNUSED)
-{
-}
-
-static void
-cal_dbus_proxy_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec G_GNUC_UNUSED)
-{
-}
-
-static void
-cal_dbus_proxy_g_signal (GDBusProxy *proxy,
- const gchar *sender_name G_GNUC_UNUSED,
- const gchar *signal_name,
- GVariant *parameters)
-{
- _ExtendedGDBusSignalInfo *info;
- GVariantIter iter;
- GVariant *child;
- GValue *paramv;
- guint num_params;
- guint n;
- guint signal_id;
- info = (_ExtendedGDBusSignalInfo *) g_dbus_interface_info_lookup_signal ((GDBusInterfaceInfo *) &_cal_dbus_interface_info.parent_struct, signal_name);
- if (info == NULL)
- return;
- num_params = g_variant_n_children (parameters);
- paramv = g_new0 (GValue, num_params + 1);
- g_value_init (¶mv[0], CAL_TYPE_DBUS);
- g_value_set_object (¶mv[0], proxy);
- g_variant_iter_init (&iter, parameters);
- n = 1;
- while ((child = g_variant_iter_next_value (&iter)) != NULL)
- {
- _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.args[n - 1];
- if (arg_info->use_gvariant)
- {
- g_value_init (¶mv[n], G_TYPE_VARIANT);
- g_value_set_variant (¶mv[n], child);
- n++;
- }
- else
- g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
- g_variant_unref (child);
- }
- signal_id = g_signal_lookup (info->signal_name, CAL_TYPE_DBUS);
- g_signal_emitv (paramv, signal_id, 0, NULL);
- for (n = 0; n < num_params + 1; n++)
- g_value_unset (¶mv[n]);
- g_free (paramv);
-}
-
-static void
-cal_dbus_proxy_g_properties_changed (GDBusProxy *_proxy,
- GVariant *changed_properties,
- const gchar *const *invalidated_properties)
-{
- calDbusProxy *proxy = CAL_DBUS_PROXY (_proxy);
- guint n;
- const gchar *key;
- GVariantIter *iter;
- _ExtendedGDBusPropertyInfo *info;
- g_variant_get (changed_properties, "a{sv}", &iter);
- while (g_variant_iter_next (iter, "{&sv}", &key, NULL))
- {
- info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_cal_dbus_interface_info.parent_struct, key);
- g_datalist_remove_data (&proxy->priv->qdata, key);
- if (info != NULL)
- g_object_notify (G_OBJECT (proxy), info->hyphen_name);
- }
- g_variant_iter_free (iter);
- for (n = 0; invalidated_properties[n] != NULL; n++)
- {
- info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_cal_dbus_interface_info.parent_struct, invalidated_properties[n]);
- g_datalist_remove_data (&proxy->priv->qdata, invalidated_properties[n]);
- if (info != NULL)
- g_object_notify (G_OBJECT (proxy), info->hyphen_name);
- }
-}
-
-static void
-cal_dbus_proxy_init (calDbusProxy *proxy)
-{
-#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
- proxy->priv = cal_dbus_proxy_get_instance_private (proxy);
-#else
- proxy->priv = G_TYPE_INSTANCE_GET_PRIVATE (proxy, CAL_TYPE_DBUS_PROXY, calDbusProxyPrivate);
-#endif
-
- g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy), cal_dbus_interface_info ());
-}
-
-static void
-cal_dbus_proxy_class_init (calDbusProxyClass *klass)
-{
- GObjectClass *gobject_class;
- GDBusProxyClass *proxy_class;
-
- gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = cal_dbus_proxy_finalize;
- gobject_class->get_property = cal_dbus_proxy_get_property;
- gobject_class->set_property = cal_dbus_proxy_set_property;
-
- proxy_class = G_DBUS_PROXY_CLASS (klass);
- proxy_class->g_signal = cal_dbus_proxy_g_signal;
- proxy_class->g_properties_changed = cal_dbus_proxy_g_properties_changed;
-
-#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
- g_type_class_add_private (klass, sizeof (calDbusProxyPrivate));
-#endif
-}
-
-static void
-cal_dbus_proxy_iface_init (calDbusIface *iface)
-{
-}
-
-/**
- * cal_dbus_proxy_new:
- * @connection: A #GDBusConnection.
- * @flags: Flags from the #GDBusProxyFlags enumeration.
- * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
- * @object_path: An object path.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
- * @user_data: User data to pass to @callback.
- *
- * Asynchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link>. See g_dbus_proxy_new() for more details.
- *
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_proxy_new_finish() to get the result of the operation.
- *
- * See cal_dbus_proxy_new_sync() for the synchronous, blocking version of this constructor.
- */
-void
-cal_dbus_proxy_new (
- GDBusConnection *connection,
- GDBusProxyFlags flags,
- const gchar *name,
- const gchar *object_path,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_async_initable_new_async (CAL_TYPE_DBUS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.tizen.calendar_service.dbus", NULL);
-}
-
-/**
- * cal_dbus_proxy_new_finish:
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_proxy_new().
- * @error: Return location for error or %NULL
- *
- * Finishes an operation started with cal_dbus_proxy_new().
- *
- * Returns: (transfer full) (type calDbusProxy): The constructed proxy object or %NULL if @error is set.
- */
-calDbus *
-cal_dbus_proxy_new_finish (
- GAsyncResult *res,
- GError **error)
-{
- GObject *ret;
- GObject *source_object;
- source_object = g_async_result_get_source_object (res);
- ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
- g_object_unref (source_object);
- if (ret != NULL)
- return CAL_DBUS (ret);
- else
- return NULL;
-}
-
-/**
- * cal_dbus_proxy_new_sync:
- * @connection: A #GDBusConnection.
- * @flags: Flags from the #GDBusProxyFlags enumeration.
- * @name: (allow-none): A bus name (well-known or unique) or %NULL if @connection is not a message bus connection.
- * @object_path: An object path.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL
- *
- * Synchronously creates a proxy for the D-Bus interface <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link>. See g_dbus_proxy_new_sync() for more details.
- *
- * The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_proxy_new() for the asynchronous version of this constructor.
- *
- * Returns: (transfer full) (type calDbusProxy): The constructed proxy object or %NULL if @error is set.
- */
-calDbus *
-cal_dbus_proxy_new_sync (
- GDBusConnection *connection,
- GDBusProxyFlags flags,
- const gchar *name,
- const gchar *object_path,
- GCancellable *cancellable,
- GError **error)
-{
- GInitable *ret;
- ret = g_initable_new (CAL_TYPE_DBUS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-connection", connection, "g-object-path", object_path, "g-interface-name", "org.tizen.calendar_service.dbus", NULL);
- if (ret != NULL)
- return CAL_DBUS (ret);
- else
- return NULL;
-}
-
-
-/**
- * cal_dbus_proxy_new_for_bus:
- * @bus_type: A #GBusType.
- * @flags: Flags from the #GDBusProxyFlags enumeration.
- * @name: A bus name (well-known or unique).
- * @object_path: An object path.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @callback: A #GAsyncReadyCallback to call when the request is satisfied.
- * @user_data: User data to pass to @callback.
- *
- * Like cal_dbus_proxy_new() but takes a #GBusType instead of a #GDBusConnection.
- *
- * When the operation is finished, @callback will be invoked in the <link linkend="g-main-context-push-thread-default">thread-default main loop</link> of the thread you are calling this method from.
- * You can then call cal_dbus_proxy_new_for_bus_finish() to get the result of the operation.
- *
- * See cal_dbus_proxy_new_for_bus_sync() for the synchronous, blocking version of this constructor.
- */
-void
-cal_dbus_proxy_new_for_bus (
- GBusType bus_type,
- GDBusProxyFlags flags,
- const gchar *name,
- const gchar *object_path,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- g_async_initable_new_async (CAL_TYPE_DBUS_PROXY, G_PRIORITY_DEFAULT, cancellable, callback, user_data, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.tizen.calendar_service.dbus", NULL);
-}
-
-/**
- * cal_dbus_proxy_new_for_bus_finish:
- * @res: The #GAsyncResult obtained from the #GAsyncReadyCallback passed to cal_dbus_proxy_new_for_bus().
- * @error: Return location for error or %NULL
- *
- * Finishes an operation started with cal_dbus_proxy_new_for_bus().
- *
- * Returns: (transfer full) (type calDbusProxy): The constructed proxy object or %NULL if @error is set.
- */
-calDbus *
-cal_dbus_proxy_new_for_bus_finish (
- GAsyncResult *res,
- GError **error)
-{
- GObject *ret;
- GObject *source_object;
- source_object = g_async_result_get_source_object (res);
- ret = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object), res, error);
- g_object_unref (source_object);
- if (ret != NULL)
- return CAL_DBUS (ret);
- else
- return NULL;
-}
-
-/**
- * cal_dbus_proxy_new_for_bus_sync:
- * @bus_type: A #GBusType.
- * @flags: Flags from the #GDBusProxyFlags enumeration.
- * @name: A bus name (well-known or unique).
- * @object_path: An object path.
- * @cancellable: (allow-none): A #GCancellable or %NULL.
- * @error: Return location for error or %NULL
- *
- * Like cal_dbus_proxy_new_sync() but takes a #GBusType instead of a #GDBusConnection.
- *
- * The calling thread is blocked until a reply is received.
- *
- * See cal_dbus_proxy_new_for_bus() for the asynchronous version of this constructor.
- *
- * Returns: (transfer full) (type calDbusProxy): The constructed proxy object or %NULL if @error is set.
- */
-calDbus *
-cal_dbus_proxy_new_for_bus_sync (
- GBusType bus_type,
- GDBusProxyFlags flags,
- const gchar *name,
- const gchar *object_path,
- GCancellable *cancellable,
- GError **error)
-{
- GInitable *ret;
- ret = g_initable_new (CAL_TYPE_DBUS_PROXY, cancellable, error, "g-flags", flags, "g-name", name, "g-bus-type", bus_type, "g-object-path", object_path, "g-interface-name", "org.tizen.calendar_service.dbus", NULL);
- if (ret != NULL)
- return CAL_DBUS (ret);
- else
- return NULL;
-}
-
-
-/* ------------------------------------------------------------------------ */
-
-/**
- * calDbusSkeleton:
- *
- * The #calDbusSkeleton structure contains only private data and should only be accessed using the provided API.
- */
-
-/**
- * calDbusSkeletonClass:
- * @parent_class: The parent class.
- *
- * Class structure for #calDbusSkeleton.
- */
-
-struct _calDbusSkeletonPrivate
-{
- GValue *properties;
- GList *changed_properties;
- GSource *changed_properties_idle_source;
- GMainContext *context;
- GMutex lock;
-};
-
-static void
-_cal_dbus_skeleton_handle_method_call (
- GDBusConnection *connection G_GNUC_UNUSED,
- const gchar *sender G_GNUC_UNUSED,
- const gchar *object_path G_GNUC_UNUSED,
- const gchar *interface_name,
- const gchar *method_name,
- GVariant *parameters,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- calDbusSkeleton *skeleton = CAL_DBUS_SKELETON (user_data);
- _ExtendedGDBusMethodInfo *info;
- GVariantIter iter;
- GVariant *child;
- GValue *paramv;
- guint num_params;
- guint num_extra;
- guint n;
- guint signal_id;
- GValue return_value = G_VALUE_INIT;
- info = (_ExtendedGDBusMethodInfo *) g_dbus_method_invocation_get_method_info (invocation);
- g_assert (info != NULL);
- num_params = g_variant_n_children (parameters);
- num_extra = info->pass_fdlist ? 3 : 2; paramv = g_new0 (GValue, num_params + num_extra);
- n = 0;
- g_value_init (¶mv[n], CAL_TYPE_DBUS);
- g_value_set_object (¶mv[n++], skeleton);
- g_value_init (¶mv[n], G_TYPE_DBUS_METHOD_INVOCATION);
- g_value_set_object (¶mv[n++], invocation);
- if (info->pass_fdlist)
- {
-#ifdef G_OS_UNIX
- g_value_init (¶mv[n], G_TYPE_UNIX_FD_LIST);
- g_value_set_object (¶mv[n++], g_dbus_message_get_unix_fd_list (g_dbus_method_invocation_get_message (invocation)));
-#else
- g_assert_not_reached ();
-#endif
- }
- g_variant_iter_init (&iter, parameters);
- while ((child = g_variant_iter_next_value (&iter)) != NULL)
- {
- _ExtendedGDBusArgInfo *arg_info = (_ExtendedGDBusArgInfo *) info->parent_struct.in_args[n - num_extra];
- if (arg_info->use_gvariant)
- {
- g_value_init (¶mv[n], G_TYPE_VARIANT);
- g_value_set_variant (¶mv[n], child);
- n++;
- }
- else
- g_dbus_gvariant_to_gvalue (child, ¶mv[n++]);
- g_variant_unref (child);
- }
- signal_id = g_signal_lookup (info->signal_name, CAL_TYPE_DBUS);
- g_value_init (&return_value, G_TYPE_BOOLEAN);
- g_signal_emitv (paramv, signal_id, 0, &return_value);
- if (!g_value_get_boolean (&return_value))
- g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD, "Method %s is not implemented on interface %s", method_name, interface_name);
- g_value_unset (&return_value);
- for (n = 0; n < num_params + num_extra; n++)
- g_value_unset (¶mv[n]);
- g_free (paramv);
-}
-
-static GVariant *
-_cal_dbus_skeleton_handle_get_property (
- GDBusConnection *connection G_GNUC_UNUSED,
- const gchar *sender G_GNUC_UNUSED,
- const gchar *object_path G_GNUC_UNUSED,
- const gchar *interface_name G_GNUC_UNUSED,
- const gchar *property_name,
- GError **error,
- gpointer user_data)
-{
- calDbusSkeleton *skeleton = CAL_DBUS_SKELETON (user_data);
- GValue value = G_VALUE_INIT;
- GParamSpec *pspec;
- _ExtendedGDBusPropertyInfo *info;
- GVariant *ret;
- ret = NULL;
- info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_cal_dbus_interface_info.parent_struct, property_name);
- g_assert (info != NULL);
- pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
- if (pspec == NULL)
- {
- g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
- }
- else
- {
- g_value_init (&value, pspec->value_type);
- g_object_get_property (G_OBJECT (skeleton), info->hyphen_name, &value);
- ret = g_dbus_gvalue_to_gvariant (&value, G_VARIANT_TYPE (info->parent_struct.signature));
- g_value_unset (&value);
- }
- return ret;
-}
-
-static gboolean
-_cal_dbus_skeleton_handle_set_property (
- GDBusConnection *connection G_GNUC_UNUSED,
- const gchar *sender G_GNUC_UNUSED,
- const gchar *object_path G_GNUC_UNUSED,
- const gchar *interface_name G_GNUC_UNUSED,
- const gchar *property_name,
- GVariant *variant,
- GError **error,
- gpointer user_data)
-{
- calDbusSkeleton *skeleton = CAL_DBUS_SKELETON (user_data);
- GValue value = G_VALUE_INIT;
- GParamSpec *pspec;
- _ExtendedGDBusPropertyInfo *info;
- gboolean ret;
- ret = FALSE;
- info = (_ExtendedGDBusPropertyInfo *) g_dbus_interface_info_lookup_property ((GDBusInterfaceInfo *) &_cal_dbus_interface_info.parent_struct, property_name);
- g_assert (info != NULL);
- pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (skeleton), info->hyphen_name);
- if (pspec == NULL)
- {
- g_set_error (error, G_DBUS_ERROR, G_DBUS_ERROR_INVALID_ARGS, "No property with name %s", property_name);
- }
- else
- {
- if (info->use_gvariant)
- g_value_set_variant (&value, variant);
- else
- g_dbus_gvariant_to_gvalue (variant, &value);
- g_object_set_property (G_OBJECT (skeleton), info->hyphen_name, &value);
- g_value_unset (&value);
- ret = TRUE;
- }
- return ret;
-}
-
-static const GDBusInterfaceVTable _cal_dbus_skeleton_vtable =
-{
- _cal_dbus_skeleton_handle_method_call,
- _cal_dbus_skeleton_handle_get_property,
- _cal_dbus_skeleton_handle_set_property,
- {NULL}
-};
-
-static GDBusInterfaceInfo *
-cal_dbus_skeleton_dbus_interface_get_info (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
-{
- return cal_dbus_interface_info ();
-}
-
-static GDBusInterfaceVTable *
-cal_dbus_skeleton_dbus_interface_get_vtable (GDBusInterfaceSkeleton *skeleton G_GNUC_UNUSED)
-{
- return (GDBusInterfaceVTable *) &_cal_dbus_skeleton_vtable;
-}
-
-static GVariant *
-cal_dbus_skeleton_dbus_interface_get_properties (GDBusInterfaceSkeleton *_skeleton)
-{
- calDbusSkeleton *skeleton = CAL_DBUS_SKELETON (_skeleton);
-
- GVariantBuilder builder;
- guint n;
- g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{sv}"));
- if (_cal_dbus_interface_info.parent_struct.properties == NULL)
- goto out;
- for (n = 0; _cal_dbus_interface_info.parent_struct.properties[n] != NULL; n++)
- {
- GDBusPropertyInfo *info = _cal_dbus_interface_info.parent_struct.properties[n];
- if (info->flags & G_DBUS_PROPERTY_INFO_FLAGS_READABLE)
- {
- GVariant *value;
- value = _cal_dbus_skeleton_handle_get_property (g_dbus_interface_skeleton_get_connection (G_DBUS_INTERFACE_SKELETON (skeleton)), NULL, g_dbus_interface_skeleton_get_object_path (G_DBUS_INTERFACE_SKELETON (skeleton)), "org.tizen.calendar_service.dbus", info->name, NULL, skeleton);
- if (value != NULL)
- {
- g_variant_take_ref (value);
- g_variant_builder_add (&builder, "{sv}", info->name, value);
- g_variant_unref (value);
- }
- }
- }
-out:
- return g_variant_builder_end (&builder);
-}
-
-static void
-cal_dbus_skeleton_dbus_interface_flush (GDBusInterfaceSkeleton *_skeleton)
-{
-}
-
-static void cal_dbus_skeleton_iface_init (calDbusIface *iface);
-#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
-G_DEFINE_TYPE_WITH_CODE (calDbusSkeleton, cal_dbus_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
- G_ADD_PRIVATE (calDbusSkeleton)
- G_IMPLEMENT_INTERFACE (CAL_TYPE_DBUS, cal_dbus_skeleton_iface_init));
-
-#else
-G_DEFINE_TYPE_WITH_CODE (calDbusSkeleton, cal_dbus_skeleton, G_TYPE_DBUS_INTERFACE_SKELETON,
- G_IMPLEMENT_INTERFACE (CAL_TYPE_DBUS, cal_dbus_skeleton_iface_init));
-
-#endif
-static void
-cal_dbus_skeleton_finalize (GObject *object)
-{
- calDbusSkeleton *skeleton = CAL_DBUS_SKELETON (object);
- g_list_free_full (skeleton->priv->changed_properties, (GDestroyNotify) _changed_property_free);
- if (skeleton->priv->changed_properties_idle_source != NULL)
- g_source_destroy (skeleton->priv->changed_properties_idle_source);
- g_main_context_unref (skeleton->priv->context);
- g_mutex_clear (&skeleton->priv->lock);
- G_OBJECT_CLASS (cal_dbus_skeleton_parent_class)->finalize (object);
-}
-
-static void
-cal_dbus_skeleton_init (calDbusSkeleton *skeleton)
-{
-#if GLIB_VERSION_MAX_ALLOWED >= GLIB_VERSION_2_38
- skeleton->priv = cal_dbus_skeleton_get_instance_private (skeleton);
-#else
- skeleton->priv = G_TYPE_INSTANCE_GET_PRIVATE (skeleton, CAL_TYPE_DBUS_SKELETON, calDbusSkeletonPrivate);
-#endif
-
- g_mutex_init (&skeleton->priv->lock);
- skeleton->priv->context = g_main_context_ref_thread_default ();
-}
-
-static void
-cal_dbus_skeleton_class_init (calDbusSkeletonClass *klass)
-{
- GObjectClass *gobject_class;
- GDBusInterfaceSkeletonClass *skeleton_class;
-
- gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->finalize = cal_dbus_skeleton_finalize;
-
- skeleton_class = G_DBUS_INTERFACE_SKELETON_CLASS (klass);
- skeleton_class->get_info = cal_dbus_skeleton_dbus_interface_get_info;
- skeleton_class->get_properties = cal_dbus_skeleton_dbus_interface_get_properties;
- skeleton_class->flush = cal_dbus_skeleton_dbus_interface_flush;
- skeleton_class->get_vtable = cal_dbus_skeleton_dbus_interface_get_vtable;
-
-#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_38
- g_type_class_add_private (klass, sizeof (calDbusSkeletonPrivate));
-#endif
-}
-
-static void
-cal_dbus_skeleton_iface_init (calDbusIface *iface)
-{
-}
-
-/**
- * cal_dbus_skeleton_new:
- *
- * Creates a skeleton object for the D-Bus interface <link linkend="gdbus-interface-org-tizen-calendar_service-dbus.top_of_page">org.tizen.calendar_service.dbus</link>.
- *
- * Returns: (transfer full) (type calDbusSkeleton): The skeleton object.
- */
-calDbus *
-cal_dbus_skeleton_new (void)
-{
- return CAL_DBUS (g_object_new (CAL_TYPE_DBUS_SKELETON, NULL));
-}
-
+++ /dev/null
-/*
- * Generated by gdbus-codegen 2.40.2. DO NOT EDIT.
- *
- * The license of this code is the same as for the source it was derived from.
- */
-
-#ifndef __CAL_DBUS_H__
-#define __CAL_DBUS_H__
-
-#include <gio/gio.h>
-
-G_BEGIN_DECLS
-
-
-/* ------------------------------------------------------------------------ */
-/* Declarations for org.tizen.calendar_service.dbus */
-
-#define CAL_TYPE_DBUS (cal_dbus_get_type ())
-#define CAL_DBUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAL_TYPE_DBUS, calDbus))
-#define CAL_IS_DBUS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAL_TYPE_DBUS))
-#define CAL_DBUS_GET_IFACE(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), CAL_TYPE_DBUS, calDbusIface))
-
-struct _calDbus;
-typedef struct _calDbus calDbus;
-typedef struct _calDbusIface calDbusIface;
-
-struct _calDbusIface
-{
- GTypeInterface parent_iface;
-
- gboolean (*handle_add_changed_cb) (
- calDbus *object,
- GDBusMethodInvocation *invocation);
-
- gboolean (*handle_clean_after_sync) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- gint arg_book_id,
- gint arg_db_version);
-
- gboolean (*handle_delete_record) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_id);
-
- gboolean (*handle_delete_records) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- GVariant *arg_ids,
- gint arg_count);
-
- gboolean (*handle_get_all_records) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_offset,
- gint arg_limit);
-
- gboolean (*handle_get_changes_by_version) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_book_id,
- gint arg_db_version);
-
- gboolean (*handle_get_changes_exception_by_version) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_parent_id,
- gint arg_db_version);
-
- gboolean (*handle_get_count) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- const gchar *arg_view_uri);
-
- gboolean (*handle_get_count_with_query) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- GVariant *arg_query);
-
- gboolean (*handle_get_current_version) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle);
-
- gboolean (*handle_get_last_change_version) (
- calDbus *object,
- GDBusMethodInvocation *invocation);
-
- gboolean (*handle_get_record) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_id);
-
- gboolean (*handle_get_records_with_query) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- GVariant *arg_query,
- gint arg_offset,
- gint arg_limit);
-
- gboolean (*handle_insert_record) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- GVariant *arg_record);
-
- gboolean (*handle_insert_records) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- GVariant *arg_list);
-
- gboolean (*handle_insert_vcalendars) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- const gchar *arg_stream);
-
- gboolean (*handle_register_resource) (
- calDbus *object,
- GDBusMethodInvocation *invocation);
-
- gboolean (*handle_remove_changed_cb) (
- calDbus *object,
- GDBusMethodInvocation *invocation);
-
- gboolean (*handle_replace_record) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- GVariant *arg_record,
- gint arg_id);
-
- gboolean (*handle_replace_records) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- GVariant *arg_list,
- GVariant *arg_ids,
- gint arg_count);
-
- gboolean (*handle_replace_vcalendars) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- const gchar *arg_stream,
- GVariant *arg_ids,
- gint arg_count);
-
- gboolean (*handle_unregister_resource) (
- calDbus *object,
- GDBusMethodInvocation *invocation);
-
- gboolean (*handle_update_record) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- GVariant *arg_record);
-
- gboolean (*handle_update_records) (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *arg_handle,
- GVariant *arg_list);
-
-};
-
-GType cal_dbus_get_type (void) G_GNUC_CONST;
-
-GDBusInterfaceInfo *cal_dbus_interface_info (void);
-guint cal_dbus_override_properties (GObjectClass *klass, guint property_id_begin);
-
-
-/* D-Bus method call completion functions: */
-void cal_dbus_complete_register_resource (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint ret);
-
-void cal_dbus_complete_unregister_resource (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint ret);
-
-void cal_dbus_complete_insert_record (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint id,
- gint version,
- gint ret);
-
-void cal_dbus_complete_update_record (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret);
-
-void cal_dbus_complete_delete_record (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret);
-
-void cal_dbus_complete_replace_record (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret);
-
-void cal_dbus_complete_insert_records (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *ids,
- gint count,
- gint version,
- gint ret);
-
-void cal_dbus_complete_update_records (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret);
-
-void cal_dbus_complete_delete_records (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret);
-
-void cal_dbus_complete_replace_records (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret);
-
-void cal_dbus_complete_get_record (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *record,
- gint ret);
-
-void cal_dbus_complete_get_all_records (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *list,
- gint ret);
-
-void cal_dbus_complete_get_records_with_query (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *list,
- gint ret);
-
-void cal_dbus_complete_get_count (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint ret,
- gint count);
-
-void cal_dbus_complete_get_count_with_query (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint ret,
- gint count);
-
-void cal_dbus_complete_get_current_version (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint version,
- gint ret);
-
-void cal_dbus_complete_add_changed_cb (
- calDbus *object,
- GDBusMethodInvocation *invocation);
-
-void cal_dbus_complete_remove_changed_cb (
- calDbus *object,
- GDBusMethodInvocation *invocation);
-
-void cal_dbus_complete_get_changes_by_version (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *list,
- gint version,
- gint ret);
-
-void cal_dbus_complete_get_last_change_version (
- calDbus *object,
- GDBusMethodInvocation *invocation);
-
-void cal_dbus_complete_get_changes_exception_by_version (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *list,
- gint ret);
-
-void cal_dbus_complete_clean_after_sync (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint ret);
-
-void cal_dbus_complete_insert_vcalendars (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- GVariant *ids,
- gint count,
- gint version,
- gint ret);
-
-void cal_dbus_complete_replace_vcalendars (
- calDbus *object,
- GDBusMethodInvocation *invocation,
- gint ret,
- gint version);
-
-
-
-/* D-Bus method calls: */
-void cal_dbus_call_register_resource (
- calDbus *proxy,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_register_resource_finish (
- calDbus *proxy,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_register_resource_sync (
- calDbus *proxy,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_unregister_resource (
- calDbus *proxy,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_unregister_resource_finish (
- calDbus *proxy,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_unregister_resource_sync (
- calDbus *proxy,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_insert_record (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_record,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_insert_record_finish (
- calDbus *proxy,
- gint *out_id,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_insert_record_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_record,
- gint *out_id,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_update_record (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_record,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_update_record_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_update_record_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_record,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_delete_record (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_id,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_delete_record_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_delete_record_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_id,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_replace_record (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_record,
- gint arg_id,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_replace_record_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_replace_record_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_record,
- gint arg_id,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_insert_records (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_list,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_insert_records_finish (
- calDbus *proxy,
- GVariant **out_ids,
- gint *out_count,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_insert_records_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_list,
- GVariant **out_ids,
- gint *out_count,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_update_records (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_list,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_update_records_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_update_records_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_list,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_delete_records (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- GVariant *arg_ids,
- gint arg_count,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_delete_records_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_delete_records_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- GVariant *arg_ids,
- gint arg_count,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_replace_records (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_list,
- GVariant *arg_ids,
- gint arg_count,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_replace_records_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_replace_records_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_list,
- GVariant *arg_ids,
- gint arg_count,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_get_record (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_id,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_get_record_finish (
- calDbus *proxy,
- GVariant **out_record,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_get_record_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_id,
- GVariant **out_record,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_get_all_records (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_offset,
- gint arg_limit,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_get_all_records_finish (
- calDbus *proxy,
- GVariant **out_list,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_get_all_records_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_offset,
- gint arg_limit,
- GVariant **out_list,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_get_records_with_query (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_query,
- gint arg_offset,
- gint arg_limit,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_get_records_with_query_finish (
- calDbus *proxy,
- GVariant **out_list,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_get_records_with_query_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_query,
- gint arg_offset,
- gint arg_limit,
- GVariant **out_list,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_get_count (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_get_count_finish (
- calDbus *proxy,
- gint *out_ret,
- gint *out_count,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_get_count_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint *out_ret,
- gint *out_count,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_get_count_with_query (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_query,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_get_count_with_query_finish (
- calDbus *proxy,
- gint *out_ret,
- gint *out_count,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_get_count_with_query_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- GVariant *arg_query,
- gint *out_ret,
- gint *out_count,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_get_current_version (
- calDbus *proxy,
- GVariant *arg_handle,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_get_current_version_finish (
- calDbus *proxy,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_get_current_version_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_add_changed_cb (
- calDbus *proxy,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_add_changed_cb_finish (
- calDbus *proxy,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_add_changed_cb_sync (
- calDbus *proxy,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_remove_changed_cb (
- calDbus *proxy,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_remove_changed_cb_finish (
- calDbus *proxy,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_remove_changed_cb_sync (
- calDbus *proxy,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_get_changes_by_version (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_book_id,
- gint arg_db_version,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_get_changes_by_version_finish (
- calDbus *proxy,
- GVariant **out_list,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_get_changes_by_version_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_book_id,
- gint arg_db_version,
- GVariant **out_list,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_get_last_change_version (
- calDbus *proxy,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_get_last_change_version_finish (
- calDbus *proxy,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_get_last_change_version_sync (
- calDbus *proxy,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_get_changes_exception_by_version (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_parent_id,
- gint arg_db_version,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_get_changes_exception_by_version_finish (
- calDbus *proxy,
- GVariant **out_list,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_get_changes_exception_by_version_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_view_uri,
- gint arg_parent_id,
- gint arg_db_version,
- GVariant **out_list,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_clean_after_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- gint arg_book_id,
- gint arg_db_version,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_clean_after_sync_finish (
- calDbus *proxy,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_clean_after_sync_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- gint arg_book_id,
- gint arg_db_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_insert_vcalendars (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_stream,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_insert_vcalendars_finish (
- calDbus *proxy,
- GVariant **out_ids,
- gint *out_count,
- gint *out_version,
- gint *out_ret,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_insert_vcalendars_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_stream,
- GVariant **out_ids,
- gint *out_count,
- gint *out_version,
- gint *out_ret,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_call_replace_vcalendars (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_stream,
- GVariant *arg_ids,
- gint arg_count,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-
-gboolean cal_dbus_call_replace_vcalendars_finish (
- calDbus *proxy,
- gint *out_ret,
- gint *out_version,
- GAsyncResult *res,
- GError **error);
-
-gboolean cal_dbus_call_replace_vcalendars_sync (
- calDbus *proxy,
- GVariant *arg_handle,
- const gchar *arg_stream,
- GVariant *arg_ids,
- gint arg_count,
- gint *out_ret,
- gint *out_version,
- GCancellable *cancellable,
- GError **error);
-
-
-
-/* ---- */
-
-#define CAL_TYPE_DBUS_PROXY (cal_dbus_proxy_get_type ())
-#define CAL_DBUS_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAL_TYPE_DBUS_PROXY, calDbusProxy))
-#define CAL_DBUS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CAL_TYPE_DBUS_PROXY, calDbusProxyClass))
-#define CAL_DBUS_PROXY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CAL_TYPE_DBUS_PROXY, calDbusProxyClass))
-#define CAL_IS_DBUS_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAL_TYPE_DBUS_PROXY))
-#define CAL_IS_DBUS_PROXY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CAL_TYPE_DBUS_PROXY))
-
-typedef struct _calDbusProxy calDbusProxy;
-typedef struct _calDbusProxyClass calDbusProxyClass;
-typedef struct _calDbusProxyPrivate calDbusProxyPrivate;
-
-struct _calDbusProxy
-{
- /*< private >*/
- GDBusProxy parent_instance;
- calDbusProxyPrivate *priv;
-};
-
-struct _calDbusProxyClass
-{
- GDBusProxyClass parent_class;
-};
-
-GType cal_dbus_proxy_get_type (void) G_GNUC_CONST;
-
-void cal_dbus_proxy_new (
- GDBusConnection *connection,
- GDBusProxyFlags flags,
- const gchar *name,
- const gchar *object_path,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-calDbus *cal_dbus_proxy_new_finish (
- GAsyncResult *res,
- GError **error);
-calDbus *cal_dbus_proxy_new_sync (
- GDBusConnection *connection,
- GDBusProxyFlags flags,
- const gchar *name,
- const gchar *object_path,
- GCancellable *cancellable,
- GError **error);
-
-void cal_dbus_proxy_new_for_bus (
- GBusType bus_type,
- GDBusProxyFlags flags,
- const gchar *name,
- const gchar *object_path,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-calDbus *cal_dbus_proxy_new_for_bus_finish (
- GAsyncResult *res,
- GError **error);
-calDbus *cal_dbus_proxy_new_for_bus_sync (
- GBusType bus_type,
- GDBusProxyFlags flags,
- const gchar *name,
- const gchar *object_path,
- GCancellable *cancellable,
- GError **error);
-
-
-/* ---- */
-
-#define CAL_TYPE_DBUS_SKELETON (cal_dbus_skeleton_get_type ())
-#define CAL_DBUS_SKELETON(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), CAL_TYPE_DBUS_SKELETON, calDbusSkeleton))
-#define CAL_DBUS_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), CAL_TYPE_DBUS_SKELETON, calDbusSkeletonClass))
-#define CAL_DBUS_SKELETON_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), CAL_TYPE_DBUS_SKELETON, calDbusSkeletonClass))
-#define CAL_IS_DBUS_SKELETON(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), CAL_TYPE_DBUS_SKELETON))
-#define CAL_IS_DBUS_SKELETON_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), CAL_TYPE_DBUS_SKELETON))
-
-typedef struct _calDbusSkeleton calDbusSkeleton;
-typedef struct _calDbusSkeletonClass calDbusSkeletonClass;
-typedef struct _calDbusSkeletonPrivate calDbusSkeletonPrivate;
-
-struct _calDbusSkeleton
-{
- /*< private >*/
- GDBusInterfaceSkeleton parent_instance;
- calDbusSkeletonPrivate *priv;
-};
-
-struct _calDbusSkeletonClass
-{
- GDBusInterfaceSkeletonClass parent_class;
-};
-
-GType cal_dbus_skeleton_get_type (void) G_GNUC_CONST;
-
-calDbus *cal_dbus_skeleton_new (void);
-
-
-G_END_DECLS
-
-#endif /* __CAL_DBUS_H__ */
#define CAL_DBUS_SET_STRING(x) (x) ? x : ""
#define CAL_DBUS_GET_STRING(x) do { \
x = (NULL != x && '\0' != *x) ? strdup(x) : NULL; \
-} while(0)
+} while (0)
-GVariant *cal_dbus_utils_null_to_gvariant(void)
+GVariant* cal_dbus_utils_null_to_gvariant(void)
{
GVariant *value = NULL;
value = g_variant_new("(s)", "");
return value;
}
-GVariant *cal_dbus_utils_common_to_gvariant(cal_record_s *rec)
+GVariant* cal_dbus_utils_common_to_gvariant(cal_record_s *rec)
{
GVariant *value = NULL;
value = g_variant_new("(isuasy)",
return value;
}
-GVariant *cal_dbus_utils_handle_to_gvariant(calendar_h handle)
+GVariant* cal_dbus_utils_handle_to_gvariant(calendar_h handle)
{
GVariant *value = NULL;
cal_s *p = (cal_s *)handle;
return value;
}
-static GVariant *_caltime_to_gvariant(calendar_time_s *ct)
+static GVariant* _caltime_to_gvariant(calendar_time_s *ct)
{
GVariant *value = NULL;
switch (ct->type) {
if (1 == is_error) {
count_composite = 0;
arg_composite = cal_dbus_utils_null_to_gvariant();
- }
- else {
+ } else {
arg_composite = g_variant_builder_end(&builder_attribute);
}
- }
- else {
+ } else {
arg_composite = cal_dbus_utils_null_to_gvariant();
}
cursor = g_slist_next(cursor);
}
arg_operate = g_variant_builder_end(&builder);
- }
- else {
+ } else {
arg_operate = cal_dbus_utils_null_to_gvariant();
}
*out_count = count_operate;
static GVariant *_filter_to_gvariant(cal_composite_filter_s *f)
{
GVariant *arg_composite_pack = NULL;
- if (f->filters) {
+ if (f->filters)
arg_composite_pack = _composite_to_gvariant(f);
- }
- else {
+ else
arg_composite_pack = cal_dbus_utils_null_to_gvariant();
- }
int count_operate = 0;
GVariant *arg_operate = NULL;
- if (f->filter_ops) {
+ if (f->filter_ops)
arg_operate = _operate_to_gvariant(f, &count_operate);
- }
- else {
+ else
arg_operate = cal_dbus_utils_null_to_gvariant();
- }
GVariant *value = NULL;
value = g_variant_new("(viv)",
int i;
GVariantBuilder builder;
g_variant_builder_init(&builder, G_VARIANT_TYPE("au"));
- for (i = 0; i < p->projection_count; i++) {
+ for (i = 0; i < p->projection_count; i++)
g_variant_builder_add(&builder, "u", p->projection[i]);
- }
+
return g_variant_builder_end(&builder);
}
if (q->filter) {
has_filter = 1;
arg_filter = _filter_to_gvariant(q->filter);
- }
- else {
+ } else {
has_filter = 0;
arg_filter = cal_dbus_utils_null_to_gvariant();
}
GVariant *arg_projection = NULL;
- if (q->projection_count) {
+ if (q->projection_count)
arg_projection = _projection_to_gvariant(q);
- }
- else {
+ else
arg_projection = cal_dbus_utils_null_to_gvariant();
- }
GVariant *value = NULL;
value = g_variant_new("(siviviii)",
calendar_record_get_child_record_at_p(record, _calendar_event.calendar_alarm, i, &alarm);
g_variant_builder_add(&builder_alarm, "v", _alarm_to_gvariant(alarm));
}
- }
- else {
+ } else {
DBG("No alarm");
g_variant_builder_add(&builder_alarm, "v", cal_dbus_utils_null_to_gvariant());
}
calendar_record_get_child_record_at_p(record, _calendar_event.calendar_attendee, i, &attendee);
g_variant_builder_add(&builder_attendee, "v", _attendee_to_gvariant(attendee));
}
- }
- else {
+ } else {
DBG("No attendee");
g_variant_builder_add(&builder_attendee, "v", cal_dbus_utils_null_to_gvariant());
}
calendar_record_get_child_record_at_p(record, _calendar_event.exception, i, &exception);
g_variant_builder_add(&builder_exception, "v", _only_event_to_gvariant(exception));
}
- }
- else {
+ } else {
DBG("No exception");
g_variant_builder_add(&builder_exception, "v", cal_dbus_utils_null_to_gvariant());
}
calendar_record_get_child_record_at_p(record, _calendar_event.extended, i, &extended);
g_variant_builder_add(&builder_extended, "v", _extended_to_gvariant(extended));
}
- }
- else {
+ } else {
DBG("No extended");
g_variant_builder_add(&builder_extended, "v", cal_dbus_utils_null_to_gvariant());
}
calendar_record_get_child_record_at_p(record, _calendar_todo.calendar_alarm, i, &alarm);
g_variant_builder_add(&builder_alarm, "v", _alarm_to_gvariant(alarm));
}
- }
- else {
+ } else {
DBG("No alarm");
g_variant_builder_add(&builder_alarm, "v", cal_dbus_utils_null_to_gvariant());
}
calendar_record_get_child_record_at_p(record, _calendar_todo.calendar_attendee, i, &attendee);
g_variant_builder_add(&builder_attendee, "v", _attendee_to_gvariant(attendee));
}
- }
- else {
+ } else {
DBG("No attendee");
g_variant_builder_add(&builder_attendee, "v", cal_dbus_utils_null_to_gvariant());
}
calendar_record_get_child_record_at_p(record, _calendar_todo.extended, i, &extended);
g_variant_builder_add(&builder_extended, "v", _extended_to_gvariant(extended));
}
- }
- else {
+ } else {
DBG("No extended");
g_variant_builder_add(&builder_extended, "v", cal_dbus_utils_null_to_gvariant());
}
g_variant_builder_add(&builder, "iv", d->property_id, arg_value);
cursor = g_slist_next(cursor);
}
- }
- else {
+ } else {
g_variant_builder_init(&builder, (G_VARIANT_TYPE("i")));
g_variant_builder_add(&builder, "i", 0);
}
if (NULL == record) {
ERR("record is NULL");
type = -1;
- }
- else {
+ } else {
cal_record_s *rec = (cal_record_s *)record;
type = rec->type;
}
cal_event_s *p = (cal_event_s *)record;
GVariant *arg_until = NULL;
- GVariant *arg_start= NULL;
+ GVariant *arg_start = NULL;
GVariant *arg_end = NULL;
g_variant_get(arg_record, "(ii&s&s&s&s&siiiiiii&s&s&siddixixiiivii"
if (1 == is_exit)
break;
- if (NULL == composite) {
+ if (NULL == composite)
composite = c;
- }
- else {
+ else
composite->filters = g_slist_append(composite->filters, c);
- }
+
}
*out_composite = composite;
return CALENDAR_ERROR_NONE;
g_variant_get(arg_operate, "ai", &iter_operate);
int operate = 0;
- while (g_variant_iter_loop(iter_operate, "i", &operate)) {
+ while (g_variant_iter_loop(iter_operate, "i", &operate))
f->filter_ops = g_slist_append(f->filter_ops, GINT_TO_POINTER(operate));
- }
return CALENDAR_ERROR_NONE;
}
ERR("calloc() Fail");
return CALENDAR_ERROR_OUT_OF_MEMORY;
}
- while (g_variant_iter_loop(iter_projection, "u", &q->projection[i])) {
+ while (g_variant_iter_loop(iter_projection, "u", &q->projection[i]))
i++;
- }
+
q->projection_count = count_projection;
return CALENDAR_ERROR_NONE;
return CALENDAR_ERROR_OUT_OF_MEMORY;
}
int i = 0;
- for (i = 0; i < count; i++) {
+ for (i = 0; i < count; i++)
g_variant_iter_loop(iter_ids, "i", &ids[i]);
- }
+
*out_ids = ids;
return CALENDAR_ERROR_NONE;
}
_gvariant_to_alarm(arg_alarm, &alarm);
calendar_record_add_child_record(record, _calendar_event.calendar_alarm, alarm);
}
- }
- else {
+ } else {
DBG("No alarm");
}
_gvariant_to_attendee(arg_attendee, &attendee);
calendar_record_add_child_record(record, _calendar_event.calendar_attendee, attendee);
}
- }
- else {
+ } else {
DBG("No attendee");
}
_gvariant_to_only_event(arg_exception, &exception);
calendar_record_add_child_record(record, _calendar_event.exception, exception);
}
- }
- else {
+ } else {
DBG("No exception");
}
_gvariant_to_extended(arg_extended, &extended);
calendar_record_add_child_record(record, _calendar_event.extended, extended);
}
- }
- else {
+ } else {
DBG("No extended");
}
cal_todo_s *p = (cal_todo_s *)record;
GVariant *arg_until = NULL;
- GVariant *arg_start= NULL;
+ GVariant *arg_start = NULL;
GVariant *arg_due = NULL;
g_variant_get(arg_record, "(ii&s&s&s&siii&sddxxiixiiivii&s&s&s&s&s&s&s&s&si"
_gvariant_to_alarm(arg_alarm, &alarm);
calendar_record_add_child_record(record, _calendar_todo.calendar_alarm, alarm);
}
- }
- else {
+ } else {
DBG("No alarm");
}
_gvariant_to_attendee(arg_attendee, &attendee);
calendar_record_add_child_record(record, _calendar_todo.calendar_attendee, attendee);
}
- }
- else {
+ } else {
DBG("No attendee");
}
_gvariant_to_extended(arg_extended, &extended);
calendar_record_add_child_record(record, _calendar_todo.extended, extended);
}
- }
- else {
+ } else {
DBG("No extended");
}
{
GList *cursor;
- for(cursor=__thread_list;cursor;cursor=cursor->next) {
+ for (cursor = __thread_list; cursor; cursor = cursor->next) {
cal_permission_info_s *info = NULL;
info = cursor->data;
if (info->thread_id == thread_id)
mode = sqlite3_column_int(stmt, 1);
temp = (char *)sqlite3_column_text(stmt, 2);
- if (!smack_enabled) // smack disabled
+ if (!smack_enabled) /* smack disabled */
info->write_list[write_index++] = id;
- else if (NULL == info->ipc) // calendar-service daemon
+ else if (NULL == info->ipc) /* calendar-service daemon */
info->write_list[write_index++] = id;
- else if (info->smack_label && temp && 0 == strcmp(temp, info->smack_label)) // owner
+ else if (info->smack_label && temp && 0 == strcmp(temp, info->smack_label)) /* owner */
info->write_list[write_index++] = id;
else if (CALENDAR_BOOK_MODE_NONE == mode)
info->write_list[write_index++] = id;
info = _cal_access_control_find_permission_info(thread_id);
char *smack_label = NULL;
- if (info && info->smack_label) {
+ if (info && info->smack_label)
smack_label = strdup(info->smack_label);
- }
+
cal_mutex_unlock(CAL_MUTEX_ACCESS_CONTROL);
return smack_label;
}
{
cal_mutex_lock(CAL_MUTEX_ACCESS_CONTROL);
GList *cursor;
- for(cursor=__thread_list;cursor;cursor=cursor->next) {
+ for (cursor = __thread_list; cursor; cursor = cursor->next) {
cal_permission_info_s *info = NULL;
info = cursor->data;
if (info)
static int _cal_server_init(void)
{
int ret = 0;
-#if !GLIB_CHECK_VERSION(2,35,0)
+#if !GLIB_CHECK_VERSION(2, 35, 0)
g_type_init();
#endif
static void _cal_server_create_directory(const char* directory, mode_t mode)
{
- if (0 == access (directory, F_OK))
+ if (0 == access(directory, F_OK))
return;
DBG("No directory[%s]", directory);
}
ret = account_subscribe_notification(cal_account_h, _noti_cb, NULL);
- if (ACCOUNT_ERROR_NONE != ret) {
+ if (ACCOUNT_ERROR_NONE != ret)
WARN("account_subscribe_notification Failed (%d)", ret);
- }
pthread_mutex_unlock(&cal_mutex_account);
return CALENDAR_ERROR_NONE;
#define CAL_SEARCH_LOOP_MAX 4
-struct _alarm_data_s
-{
+struct _alarm_data_s {
int event_id;
long long int alert_utime; /* to compare */
int unit;
int ret = 0;
ret = cal_db_util_begin_trans();
- if (CALENDAR_ERROR_NONE != ret)
- {
+ if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_db_util_begin_trans() Fail");
return CALENDAR_ERROR_DB_FAILED;
}
DBG("remove alarm id(%d)", alarm_id);
_cal_server_alarm_unset_alerted_alarmmgr_id(alarm_id);
ret = alarmmgr_remove_alarm(alarm_id);
- if (ret != ALARMMGR_RESULT_SUCCESS)
- {
+ if (ret != ALARMMGR_RESULT_SUCCESS) {
ERR("alarmmgr_remove_alarm() Fail(ret:%d)", ret);
return ret;
}
int ret = 0;
ret = cal_db_util_begin_trans();
- if (CALENDAR_ERROR_NONE != ret)
- {
+ if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_db_util_begin_trans() Fail");
return CALENDAR_ERROR_DB_FAILED;
}
if (CALENDAR_ALARM_TIME_UNIT_SPECIFIC == unit) {
if (CALENDAR_TIME_UTIME == type) {
*tt_alert = utime;
- }
- else {
+ } else {
int y = 0, m = 0, d = 0;
int h = 0, n = 0, s = 0;
sscanf(datetime, CAL_FORMAT_LOCAL_DATETIME, &y, &m, &d, &h, &n, &s);
return;
}
- ad->event_id = sqlite3_column_int(stmt,0);
+ ad->event_id = sqlite3_column_int(stmt, 0);
ad->unit = sqlite3_column_int(stmt, 1);
ad->tick = sqlite3_column_int(stmt, 2);
ad->type = sqlite3_column_int(stmt, 3);
{
struct _alarm_data_s *p1 = (struct _alarm_data_s *)a;
struct _alarm_data_s *p2 = (struct _alarm_data_s *)b;
- DBG("%lld) > (%lld)",p1->alert_utime, p2->alert_utime);
+ DBG("%lld) > (%lld)", p1->alert_utime, p2->alert_utime);
return p1->alert_utime < p2->alert_utime ? -1 : 1;
}
l = g_list_next(l);
}
app_control_add_extra_data_array(b, "ids", (const char **)ids, len);
- app_control_send_launch_request (b, NULL, NULL);
+ app_control_send_launch_request(b, NULL, NULL);
app_control_destroy(b);
for (i = 0; i < len; i++) {
{
GList *l = NULL;
_cal_server_alarm_get_latest(utime, false, &l);
- if (NULL == l) {
+ if (NULL == l)
return CALENDAR_ERROR_NONE;
- }
l = g_list_sort(l, _cal_server_alarm_sort_cb);
g_list_foreach(l, (GFunc)_cal_server_alarm_print_cb, NULL);
#define CAL_SERVER_CALENDAR_DELETE_STEP_TIME 1
#define CAL_SERVER_CALENDAR_DELETE_THREAD_NAME "cal_server_calendar_delete"
-typedef enum
-{
+typedef enum {
STEP_1, /* create calendar_id_list */
STEP_2, /* delete schedule_table <-- CAL_SERVER_CALENDAR_DELETE_COUNT */
STEP_3, /* delete calendar_table*/
g_list_free(data->calendar_id_list);
CAL_FREE(data);
- ERR("_cal_server_calendar_delete_step Fail(%d)",ret);
+ ERR("_cal_server_calendar_delete_step Fail(%d)", ret);
return false;
}
switch (data->step) {
break;
case STEP_2:
if (ret == CALENDAR_ERROR_NO_DATA)
- {
data->step = STEP_3;
- }
+
break;
case STEP_3:
data->step = STEP_1;
count = g_list_length(data->calendar_id_list);
if (count <= 0)
- {
- return CALENDAR_ERROR_NO_DATA;
- }
+ return CALENDAR_ERROR_NO_DATA;
GList *cursor = g_list_first(data->calendar_id_list);
- if (cursor)
- {
+ if (cursor) {
data->current_calendar_id = GPOINTER_TO_INT(cursor->data);
data->calendar_id_list = g_list_remove(data->calendar_id_list, GINT_TO_POINTER(data->current_calendar_id));
return CALENDAR_ERROR_NONE;
- }
- else
- {
+ } else {
return CALENDAR_ERROR_NO_DATA;
}
}
CAL_FN_CALL();
ret = cal_db_util_begin_trans();
- if (CALENDAR_ERROR_NONE != ret)
- {
+ if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_db_util_begin_trans() failed");
return CALENDAR_ERROR_DB_FAILED;
}
}
GList *cursor = g_list_first(list);
- while(cursor) {
+ while (cursor) {
int id = GPOINTER_TO_INT(cursor->data);
/* delete event table */
snprintf(query, sizeof(query), "DELETE FROM %s WHERE id=%d", CAL_TABLE_SCHEDULE, id);
char query[CAL_DB_SQL_MIN_LEN] = {0};
ret = cal_db_util_begin_trans();
- if (CALENDAR_ERROR_NONE != ret)
- {
+ if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_db_util_begin_trans() failed");
return CALENDAR_ERROR_DB_FAILED;
}
int ret = CALENDAR_ERROR_NONE;
CAL_FN_CALL();
- while(1) {
+ while (1) {
__calendar_delete_data_s *callback_data = NULL;
callback_data = calloc(1, sizeof(__calendar_delete_data_s));
if (NULL == callback_data) {
#include <stdlib.h>
#include <sys/time.h>
#include <contacts.h>
-#include <unistd.h> // usleep
+#include <unistd.h> /* usleep */
#include "calendar.h"
#include "cal_typedef.h"
contacts_record_destroy(contact, true);
return CALENDAR_ERROR_SYSTEM;
}
- DBG("account_id[%d]",account_id);
+ DBG("account_id[%d]", account_id);
}
int index = 0;
if (0 < delete_count) {
DBG("delete_count");
- if (NULL == array) {
+ if (NULL == array)
array = calloc(delete_count, sizeof(int));
- }
- else {
+ else
array = realloc(array, (count +delete_count) *sizeof(int));
- }
+
if (NULL == array) {
ERR("calloc() Fail");
free(delete_array);
return ;
}
ret = calendar_filter_add_int(filter, _calendar_event.calendar_book_id,
- CALENDAR_MATCH_EQUAL,DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID);
+ CALENDAR_MATCH_EQUAL, DEFAULT_BIRTHDAY_CALENDAR_BOOK_ID);
if (CALENDAR_ERROR_NONE != ret) {
ERR("calendar_filter_add_int() Fail(%d)", ret);
calendar_filter_destroy(filter);
return ;
}
unsigned int projection = _calendar_event.id;
- ret = calendar_query_set_projection(query, &projection ,1);
+ ret = calendar_query_set_projection(query, &projection , 1);
if (CALENDAR_ERROR_NONE != ret) {
ERR("calendar_query_set_projection() Fail");
calendar_filter_destroy(filter);
cal_access_control_set_client_info(NULL, "calendar-service");
- while(1) {
+ while (1) {
if (CALENDAR_ERROR_NONE != _cal_server_contacts_sync()) {
DBG("end");
break;
return CALENDAR_ERROR_NONE;
}
-static int _cal_server_dbus_cleanup_sender(cal_sender_s *sender) // cleanup_handle_list
+static int _cal_server_dbus_cleanup_sender(cal_sender_s *sender) /* cleanup_handle_list */
{
CAL_FN_CALL();
RETV_IF(NULL == sender, CALENDAR_ERROR_INVALID_PARAMETER);
G_CALLBACK(_handle_get_count_with_query), NULL);
g_signal_connect(dbus_object, "handle-get-current-version",
G_CALLBACK(_handle_get_current_version), NULL);
-// g_signal_connect(dbus_object, "handle-add-changed-cb",
-// G_CALLBACK(_handle_add_changed_cb), NULL);
-// g_signal_connect(dbus_object, "handle-remove-changed-cb",
-// G_CALLBACK(_handle_remove_changed_cb), NULL);
+/*
+ g_signal_connect(dbus_object, "handle-add-changed-cb",
+ G_CALLBACK(_handle_add_changed_cb), NULL);
+ g_signal_connect(dbus_object, "handle-remove-changed-cb",
+ G_CALLBACK(_handle_remove_changed_cb), NULL);
+*/
g_signal_connect(dbus_object, "handle-get-changes-by-version",
G_CALLBACK(_handle_get_changes_by_version), NULL);
-// g_signal_connect(dbus_object, "handle-get-last-change-version",
-// G_CALLBACK(_handle_get_last_change_version), NULL);
+/*
+ g_signal_connect(dbus_object, "handle-get-last-change-version",
+ G_CALLBACK(_handle_get_last_change_version), NULL);
+*/
g_signal_connect(dbus_object, "handle-get-changes-exception-by-version",
G_CALLBACK(_handle_get_changes_exception_by_version), NULL);
g_signal_connect(dbus_object, "handle-clean-after-sync",
int ret, fd;
char *errmsg;
sqlite3 *db;
- char db_file[CAL_STR_MIDDLE_LEN]={0};
- char jn_file[CAL_STR_MIDDLE_LEN]={0};
+ char db_file[CAL_STR_MIDDLE_LEN] = {0};
+ char jn_file[CAL_STR_MIDDLE_LEN] = {0};
snprintf(db_file, sizeof(db_file), "%s/%s", db_path ? db_path : DB_PATH, CALS_DB_NAME);
static inline int __check_db_file(char* db_path)
{
int fd = -1;
- char db_file[CAL_STR_MIDDLE_LEN]={0,};
+ char db_file[CAL_STR_MIDDLE_LEN] = {0,};
snprintf(db_file, sizeof(db_file), "%s/%s", db_path ? db_path : DB_PATH, CALS_DB_NAME);
DBG("[%s]", db_file);
cal_mutex_lock(CAL_MUTEX_CONNECTION);
if (0 == cal_total_connection) {
-#if !GLIB_CHECK_VERSION(2,35,0)
- g_type_init(); // added for alarmmgr
+#if !GLIB_CHECK_VERSION(2, 35, 0)
+ g_type_init(); /* added for alarmmgr */
#endif
cal_view_initialize();
ret = cal_inotify_init();
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return ret;
}
- }
- else {
+ } else {
DBG("[System] calendar service has been already connected");
}
cal_total_connection++;
cal_mutex_lock(CAL_MUTEX_CONNECTION);
if (1 == cal_thread_connection) {
cal_db_util_close();
- }
- else if (cal_thread_connection <= 0) {
+ } else if (cal_thread_connection <= 0) {
DBG("[System] not connected, count(%d)", cal_thread_connection);
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return CALENDAR_ERROR_INVALID_PARAMETER;
if (1 == cal_total_connection) {
cal_inotify_deinit();
cal_view_finalize();
- }
- else if (1 < cal_total_connection) {
+ } else if (1 < cal_total_connection) {
DBG("[System] connection count(%d)", cal_total_connection);
- }
- else {
+ } else {
DBG("[System] Not connected, count(%d)", cal_total_connection);
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return CALENDAR_ERROR_INVALID_PARAMETER;
cal_db_util_close();
cal_thread_connection--;
- if (1 <= cal_total_connection) {
+ if (1 <= cal_total_connection)
cal_total_connection--;
- }
}
cal_mutex_unlock(CAL_MUTEX_CONNECTION);
return CALENDAR_ERROR_NONE;
return CALENDAR_ERROR_DB_FAILED;
}
ret = sqlite3_step(stmt);
- if (SQLITE_ROW != ret)
- {
+ if (SQLITE_ROW != ret) {
ERR("sqlite3_step() failed[%s]", sqlite3_errmsg(db));
sqlite3_finalize(stmt);
return CALENDAR_ERROR_DB_FAILED;
* added attendee_table(cutype, delegatee_uri, member), alarm_table(summary, action, attach).
*/
ret = sqlite3_exec(__db, "DROP VIEW event_calendar_attendee_view", NULL, 0, &errmsg);
- if (SQLITE_OK != ret)
- {
+ if (SQLITE_OK != ret) {
ERR("sqlite3_exec() failed: DROP VIEW event_calendar_attendee_view(%d) [%s]", ret, errmsg);
sqlite3_free(errmsg);
}
ret = sqlite3_exec(__db, "ALTER TABLE attendee_table ADD COLUMN attendee_cutype INTEGER", NULL, 0, &errmsg);
- if (SQLITE_OK != ret)
- {
+ if (SQLITE_OK != ret) {
ERR("sqlite3_exec() failed: ALTER TABLE attendee_table ADD COLUMN attendee_cutype(%d) [%s]", ret, errmsg);
sqlite3_free(errmsg);
}
ret = sqlite3_exec(__db, "ALTER TABLE attendee_table ADD COLUMN attendee_delegatee_uri TEXT", NULL, 0, &errmsg);
- if (SQLITE_OK != ret)
- {
+ if (SQLITE_OK != ret) {
ERR("sqlite3_exec() failed: ALTER TABLE attendee_table ADD COLUMN attendee_delegatee_uri(%d) [%s]", ret, errmsg);
sqlite3_free(errmsg);
}
ret = sqlite3_exec(__db, "ALTER TABLE attendee_table ADD COLUMN attendee_member TEXT", NULL, 0, &errmsg);
- if (SQLITE_OK != ret)
- {
+ if (SQLITE_OK != ret) {
ERR("sqlite3_exec() failed: ALTER TABLE attendee_table ADD COLUMN attendee_member(%d) [%s]", ret, errmsg);
sqlite3_free(errmsg);
}
ret = sqlite3_exec(__db, "ALTER TABLE alarm_table ADD COLUMN alarm_summary TEXT", NULL, 0, &errmsg);
- if (SQLITE_OK != ret)
- {
+ if (SQLITE_OK != ret) {
ERR("sqlite3_exec() failed: ALTER TABLE alarm_table ADD COLUMN alarm_summary(%d) [%s]", ret, errmsg);
sqlite3_free(errmsg);
}
ret = sqlite3_exec(__db, "ALTER TABLE alarm_table ADD COLUMN alarm_action INTEGER", NULL, 0, &errmsg);
- if (SQLITE_OK != ret)
- {
+ if (SQLITE_OK != ret) {
ERR("sqlite3_exec() failed: ALTER TABLE alarm_table ADD COLUMN alarm_action(%d) [%s]", ret, errmsg);
sqlite3_free(errmsg);
}
ret = sqlite3_exec(__db, "ALTER TABLE alarm_table ADD COLUMN alarm_attach TEXT", NULL, 0, &errmsg);
- if (SQLITE_OK != ret)
- {
+ if (SQLITE_OK != ret) {
ERR("sqlite3_exec() failed: ALTER TABLE alarm_table ADD COLUMN alarm_attach(%d) [%s]", ret, errmsg);
sqlite3_free(errmsg);
}
* added schedule_table(freq) for view table parameter.
*/
ret = sqlite3_exec(__db, "ALTER TABLE schedule_table ADD COLUMN freq INTEGER DEFAULT 0", NULL, 0, &errmsg);
- if (SQLITE_OK != ret)
- {
+ if (SQLITE_OK != ret) {
ERR("sqlite3_exec() failed: ALTER TABLE schedule_table ADD COLUMN freq(%d) [%s]", ret, errmsg);
sqlite3_free(errmsg);
}
sqlite3_free(errmsg);
}
ret = sqlite3_exec(__db, "DROP VIEW allday_instance_view", NULL, 0, &errmsg);
- if (SQLITE_OK != ret)
- {
+ if (SQLITE_OK != ret) {
ERR("sqlite3_exec() failed: DROP VIEW allday_instance_view(%d) [%s]", ret, errmsg);
sqlite3_free(errmsg);
}
ret = sqlite3_exec(__db, "DROP VIEW allday_instance_view_extended", NULL, 0, &errmsg);
- if (SQLITE_OK != ret)
- {
+ if (SQLITE_OK != ret) {
ERR("sqlite3_exec() failed: DROP VIEW allday_instance_view_extended(%d) [%s]", ret, errmsg);
sqlite3_free(errmsg);
}
/* update DB user_version */
snprintf(query, sizeof(query), "PRAGMA user_version = %d", __USER_VERSION);
ret = sqlite3_exec(__db, query, NULL, 0, &errmsg);
- if (SQLITE_OK != ret)
- {
+ if (SQLITE_OK != ret) {
ERR("sqlite3_exec() failed(%d) [%s]", ret, errmsg);
sqlite3_free(errmsg);
}
int cal_db_update_record(calendar_record_h record)
{
- cal_record_s *temp=NULL ;
+ cal_record_s *temp = NULL;
int ret = CALENDAR_ERROR_NONE;
RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
int cal_db_replace_record(calendar_record_h record, int record_id)
{
- cal_record_s *temp=NULL ;
+ cal_record_s *temp = NULL;
int ret = CALENDAR_ERROR_NONE;
RETV_IF(NULL == record, CALENDAR_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == plugin_cb, CALENDAR_ERROR_INVALID_PARAMETER);
RETVM_IF(NULL == plugin_cb->get_all_records, CALENDAR_ERROR_NOT_PERMITTED, "Not permitted");
- ret = plugin_cb->get_all_records(offset,limit, &list);
+ ret = plugin_cb->get_all_records(offset, limit, &list);
if (CALENDAR_ERROR_NONE != ret) {
ERR("get_all_records() Fail");
return ret;
for (i = 0; i < _count; i++) {
calendar_record_h record = NULL;
ret = calendar_list_get_current_record_p(list, &record);
- if (NULL == record|| CALENDAR_ERROR_NONE != ret) {
+ if (NULL == record || CALENDAR_ERROR_NONE != ret) {
ERR("No record in the list");
cal_db_util_end_trans(false);
CAL_FREE(_ids);
ret = cal_db_util_begin_trans();
RETVM_IF(CALENDAR_ERROR_NONE != ret, CALENDAR_ERROR_DB_FAILED, "cal_db_util_begin_trans() Fail(%d)", ret);
- ret = plugin_cb->delete_records(record_id_array,count);
+ ret = plugin_cb->delete_records(record_id_array, count);
if (CALENDAR_ERROR_NONE == ret)
ret = cal_db_util_end_trans(true);
return CALENDAR_ERROR_DB_FAILED;
}
- for(i=0;i<list_count;i++) {
+ for (i = 0; i < list_count; i++) {
calendar_record_h record = NULL;
ret = calendar_list_get_current_record_p(list, &record);
int div = (int)(count / BULK_DEFAULT_COUNT) + 1;
int bulk = count / div + 1;
- for(i = 0; i < list_count; i++) {
+ for (i = 0; i < list_count; i++) {
calendar_record_h record = NULL;
char *view_uri = NULL;
if (CAL_STRING_EQUAL == strcmp(view_uri, _calendar_event._uri)) {
ret = cal_record_set_int(record, _calendar_event.id, record_id_array[i]);
- }
- else if (CAL_STRING_EQUAL == strcmp(view_uri, _calendar_todo._uri)) {
+ } else if (CAL_STRING_EQUAL == strcmp(view_uri, _calendar_todo._uri)) {
ret = cal_record_set_int(record, _calendar_todo.id, record_id_array[i]);
- }
- else {
+ } else {
DBG("this uri[%s] is not replacable.", view_uri);
calendar_list_next(list);
continue;
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_db_util_query_get_first_int_result() Fail(%d)", ret);
char buf[CAL_STR_SHORT_LEN64] = {0};
- if (0 < calendar_book_id) {
+ if (0 < calendar_book_id)
snprintf(buf, sizeof(buf), "AND calendar_id = %d ", calendar_book_id);
-
- }
- else {
+ else
memset(buf, 0x0, sizeof(buf));
- }
int schedule_type = 0;
int record_type = 0;
- if (CAL_STRING_EQUAL == strcmp(view_uri,_calendar_event._uri)) {
+ if (CAL_STRING_EQUAL == strcmp(view_uri, _calendar_event._uri)) {
schedule_type = CAL_SCH_TYPE_EVENT;
record_type = CAL_RECORD_TYPE_EVENT;
- }
- else if (CAL_STRING_EQUAL == strcmp(view_uri,_calendar_todo._uri)) {
+ } else if (CAL_STRING_EQUAL == strcmp(view_uri, _calendar_todo._uri)) {
schedule_type = CAL_SCH_TYPE_TODO;
record_type = CAL_RECORD_TYPE_TODO;
-
- }
- else {
+ } else {
ERR("Invalid parameter");
return CALENDAR_ERROR_INVALID_PARAMETER;
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- int id = 0, calendar_id = 0,type = 0;
+ int id = 0, calendar_id = 0, type = 0;
int ver = 0;
int created_ver = 0;
- ret = calendar_record_create(_calendar_updated_info._uri,&record);
+ ret = calendar_record_create(_calendar_updated_info._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
ERR("calendar_record_create() Fail");
calendar_list_destroy(*record_list, true);
ver = sqlite3_column_int(stmt, 1);
created_ver = sqlite3_column_int(stmt, 2);
is_deleted = sqlite3_column_int(stmt, 3);
- if (is_deleted == 1) {
+ if (is_deleted == 1)
type = CALENDAR_RECORD_MODIFIED_STATUS_DELETED;
- }
- else if (created_ver != ver) {
+ else if (created_ver != ver)
type = CALENDAR_RECORD_MODIFIED_STATUS_UPDATED;
- }
- else {
+ else
type = CALENDAR_RECORD_MODIFIED_STATUS_INSERTED;
- }
calendar_id = sqlite3_column_int(stmt, 4);
continue;
}
- cal_record_set_int(record,_calendar_updated_info.id,id);
- cal_record_set_int(record,_calendar_updated_info.calendar_book_id,calendar_id);
- cal_record_set_int(record,_calendar_updated_info.modified_status,type);
- cal_record_set_int(record,_calendar_updated_info.version,ver);
+ cal_record_set_int(record, _calendar_updated_info.id, id);
+ cal_record_set_int(record, _calendar_updated_info.calendar_book_id, calendar_id);
+ cal_record_set_int(record, _calendar_updated_info.modified_status, type);
+ cal_record_set_int(record, _calendar_updated_info.version, ver);
- ret = calendar_list_add(*record_list,record);
+ ret = calendar_list_add(*record_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*record_list, true);
*record_list = NULL;
int schedule_type = 0;
int record_type = 0;
- if (CAL_STRING_EQUAL == strcmp(view_uri,_calendar_event._uri)) {
+ if (CAL_STRING_EQUAL == strcmp(view_uri, _calendar_event._uri)) {
schedule_type = CAL_SCH_TYPE_EVENT;
record_type = CAL_RECORD_TYPE_EVENT;
- }
- else {
+ } else {
ERR("Invalid parameter");
return CALENDAR_ERROR_INVALID_PARAMETER;
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- int id = 0, calendar_id = 0,type = 0;
+ int id = 0, calendar_id = 0, type = 0;
int ver = 0;
int created_ver = 0;
- ret = calendar_record_create(_calendar_updated_info._uri,&record);
+ ret = calendar_record_create(_calendar_updated_info._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
ERR("calendar_record_create() Fail");
calendar_list_destroy(*record_list, true);
calendar_id = sqlite3_column_int(stmt, 4);
- cal_record_set_int(record,_calendar_updated_info.id,id);
- cal_record_set_int(record,_calendar_updated_info.calendar_book_id,calendar_id);
- cal_record_set_int(record,_calendar_updated_info.modified_status,type);
- cal_record_set_int(record,_calendar_updated_info.version,ver);
+ cal_record_set_int(record, _calendar_updated_info.id, id);
+ cal_record_set_int(record, _calendar_updated_info.calendar_book_id, calendar_id);
+ cal_record_set_int(record, _calendar_updated_info.modified_status, type);
+ cal_record_set_int(record, _calendar_updated_info.version, ver);
- ret = calendar_list_add(*record_list,record);
+ ret = calendar_list_add(*record_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*record_list, true);
*record_list = NULL;
ucal_get(s_ucal, UCAL_MINUTE, &ec),
ucal_get(s_ucal, UCAL_SECOND, &ec));
- if (CALENDAR_SYSTEM_EAST_ASIAN_LUNISOLAR == calendar_system_type) {
+ if (CALENDAR_SYSTEM_EAST_ASIAN_LUNISOLAR == calendar_system_type)
ucal_close(s_ucal);
- }
}
static void __get_allday_date(cal_event_s *event, UCalendar *ucal, int *y, int *m, int *d, int *h, int *n, int *s)
if (s)
*s = ucal_get(s_ucal, UCAL_SECOND, &ec);
- if (CALENDAR_SYSTEM_EAST_ASIAN_LUNISOLAR == event->system_type) {
+ if (CALENDAR_SYSTEM_EAST_ASIAN_LUNISOLAR == event->system_type)
ucal_close(s_ucal);
- }
}
static int _cal_db_instance_parse_byint(char *byint, int *by, int *len)
RETV_IF(NULL == ucal, CALENDAR_ERROR_INVALID_PARAMETER);
RETV_IF(NULL == event, CALENDAR_ERROR_INVALID_PARAMETER);
- if (NULL == event->exdate || '\0' == *(event->exdate)) {
+ if (NULL == event->exdate || '\0' == *(event->exdate))
return CALENDAR_ERROR_NONE;
- }
char **t = NULL;
t = g_strsplit_set(event->exdate, " ,", -1);
int i;
for (i = 0; i < len; i++) {
char *p = t[i];
- if (NULL == p) {
+ if (NULL == p)
continue;
- }
+
int y = 0, m = 0, d = 0;
int h = 0, n = 0, s = 0;
long long int lli = 0;
t = g_strsplit_set(recurrence_id, " ,", -1);
RETVM_IF(NULL == t, CALENDAR_ERROR_OUT_OF_MEMORY, "g_strsplit_set() Fail");;
- for (i = 0; t[i]; i++)
- {
+ for (i = 0; t[i]; i++) {
p = t[i];
/* remove space */
t2->time.date.year, t2->time.date.month, t2->time.date.mday);
if (t1->time.date.year == t2->time.date.year) {
- if (t1->time.date.month == t2->time.date.month) {
+ if (t1->time.date.month == t2->time.date.month)
return t1->time.date.mday < t2->time.date.mday ? 0 : 1;
- }
+
return t1->time.date.month < t2->time.date.month ? 0 : 1;
}
return t1->time.date.year < t2->time.date.year ? 0 : 1;
int cnt;
char query[CAL_DB_SQL_MAX_LEN];
- if (event->range_type != CALENDAR_RANGE_COUNT) {
+ if (event->range_type != CALENDAR_RANGE_COUNT)
return CALENDAR_ERROR_NONE;
- }
cnt = event->count;
DBG("get count(%d) and del after this", cnt);
CAL_TABLE_NORMAL_INSTANCE,
event_id, cnt -1);
- }
- else if (st->type == CALENDAR_TIME_LOCALTIME) {
+ } else if (st->type == CALENDAR_TIME_LOCALTIME) {
snprintf(query, sizeof(query), "DELETE FROM %s WHERE event_id = %d "
"AND dtstart_datetime > (SELECT dtstart_datetime FROM %s "
"WHERE event_id = %d ORDER BY dtstart_datetime LIMIT %d, 1) ",
switch (st->type) {
case CALENDAR_TIME_UTIME:
- if ( et->time.utime < st->time.utime) {
+ if (et->time.utime < st->time.utime) {
ERR("check time: end(%lld < start(%lld)", et->time.utime, st->time.utime);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
const char *week_text[7] = {"SU", "MO", "TU", "WE", "TH", "FR", "SA"};
int i;
for (i = 0; i < 7; i++) {
- if (strstr(wday, week_text[i])) {
+ if (strstr(wday, week_text[i]))
return i + 1;
- }
}
return 0;
}
if (range < event->until.time.utime) {
DBG("range max < until time(%lld), so set max(%lld)", event->until.time.utime, range);
until->time.utime = range;
- }
- else {
+ } else {
until->time.utime = event->until.time.utime;
}
break;
for (i = 0; i < bysetpos_len; i++) {
if (0 < bysetpos[i]) {
- if (bysetpos[i] == (index + 1)) {
+ if (bysetpos[i] == (index + 1))
return false;
- }
- }
- else {
- if ((index - dates_len) == bysetpos[i]) {
+ } else {
+ if ((index - dates_len) == bysetpos[i])
return false;
- }
}
}
return true;
int month = ucal_get(ucal, UCAL_MONTH, &ec) + 1;
int i;
for (i = 0; i < bymonth_len; i++) {
- if (month == bymonth[i]) {
+ if (month == bymonth[i])
return false;
- }
}
if (*log_value != month) {
DBG("Get month(%d) Not in bymonth", month);
int i;
for (i = 0; i < byyearday_len; i++) {
ucal_set(ucal, UCAL_DAY_OF_YEAR, byyearday[i]);
- if (true == __check_bysetpos_to_skip(i, bysetpos, bysetpos_len, byyearday_len)) {
+ if (true == __check_bysetpos_to_skip(i, bysetpos, bysetpos_len, byyearday_len))
continue;
- }
+
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
- if (true == __check_before_dtstart(current_utime, dtstart_utime)) {
+ if (true == __check_before_dtstart(current_utime, dtstart_utime))
continue;
- }
+
if (true == __check_exdate_to_skip(current_utime, exdate_len, &l)) {
count++;
continue;
}
is_exit = __check_out_of_range(current_utime, event, until_utime, &count);
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
_cal_db_instance_insert_record(ucal, duration, event);
}
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
is_exit = __check_to_stop_loop(current_utime, &last_utime, loop);
loop++;
week_bits |= (0x01 << (dtstart_wday - 1));
byday_len = 1;
- }
- else {
+ } else {
week_bits = __convert_week_to_bits(event->byday, &byday_len);
}
DBG("byday_len (%d) week integer(0x%x)", byday_len, week_bits);
week_count++;
ucal_set(ucal, UCAL_WEEK_OF_YEAR, byweekno[i] + extra_weekno);
ucal_set(ucal, UCAL_DAY_OF_WEEK, j + 1);
- if (true == __check_bysetpos_to_skip(i + week_count - 1, bysetpos, bysetpos_len, byweekno_len + byday_len - 1)) {
+ if (true == __check_bysetpos_to_skip(i + week_count - 1, bysetpos, bysetpos_len, byweekno_len + byday_len - 1))
continue;
- }
+
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
- if (true == __check_before_dtstart(current_utime, dtstart_utime)) {
+ if (true == __check_before_dtstart(current_utime, dtstart_utime))
continue;
- }
+
if (true == __check_exdate_to_skip(current_utime, exdate_len, &l)) {
count++;
continue;
}
is_exit = __check_out_of_range(current_utime, event, until_utime, &count);
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
_cal_db_instance_insert_record(ucal, duration, event);
}
}
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
}
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
is_exit = __check_to_stop_loop(current_utime, &last_utime, loop);
loop++;
t = g_strsplit_set(buf, " ,", -1);
byday_len = 1;
- }
- else {
+ } else {
t = g_strsplit_set(event->byday, " ,", -1);
byday_len = g_strv_length(t);
}
ucal_set(ucal, UCAL_MONTH, false == has_bymonth ? 0 : (bymonth[i] - 1));
ucal_add(ucal, UCAL_WEEK_OF_YEAR, nth - 1, &ec);
- }
- else {
+ } else {
ucal_set(ucal, UCAL_DAY_OF_WEEK, wday_int);
ucal_set(ucal, UCAL_MONTH, false == has_bymonth ? 0 : bymonth[i] - 1);
ucal_set(ucal, UCAL_DAY_OF_WEEK_IN_MONTH, nth);
}
- if (true == __check_bysetpos_to_skip(j, bysetpos, bysetpos_len, bymonth_len + byday_len - 1)) {
+ if (true == __check_bysetpos_to_skip(j, bysetpos, bysetpos_len, bymonth_len + byday_len - 1))
continue;
- }
+
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
- if (true == __check_before_dtstart(current_utime, dtstart_utime)) {
+ if (true == __check_before_dtstart(current_utime, dtstart_utime))
continue;
- }
+
if (true == __check_exdate_to_skip(current_utime, exdate_len, &l)) {
count++;
continue;
}
is_exit = __check_out_of_range(current_utime, event, until_utime, &count);
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
_cal_db_instance_insert_record(ucal, duration, event);
}
- }
- else {
+ } else {
/* SU, SA: no week num: means all week:1TH,2TH,3TH.., so needs another byevent->system_typex */
int week_bits = 0;
/* if nowday in weekly */
int dtstart_wday = ucal_get(ucal, UCAL_DAY_OF_WEEK, &ec);
week_bits |= (0x01 << (dtstart_wday - 1));
- }
- else {
+ } else {
week_bits = __convert_week_to_bits(event->byday, NULL);
}
DBG("week integer(0x%x)", week_bits);
DBG("get wday(%d) != want wday(%d)", w, k + 1);
continue;
}
- if (true == __check_bysetpos_to_skip(j, bysetpos, bysetpos_len, bymonthday_len)) {
+ if (true == __check_bysetpos_to_skip(j, bysetpos, bysetpos_len, bymonthday_len))
continue;
- }
+
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
- if (true == __check_before_dtstart(current_utime, dtstart_utime)) {
+ if (true == __check_before_dtstart(current_utime, dtstart_utime))
continue;
- }
+
if (true == __check_exdate_to_skip(current_utime, exdate_len, &l)) {
count++;
continue;
}
is_exit = __check_out_of_range(current_utime, event, until_utime, &count);
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
_cal_db_instance_insert_record(ucal, duration, event);
}
- }
- else {
+ } else {
int year = ucal_get(ucal, UCAL_YEAR, &ec);
ucal_set(ucal, UCAL_MONTH, bymonth[i] - 1);
int get_month = ucal_get(ucal, UCAL_MONTH, &ec) + 1;
if (bymonth[i] != get_month) { j = 6; break; }
- if (true == __check_bysetpos_to_skip(index, bysetpos, bysetpos_len, dates_len)) {
+ if (true == __check_bysetpos_to_skip(index, bysetpos, bysetpos_len, dates_len))
continue;
- }
+
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
- if (true == __check_before_dtstart(current_utime, dtstart_utime)) {
+ if (true == __check_before_dtstart(current_utime, dtstart_utime))
continue;
- }
+
if (true == __check_exdate_to_skip(current_utime, exdate_len, &l)) {
count++;
continue;
}
is_exit = __check_out_of_range(current_utime, event, until_utime, &count);
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
_cal_db_instance_insert_record(ucal, duration, event);
}
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
}
}
}
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
}
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
is_exit = __check_to_stop_loop(current_utime, &last_utime, loop);
loop++;
DBG("bymonthday(%d) but get (%d) from icu", bymonthday[i], get_mday);
continue;
}
- }
- else if (bymonthday[i] < 0) {
+ } else if (bymonthday[i] < 0) {
ucal_set(ucal, UCAL_MONTH, bymonth[j] - 1);
ucal_set(ucal, UCAL_DATE, 1);
ucal_add(ucal, UCAL_MONTH, 1, &ec);
ucal_add(ucal, UCAL_DAY_OF_YEAR, bymonthday[i], &ec);
- }
- else { /* 0 is invalid */
+ } else { /* 0 is invalid */
DBG("Invalid bymonthday(%d)", bymonthday[i]);
continue;
}
continue;
}
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
- if (true == __check_before_dtstart(current_utime, dtstart_utime)) {
+ if (true == __check_before_dtstart(current_utime, dtstart_utime))
continue;
- }
+
if (true == __check_exdate_to_skip(current_utime, exdate_len, &l)) {
count++;
continue;
}
is_exit = __check_out_of_range(current_utime, event, until_utime, &count);
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
_cal_db_instance_insert_record(ucal, duration, event);
}
}
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
is_exit = __check_to_stop_loop(current_utime, &last_utime, loop);
loop++;
if (event->byyearday && 0 < strlen(event->byyearday)) {
_cal_db_instance_publish_yearly_yday(ucal, event, duration);
- }
- else if (event->byweekno && 0 < strlen(event->byweekno)) {
+ } else if (event->byweekno && 0 < strlen(event->byweekno)) {
_cal_db_instance_publish_yearly_weekno(ucal, event, duration);
- }
- else {
- if (event->byday && *event->byday) {
+ } else {
+ if (event->byday && *event->byday)
_cal_db_instance_publish_yearly_wday(ucal, event, duration);
- }
- else {
+ else
_cal_db_instance_publish_yearly_mday(ucal, event, duration);
- }
}
return CALENDAR_ERROR_NONE;
}
t = g_strsplit_set(buf, " ,", -1);
byday_len = 1;
- }
- else {
+ } else {
t = g_strsplit_set(event->byday, " ,", -1);
byday_len = g_strv_length(t);
}
ucal_set(ucal, UCAL_DAY_OF_WEEK, wday_int);
ucal_set(ucal, UCAL_DAY_OF_WEEK_IN_MONTH, -1);
- }
- else {
+ } else {
ucal_set(ucal, UCAL_DAY_OF_WEEK, wday_int);
ucal_set(ucal, UCAL_DAY_OF_WEEK_IN_MONTH, 1);
ucal_add(ucal, UCAL_WEEK_OF_YEAR, nth - 1, &ec);
}
- }
- else {
+ } else {
ucal_set(ucal, UCAL_DAY_OF_WEEK, wday_int);
ucal_set(ucal, UCAL_DAY_OF_WEEK_IN_MONTH, nth);
}
- if (true == __check_bysetpos_to_skip(i, bysetpos, bysetpos_len, byday_len)) {
+ if (true == __check_bysetpos_to_skip(i, bysetpos, bysetpos_len, byday_len))
continue;
- }
+
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
- if (true == __check_before_dtstart(current_utime, dtstart_utime)) {
+ if (true == __check_before_dtstart(current_utime, dtstart_utime))
continue;
- }
+
if (true == __check_exdate_to_skip(current_utime, exdate_len, &l)) {
count++;
continue;
}
is_exit = __check_out_of_range(current_utime, event, until_utime, &count);
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
_cal_db_instance_insert_record(ucal, duration, event);
}
- }
- else { /* SU, SA: no week num: means all week:1TH,2TH,3TH.., so needs another byevent->system_type */
+ } else { /* SU, SA: no week num: means all week:1TH,2TH,3TH.., so needs another byevent->system_type */
int week_bits = 0;
/* if nowday in weekly */
if (NULL == event->byday || '\0' == event->byday[0]) {
int dtstart_wday = ucal_get(ucal, UCAL_DAY_OF_WEEK, &ec);
week_bits |= (0x01 << (dtstart_wday - 1));
- }
- else {
+ } else {
week_bits = __convert_week_to_bits(event->byday, NULL);
}
DBG("week integer(0x%x)", week_bits);
DBG("get wday(%d) != want wday(%d)", w, k + 1);
continue;
}
- if (true == __check_bysetpos_to_skip(j, bysetpos, bysetpos_len, bymonthday_len)) {
+ if (true == __check_bysetpos_to_skip(j, bysetpos, bysetpos_len, bymonthday_len))
continue;
- }
+
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
- if (true == __check_before_dtstart(current_utime, dtstart_utime)) {
+ if (true == __check_before_dtstart(current_utime, dtstart_utime))
continue;
- }
+
if (true == __check_exdate_to_skip(current_utime, exdate_len, &l)) {
count++;
continue;
}
is_exit = __check_out_of_range(current_utime, event, until_utime, &count);
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
_cal_db_instance_insert_record(ucal, duration, event);
}
- }
- else {
+ } else {
int year = ucal_get(ucal, UCAL_YEAR, &ec);
int month = ucal_get(ucal, UCAL_MONTH, &ec) + 1;
int get_month = ucal_get(ucal, UCAL_MONTH, &ec) + 1;
if (month != get_month) { j = 6; break; }
- if (true == __check_bysetpos_to_skip(index, bysetpos, bysetpos_len, dates_len)) {
+ if (true == __check_bysetpos_to_skip(index, bysetpos, bysetpos_len, dates_len))
continue;
- }
+
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
- if (true == __check_before_dtstart(current_utime, dtstart_utime)) {
+ if (true == __check_before_dtstart(current_utime, dtstart_utime))
continue;
- }
+
if (true == __check_exdate_to_skip(current_utime, exdate_len, &l)) {
count++;
continue;
}
is_exit = __check_out_of_range(current_utime, event, until_utime, &count);
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
_cal_db_instance_insert_record(ucal, duration, event);
}
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
}
}
}
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
is_exit = __check_to_stop_loop(current_utime, &last_utime, loop);
loop++;
DBG("bymonthday(%d) but get (%d) from icu", bymonthday[i], get_mday);
continue;
}
- }
- else if (bymonthday[i] < 0) {
+ } else if (bymonthday[i] < 0) {
ucal_set(ucal, UCAL_DATE, 1);
ucal_add(ucal, UCAL_MONTH, 1, &ec);
ucal_add(ucal, UCAL_DAY_OF_YEAR, bymonthday[i], &ec);
- }
- else { /* 0 is invalid */
+ } else { /* 0 is invalid */
DBG("Invalid bymonthday(%d)", bymonthday[i]);
continue;
}
- if (true == __check_bysetpos_to_skip(i, bysetpos, bysetpos_len, bymonthday_len)) {
+ if (true == __check_bysetpos_to_skip(i, bysetpos, bysetpos_len, bymonthday_len))
continue;
- }
+
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
- if (true == __check_before_dtstart(current_utime, dtstart_utime)) {
+ if (true == __check_before_dtstart(current_utime, dtstart_utime))
continue;
- }
+
if (true == __check_exdate_to_skip(current_utime, exdate_len, &l)) {
count++;
continue;
}
is_exit = __check_out_of_range(current_utime, event, until_utime, &count);
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
_cal_db_instance_insert_record(ucal, duration, event);
}
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
is_exit = __check_to_stop_loop(current_utime, &last_utime, loop);
loop++;
int dtstart_wday = ucal_get(ucal, UCAL_DAY_OF_WEEK, &ec);
week_bits |= (0x01 << (dtstart_wday - 1));
- }
- else {
+ } else {
week_bits = __convert_week_to_bits(event->byday, &byday_len);
}
DBG("week integer(0x%x)", week_bits);
int i;
int index = -1;
for (i = 0; i < 7; i++) {
- if (0 == (week_bits & (0x01 << ((byday_start -1 +i)%7)))) continue;
+ if (0 == (week_bits & (0x01 << ((byday_start -1 +i)%7))))
+ continue;
index++;
int wday_int = (byday_start -1 +i) %7 + 1;
ucal_set(ucal, UCAL_DAY_OF_WEEK, wday_int);
- if (true == __check_bysetpos_to_skip(index, bysetpos, bysetpos_len, byday_len)) {
+ if (true == __check_bysetpos_to_skip(index, bysetpos, bysetpos_len, byday_len))
continue;
- }
+
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
- if (true == __check_before_dtstart(current_utime, dtstart_utime)) {
+ if (true == __check_before_dtstart(current_utime, dtstart_utime))
continue;
- }
+
if (true == __check_exdate_to_skip(current_utime, exdate_len, &l)) {
count++;
continue;
}
is_exit = __check_out_of_range(current_utime, event, until_utime, &count);
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
_cal_db_instance_insert_record(ucal, duration, event);
}
- if (true == is_exit) break;
+ if (true == is_exit)
+ break;
current_utime = ms2sec(ucal_getMillis(ucal, &ec));
is_exit = __check_to_stop_loop(current_utime, &last_utime, loop);
loop++;
#include "cal_db_plugin_alarm_helper.h"
#include "cal_utils.h"
-//static int _cal_db_alarm_get_record(int id, calendar_record_h* out_record);
-static int _cal_db_alarm_get_all_records(int offset, int limit, calendar_list_h* out_list);
+/* static int _cal_db_alarm_get_record(int id, calendar_record_h* out_record); */
+static int _cal_db_alarm_get_all_records(int offset, int limit, calendar_list_h *out_list);
static int _cal_db_alarm_get_records_with_query(calendar_query_h query, int offset, int limit, calendar_list_h* out_list);
static int _cal_db_alarm_get_count(int *out_count);
static int _cal_db_alarm_get_count_with_query(calendar_query_h query, int *out_count);
.get_count_with_query = _cal_db_alarm_get_count_with_query
};
-static void _cal_db_alarm_get_stmt(sqlite3_stmt *stmt,calendar_record_h record)
+static void _cal_db_alarm_get_stmt(sqlite3_stmt *stmt, calendar_record_h record)
{
cal_alarm_s *alarm = NULL;
int index;
alarm->alarm_attach = cal_strdup((const char*)temp);
if (alarm->alarm.type == CALENDAR_TIME_UTIME) {
- alarm->alarm.time.utime = sqlite3_column_int64(stmt,index++);
+ alarm->alarm.time.utime = sqlite3_column_int64(stmt, index++);
index++; /* datetime */
- }
- else {
+ } else {
index++; /* utime */
temp = sqlite3_column_text(stmt, index++);
if (temp) {
ret = calendar_list_create(out_list);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "calendar_list_create() Fail(%d)", ret);
- if (0 < offset) {
+ if (0 < offset)
snprintf(offsetquery, sizeof(offsetquery), "OFFSET %d", offset);
- }
- if (0 < limit) {
+
+ if (0 < limit)
snprintf(limitquery, sizeof(limitquery), "LIMIT %d", limit);
- }
+
snprintf(query, sizeof(query), "SELECT *, rowid FROM %s %s %s",
- CAL_TABLE_ALARM,limitquery,offsetquery);
+ CAL_TABLE_ALARM, limitquery, offsetquery);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record = NULL;
- ret = calendar_record_create(_calendar_alarm._uri,&record);
+ ret = calendar_record_create(_calendar_alarm._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
return ret;
}
- _cal_db_alarm_get_stmt(stmt,record);
+ _cal_db_alarm_get_stmt(stmt, record);
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
alarm->alarm.time.utime = sqlite3_column_int64(stmt, *stmt_count);
*stmt_count = *stmt_count+1; /* datetime */
- }
- else {
+ } else {
*stmt_count = *stmt_count+1; /* utime */
*stmt_count = *stmt_count+1;
temp = sqlite3_column_text(stmt, *stmt_count);
const unsigned int *projection, const int projection_count,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
int stmt_count = 0;
- for(i=0;i<projection_count;i++)
- _cal_db_alarm_get_property_stmt(stmt,projection[i],&stmt_count,record);
+ for (i = 0; i < projection_count; i++)
+ _cal_db_alarm_get_property_stmt(stmt, projection[i], &stmt_count, record);
}
static int _cal_db_alarm_get_records_with_query(calendar_query_h query, int offset, int limit, calendar_list_h* out_list)
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_ALARM)) {
table_name = cal_strdup(CAL_TABLE_ALARM);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
cal_db_append_string(&query_str, "FROM");
cal_db_append_string(&query_str, table_name);
CAL_FREE(projection);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT *, rowid FROM ");
cal_db_append_string(&query_str, table_name);
}
/* bind text */
if (bind_text) {
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++) {
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
- }
}
ret = calendar_list_create(out_list);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(_calendar_alarm._uri,&record);
+ ret = calendar_record_create(_calendar_alarm._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
_cal_db_alarm_get_projection_stmt(stmt,
que->projection, que->projection_count,
record);
- }
- else {
- _cal_db_alarm_get_stmt(stmt,record);
+ } else {
+ _cal_db_alarm_get_stmt(stmt, record);
}
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
ERR("cal_db_util_query_get_first_int_result() failed");
return ret;
}
- DBG("%s=%d",query,count);
+ DBG("%s=%d", query, count);
*out_count = count;
return CALENDAR_ERROR_NONE;
que = (cal_query_s *)query;
- if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_ALARM)) {
+ if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_ALARM)) {
table_name = cal_strdup(CAL_TABLE_ALARM);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
CAL_FREE(query_str);
return ret;
}
- DBG("%s=%d",query_str,count);
+ DBG("%s=%d", query_str, count);
*out_count = count;
alarm->alarm.type = sqlite3_column_int(stmt, index++);
temp = sqlite3_column_text(stmt, index++);
- alarm->alarm_summary= cal_strdup((const char*)temp);
+ alarm->alarm_summary = cal_strdup((const char*)temp);
alarm->alarm_action = sqlite3_column_int(stmt, index++);
temp = sqlite3_column_text(stmt, index++);
- alarm->alarm_attach= cal_strdup((const char*)temp);
+ alarm->alarm_attach = cal_strdup((const char*)temp);
if (alarm->alarm.type == CALENDAR_TIME_UTIME) {
- alarm->alarm.time.utime = sqlite3_column_int64(stmt,index++);
+ alarm->alarm.time.utime = sqlite3_column_int64(stmt, index++);
index++; /* datetime */
- }
- else {
+ } else {
index++; /* utime */
temp = sqlite3_column_text(stmt, index++);
if (temp) {
static int _cal_db_attendee_get_records_with_query(calendar_query_h query, int offset, int limit, calendar_list_h* out_list);
static int _cal_db_attendee_get_count(int *out_count);
static int _cal_db_attendee_get_count_with_query(calendar_query_h query, int *out_count);
-// static int _cal_db_attendee_get_record(int id, calendar_record_h* out_record)
+/* static int _cal_db_attendee_get_record(int id, calendar_record_h* out_record) */
cal_db_plugin_cb_s cal_db_attendee_plugin_cb = {
.is_query_only = false,
.get_count_with_query = _cal_db_attendee_get_count_with_query
};
-static void _cal_db_attendee_get_stmt(sqlite3_stmt *stmt,calendar_record_h record)
+static void _cal_db_attendee_get_stmt(sqlite3_stmt *stmt, calendar_record_h record)
{
cal_attendee_s *attendee = NULL;
int index;
ret = calendar_list_create(out_list);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "calendar_list_create() Fail(%d)", ret);
- if (0 < limit) {
+ if (0 < limit)
snprintf(limitquery, sizeof(limitquery), "LIMIT %d ", limit);
- }
- if (0 < offset) {
+
+ if (0 < offset)
snprintf(offsetquery, sizeof(offsetquery), "OFFSET %d ", offset);
- }
+
snprintf(query, sizeof(query), "SELECT *, rowid FROM %s %s %s ",
CAL_TABLE_ATTENDEE, limitquery, offsetquery);
sqlite3_finalize(stmt);
return ret;
}
- _cal_db_attendee_get_stmt(stmt,record);
+ _cal_db_attendee_get_stmt(stmt, record);
ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
const unsigned int *projection, const int projection_count,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
int stmt_count = 0;
- for(i=0;i<projection_count;i++)
- _cal_db_attendee_get_property_stmt(stmt,projection[i],&stmt_count,record);
+ for (i = 0; i < projection_count; i++)
+ _cal_db_attendee_get_property_stmt(stmt, projection[i], &stmt_count, record);
}
static int _cal_db_attendee_get_records_with_query(calendar_query_h query, int offset, int limit, calendar_list_h* out_list)
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_ATTENDEE)) {
table_name = cal_strdup(CAL_TABLE_ATTENDEE);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
cal_db_append_string(&query_str, "FROM");
cal_db_append_string(&query_str, table_name);
CAL_FREE(projection);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT *, rowid FROM ");
cal_db_append_string(&query_str, table_name);
}
/* bind text */
if (bind_text) {
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++)
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(_calendar_attendee._uri,&record);
+ ret = calendar_record_create(_calendar_attendee._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
_cal_db_attendee_get_projection_stmt(stmt,
que->projection, que->projection_count,
record);
- }
- else {
- _cal_db_attendee_get_stmt(stmt,record);
+ } else {
+ _cal_db_attendee_get_stmt(stmt, record);
}
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
ERR("cal_db_util_query_get_first_int_result() failed");
return ret;
}
- DBG("%s=%d",query,count);
+ DBG("%s=%d", query, count);
*out_count = count;
return CALENDAR_ERROR_NONE;
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_ATTENDEE)) {
table_name = cal_strdup(CAL_TABLE_ATTENDEE);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
CAL_FREE(query_str);
return ret;
}
- DBG("%s=%d",query_str,count);
+ DBG("%s=%d", query_str, count);
*out_count = count;
/*
* static function
*/
-static void _cal_db_calendar_get_stmt(sqlite3_stmt *stmt,calendar_record_h record);
+static void _cal_db_calendar_get_stmt(sqlite3_stmt *stmt, calendar_record_h record);
static void _cal_db_calendar_get_property_stmt(sqlite3_stmt *stmt,
unsigned int property, int stmt_count, calendar_record_h record);
static void _cal_db_calendar_get_projection_stmt(sqlite3_stmt *stmt,
static int _cal_db_calendar_update_projection(calendar_record_h record);
cal_db_plugin_cb_s cal_db_calendar_plugin_cb = {
- .is_query_only=false,
- .insert_record=_cal_db_calendar_insert_record,
- .get_record=_cal_db_calendar_get_record,
- .update_record=_cal_db_calendar_update_record,
- .delete_record=_cal_db_calendar_delete_record,
- .get_all_records=_cal_db_calendar_get_all_records,
- .get_records_with_query=_cal_db_calendar_get_records_with_query,
- .insert_records=_cal_db_calendar_insert_records,
- .update_records=_cal_db_calendar_update_records,
- .delete_records=_cal_db_calendar_delete_records,
- .get_count=_cal_db_calendar_get_count,
- .get_count_with_query=_cal_db_calendar_get_count_with_query,
+ .is_query_only = false,
+ .insert_record = _cal_db_calendar_insert_record,
+ .get_record = _cal_db_calendar_get_record,
+ .update_record = _cal_db_calendar_update_record,
+ .delete_record = _cal_db_calendar_delete_record,
+ .get_all_records = _cal_db_calendar_get_all_records,
+ .get_records_with_query = _cal_db_calendar_get_records_with_query,
+ .insert_records = _cal_db_calendar_insert_records,
+ .update_records = _cal_db_calendar_update_records,
+ .delete_records = _cal_db_calendar_delete_records,
+ .get_count = _cal_db_calendar_get_count,
+ .get_count_with_query = _cal_db_calendar_get_count_with_query,
.replace_record = _cal_db_calendar_replace_record,
.replace_records = _cal_db_calendar_replace_records
};
sqlite3_stmt *stmt = NULL;
int ret = 0;
- ret = calendar_record_create(_calendar_book._uri ,out_record);
+ ret = calendar_record_create(_calendar_book._uri, out_record);
if (CALENDAR_ERROR_NONE != ret) {
ERR("calendar_record_create() Fail(%d)", ret);
return CALENDAR_ERROR_OUT_OF_MEMORY;
return CALENDAR_ERROR_INVALID_PARAMETER;
}
- if (book->common.properties_flags != NULL) {
+ if (book->common.properties_flags != NULL)
return _cal_db_calendar_update_projection(record);
- }
+
char query[CAL_DB_SQL_MAX_LEN] = {0};
snprintf(query, sizeof(query), "UPDATE %s SET "
}
snprintf(query, sizeof(query), "select count(*) from %s", CAL_TABLE_ALLDAY_INSTANCE);
- ret = cal_db_util_query_get_first_int_result(query,NULL, &count2);
+ ret = cal_db_util_query_get_first_int_result(query, NULL, &count2);
if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_db_util_query_get_first_int_result() Fail");
return ret;
ret = cal_db_util_query_exec(query);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_db_util_query_exec() Fail(%d)", ret);
cal_server_calendar_delete_start();
- }
- else {
+ } else {
snprintf(query, sizeof(query), "DELETE FROM %s WHERE id = %d", CAL_TABLE_CALENDAR, id);
ret = cal_db_util_query_exec(query);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "cal_db_util_query_exec() Fail(%d)", ret);
}
book->index = id;
- if (book->common.properties_flags) {
+ if (book->common.properties_flags)
return _cal_db_calendar_update_projection(record);
- }
char query[CAL_DB_SQL_MAX_LEN] = {0};
snprintf(query, sizeof(query), "UPDATE %s SET "
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(_calendar_book._uri,&record);
+ ret = calendar_record_create(_calendar_book._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
CAL_FREE(query_str);
return ret;
}
- _cal_db_calendar_get_stmt(stmt,record);
+ _cal_db_calendar_get_stmt(stmt, record);
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
cal_db_append_string(&query_str, "FROM");
cal_db_append_string(&query_str, CAL_TABLE_CALENDAR);
CAL_FREE(projection);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT * FROM");
cal_db_append_string(&query_str, CAL_TABLE_CALENDAR);
}
/* bind text */
if (bind_text) {
g_slist_length(bind_text);
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++)
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
}
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(_calendar_book._uri,&record);
+ ret = calendar_record_create(_calendar_book._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
_cal_db_calendar_get_projection_stmt(stmt,
que->projection, que->projection_count,
record);
- }
- else {
- _cal_db_calendar_get_stmt(stmt,record);
+ } else {
+ _cal_db_calendar_get_stmt(stmt, record);
}
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_h record;
int ret = 0;
int count = 0;
- int i=0;
+ int i = 0;
int *id = NULL;
ret = calendar_list_get_count(list, &count);
i++;
} while (CALENDAR_ERROR_NO_DATA != calendar_list_next(list));
- if (ids) {
+ if (ids)
*ids = id;
- }
- else {
+ else
CAL_FREE(id);
- }
return CALENDAR_ERROR_NONE;
}
{
int ret = 0;
int i = 0;
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
ret = _cal_db_calendar_delete_record(ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
ERR("_cal_db_calendar_delete_record() Fail(%d)", ret);
return ret;
}
}
- if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list)) {
+ if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list))
break;
- }
}
return CALENDAR_ERROR_NONE;
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_CALENDAR)) {
table_name = cal_strdup(CAL_TABLE_CALENDAR);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return CALENDAR_ERROR_NONE;
}
-static void _cal_db_calendar_get_stmt(sqlite3_stmt *stmt,calendar_record_h record)
+static void _cal_db_calendar_get_stmt(sqlite3_stmt *stmt, calendar_record_h record)
{
cal_book_s* calendar = (cal_book_s*)(record);
int count = 0;
const unsigned int *projection, const int projection_count,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
- for(i=0;i<projection_count;i++)
- _cal_db_calendar_get_property_stmt(stmt,projection[i],i,record);
+ for (i = 0; i < projection_count; i++)
+ _cal_db_calendar_get_property_stmt(stmt, projection[i], i, record);
}
static int _cal_db_calendar_update_projection(calendar_record_h record)
GSList *bind_text = NULL;
GSList *cursor = NULL;
- ret = cal_db_query_create_projection_update_set(record,&set,&bind_text);
+ ret = cal_db_query_create_projection_update_set(record, &set, &bind_text);
RETV_IF(CALENDAR_ERROR_NONE != ret, ret);
snprintf(query, sizeof(query), "UPDATE %s SET %s "
"WHERE id = %d",
- CAL_TABLE_CALENDAR,set,
+ CAL_TABLE_CALENDAR, set,
calendar->index);
ret = cal_db_util_query_prepare(query, &stmt);
/* bind */
if (bind_text) {
int i = 0;
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++)
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
}
sqlite3_finalize(stmt);
if (calendar_list)
- DBG("calendar cnt=%d",g_list_length(calendar_list));
+ DBG("calendar cnt=%d", g_list_length(calendar_list));
ret = cal_db_util_begin_trans();
if (CALENDAR_ERROR_NONE != ret) {
/*
* static function
*/
-static void _cal_db_event_get_stmt(sqlite3_stmt *stmt,bool is_view_table,calendar_record_h record, int *exception, int *extended);
+static void _cal_db_event_get_stmt(sqlite3_stmt *stmt, bool is_view_table, calendar_record_h record, int *exception, int *extended);
static void _cal_db_event_get_property_stmt(sqlite3_stmt *stmt, unsigned int property, int *stmt_count, calendar_record_h record);
static void _cal_db_event_get_projection_stmt(sqlite3_stmt *stmt, const unsigned int *projection, const int projection_count, calendar_record_h record);
static int _cal_db_event_exception_get_records(int original_id, cal_list_s *list);
calendar_record_h record_calendar;
calendar_book_sync_event_type_e sync_event_type = CALENDAR_BOOK_SYNC_EVENT_FOR_ME;
- ret = calendar_record_create(_calendar_event._uri ,out_record);
+ ret = calendar_record_create(_calendar_event._uri, out_record);
if (CALENDAR_ERROR_NONE != ret) {
ERR("calendar_record_create(%d)", ret);
return CALENDAR_ERROR_OUT_OF_MEMORY;
int i;
int is_dirty_in_time = DIRTY_IN_OTHER;
for (i = 0; i < count; i++) {
- if (false == cal_record_check_property_flag(record, info[i].property_id , CAL_PROPERTY_FLAG_DIRTY)) {
+ if (false == cal_record_check_property_flag(record, info[i].property_id, CAL_PROPERTY_FLAG_DIRTY))
continue;
- }
+
switch (info[i].property_id) {
case CAL_PROPERTY_EVENT_START:
case CAL_PROPERTY_EVENT_END:
static int __get_time_shifted_field(char *old_field, int old_type, int new_type, time_t time_diff, char **new_field)
{
- if (NULL == old_field || '\0' == *old_field) {
+ if (NULL == old_field || '\0' == *old_field)
return CALENDAR_ERROR_NONE;
- }
gchar **t = NULL;
t = g_strsplit_set(old_field, " ,", -1);
int len_t = g_strv_length(t);
int len_field = strlen(old_field);
- char *new= NULL;
- new= calloc(len_field + (len_t * 8) + 1, sizeof(char)); /* add (len_t * 8) for YYYYMMDD -> YYYYMMDDTHHMMSSZ */
+ char *new = NULL;
+ new = calloc(len_field + (len_t * 8) + 1, sizeof(char)); /* add (len_t * 8) for YYYYMMDD -> YYYYMMDDTHHMMSSZ */
if (NULL == new) {
ERR("calloc() Fail");
g_strfreev(t);
}
if (event->common.properties_flags) {
- if (DIRTY_INIT == is_dirty_in_time) {
+ if (DIRTY_INIT == is_dirty_in_time)
is_dirty_in_time = __is_dirty_in_time(record);
- }
+
return _cal_db_event_update_dirty(record, is_dirty_in_time);
}
event->end.type,
event->end.type == CALENDAR_TIME_UTIME ? event->end.time.utime : 0,
0 < event->freq ? 1 : 0,
- (event->attendee_list && 0 < event->attendee_list->count)? 1: 0,
+ (event->attendee_list && 0 < event->attendee_list->count) ? 1 : 0,
has_alarm,
event->system_type,
event->updated,
- (event->exception_list && 0 < event->exception_list->count)? 1 : 0,
- (event->extended_list && 0 < event->extended_list->count)? 1 : 0,
+ (event->exception_list && 0 < event->exception_list->count) ? 1 : 0,
+ (event->extended_list && 0 < event->extended_list->count) ? 1 : 0,
event->freq,
is_allday,
event->index);
index++;
if (event->exdate) {
- if (DIRTY_IN_TIME == is_dirty_in_time) {
+ if (DIRTY_IN_TIME == is_dirty_in_time)
__update_exdate(event, time_diff);
- }
+
cal_db_util_stmt_bind_text(stmt, index, event->exdate);
}
index++;
cal_db_instance_discard_record(event->index);
cal_db_instance_publish_record(record);
- }
- else {
+ } else {
cal_db_instance_update_exdate_del(event->index, event->exdate);
}
if (NULL == temp || strlen((char *)temp) < 1) {
exdate = cal_strdup(recurrence_id);
DBG("append first exdate[%s]", exdate);
- }
- else {
+ } else {
if (strstr((char *)temp, recurrence_id)) {
DBG("warn: recurrence id already is registered to exdate");
sqlite3_finalize(stmt);
snprintf(exdate, len, "%s,%s", temp, recurrence_id);
DBG("append [%s] to already has exdate [%s]", temp, recurrence_id);
}
- }
- else {
+ } else {
DBG("Failed to get exdate: event_id(%d)", original_event_id);
}
sqlite3_finalize(stmt);
return ret;
}
- }
- else {
+ } else {
cal_db_util_get_next_ver();
DBG("delete event");
ret = calendar_list_create(out_list);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "calendar_list_create() Fail(%d)", ret);
- if (0 < offset) {
+ if (0 < offset)
snprintf(offsetquery, sizeof(offsetquery), "OFFSET %d", offset);
- }
- if (0 < limit) {
+
+ if (0 < limit)
snprintf(limitquery, sizeof(limitquery), "LIMIT %d", limit);
- }
char *query_str = NULL;
cal_db_append_string(&query_str, "SELECT * FROM");
SECURE("[TEST]---------query[%s]", query_str);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- int exception=0, extended=0;
- ret = calendar_record_create(_calendar_event._uri,&record);
+ int exception = 0, extended = 0;
+ ret = calendar_record_create(_calendar_event._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
int record_id = 0;
cal_event_s* pevent = (cal_event_s*) record;
calendar_record_get_int(record, _calendar_event.id, &record_id);
- if (CALENDAR_ERROR_NONE == calendar_record_get_int(record, _calendar_event.has_attendee,&has_attendee)) {
- if (has_attendee == 1) {
+ if (CALENDAR_ERROR_NONE == calendar_record_get_int(record, _calendar_event.has_attendee, &has_attendee)) {
+ if (has_attendee == 1)
cal_db_attendee_get_records(record_id, pevent->attendee_list);
- }
}
- if (CALENDAR_ERROR_NONE == calendar_record_get_int(record, _calendar_event.has_alarm,&has_alarm)) {
- if (has_alarm == 1) {
+ if (CALENDAR_ERROR_NONE == calendar_record_get_int(record, _calendar_event.has_alarm, &has_alarm)) {
+ if (has_alarm == 1)
cal_db_alarm_get_records(record_id, pevent->alarm_list);
- }
}
if (exception == 1)
_cal_db_event_exception_get_records(record_id, pevent->exception_list);
+
if (extended == 1)
cal_db_extended_get_records(record_id, CALENDAR_RECORD_TYPE_EVENT, pevent->extended_list);
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT)) {
table_name = cal_strdup(CAL_VIEW_TABLE_EVENT);
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_CALENDAR);
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR_ATTENDEE)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR_ATTENDEE)) {
table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_CALENDAR_ATTENDEE);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
cal_db_append_string(&query_str, "FROM");
cal_db_append_string(&query_str, table_name);
CAL_FREE(projection);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT * FROM");
cal_db_append_string(&query_str, table_name);
}
cal_db_append_string(&query_str, buf);
}
}
- DBG("%s",query_str);
+ DBG("%s", query_str);
/* query */
ret = cal_db_util_query_prepare(query_str, &stmt);
/* bind text */
if (bind_text) {
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++) {
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
- }
}
ret = calendar_list_create(&list);
int exception = 1, extended = 1;
int attendee = 1, alarm = 1;
- ret = calendar_record_create(_calendar_event._uri,&record);
+ ret = calendar_record_create(_calendar_event._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(list, true);
if (bind_text) {
if (0 < que->projection_count) {
cal_record_set_projection(record, que->projection, que->projection_count, que->property_count);
_cal_db_event_get_projection_stmt(stmt, que->projection, que->projection_count, record);
- }
- else {
+ } else {
cal_event_s *event = NULL;
- _cal_db_event_get_stmt(stmt,true,record, &exception, &extended);
+ _cal_db_event_get_stmt(stmt, true, record, &exception, &extended);
event = (cal_event_s*)(record);
if (event) {
attendee = event->has_attendee;
cal_event_s* pevent = (cal_event_s*) record;
cal_db_attendee_get_records(pevent->index, pevent->attendee_list);
}
- if (cal_db_query_find_projection_property(query, CAL_PROPERTY_EVENT_EXCEPTION) == true && exception ==1) {
+ if (cal_db_query_find_projection_property(query, CAL_PROPERTY_EVENT_EXCEPTION) == true && exception == 1) {
cal_event_s* pevent = (cal_event_s*) record;
_cal_db_event_exception_get_records(pevent->index, pevent->exception_list);
}
- if (cal_db_query_find_projection_property(query, CAL_PROPERTY_EVENT_EXTENDED) == true && extended ==1) {
+ if (cal_db_query_find_projection_property(query, CAL_PROPERTY_EVENT_EXTENDED) == true && extended == 1) {
cal_event_s* pevent = (cal_event_s*) record;
cal_db_extended_get_records(pevent->index, CALENDAR_RECORD_TYPE_EVENT, pevent->extended_list);
}
- ret = calendar_list_add(list,record);
+ ret = calendar_list_add(list, record);
if (CALENDAR_ERROR_NONE != ret) {
ERR("calendar_list_add() Fail(%d)", ret);
calendar_list_destroy(list, true);
calendar_record_h record;
int ret = 0;
int count = 0;
- int i=0;
+ int i = 0;
int *id = NULL;
ret = calendar_list_get_count(list, &count);
i++;
} while (CALENDAR_ERROR_NO_DATA != calendar_list_next(list));
- if (ids) {
+ if (ids)
*ids = id;
- }
- else {
+ else
CAL_FREE(id);
- }
+
return CALENDAR_ERROR_NONE;
}
int ret = CALENDAR_ERROR_NONE;
int i = 0;
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
ret = _cal_db_event_delete_record(ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
ERR("_cal_db_event_delete_record() Fail(%d)", ret);
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT)) {
table_name = cal_strdup(CAL_VIEW_TABLE_EVENT);
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_CALENDAR);
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR_ATTENDEE)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR_ATTENDEE)) {
table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_CALENDAR_ATTENDEE);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
ERR("cal_access_control_have_write_permission() Fail");
return CALENDAR_ERROR_PERMISSION_DENIED;
}
- if (event->common.properties_flags != NULL) {
+ if (event->common.properties_flags != NULL)
return _cal_db_event_update_dirty(record, -1);
- }
+
has_alarm = cal_db_alarm_has_alarm(event->alarm_list);
cal_db_timezone_search_with_tzid(event->calendar_id, event->start_tzid, &timezone_id);
input_ver = cal_db_util_get_next_ver();
return CALENDAR_ERROR_DB_FAILED;
}
}
- if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list)) {
+ if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list))
break;
- }
}
return CALENDAR_ERROR_NONE;
}
-static void _cal_db_event_get_stmt(sqlite3_stmt *stmt,bool is_view_table,calendar_record_h record,
+static void _cal_db_event_get_stmt(sqlite3_stmt *stmt, bool is_view_table, calendar_record_h record,
int *exception, int *extended)
{
cal_event_s *event = NULL;
event->meeting_status = sqlite3_column_int(stmt, count++);
event->calendar_id = sqlite3_column_int(stmt, count++);
event->original_event_id = sqlite3_column_int(stmt, count++);
- event->latitude = sqlite3_column_double(stmt,count++);
- event->longitude = sqlite3_column_double(stmt,count++);
+ event->latitude = sqlite3_column_double(stmt, count++);
+ event->longitude = sqlite3_column_double(stmt, count++);
event->email_id = sqlite3_column_int(stmt, count++);
event->created_time = sqlite3_column_int64(stmt, count++);
count++; /* changed_ver */
count++; /* created_ver */
- event->is_deleted = sqlite3_column_int(stmt,count++);
- event->start.type = sqlite3_column_int(stmt,count++);
+ event->is_deleted = sqlite3_column_int(stmt, count++);
+ event->start.type = sqlite3_column_int(stmt, count++);
if (event->start.type == CALENDAR_TIME_UTIME) {
- event->start.time.utime = sqlite3_column_int64(stmt,count++);
+ event->start.time.utime = sqlite3_column_int64(stmt, count++);
count++; /* dtstart_datetime */
- }
- else {
+ } else {
count++; /* dtstart_utime */
temp = sqlite3_column_text(stmt, count++);
if (temp) {
event->end.type = sqlite3_column_int(stmt, count++);
if (event->end.type == CALENDAR_TIME_UTIME) {
- event->end.time.utime = sqlite3_column_int64(stmt,count++);
+ event->end.time.utime = sqlite3_column_int64(stmt, count++);
count++; /* dtend_datetime */
- }
- else {
+ } else {
count++; /* dtend_utime */
temp = sqlite3_column_text(stmt, count++);
if (temp) {
temp = sqlite3_column_text(stmt, count++);
event->end_tzid = cal_strdup((const char*)temp);
- event->last_mod = sqlite3_column_int64(stmt,count++);
- sqlite3_column_int(stmt,count++);
+ event->last_mod = sqlite3_column_int64(stmt, count++);
+ sqlite3_column_int(stmt, count++);
temp = sqlite3_column_text(stmt, count++);
event->recurrence_id = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
event->rdate = cal_strdup((const char*)temp);
- event->has_attendee = sqlite3_column_int(stmt,count++);
- event->has_alarm = sqlite3_column_int(stmt,count++);
- event->system_type = sqlite3_column_int(stmt,count++);
- event->updated = sqlite3_column_int(stmt,count++);
+ event->has_attendee = sqlite3_column_int(stmt, count++);
+ event->has_alarm = sqlite3_column_int(stmt, count++);
+ event->system_type = sqlite3_column_int(stmt, count++);
+ event->updated = sqlite3_column_int(stmt, count++);
temp = sqlite3_column_text(stmt, count++);
event->sync_data1 = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
/* has_exception */
if (exception)
- *exception = sqlite3_column_int(stmt,count++);
+ *exception = sqlite3_column_int(stmt, count++);
/* has_extended */
if (extended)
- *extended = sqlite3_column_int(stmt,count++);
+ *extended = sqlite3_column_int(stmt, count++);
event->freq = sqlite3_column_int(stmt, count++);
event->is_allday = sqlite3_column_int(stmt, count++);
if (is_view_table == true) {
- if (event->freq <= 0) {
+ if (event->freq <= 0)
return ;
- }
event->range_type = sqlite3_column_int(stmt, count++);
event->until.type = sqlite3_column_int(stmt, count++);
event->byhour = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
- event->byday= cal_strdup((const char*)temp);
+ event->byday = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
- event->bymonthday= cal_strdup((const char*)temp);
+ event->bymonthday = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
- event->byyearday= cal_strdup((const char*)temp);
+ event->byyearday = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
- event->byweekno= cal_strdup((const char*)temp);
+ event->byweekno = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
- event->bymonth= cal_strdup((const char*)temp);
+ event->bymonth = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
event->bysetpos = cal_strdup((const char*)temp);
event->original_event_id = sqlite3_column_int(stmt, *stmt_count);
break;
case CAL_PROPERTY_EVENT_LATITUDE:
- event->latitude = sqlite3_column_double(stmt,*stmt_count);
+ event->latitude = sqlite3_column_double(stmt, *stmt_count);
break;
case CAL_PROPERTY_EVENT_LONGITUDE:
- event->longitude = sqlite3_column_double(stmt,*stmt_count);
+ event->longitude = sqlite3_column_double(stmt, *stmt_count);
break;
case CAL_PROPERTY_EVENT_EMAIL_ID:
event->email_id = sqlite3_column_int(stmt, *stmt_count);
event->sync_data4 = cal_strdup((const char*)temp);
break;
case CAL_PROPERTY_EVENT_START:
- event->start.type = sqlite3_column_int(stmt,*stmt_count);
+ event->start.type = sqlite3_column_int(stmt, *stmt_count);
if (event->start.type == CALENDAR_TIME_UTIME) {
*stmt_count = *stmt_count+1;
- event->start.time.utime = sqlite3_column_int64(stmt,*stmt_count);
+ event->start.time.utime = sqlite3_column_int64(stmt, *stmt_count);
*stmt_count = *stmt_count+1; /* dtstart_datetime */
- }
- else {
+ } else {
*stmt_count = *stmt_count+1;
*stmt_count = *stmt_count+1;
temp = sqlite3_column_text(stmt, *stmt_count);
event->end.type = sqlite3_column_int(stmt, *stmt_count);
if (event->end.type == CALENDAR_TIME_UTIME) {
*stmt_count = *stmt_count+1;
- event->end.time.utime = sqlite3_column_int64(stmt,*stmt_count);
+ event->end.time.utime = sqlite3_column_int64(stmt, *stmt_count);
*stmt_count = *stmt_count+1; /* dtstart_datetime */
- }
- else {
+ } else {
*stmt_count = *stmt_count+1; /* dtend_utime */
*stmt_count = *stmt_count+1;
temp = sqlite3_column_text(stmt, *stmt_count);
const unsigned int *projection, const int projection_count,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
int stmt_count = 0;
- for(i=0;i<projection_count;i++) {
- _cal_db_event_get_property_stmt(stmt,projection[i],&stmt_count,record);
- }
+ for (i = 0; i < projection_count; i++)
+ _cal_db_event_get_property_stmt(stmt, projection[i], &stmt_count, record);
}
static bool _cal_db_event_check_calendar_book_type(calendar_record_h record)
if (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
store_type = sqlite3_column_int(stmt, 0);
- }
- else {
+ } else {
sqlite3_finalize(stmt);
stmt = NULL;
DBG("Failed to get calendar: calendar_id(%d)", event->calendar_id);
int ret = CALENDAR_ERROR_NONE;
calendar_record_h original_record = NULL;
- ret = calendar_record_get_int(record,_calendar_event.id, &event_id);
+ ret = calendar_record_get_int(record, _calendar_event.id, &event_id);
RETV_IF(CALENDAR_ERROR_NONE != ret, ret);
- DBG("id=%d",event_id);
+ DBG("id=%d", event_id);
ret = _cal_db_event_get_record(event_id, &original_record);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "_cal_db_event_get_record() Fail(%d)", ret);
cal_record_s *_record = NULL;
const cal_property_info_s* property_info = NULL;
int property_info_count = 0;
- int i=0;
+ int i = 0;
_record = (cal_record_s *)record;
property_info = cal_view_get_property_info(_record->view_uri, &property_info_count);
- for(i=0;i<property_info_count;i++) {
- if (false == cal_record_check_property_flag(record, property_info[i].property_id , CAL_PROPERTY_FLAG_DIRTY)) {
+ for (i = 0; i < property_info_count; i++) {
+ if (false == cal_record_check_property_flag(record, property_info[i].property_id , CAL_PROPERTY_FLAG_DIRTY))
continue;
- }
if (property_info[i].property_id == CAL_PROPERTY_EVENT_EXDATE) {
int calendar_id = 0;
calendar_book_sync_event_type_e sync_event_type = CALENDAR_BOOK_SYNC_EVENT_FOR_ME;
char *record_exdate = NULL;
- ret = calendar_record_get_str_p(record,property_info[i]. property_id, &record_exdate);
+ ret = calendar_record_get_str_p(record, property_info[i]. property_id, &record_exdate);
if (CALENDAR_ERROR_NONE != ret)
continue;
ret = calendar_record_get_int(original_record, CAL_PROPERTY_EVENT_CALENDAR_ID, &calendar_id);
calendar_record_destroy(record_calendar, true);
char *original_exdate = NULL;
- ret = calendar_record_get_str_p(original_record,property_info[i].property_id,&original_exdate);
+ ret = calendar_record_get_str_p(original_record, property_info[i].property_id, &original_exdate);
if (CALENDAR_ERROR_NONE != ret)
continue;
if (sync_event_type == CALENDAR_BOOK_SYNC_EVENT_FOR_EVERY_AND_REMAIN) {
ret = _cal_db_event_exdate_insert_normal(event_id, original_exdate, record_exdate, NULL, NULL);
- WARN_IF(CALENDAR_ERROR_NONE != ret, "%s->%s",original_exdate,record_exdate);
+ WARN_IF(CALENDAR_ERROR_NONE != ret, "%s->%s", original_exdate, record_exdate);
- }
- else {
+ } else {
int *exception_ids = NULL;
int exception_len = 0;
ret = _cal_db_event_exdate_insert_normal(event_id, original_exdate, record_exdate, &exception_ids, &exception_len);
- WARN_IF(CALENDAR_ERROR_NONE != ret, "%s->%s",original_exdate,record_exdate);
+ WARN_IF(CALENDAR_ERROR_NONE != ret, "%s->%s", original_exdate, record_exdate);
ret = _cal_db_event_delete_exception(exception_ids, exception_len);
WARN_IF(CALENDAR_ERROR_NONE != ret, "_cal_db_event_delete_record() Fail");
free(exception_ids);
ret = cal_record_set_str(original_record, property_info[i].property_id, record_exdate);
if (CALENDAR_ERROR_NONE != ret)
continue;
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_INT) == true) {
- int tmp=0;
- ret = calendar_record_get_int(record,property_info[i].property_id,&tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_INT) == true) {
+ int tmp = 0;
+ ret = calendar_record_get_int(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
ret = cal_record_set_int(original_record, property_info[i].property_id, tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
- char *tmp=NULL;
- ret = calendar_record_get_str_p(record,property_info[i].property_id,&tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
+ char *tmp = NULL;
+ ret = calendar_record_get_str_p(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
ret = cal_record_set_str(original_record, property_info[i].property_id, tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
- double tmp=0;
- ret = calendar_record_get_double(record,property_info[i].property_id,&tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
+ double tmp = 0;
+ ret = calendar_record_get_double(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
ret = cal_record_set_double(original_record, property_info[i].property_id, tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
- long long int tmp=0;
- ret = calendar_record_get_lli(record,property_info[i].property_id,&tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
+ long long int tmp = 0;
+ ret = calendar_record_get_lli(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
ret = cal_record_set_lli(original_record, property_info[i].property_id, tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
calendar_time_s tmp = {0,};
- ret = calendar_record_get_caltime(record,property_info[i].property_id,&tmp);
+ ret = calendar_record_get_caltime(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
ret = cal_record_set_caltime(original_record, property_info[i].property_id, tmp);
calendar_list_first(exception_list);
while (CALENDAR_ERROR_NONE == calendar_list_get_current_record_p(exception_list, &exception)) {
int exception_id = 0;
- ret = calendar_record_get_int(exception,_calendar_event.id, &exception_id);
+ ret = calendar_record_get_int(exception, _calendar_event.id, &exception_id);
DBG("exception(%d)", exception_id);
if (0 < exception_id && exception_id != original_id) { /* update */
bool bchanged = false;
cal_db_instance_discard_record(exception_id);
cal_db_instance_publish_record(exception);
- }
- else {
+ } else {
cal_db_instance_discard_record(exception_id);
cal_db_instance_publish_record(exception);
- DBG("exception don't changed. exception_id=[%d]",exception_id);
+ DBG("exception don't changed. exception_id=[%d]", exception_id);
}
if (id_list)
id_list = g_list_remove(id_list, GINT_TO_POINTER(exception_id));
- }
- else {
+ } else {
/* insert */
- ret = cal_record_set_int(exception,_calendar_event.calendar_book_id, calendar_id);
+ ret = cal_record_set_int(exception, _calendar_event.calendar_book_id, calendar_id);
if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_record_set_int() Fail(%d)", ret);
if (id_list)
RETVM_IF(NULL == ids, CALENDAR_ERROR_OUT_OF_MEMORY, "calloc() Fail");
int exception_count = 0;
- for(i = 0; i < len1; i++) {
+ for (i = 0; i < len1; i++) {
if (NULL == patterns1[i]) {
ERR("exdate is NULL, so check next");
continue;
}
bool bFind = false;
- for(j = 0; j < len2; j++) {
+ for (j = 0; j < len2; j++) {
if (NULL == patterns2[j]) {
ERR("original exdate is NULL");
continue;
&y, &mon, &d, &h, &min, &s);
start_utime = cal_time_convert_itol(NULL, y, mon, d, h, min, s);
- }
- else {
+ } else {
snprintf(datetime, sizeof(datetime),
"%s", patterns1[i]);
exception_count++;
}
}
- if (exception_ids) {
+ if (exception_ids)
*exception_ids = ids;
- }
- else {
+ else
free(ids);
- }
+
if (exception_len)
*exception_len = exception_count;
if (event->start.time.date.month < 1 || 12 < event->start.time.date.month) {
ERR("Error check start month(input:%d)", event->start.time.date.month);
return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- else if (event->start.time.date.mday < 1 || 31 < event->start.time.date.mday) {
+ } else if (event->start.time.date.mday < 1 || 31 < event->start.time.date.mday) {
ERR("Error check start mday(input:%d)", event->start.time.date.mday);
return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- else if (event->end.time.date.month < 1 || 12 < event->end.time.date.month) {
+ } else if (event->end.time.date.month < 1 || 12 < event->end.time.date.month) {
ERR("Error check end month(input:%d)", event->end.time.date.month);
return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- else if (event->end.time.date.mday < 1 || 31 < event->end.time.date.mday) {
+ } else if (event->end.time.date.mday < 1 || 31 < event->end.time.date.mday) {
ERR("Error check end mday(input:%d)", event->end.time.date.mday);
return CALENDAR_ERROR_INVALID_PARAMETER;
- }
- else {
+ } else {
/* handle hour, minute, second */
if (event->start.time.date.hour < 0 || 24 < event->start.time.date.hour)
event->start.time.date.hour = 0;
}
char *recurrence_id = NULL;
- if (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
+ if (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt))
recurrence_id = cal_strdup((const char*)sqlite3_column_text(stmt, 0));
- }
+
sqlite3_finalize(stmt);
return recurrence_id;
}
continue;
tzid = strdup(s[i] + strlen("TZID="));
DBG("tzid [%s]", tzid);
- }
- else if (CAL_STRING_EQUAL == strncmp(s[i], "RANGE=", strlen("RANGE="))) {
+ } else if (CAL_STRING_EQUAL == strncmp(s[i], "RANGE=", strlen("RANGE="))) {
char *param = s[i] + strlen("RANGE=");
if (CAL_STRING_EQUAL == strncmp(param, "THISANDFUTURE", strlen("THISANDFUTURE")))
range = CAL_RECURRENCE_ID_RANGE_THISANDFUTURE;
range = CAL_RECURRENCE_ID_RANGE_THISANDPRIOR;
else
ERR("Invalid param[%s]", s[i]);
- }
- else {
+ } else {
ERR("Invalid param[%s]", s[i]);
}
}
sscanf(temp, CAL_FORMAT_LOCAL_DATETIME,
&(dtstart->time.date.year), &(dtstart->time.date.month), &(dtstart->time.date.mday),
&(dtstart->time.date.hour), &(dtstart->time.date.minute), &(dtstart->time.date.second));
- }
- else {
+ } else {
ERR("datetime is NULL");
}
}
dtstart_utime = cal_time_convert_itol(tzid, y, m, d, h, n, s);
rectime.type = CALENDAR_TIME_UTIME;
rectime.time.utime = dtstart_utime;
- }
- else {
+ } else {
snprintf(dtstart_datetime, sizeof(dtstart_datetime), CAL_FORMAT_LOCAL_DATETIME, y, m, d, h, n, s);
rectime.type = CALENDAR_TIME_LOCALTIME;
rectime.time.date.year = y;
SECURE("query[%s]", query);
return ret;
}
- if (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
+ if (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt))
parent_id = sqlite3_column_int64(stmt, 0);
- }
+
sqlite3_finalize(stmt);
DBG("found parent_id(%d)", parent_id);
return parent_id;
calendar_record_get_int(record, _calendar_event.id, &tmp);
cal_record_set_int(record, _calendar_event.id, event_id);
- if (id) {
+ if (id)
*id = event_id;
- }
cal_db_rrule_get_rrule_from_record(record, &rrule);
if (rrule) {
cal_db_rrule_insert_record(event_id, rrule);
CAL_FREE(rrule);
}
- if (0 < original_event_id) {
+
+ if (0 < original_event_id)
cal_record_set_int(record, _calendar_event.original_event_id, original_event_id);
- }
+
cal_db_instance_publish_record(record);
while (event->uid && *event->uid) {
l = g_list_next(l);
}
g_list_free(list);
- }
- else {
+ } else {
DBG("this is child");
/* get parent with uid and update original_event_id */
int parent_id = 0;
DBG("insert alarm");
ret = cal_db_alarm_insert_records(event->alarm_list, event_id);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_db_alarm_insert_records() Fail(%d)", ret);
- }
- else {
+ } else {
DBG("No alarm");
}
DBG("insert attendee");
ret = cal_db_attendee_insert_records(event->attendee_list, event_id);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_db_attendee_insert_records() Fail(%d)", ret);
- }
- else {
+ } else {
DBG("No attendee");
}
DBG("insert exception");
ret = cal_db_event_insert_records(event->exception_list, event_id);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_db_event_insert_records() Fail(%d)", ret);
- }
- else {
+ } else {
DBG("No exception");
}
DBG("insert extended");
ret = cal_db_extended_insert_records(event->extended_list, event_id, CALENDAR_RECORD_TYPE_EVENT);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_db_extended_insert_records() Fail(%d)", ret);
- }
- else {
+ } else {
DBG("No extended");
}
/*
* static function
*/
-static void _cal_db_extended_get_stmt(sqlite3_stmt *stmt,calendar_record_h record);
+static void _cal_db_extended_get_stmt(sqlite3_stmt *stmt, calendar_record_h record);
static void _cal_db_extended_get_property_stmt(sqlite3_stmt *stmt,
unsigned int property, int stmt_count, calendar_record_h record);
static void _cal_db_extended_get_projection_stmt(sqlite3_stmt *stmt,
const unsigned int *projection, const int projection_count,
calendar_record_h record);
-static void _cal_db_extended_get_stmt(sqlite3_stmt *stmt,calendar_record_h record);
+static void _cal_db_extended_get_stmt(sqlite3_stmt *stmt, calendar_record_h record);
static int _cal_db_extended_update_projection(calendar_record_h record);
cal_db_plugin_cb_s cal_db_extended_plugin_cb = {
- .is_query_only=false,
- .insert_record=_cal_db_extended_insert_record,
- .get_record=_cal_db_extended_get_record,
- .update_record=_cal_db_extended_update_record,
- .delete_record=_cal_db_extended_delete_record,
- .get_all_records=_cal_db_extended_get_all_records,
- .get_records_with_query=_cal_db_extended_get_records_with_query,
- .insert_records=_cal_db_extended_insert_records,
- .update_records=_cal_db_extended_update_records,
- .delete_records=_cal_db_extended_delete_records,
- .get_count=_cal_db_extended_get_count,
- .get_count_with_query=_cal_db_extended_get_count_with_query,
+ .is_query_only = false,
+ .insert_record = _cal_db_extended_insert_record,
+ .get_record = _cal_db_extended_get_record,
+ .update_record = _cal_db_extended_update_record,
+ .delete_record = _cal_db_extended_delete_record,
+ .get_all_records = _cal_db_extended_get_all_records,
+ .get_records_with_query = _cal_db_extended_get_records_with_query,
+ .insert_records = _cal_db_extended_insert_records,
+ .update_records = _cal_db_extended_update_records,
+ .delete_records = _cal_db_extended_delete_records,
+ .get_count = _cal_db_extended_get_count,
+ .get_count_with_query = _cal_db_extended_get_count_with_query,
.replace_record = _cal_db_extended_replace_record,
.replace_records = _cal_db_extended_replace_records
};
char query[CAL_DB_SQL_MAX_LEN];
sqlite3_stmt *stmt = NULL;
- ret = calendar_record_create(_calendar_extended_property._uri ,out_record);
+ ret = calendar_record_create(_calendar_extended_property._uri, out_record);
if (CALENDAR_ERROR_NONE != ret) {
ERR("calendar_record_create() Fail(%d)", ret);
return CALENDAR_ERROR_OUT_OF_MEMORY;
return ret;
}
- _cal_db_extended_get_stmt(stmt,*out_record);
+ _cal_db_extended_get_stmt(stmt, *out_record);
sqlite3_finalize(stmt);
stmt = NULL;
RETV_IF(NULL == extended_info, CALENDAR_ERROR_INVALID_PARAMETER);
- if (extended_info->common.properties_flags) {
+ if (extended_info->common.properties_flags)
return _cal_db_extended_update_projection(record);
- }
snprintf(query, sizeof(query), "UPDATE %s SET "
"record_id=%d,"
RETV_IF(NULL == extended_info, CALENDAR_ERROR_INVALID_PARAMETER);
extended_info->id = id;
- if (extended_info->common.properties_flags) {
+ if (extended_info->common.properties_flags)
return _cal_db_extended_update_projection(record);
- }
snprintf(query, sizeof(query), "UPDATE %s SET "
"record_id=%d,"
ret = calendar_list_create(out_list);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "calendar_list_create() Fail(%d)", ret);
- if (0 < offset) {
+ if (0 < offset)
snprintf(offsetquery, sizeof(offsetquery), "OFFSET %d", offset);
- }
- if (0 < limit) {
+
+ if (0 < limit)
snprintf(limitquery, sizeof(limitquery), "LIMIT %d", limit);
- }
- snprintf(query, sizeof(query), "SELECT * FROM %s %s %s", CAL_TABLE_EXTENDED,limitquery,offsetquery);
+
+ snprintf(query, sizeof(query), "SELECT * FROM %s %s %s", CAL_TABLE_EXTENDED, limitquery, offsetquery);
ret = cal_db_util_query_prepare(query, &stmt);
if (CALENDAR_ERROR_NONE != ret) {
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(_calendar_extended_property._uri,&record);
+ ret = calendar_record_create(_calendar_extended_property._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
return ret;
}
- _cal_db_extended_get_stmt(stmt,record);
+ _cal_db_extended_get_stmt(stmt, record);
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
cal_db_append_string(&query_str, "FROM");
cal_db_append_string(&query_str, CAL_TABLE_EXTENDED);
CAL_FREE(projection);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT * FROM");
cal_db_append_string(&query_str, CAL_TABLE_EXTENDED);
}
/* bind text */
if (bind_text) {
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++) {
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
- }
}
ret = calendar_list_create(out_list);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(_calendar_extended_property._uri,&record);
+ ret = calendar_record_create(_calendar_extended_property._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
_cal_db_extended_get_projection_stmt(stmt,
que->projection, que->projection_count,
record);
- }
- else {
- _cal_db_extended_get_stmt(stmt,record);
+ } else {
+ _cal_db_extended_get_stmt(stmt, record);
}
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_h record;
int ret = 0;
int count = 0;
- int i=0;
+ int i = 0;
int *id = NULL;
ret = calendar_list_get_count(list, &count);
i++;
} while (CALENDAR_ERROR_NO_DATA != calendar_list_next(list));
- if (ids) {
+ if (ids)
*ids = id;
- }
- else {
+ else
CAL_FREE(id);
- }
return CALENDAR_ERROR_NONE;
}
{
int ret = 0;
int i = 0;
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
ret = _cal_db_extended_delete_record(ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
ERR("_cal_db_extended_delete_record() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
}
}
- if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list)) {
+ if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list))
break;
- }
}
return CALENDAR_ERROR_NONE;
ERR("cal_db_util_query_get_first_int_result() Fail");
return ret;
}
- DBG("%s=%d",query,count);
+ DBG("%s=%d", query, count);
*out_count = count;
return CALENDAR_ERROR_NONE;
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EXTENDED)) {
table_name = cal_strdup(CAL_TABLE_EXTENDED);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
CAL_FREE(query_str);
return ret;
}
- DBG("%s=%d",query_str,count);
+ DBG("%s=%d", query_str, count);
*out_count = count;
return CALENDAR_ERROR_NONE;
}
-static void _cal_db_extended_get_stmt(sqlite3_stmt *stmt,calendar_record_h record)
+static void _cal_db_extended_get_stmt(sqlite3_stmt *stmt, calendar_record_h record)
{
cal_extended_s* extended = (cal_extended_s*)(record);
int count = 0;
const unsigned int *projection, const int projection_count,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
- for(i=0;i<projection_count;i++) {
- _cal_db_extended_get_property_stmt(stmt,projection[i],i,record);
- }
+ for (i = 0; i < projection_count; i++)
+ _cal_db_extended_get_property_stmt(stmt, projection[i], i, record);
}
static int _cal_db_extended_update_projection(calendar_record_h record)
GSList *bind_text = NULL;
GSList *cursor = NULL;
- ret = cal_db_query_create_projection_update_set(record,&set,&bind_text);
+ ret = cal_db_query_create_projection_update_set(record, &set, &bind_text);
RETV_IF(CALENDAR_ERROR_NONE != ret, ret);
snprintf(query, sizeof(query), "UPDATE %s SET %s WHERE id = %d",
if (bind_text) {
int i = 0;
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++)
- {
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
- }
}
ret = cal_db_util_stmt_step(stmt);
index = cal_db_util_last_insert_id();
/* cal_record_set_int(record, _calendar_extended.id,index); */
- if (id) {
+ if (id)
*id = index;
- }
if (record_type == CALENDAR_RECORD_TYPE_EVENT || record_type == CALENDAR_RECORD_TYPE_TODO) {
snprintf(query, sizeof(query), "UPDATE %s SET has_extended = 1 WHERE id = %d ",
/*
* static function
*/
-static void _cal_db_instance_allday_get_stmt(sqlite3_stmt *stmt,calendar_record_h record);
+static void _cal_db_instance_allday_get_stmt(sqlite3_stmt *stmt, calendar_record_h record);
static void _cal_db_instance_allday_get_property_stmt(sqlite3_stmt *stmt,
unsigned int property, int *stmt_count, calendar_record_h record);
static void _cal_db_instance_allday_get_projection_stmt(sqlite3_stmt *stmt,
cal_db_plugin_cb_s cal_db_instance_allday_plugin_cb = {
.is_query_only = false,
- .insert_record=NULL,
- .get_record=NULL,
- .update_record=NULL,
- .delete_record=_cal_db_instance_allday_delete_record,
- .get_all_records=_cal_db_instance_allday_get_all_records,
- .get_records_with_query=_cal_db_instance_allday_get_records_with_query,
- .insert_records=NULL,
- .update_records=NULL,
- .delete_records=NULL,
- .get_count=_cal_db_instance_allday_get_count,
- .get_count_with_query=_cal_db_instance_allday_get_count_with_query,
- .replace_record=NULL,
- .replace_records=NULL
+ .insert_record = NULL,
+ .get_record = NULL,
+ .update_record = NULL,
+ .delete_record = _cal_db_instance_allday_delete_record,
+ .get_all_records = _cal_db_instance_allday_get_all_records,
+ .get_records_with_query = _cal_db_instance_allday_get_records_with_query,
+ .insert_records = NULL,
+ .update_records = NULL,
+ .delete_records = NULL,
+ .get_count = _cal_db_instance_allday_get_count,
+ .get_count_with_query = _cal_db_instance_allday_get_count_with_query,
+ .replace_record = NULL,
+ .replace_records = NULL
};
static int _cal_db_instance_allday_delete_record(int id)
SECURE("[TEST]---------query[%s]", query_str);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(_calendar_instance_localtime_calendar_book._uri,&record);
+ ret = calendar_record_create(_calendar_instance_localtime_calendar_book._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_ALLDAY_INSTANCE);
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR_EXTENDED)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR_EXTENDED)) {
table_name = cal_strdup(CAL_VIEW_TABLE_ALLDAY_INSTANCE_EXTENDED);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
cal_db_append_string(&query_str, "FROM");
cal_db_append_string(&query_str, table_name);
CAL_FREE(projection);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT * FROM");
cal_db_append_string(&query_str, table_name);
}
/* bind text */
if (bind_text) {
g_slist_length(bind_text);
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++) {
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
- }
}
ret = calendar_list_create(out_list);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(que->view_uri,&record);
+ ret = calendar_record_create(que->view_uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
if (0 < que->projection_count) {
cal_record_set_projection(record, que->projection, que->projection_count, que->property_count);
_cal_db_instance_allday_get_projection_stmt(stmt, que->projection, que->projection_count, record);
- }
- else {
- _cal_db_instance_allday_get_stmt(stmt,record);
+ } else {
+ _cal_db_instance_allday_get_stmt(stmt, record);
}
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_ALLDAY_INSTANCE);
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR_EXTENDED)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR_EXTENDED)) {
table_name = cal_strdup(CAL_VIEW_TABLE_ALLDAY_INSTANCE_EXTENDED);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return CALENDAR_ERROR_NONE;
}
-static void _cal_db_instance_allday_get_stmt(sqlite3_stmt *stmt,calendar_record_h record)
+static void _cal_db_instance_allday_get_stmt(sqlite3_stmt *stmt, calendar_record_h record)
{
cal_instance_allday_s* instance = (cal_instance_allday_s*)(record);
const unsigned char *temp;
instance->sensitivity = sqlite3_column_int(stmt, count++);
instance->has_rrule = sqlite3_column_int(stmt, count++);
- if (0 < instance->has_rrule) {
+ if (0 < instance->has_rrule)
instance->has_rrule = 1;
- }
- instance->latitude = sqlite3_column_double(stmt,count++);
- instance->longitude = sqlite3_column_double(stmt,count++);
- instance->has_alarm = sqlite3_column_int(stmt,count++);
+ instance->latitude = sqlite3_column_double(stmt, count++);
+ instance->longitude = sqlite3_column_double(stmt, count++);
+ instance->has_alarm = sqlite3_column_int(stmt, count++);
instance->original_event_id = sqlite3_column_int(stmt, count++);
instance->calendar_id = sqlite3_column_int(stmt, count++);
instance->last_mod = sqlite3_column_int64(stmt, count++);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_HAS_RRULE:
instance->has_rrule = sqlite3_column_int(stmt, *stmt_count);
- if (0 < instance->has_rrule) {
+ if (0 < instance->has_rrule)
instance->has_rrule = 1;
- }
+
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_LATITUDE:
- instance->latitude = sqlite3_column_double(stmt,*stmt_count);
+ instance->latitude = sqlite3_column_double(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_LONGITUDE:
- instance->longitude = sqlite3_column_double(stmt,*stmt_count);
+ instance->longitude = sqlite3_column_double(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_EVENT_ID:
instance->event_id = sqlite3_column_int(stmt, *stmt_count);
const unsigned int *projection, const int projection_count,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
int stmt_count = 0;
- for(i=0;i<projection_count;i++) {
- _cal_db_instance_allday_get_property_stmt(stmt,projection[i],&stmt_count,record);
- }
+ for (i = 0; i < projection_count; i++)
+ _cal_db_instance_allday_get_property_stmt(stmt, projection[i], &stmt_count, record);
}
/*
* static function
*/
-static void _cal_db_instance_allday_extended_get_stmt(sqlite3_stmt *stmt,calendar_record_h record);
+static void _cal_db_instance_allday_extended_get_stmt(sqlite3_stmt *stmt, calendar_record_h record);
static void _cal_db_instance_allday_extended_get_property_stmt(sqlite3_stmt *stmt,
unsigned int property, int *stmt_count, calendar_record_h record);
static void _cal_db_instance_allday_extended_get_projection_stmt(sqlite3_stmt *stmt,
cal_db_plugin_cb_s cal_db_instance_allday_extended_plugin_cb = {
.is_query_only = false,
- .insert_record= NULL,
- .get_record= NULL,
- .update_record=NULL,
- .delete_record=NULL,
- .get_all_records=_cal_db_instance_allday_extended_get_all_records,
- .get_records_with_query=_cal_db_instance_allday_extended_get_records_with_query,
- .insert_records=NULL,
- .update_records=NULL,
- .delete_records=NULL,
- .get_count=_cal_db_instance_allday_extended_get_count,
- .get_count_with_query=_cal_db_instance_allday_extended_get_count_with_query,
- .replace_record=NULL,
- .replace_records=NULL
+ .insert_record = NULL,
+ .get_record = NULL,
+ .update_record = NULL,
+ .delete_record = NULL,
+ .get_all_records = _cal_db_instance_allday_extended_get_all_records,
+ .get_records_with_query = _cal_db_instance_allday_extended_get_records_with_query,
+ .insert_records = NULL,
+ .update_records = NULL,
+ .delete_records = NULL,
+ .get_count = _cal_db_instance_allday_extended_get_count,
+ .get_count_with_query = _cal_db_instance_allday_extended_get_count_with_query,
+ .replace_record = NULL,
+ .replace_records = NULL
};
static int _cal_db_instance_allday_extended_get_all_records(int offset, int limit, calendar_list_h* out_list)
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(_calendar_instance_localtime_calendar_book_extended._uri,&record);
+ ret = calendar_record_create(_calendar_instance_localtime_calendar_book_extended._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
CAL_FREE(query_str);
return ret;
}
- _cal_db_instance_allday_extended_get_stmt(stmt,record);
+ _cal_db_instance_allday_extended_get_stmt(stmt, record);
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
cal_db_append_string(&query_str, "FROM");
cal_db_append_string(&query_str, table_name);
CAL_FREE(projection);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT * FROM");
cal_db_append_string(&query_str, table_name);
}
/* bind text */
if (bind_text) {
g_slist_length(bind_text);
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++) {
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
- }
}
ret = calendar_list_create(out_list);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(que->view_uri,&record);
+ ret = calendar_record_create(que->view_uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
if (0 < que->projection_count) {
cal_record_set_projection(record, que->projection, que->projection_count, que->property_count);
_cal_db_instance_allday_extended_get_projection_stmt(stmt, que->projection, que->projection_count, record);
- }
- else {
- _cal_db_instance_allday_extended_get_stmt(stmt,record);
+ } else {
+ _cal_db_instance_allday_extended_get_stmt(stmt, record);
}
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
return CALENDAR_ERROR_NONE;
}
-static void _cal_db_instance_allday_extended_get_stmt(sqlite3_stmt *stmt,calendar_record_h record)
+static void _cal_db_instance_allday_extended_get_stmt(sqlite3_stmt *stmt, calendar_record_h record)
{
cal_instance_allday_extended_s* instance = (cal_instance_allday_extended_s*)(record);
const unsigned char *temp;
instance->sensitivity = sqlite3_column_int(stmt, count++);
instance->has_rrule = sqlite3_column_int(stmt, count++);
- if (0 < instance->has_rrule) {
+ if (0 < instance->has_rrule)
instance->has_rrule = 1;
- }
- instance->latitude = sqlite3_column_double(stmt,count++);
- instance->longitude = sqlite3_column_double(stmt,count++);
- instance->has_alarm = sqlite3_column_int(stmt,count++);
+ instance->latitude = sqlite3_column_double(stmt, count++);
+ instance->longitude = sqlite3_column_double(stmt, count++);
+ instance->has_alarm = sqlite3_column_int(stmt, count++);
instance->original_event_id = sqlite3_column_int(stmt, count++);
instance->calendar_id = sqlite3_column_int(stmt, count++);
instance->organizer_name = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
- instance->categories= cal_strdup((const char*)temp);
+ instance->categories = cal_strdup((const char*)temp);
- instance->has_attendee= sqlite3_column_int(stmt, count++);
+ instance->has_attendee = sqlite3_column_int(stmt, count++);
temp = sqlite3_column_text(stmt, count++);
instance->sync_data2 = cal_strdup((const char*)temp);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_HAS_RRULE:
instance->has_rrule = sqlite3_column_int(stmt, *stmt_count);
- if (0 < instance->has_rrule) {
+ if (0 < instance->has_rrule)
instance->has_rrule = 1;
- }
+
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_LATITUDE:
- instance->latitude = sqlite3_column_double(stmt,*stmt_count);
+ instance->latitude = sqlite3_column_double(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_LONGITUDE:
- instance->longitude = sqlite3_column_double(stmt,*stmt_count);
+ instance->longitude = sqlite3_column_double(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_EVENT_ID:
instance->event_id = sqlite3_column_int(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_ORGANIZER_NAME:
temp = sqlite3_column_text(stmt, *stmt_count);
- instance->organizer_name= cal_strdup((const char*)temp);
+ instance->organizer_name = cal_strdup((const char*)temp);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_CATEGORIES:
temp = sqlite3_column_text(stmt, *stmt_count);
- instance->categories= cal_strdup((const char*)temp);
+ instance->categories = cal_strdup((const char*)temp);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_HAS_ATTENDEE:
- instance->has_attendee= sqlite3_column_int(stmt, *stmt_count);
+ instance->has_attendee = sqlite3_column_int(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_SYNC_DATA2:
temp = sqlite3_column_text(stmt, *stmt_count);
- instance->sync_data2= cal_strdup((const char*)temp);
+ instance->sync_data2 = cal_strdup((const char*)temp);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_SYNC_DATA3:
temp = sqlite3_column_text(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_SYNC_DATA4:
temp = sqlite3_column_text(stmt, *stmt_count);
- instance->sync_data4= cal_strdup((const char*)temp);
+ instance->sync_data4 = cal_strdup((const char*)temp);
break;
case CAL_PROPERTY_INSTANCE_ALLDAY_EXTENDED_IS_ALLDAY:
instance->is_allday = sqlite3_column_int(stmt, *stmt_count);
const unsigned int *projection, const int projection_count,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
int stmt_count = 0;
- for(i=0;i<projection_count;i++) {
- _cal_db_instance_allday_extended_get_property_stmt(stmt,projection[i],&stmt_count,record);
- }
+ for (i = 0; i < projection_count; i++)
+ _cal_db_instance_allday_extended_get_property_stmt(stmt, projection[i], &stmt_count, record);
}
/*
* static function
*/
-static void _cal_db_instance_normal_get_stmt(sqlite3_stmt *stmt,calendar_record_h record);
+static void _cal_db_instance_normal_get_stmt(sqlite3_stmt *stmt, calendar_record_h record);
static void _cal_db_instance_normal_get_property_stmt(sqlite3_stmt *stmt,
unsigned int property, int *stmt_count, calendar_record_h record);
static void _cal_db_instance_normal_get_projection_stmt(sqlite3_stmt *stmt,
cal_db_plugin_cb_s cal_db_instance_normal_plugin_cb = {
.is_query_only = false,
- .insert_record=NULL,
- .get_record=NULL,
- .update_record=NULL,
- .delete_record=_cal_db_instance_normal_delete_record,
- .get_all_records=_cal_db_instance_normal_get_all_records,
- .get_records_with_query=_cal_db_instance_normal_get_records_with_query,
- .insert_records=NULL,
- .update_records=NULL,
- .delete_records=NULL,
- .get_count=_cal_db_instance_normal_get_count,
- .get_count_with_query=_cal_db_instance_normal_get_count_with_query,
- .replace_record=NULL,
- .replace_records=NULL
+ .insert_record = NULL,
+ .get_record = NULL,
+ .update_record = NULL,
+ .delete_record = _cal_db_instance_normal_delete_record,
+ .get_all_records = _cal_db_instance_normal_get_all_records,
+ .get_records_with_query = _cal_db_instance_normal_get_records_with_query,
+ .insert_records = NULL,
+ .update_records = NULL,
+ .delete_records = NULL,
+ .get_count = _cal_db_instance_normal_get_count,
+ .get_count_with_query = _cal_db_instance_normal_get_count_with_query,
+ .replace_record = NULL,
+ .replace_records = NULL
};
static int _cal_db_instance_normal_delete_record(int id)
SECURE("[TEST]---------query[%s]", query_str);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(_calendar_instance_utime_calendar_book._uri,&record);
+ ret = calendar_record_create(_calendar_instance_utime_calendar_book._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_UTIME_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_NORMAL_INSTANCE);
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_UTIME_CALENDAR_EXTENDED)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_UTIME_CALENDAR_EXTENDED)) {
table_name = cal_strdup(CAL_VIEW_TABLE_NORMAL_INSTANCE_EXTENDED);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
cal_db_append_string(&query_str, "FROM");
cal_db_append_string(&query_str, table_name);
CAL_FREE(projection);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT * FROM");
cal_db_append_string(&query_str, table_name);
}
/* bind text */
if (bind_text) {
g_slist_length(bind_text);
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++) {
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
- }
}
ret = calendar_list_create(out_list);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(que->view_uri,&record);
+ ret = calendar_record_create(que->view_uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
_cal_db_instance_normal_get_projection_stmt(stmt,
que->projection, que->projection_count,
record);
- }
- else {
- _cal_db_instance_normal_get_stmt(stmt,record);
+ } else {
+ _cal_db_instance_normal_get_stmt(stmt, record);
}
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_UTIME_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_NORMAL_INSTANCE);
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_UTIME_CALENDAR_EXTENDED)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_UTIME_CALENDAR_EXTENDED)) {
table_name = cal_strdup(CAL_VIEW_TABLE_NORMAL_INSTANCE_EXTENDED);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
instance->sensitivity = sqlite3_column_int(stmt, count++);
instance->has_rrule = sqlite3_column_int(stmt, count++);
- if (0 < instance->has_rrule) {
+ if (0 < instance->has_rrule)
instance->has_rrule = 1;
- }
- instance->latitude = sqlite3_column_double(stmt,count++);
- instance->longitude = sqlite3_column_double(stmt,count++);
- instance->has_alarm = sqlite3_column_int(stmt,count++);
+ instance->latitude = sqlite3_column_double(stmt, count++);
+ instance->longitude = sqlite3_column_double(stmt, count++);
+ instance->has_alarm = sqlite3_column_int(stmt, count++);
instance->original_event_id = sqlite3_column_int(stmt, count++);
instance->calendar_id = sqlite3_column_int(stmt, count++);
instance->last_mod = sqlite3_column_int64(stmt, count++);
break;
case CAL_PROPERTY_INSTANCE_NORMAL_END:
instance->end.type = CALENDAR_TIME_UTIME;
- sqlite3_column_int(stmt,*stmt_count);
+ sqlite3_column_int(stmt, *stmt_count);
*stmt_count = *stmt_count+1;
instance->end.time.utime = sqlite3_column_int64(stmt, *stmt_count);
*stmt_count = *stmt_count+1; /* datatime */
break;
case CAL_PROPERTY_INSTANCE_NORMAL_HAS_RRULE:
instance->has_rrule = sqlite3_column_int(stmt, *stmt_count);
- if (0 < instance->has_rrule) {
+ if (0 < instance->has_rrule)
instance->has_rrule = 1;
- }
+
break;
case CAL_PROPERTY_INSTANCE_NORMAL_LATITUDE:
- instance->latitude = sqlite3_column_double(stmt,*stmt_count);
+ instance->latitude = sqlite3_column_double(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_NORMAL_LONGITUDE:
- instance->longitude = sqlite3_column_double(stmt,*stmt_count);
+ instance->longitude = sqlite3_column_double(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_NORMAL_EVENT_ID:
instance->event_id = sqlite3_column_int(stmt, *stmt_count);
const unsigned int *projection, const int projection_count,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
int stmt_count = 0;
- for(i=0;i<projection_count;i++) {
- _cal_db_instance_normal_get_property_stmt(stmt,projection[i],&stmt_count,record);
- }
+ for (i = 0; i < projection_count; i++)
+ _cal_db_instance_normal_get_property_stmt(stmt, projection[i], &stmt_count, record);
}
/*
* static function
*/
-static void _cal_db_instance_normal_extended_get_stmt(sqlite3_stmt *stmt,calendar_record_h record);
+static void _cal_db_instance_normal_extended_get_stmt(sqlite3_stmt *stmt, calendar_record_h record);
static void _cal_db_instance_normal_extended_get_property_stmt(sqlite3_stmt *stmt,
unsigned int property, int *stmt_count, calendar_record_h record);
static void _cal_db_instance_normal_extended_get_projection_stmt(sqlite3_stmt *stmt,
cal_db_plugin_cb_s cal_db_instance_normal_extended_plugin_cb = {
.is_query_only = false,
- .insert_record=NULL,
- .get_record=NULL,
- .update_record=NULL,
- .delete_record=NULL,
- .get_all_records=_cal_db_instance_normal_extended_get_all_records,
- .get_records_with_query=_cal_db_instance_normal_extended_get_records_with_query,
- .insert_records=NULL,
- .update_records=NULL,
- .delete_records=NULL,
- .get_count=_cal_db_instance_normal_extended_get_count,
- .get_count_with_query=_cal_db_instance_normal_extended_get_count_with_query,
- .replace_record=NULL,
- .replace_records=NULL
+ .insert_record = NULL,
+ .get_record = NULL,
+ .update_record = NULL,
+ .delete_record = NULL,
+ .get_all_records = _cal_db_instance_normal_extended_get_all_records,
+ .get_records_with_query = _cal_db_instance_normal_extended_get_records_with_query,
+ .insert_records = NULL,
+ .update_records = NULL,
+ .delete_records = NULL,
+ .get_count = _cal_db_instance_normal_extended_get_count,
+ .get_count_with_query = _cal_db_instance_normal_extended_get_count_with_query,
+ .replace_record = NULL,
+ .replace_records = NULL
};
static int _cal_db_instance_normal_extended_get_all_records(int offset, int limit, calendar_list_h* out_list)
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(_calendar_instance_utime_calendar_book_extended._uri,&record);
+ ret = calendar_record_create(_calendar_instance_utime_calendar_book_extended._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
CAL_FREE(query_str);
return ret;
}
- _cal_db_instance_normal_extended_get_stmt(stmt,record);
+ _cal_db_instance_normal_extended_get_stmt(stmt, record);
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
cal_db_append_string(&query_str, "FROM");
cal_db_append_string(&query_str, table_name);
CAL_FREE(projection);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT * FROM");
cal_db_append_string(&query_str, table_name);
}
/* bind text */
if (bind_text) {
g_slist_length(bind_text);
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++) {
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
- }
}
ret = calendar_list_create(out_list);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(que->view_uri,&record);
+ ret = calendar_record_create(que->view_uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
_cal_db_instance_normal_extended_get_projection_stmt(stmt,
que->projection, que->projection_count, record);
- }
- else {
- _cal_db_instance_normal_extended_get_stmt(stmt,record);
+ } else {
+ _cal_db_instance_normal_extended_get_stmt(stmt, record);
}
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
return CALENDAR_ERROR_NONE;
}
-static void _cal_db_instance_normal_extended_get_stmt(sqlite3_stmt *stmt,calendar_record_h record)
+static void _cal_db_instance_normal_extended_get_stmt(sqlite3_stmt *stmt, calendar_record_h record)
{
cal_instance_normal_extended_s* instance = (cal_instance_normal_extended_s*)(record);
const unsigned char *temp;
instance->sensitivity = sqlite3_column_int(stmt, count++);
instance->has_rrule = sqlite3_column_int(stmt, count++);
- if (0 < instance->has_rrule) {
+ if (0 < instance->has_rrule)
instance->has_rrule = 1;
- }
- instance->latitude = sqlite3_column_double(stmt,count++);
- instance->longitude = sqlite3_column_double(stmt,count++);
- instance->has_alarm = sqlite3_column_int(stmt,count++);
+ instance->latitude = sqlite3_column_double(stmt, count++);
+ instance->longitude = sqlite3_column_double(stmt, count++);
+ instance->has_alarm = sqlite3_column_int(stmt, count++);
instance->original_event_id = sqlite3_column_int(stmt, count++);
instance->calendar_id = sqlite3_column_int(stmt, count++);
instance->last_mod = sqlite3_column_int64(stmt, count++);
instance->organizer_name = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
- instance->categories= cal_strdup((const char*)temp);
+ instance->categories = cal_strdup((const char*)temp);
- instance->has_attendee= sqlite3_column_int(stmt, count++);
+ instance->has_attendee = sqlite3_column_int(stmt, count++);
temp = sqlite3_column_text(stmt, count++);
instance->sync_data2 = cal_strdup((const char*)temp);
break;
case CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_HAS_RRULE:
instance->has_rrule = sqlite3_column_int(stmt, *stmt_count);
- if (0 < instance->has_rrule) {
+ if (0 < instance->has_rrule)
instance->has_rrule = 1;
- }
+
break;
case CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_LATITUDE:
- instance->latitude = sqlite3_column_double(stmt,*stmt_count);
+ instance->latitude = sqlite3_column_double(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_LONGITUDE:
- instance->longitude = sqlite3_column_double(stmt,*stmt_count);
+ instance->longitude = sqlite3_column_double(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_EVENT_ID:
instance->event_id = sqlite3_column_int(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_ORGANIZER_NAME:
temp = sqlite3_column_text(stmt, *stmt_count);
- instance->organizer_name= cal_strdup((const char*)temp);
+ instance->organizer_name = cal_strdup((const char*)temp);
break;
case CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_CATEGORIES:
temp = sqlite3_column_text(stmt, *stmt_count);
- instance->categories= cal_strdup((const char*)temp);
+ instance->categories = cal_strdup((const char*)temp);
break;
case CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_HAS_ATTENDEE:
- instance->has_attendee= sqlite3_column_int(stmt, *stmt_count);
+ instance->has_attendee = sqlite3_column_int(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_SYNC_DATA2:
temp = sqlite3_column_text(stmt, *stmt_count);
- instance->sync_data2= cal_strdup((const char*)temp);
+ instance->sync_data2 = cal_strdup((const char*)temp);
break;
case CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_SYNC_DATA3:
temp = sqlite3_column_text(stmt, *stmt_count);
break;
case CAL_PROPERTY_INSTANCE_NORMAL_EXTENDED_SYNC_DATA4:
temp = sqlite3_column_text(stmt, *stmt_count);
- instance->sync_data4= cal_strdup((const char*)temp);
+ instance->sync_data4 = cal_strdup((const char*)temp);
break;
default:
sqlite3_column_int(stmt, *stmt_count);
const unsigned int *projection, const int projection_count,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
int stmt_count = 0;
- for(i=0;i<projection_count;i++) {
- _cal_db_instance_normal_extended_get_property_stmt(stmt,projection[i],&stmt_count,record);
- }
+ for (i = 0; i < projection_count; i++)
+ _cal_db_instance_normal_extended_get_property_stmt(stmt, projection[i], &stmt_count, record);
}
/*
* static function
*/
-static void _cal_db_search_get_stmt(sqlite3_stmt *stmt,calendar_query_h query, calendar_record_h record);
+static void _cal_db_search_get_stmt(sqlite3_stmt *stmt, calendar_query_h query, calendar_record_h record);
static void _cal_db_search_get_property_stmt(sqlite3_stmt *stmt, unsigned int property, int *stmt_count, calendar_record_h record);
static void _cal_db_search_get_projection_stmt(sqlite3_stmt *stmt, const unsigned int *projection, const int projection_count, calendar_record_h record);
static int _cal_db_search_make_projection(calendar_query_h query, char **projection);
cal_db_plugin_cb_s cal_db_search_plugin_cb = {
- .is_query_only=true,
- .insert_record=NULL,
- .get_record=NULL,
- .update_record=NULL,
- .delete_record=NULL,
- .get_all_records=NULL,
- .get_records_with_query=_cal_db_search_get_records_with_query,
- .insert_records=NULL,
- .update_records=NULL,
- .delete_records=NULL,
- .get_count=NULL,
- .get_count_with_query=_cal_db_search_get_count_with_query,
- .replace_record=NULL,
- .replace_records=NULL
+ .is_query_only = true,
+ .insert_record = NULL,
+ .get_record = NULL,
+ .update_record = NULL,
+ .delete_record = NULL,
+ .get_all_records = NULL,
+ .get_records_with_query = _cal_db_search_get_records_with_query,
+ .insert_records = NULL,
+ .update_records = NULL,
+ .delete_records = NULL,
+ .get_count = NULL,
+ .get_count_with_query = _cal_db_search_get_count_with_query,
+ .replace_record = NULL,
+ .replace_records = NULL
};
static int _cal_db_search_get_records_with_query(calendar_query_h query, int offset, int limit, calendar_list_h* out_list)
}
/* make: projection */
- if (0 < que->projection_count) {
+ if (0 < que->projection_count)
ret = cal_db_query_create_projection(query, &projection);
- }
- else {
+ else
_cal_db_search_make_projection(query, &projection);
- }
- // query - projection
+ /* query - projection */
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR)) {
table_name = strdup(CAL_VIEW_TABLE_EVENT_CALENDAR);
} else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TODO_CALENDAR)) {
} else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR_EXTENDED)) {
table_name = strdup(CAL_VIEW_TABLE_ALLDAY_INSTANCE_EXTENDED);
} else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ ERR("uri(%s) not support get records with query", que->view_uri);
CAL_FREE(projection);
CAL_FREE(condition);
return CALENDAR_ERROR_INVALID_PARAMETER;
cal_db_append_string(&query_str, projection);
cal_db_append_string(&query_str, "FROM");
cal_db_append_string(&query_str, table_name);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT");
cal_db_append_string(&query_str, projection);
cal_db_append_string(&query_str, "FROM");
/* bind text */
if (bind_text) {
g_slist_length(bind_text);
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++) {
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
- }
}
ret = calendar_list_create(out_list);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(que->view_uri,&record);
+ ret = calendar_record_create(que->view_uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
return ret;
}
if (0 < que->projection_count) {
- _cal_db_search_get_projection_stmt(stmt,que->projection,que->projection_count,
+ _cal_db_search_get_projection_stmt(stmt, que->projection, que->projection_count,
record);
- }
- else {
- _cal_db_search_get_stmt(stmt, query,record);
+ } else {
+ _cal_db_search_get_stmt(stmt, query, record);
}
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_CALENDAR);
projection = cal_strdup("id");
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TODO_CALENDAR)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TODO_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_TODO_CALENDAR);
projection = cal_strdup("id");
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR_ATTENDEE)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_EVENT_CALENDAR_ATTENDEE)) {
table_name = cal_strdup(CAL_VIEW_TABLE_EVENT_CALENDAR_ATTENDEE);
projection = cal_strdup("id");
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_UTIME_CALENDAR)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_UTIME_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_NORMAL_INSTANCE);
projection = cal_strdup("event_id");
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_INSTANCE_LOCALTIME_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_ALLDAY_INSTANCE);
projection = cal_strdup("event_id");
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
cal_db_append_string(&query_str, projection);
cal_db_append_string(&query_str, ") FROM");
cal_db_append_string(&query_str, table_name);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT count(*) FROM");
cal_db_append_string(&query_str, table_name);
}
return CALENDAR_ERROR_NONE;
}
-static void _cal_db_search_get_stmt(sqlite3_stmt *stmt,calendar_query_h query,
+static void _cal_db_search_get_stmt(sqlite3_stmt *stmt, calendar_query_h query,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
int stmt_count = 0;
cal_query_s *query_s = NULL;
cal_property_info_s *properties = NULL;
query_s = (cal_query_s *)query;
- for (i=0;i<query_s->property_count;i++) {
+ for (i = 0; i < query_s->property_count; i++) {
properties = &(query_s->properties[i]);
- if (CAL_PROPERTY_CHECK_FLAGS(properties->property_id, CAL_PROPERTY_FLAGS_FILTER) == true) {
+ if (CAL_PROPERTY_CHECK_FLAGS(properties->property_id, CAL_PROPERTY_FLAGS_FILTER) == true)
break;
- }
- _cal_db_search_get_property_stmt(stmt, properties->property_id, &stmt_count,record);
+ _cal_db_search_get_property_stmt(stmt, properties->property_id, &stmt_count, record);
}
return ;
}
if (CAL_PROPERTY_CHECK_DATA_TYPE(property, CAL_PROPERTY_DATA_TYPE_INT) == true) {
int_tmp = sqlite3_column_int(stmt, *stmt_count);
- cal_record_set_int(record,property,int_tmp);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property, CAL_PROPERTY_DATA_TYPE_STR) == true) {
+ cal_record_set_int(record, property, int_tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property, CAL_PROPERTY_DATA_TYPE_STR) == true) {
temp = sqlite3_column_text(stmt, *stmt_count);
- cal_record_set_str(record,property, (const char*)temp);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
- d_tmp = sqlite3_column_double(stmt,*stmt_count);
- cal_record_set_double(record,property,d_tmp);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
+ cal_record_set_str(record, property, (const char*)temp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
+ d_tmp = sqlite3_column_double(stmt, *stmt_count);
+ cal_record_set_double(record, property, d_tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
lli_tmp = sqlite3_column_int64(stmt, *stmt_count);
- cal_record_set_lli(record,property,lli_tmp);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
+ cal_record_set_lli(record, property, lli_tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
calendar_time_s caltime_tmp;
- caltime_tmp.type = sqlite3_column_int(stmt,*stmt_count);
+ caltime_tmp.type = sqlite3_column_int(stmt, *stmt_count);
switch (caltime_tmp.type) {
case CALENDAR_TIME_UTIME:
*stmt_count = *stmt_count+1;
- caltime_tmp.time.utime = sqlite3_column_int64(stmt,*stmt_count);
+ caltime_tmp.time.utime = sqlite3_column_int64(stmt, *stmt_count);
*stmt_count = *stmt_count+1; /* datatime */
break;
}
break;
}
- ret = cal_record_set_caltime(record,property,caltime_tmp);
+ ret = cal_record_set_caltime(record, property, caltime_tmp);
WARN_IF(CALENDAR_ERROR_NONE != ret, "Failed to cal_record_set_caltime()");
- }
- else {
+ } else {
sqlite3_column_int(stmt, *stmt_count);
}
const unsigned int *projection, const int projection_count,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
int stmt_count = 0;
- for(i=0;i<projection_count;i++) {
- _cal_db_search_get_property_stmt(stmt,projection[i],&stmt_count,record);
- }
+ for (i = 0; i < projection_count; i++)
+ _cal_db_search_get_property_stmt(stmt, projection[i], &stmt_count, record);
}
static int _cal_db_search_make_projection(calendar_query_h query, char **projection)
return CALENDAR_ERROR_SYSTEM;
}
- for (i=1;i<query_s->property_count;i++) {
+ for (i = 1; i < query_s->property_count; i++) {
properties = &(query_s->properties[i]);
field_name = properties->fields;
- if (CAL_PROPERTY_CHECK_FLAGS(properties->property_id, CAL_PROPERTY_FLAGS_FILTER) == true) {
+ if (CAL_PROPERTY_CHECK_FLAGS(properties->property_id, CAL_PROPERTY_FLAGS_FILTER) == true)
break;
- }
if (field_name) {
len += snprintf(out_projection+len, sizeof(out_projection)-len, ", %s", field_name);
/*
* static function
*/
-static void _cal_db_timezone_get_stmt(sqlite3_stmt *stmt,calendar_record_h record);
+static void _cal_db_timezone_get_stmt(sqlite3_stmt *stmt, calendar_record_h record);
static void _cal_db_timezone_get_property_stmt(sqlite3_stmt *stmt,
unsigned int property, int stmt_count, calendar_record_h record);
static void _cal_db_timezone_get_projection_stmt(sqlite3_stmt *stmt,
const unsigned int *projection, const int projection_count,
calendar_record_h record);
-static void _cal_db_timezone_get_stmt(sqlite3_stmt *stmt,calendar_record_h record);
+static void _cal_db_timezone_get_stmt(sqlite3_stmt *stmt, calendar_record_h record);
static int _cal_db_timezone_update_projection(calendar_record_h record);
cal_db_plugin_cb_s cal_db_timezone_plugin_cb = {
- .is_query_only=false,
- .insert_record=_cal_db_timezone_insert_record,
- .get_record=_cal_db_timezone_get_record,
- .update_record=_cal_db_timezone_update_record,
- .delete_record=_cal_db_timezone_delete_record,
- .get_all_records=_cal_db_timezone_get_all_records,
- .get_records_with_query=_cal_db_timezone_get_records_with_query,
- .insert_records=_cal_db_timezone_insert_records,
- .update_records=_cal_db_timezone_update_records,
- .delete_records=_cal_db_timezone_delete_records,
- .get_count=_cal_db_timezone_get_count,
- .get_count_with_query=_cal_db_timezone_get_count_with_query,
+ .is_query_only = false,
+ .insert_record = _cal_db_timezone_insert_record,
+ .get_record = _cal_db_timezone_get_record,
+ .update_record = _cal_db_timezone_update_record,
+ .delete_record = _cal_db_timezone_delete_record,
+ .get_all_records = _cal_db_timezone_get_all_records,
+ .get_records_with_query = _cal_db_timezone_get_records_with_query,
+ .insert_records = _cal_db_timezone_insert_records,
+ .update_records = _cal_db_timezone_update_records,
+ .delete_records = _cal_db_timezone_delete_records,
+ .get_count = _cal_db_timezone_get_count,
+ .get_count_with_query = _cal_db_timezone_get_count_with_query,
.replace_record = _cal_db_timezone_replace_record,
.replace_records = _cal_db_timezone_replace_records
};
}
index = cal_db_util_last_insert_id();
- if (id) {
+ if (id)
*id = index;
- }
return CALENDAR_ERROR_NONE;
}
sqlite3_stmt *stmt = NULL;
int ret = 0;
- ret = calendar_record_create(_calendar_timezone._uri ,out_record);
+ ret = calendar_record_create(_calendar_timezone._uri, out_record);
if (CALENDAR_ERROR_NONE != ret) {
ERR("calendar_record_create() Fail(%d)", ret);
return CALENDAR_ERROR_OUT_OF_MEMORY;
return ret;
}
- _cal_db_timezone_get_stmt(stmt,*out_record);
+ _cal_db_timezone_get_stmt(stmt, *out_record);
sqlite3_finalize(stmt);
stmt = NULL;
RETV_IF(NULL == timezone_info, CALENDAR_ERROR_INVALID_PARAMETER);
- if (timezone_info->common.properties_flags) {
+ if (timezone_info->common.properties_flags)
return _cal_db_timezone_update_projection(record);
- }
snprintf(query, sizeof(query), "UPDATE %s SET "
"tz_offset_from_gmt=%d,"
RETV_IF(NULL == timezone_info, CALENDAR_ERROR_INVALID_PARAMETER);
timezone_info->index = id;
- if (timezone_info->common.properties_flags) {
+ if (timezone_info->common.properties_flags)
return _cal_db_timezone_update_projection(record);
- }
snprintf(query, sizeof(query), "UPDATE %s SET "
"tz_offset_from_gmt=%d,"
ret = calendar_list_create(out_list);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "calendar_list_create() Fail(%d)", ret);
- if (0 < offset) {
+ if (0 < offset)
snprintf(offsetquery, sizeof(offsetquery), "OFFSET %d", offset);
- }
- if (0 < limit) {
+
+ if (0 < limit)
snprintf(limitquery, sizeof(limitquery), "LIMIT %d", limit);
- }
+
snprintf(query, sizeof(query), "SELECT * FROM %s where "
"calendar_id IN (select id from %s where deleted = 0) "
"%s %s",
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(_calendar_timezone._uri,&record);
+ ret = calendar_record_create(_calendar_timezone._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
sqlite3_finalize(stmt);
return ret;
}
- _cal_db_timezone_get_stmt(stmt,record);
+ _cal_db_timezone_get_stmt(stmt, record);
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
cal_db_append_string(&query_str, "FROM");
cal_db_append_string(&query_str, CAL_TABLE_TIMEZONE);
CAL_FREE(projection);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT * FROM");
cal_db_append_string(&query_str, CAL_TABLE_TIMEZONE);
}
cal_db_append_string(&query_str, "AND calendar_id IN (select id from");
cal_db_append_string(&query_str, CAL_TABLE_CALENDAR);
cal_db_append_string(&query_str, "where deleted = 0)");
- }
- else {
+ } else {
cal_db_append_string(&query_str, "WHERE calendar_id IN (select id from");
cal_db_append_string(&query_str, CAL_TABLE_CALENDAR);
cal_db_append_string(&query_str, "where deleted = 0)");
/* bind text */
if (bind_text) {
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++) {
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
- }
}
ret = calendar_list_create(out_list);
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
- ret = calendar_record_create(_calendar_timezone._uri,&record);
+ ret = calendar_record_create(_calendar_timezone._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
_cal_db_timezone_get_projection_stmt(stmt,
que->projection, que->projection_count,
record);
- }
- else {
- _cal_db_timezone_get_stmt(stmt,record);
+ } else {
+ _cal_db_timezone_get_stmt(stmt, record);
}
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_h record;
int ret = 0;
int count = 0;
- int i=0;
+ int i = 0;
int *id = NULL;
ret = calendar_list_get_count(list, &count);
i++;
} while (CALENDAR_ERROR_NO_DATA != calendar_list_next(list));
- if (ids) {
+ if (ids)
*ids = id;
- }
- else {
+ else
CAL_FREE(id);
- }
+
return CALENDAR_ERROR_NONE;
}
{
int ret = 0;
int i = 0;
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
ret = _cal_db_timezone_delete_record(ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
ERR("_cal_db_timezone_delete_record() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
}
}
- if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list)) {
+ if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list))
break;
- }
}
return CALENDAR_ERROR_NONE;
ERR("cal_db_util_query_get_first_int_result() Fail");
return ret;
}
- DBG("%s=%d",query,count);
+ DBG("%s=%d", query, count);
*out_count = count;
return CALENDAR_ERROR_NONE;
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TIMEZONE)) {
table_name = cal_strdup(CAL_TABLE_TIMEZONE);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
cal_db_append_string(&query_str, CAL_TABLE_CALENDAR);
cal_db_append_string(&query_str, "where deleted = 0)");
CAL_FREE(condition);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "WHERE calendar_id IN (select id from");
cal_db_append_string(&query_str, CAL_TABLE_CALENDAR);
cal_db_append_string(&query_str, "where deleted = 0)");
CAL_FREE(query_str);
return ret;
}
- DBG("%s=%d",query_str,count);
+ DBG("%s=%d", query_str, count);
*out_count = count;
return CALENDAR_ERROR_NONE;
}
-static void _cal_db_timezone_get_stmt(sqlite3_stmt *stmt,calendar_record_h record)
+static void _cal_db_timezone_get_stmt(sqlite3_stmt *stmt, calendar_record_h record)
{
cal_timezone_s* timezone = (cal_timezone_s*)(record);
int count = 0;
const unsigned int *projection, const int projection_count,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
- for(i=0;i<projection_count;i++) {
- _cal_db_timezone_get_property_stmt(stmt,projection[i],i,record);
- }
+ for (i = 0; i < projection_count; i++)
+ _cal_db_timezone_get_property_stmt(stmt, projection[i], i, record);
}
static int _cal_db_timezone_update_projection(calendar_record_h record)
GSList *bind_text = NULL;
GSList *cursor = NULL;
- ret = cal_db_query_create_projection_update_set(record,&set,&bind_text);
+ ret = cal_db_query_create_projection_update_set(record, &set, &bind_text);
RETV_IF(CALENDAR_ERROR_NONE != ret, ret);
snprintf(query, sizeof(query), "UPDATE %s SET %s WHERE id = %d",
if (bind_text) {
int i = 0;
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++) {
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
- }
}
ret = cal_db_util_stmt_step(stmt);
/*
* static function
*/
-static void _cal_db_todo_get_stmt(sqlite3_stmt *stmt,bool is_view_table,calendar_record_h record, int *extended);
+static void _cal_db_todo_get_stmt(sqlite3_stmt *stmt, bool is_view_table, calendar_record_h record, int *extended);
static void _cal_db_todo_get_property_stmt(sqlite3_stmt *stmt,
unsigned int property, int *stmt_count, calendar_record_h record);
static void _cal_db_todo_get_projection_stmt(sqlite3_stmt *stmt,
.insert_records = _cal_db_todo_insert_records,
.update_records = _cal_db_todo_update_records,
.delete_records = _cal_db_todo_delete_records,
- .get_count=_cal_db_todo_get_count,
- .get_count_with_query=_cal_db_todo_get_count_with_query,
+ .get_count = _cal_db_todo_get_count,
+ .get_count_with_query = _cal_db_todo_get_count_with_query,
.replace_record = _cal_db_todo_replace_record,
.replace_records = _cal_db_todo_replace_records
};
calendar_record_get_int(record, _calendar_todo.id, &tmp);
cal_record_set_int(record, _calendar_todo.id, index);
- if (id) {
+ if (id)
*id = index;
- }
cal_db_rrule_get_rrule_from_record(record, &rrule);
cal_db_rrule_insert_record(index, rrule);
DBG("insert extended");
ret = cal_db_extended_insert_records(todo->extended_list, index, CALENDAR_RECORD_TYPE_TODO);
WARN_IF(CALENDAR_ERROR_NONE != ret, "cal_db_extended_insert_records() Fail(%x)", ret);
- }
- else {
+ } else {
DBG("No extended");
}
calendar_book_sync_event_type_e sync_event_type = CALENDAR_BOOK_SYNC_EVENT_FOR_ME;
int ret = 0;
- ret = calendar_record_create(_calendar_todo._uri ,out_record);
+ ret = calendar_record_create(_calendar_todo._uri, out_record);
if (CALENDAR_ERROR_NONE != ret) {
ERR("calendar_record_create() Fail(%d)", ret);
return CALENDAR_ERROR_OUT_OF_MEMORY;
return ret;
}
- _cal_db_todo_get_stmt(stmt,false,*out_record, &extended);
+ _cal_db_todo_get_stmt(stmt, false, *out_record, &extended);
sqlite3_finalize(stmt);
stmt = NULL;
return CALENDAR_ERROR_PERMISSION_DENIED;
}
- if (todo->common.properties_flags != NULL) {
+ if (todo->common.properties_flags != NULL)
return _cal_db_todo_update_dirty(record);
- }
has_alarm = cal_db_alarm_has_alarm(todo->alarm_list);
int is_allday = 0;
return ret;
}
DBG("attendee, alarm and rrule will be deleted by trigger after sync clean");
- }
- else {
+ } else {
cal_db_util_get_next_ver();
DBG("delete event");
return CALENDAR_ERROR_PERMISSION_DENIED;
}
- if (todo->common.properties_flags) {
+ if (todo->common.properties_flags)
return _cal_db_todo_update_dirty(record);
- }
+
int is_allday = 0;
if (CALENDAR_TIME_LOCALTIME == todo->start.type
&& (0 == todo->start.time.date.hour)
ret = calendar_list_create(out_list);
RETVM_IF(CALENDAR_ERROR_NONE != ret, ret, "calendar_list_create() Fail(%d)", ret);
- if (0 < offset) {
+ if (0 < offset)
snprintf(offsetquery, sizeof(offsetquery), "OFFSET %d", offset);
- }
- if (0 < limit) {
+
+ if (0 < limit)
snprintf(limitquery, sizeof(limitquery), "LIMIT %d", limit);
- }
char *query_str = NULL;
cal_db_append_string(&query_str, "SELECT * FROM");
while (CAL_SQLITE_ROW == cal_db_util_stmt_step(stmt)) {
calendar_record_h record;
int extended = 0;
- ret = calendar_record_create(_calendar_todo._uri,&record);
+ ret = calendar_record_create(_calendar_todo._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
CAL_FREE(query_str);
return ret;
}
- _cal_db_todo_get_stmt(stmt,true,record, &extended);
+ _cal_db_todo_get_stmt(stmt, true, record, &extended);
/* child */
int has_attendee = 0, has_alarm = 0;
int record_id = 0;
cal_todo_s* ptodo = (cal_todo_s*) record;
calendar_record_get_int(record, _calendar_todo.id, &record_id);
- if (CALENDAR_ERROR_NONE == calendar_record_get_int(record, _calendar_todo.has_attendee,&has_attendee)) {
- if (has_attendee == 1) {
+ if (CALENDAR_ERROR_NONE == calendar_record_get_int(record, _calendar_todo.has_attendee, &has_attendee)) {
+ if (has_attendee == 1)
cal_db_attendee_get_records(record_id, ptodo->attendee_list);
- }
}
- if (CALENDAR_ERROR_NONE == calendar_record_get_int(record, _calendar_todo.has_alarm,&has_alarm)) {
- if (has_alarm == 1) {
+ if (CALENDAR_ERROR_NONE == calendar_record_get_int(record, _calendar_todo.has_alarm, &has_alarm)) {
+ if (has_alarm == 1)
cal_db_alarm_get_records(record_id, ptodo->alarm_list);
- }
}
if (extended == 1)
cal_db_extended_get_records(record_id, CALENDAR_RECORD_TYPE_TODO, ptodo->extended_list);
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TODO)) {
table_name = cal_strdup(CAL_VIEW_TABLE_TODO);
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TODO_CALENDAR)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TODO_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_TODO_CALENDAR);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
cal_db_append_string(&query_str, "FROM");
cal_db_append_string(&query_str, table_name);
CAL_FREE(projection);
- }
- else {
+ } else {
cal_db_append_string(&query_str, "SELECT * FROM");
cal_db_append_string(&query_str, table_name);
}
/* bind text */
if (bind_text) {
g_slist_length(bind_text);
- for (cursor=bind_text, i=1; cursor;cursor=cursor->next, i++) {
+ for (cursor = bind_text, i = 1; cursor; cursor = cursor->next, i++)
cal_db_util_stmt_bind_text(stmt, i, cursor->data);
- }
}
ret = calendar_list_create(out_list);
calendar_record_h record;
int extended = 1;
int attendee = 1, alarm = 1;
- ret = calendar_record_create(_calendar_todo._uri,&record);
+ ret = calendar_record_create(_calendar_todo._uri, &record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
_cal_db_todo_get_projection_stmt(stmt,
que->projection, que->projection_count,
record);
- }
- else {
+ } else {
cal_todo_s *todo = NULL;
- _cal_db_todo_get_stmt(stmt,true,record, &extended);
+ _cal_db_todo_get_stmt(stmt, true, record, &extended);
todo = (cal_todo_s*)(record);
if (todo) {
attendee = todo->has_attendee;
}
/* child */
- if (cal_db_query_find_projection_property(query, CAL_PROPERTY_TODO_CALENDAR_ALARM) == true && alarm ==1) {
+ if (cal_db_query_find_projection_property(query, CAL_PROPERTY_TODO_CALENDAR_ALARM) == true && alarm == 1) {
cal_todo_s* todo = (cal_todo_s*) record;
cal_db_alarm_get_records(todo->index, todo->alarm_list);
}
- if (cal_db_query_find_projection_property(query, CAL_PROPERTY_TODO_CALENDAR_ATTENDEE) == true && attendee==1) {
+ if (cal_db_query_find_projection_property(query, CAL_PROPERTY_TODO_CALENDAR_ATTENDEE) == true && attendee == 1) {
cal_todo_s* todo = (cal_todo_s*) record;
cal_db_attendee_get_records(todo->index, todo->attendee_list);
}
cal_db_extended_get_records(todo->index, CALENDAR_RECORD_TYPE_TODO, todo->extended_list);
}
- ret = calendar_list_add(*out_list,record);
+ ret = calendar_list_add(*out_list, record);
if (CALENDAR_ERROR_NONE != ret) {
calendar_list_destroy(*out_list, true);
*out_list = NULL;
calendar_record_h record;
int ret = 0;
int count = 0;
- int i=0;
+ int i = 0;
int *id = NULL;
ret = calendar_list_get_count(list, &count);
i++;
} while (CALENDAR_ERROR_NO_DATA != calendar_list_next(list));
- if (ids) {
+ if (ids)
*ids = id;
- }
- else {
+ else
CAL_FREE(id);
- }
return CALENDAR_ERROR_NONE;
}
{
int ret = 0;
int i = 0;
- for(i = 0; i < count; i++) {
+ for (i = 0; i < count; i++) {
ret = _cal_db_todo_delete_record(ids[i]);
if (CALENDAR_ERROR_NONE != ret) {
ERR("_cal_db_todo_delete_record() Fail(%d)", ret);
return CALENDAR_ERROR_DB_FAILED;
}
}
- if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list)) {
+ if (CALENDAR_ERROR_NO_DATA != calendar_list_next(list))
break;
- }
}
return CALENDAR_ERROR_NONE;
if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TODO)) {
table_name = cal_strdup(CAL_VIEW_TABLE_TODO);
- }
- else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TODO_CALENDAR)) {
+ } else if (CAL_STRING_EQUAL == strcmp(que->view_uri, CALENDAR_VIEW_TODO_CALENDAR)) {
table_name = cal_strdup(CAL_VIEW_TABLE_TODO_CALENDAR);
- }
- else {
- ERR("uri(%s) not support get records with query",que->view_uri);
+ } else {
+ ERR("uri(%s) not support get records with query", que->view_uri);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
return CALENDAR_ERROR_NONE;
}
-static void _cal_db_todo_get_stmt(sqlite3_stmt *stmt,bool is_view_table,calendar_record_h record, int *extended)
+static void _cal_db_todo_get_stmt(sqlite3_stmt *stmt, bool is_view_table, calendar_record_h record, int *extended)
{
cal_todo_s *todo = NULL;
const unsigned char *temp;
sqlite3_column_int(stmt, count++);
- todo->latitude = sqlite3_column_double(stmt,count++);
- todo->longitude = sqlite3_column_double(stmt,count++);
+ todo->latitude = sqlite3_column_double(stmt, count++);
+ todo->longitude = sqlite3_column_double(stmt, count++);
sqlite3_column_int(stmt, count++);
todo->created_time = sqlite3_column_int64(stmt, count++);
todo->completed_time = sqlite3_column_int64(stmt, count++);
- todo->progress = sqlite3_column_int(stmt,count++);
+ todo->progress = sqlite3_column_int(stmt, count++);
- sqlite3_column_int(stmt,count++);
- sqlite3_column_int(stmt,count++);
- todo->is_deleted = sqlite3_column_int(stmt,count++);
+ sqlite3_column_int(stmt, count++);
+ sqlite3_column_int(stmt, count++);
+ todo->is_deleted = sqlite3_column_int(stmt, count++);
- todo->start.type = sqlite3_column_int(stmt,count++);
+ todo->start.type = sqlite3_column_int(stmt, count++);
if (todo->start.type == CALENDAR_TIME_UTIME) {
- todo->start.time.utime = sqlite3_column_int64(stmt,count++);
+ todo->start.time.utime = sqlite3_column_int64(stmt, count++);
count++; /* dtstart_datetime */
- }
- else {
+ } else {
count++; /* dtstart_utime */
temp = sqlite3_column_text(stmt, count++);
if (temp) {
todo->start_tzid = cal_strdup((const char*)temp);
todo->due.type = sqlite3_column_int(stmt, count++);
if (todo->due.type == CALENDAR_TIME_UTIME) {
- todo->due.time.utime = sqlite3_column_int64(stmt,count++);
+ todo->due.time.utime = sqlite3_column_int64(stmt, count++);
count++; /* datatime */
- }
- else {
+ } else {
count++;
temp = sqlite3_column_text(stmt, count++);
if (temp) {
temp = sqlite3_column_text(stmt, count++);
todo->due_tzid = cal_strdup((const char*)temp);
- todo->last_mod = sqlite3_column_int64(stmt,count++);
- sqlite3_column_int(stmt,count++);
+ todo->last_mod = sqlite3_column_int64(stmt, count++);
+ sqlite3_column_int(stmt, count++);
sqlite3_column_text(stmt, count++);
sqlite3_column_text(stmt, count++);
- todo->has_attendee = sqlite3_column_int(stmt,count++);
- todo->has_alarm = sqlite3_column_int(stmt,count++);
- todo->system_type = sqlite3_column_int(stmt,count++);
- todo->updated = sqlite3_column_int(stmt,count++);
+ todo->has_attendee = sqlite3_column_int(stmt, count++);
+ todo->has_alarm = sqlite3_column_int(stmt, count++);
+ todo->system_type = sqlite3_column_int(stmt, count++);
+ todo->updated = sqlite3_column_int(stmt, count++);
temp = sqlite3_column_text(stmt, count++);
todo->sync_data1 = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
temp = sqlite3_column_text(stmt, count++);
todo->sync_data4 = cal_strdup((const char*)temp);
- sqlite3_column_int(stmt,count++);
+ sqlite3_column_int(stmt, count++);
if (extended)
- *extended = sqlite3_column_int(stmt,count++);
+ *extended = sqlite3_column_int(stmt, count++);
todo->freq = sqlite3_column_int(stmt, count++);
todo->is_allday = sqlite3_column_int(stmt, count++);
if (is_view_table == true) {
- if (todo->freq <= 0) {
- return ;
- }
+ if (todo->freq <= 0)
+ return;
todo->range_type = sqlite3_column_int(stmt, count++);
todo->until.type = sqlite3_column_int(stmt, count++);
todo->byhour = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
- todo->byday= cal_strdup((const char*)temp);
+ todo->byday = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
- todo->bymonthday= cal_strdup((const char*)temp);
+ todo->bymonthday = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
- todo->byyearday= cal_strdup((const char*)temp);
+ todo->byyearday = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
- todo->byweekno= cal_strdup((const char*)temp);
+ todo->byweekno = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
- todo->bymonth= cal_strdup((const char*)temp);
+ todo->bymonth = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, count++);
todo->bysetpos = cal_strdup((const char*)temp);
todo->uid = cal_strdup((const char*)temp);
break;
case CAL_PROPERTY_TODO_LATITUDE:
- todo->latitude = sqlite3_column_double(stmt,*stmt_count);
+ todo->latitude = sqlite3_column_double(stmt, *stmt_count);
break;
case CAL_PROPERTY_TODO_LONGITUDE:
- todo->longitude = sqlite3_column_double(stmt,*stmt_count);
+ todo->longitude = sqlite3_column_double(stmt, *stmt_count);
break;
case CAL_PROPERTY_TODO_PROGRESS:
todo->progress = sqlite3_column_int(stmt, *stmt_count);
todo->sync_data4 = cal_strdup((const char*)temp);
break;
case CAL_PROPERTY_TODO_START:
- todo->start.type = sqlite3_column_int(stmt,*stmt_count);
+ todo->start.type = sqlite3_column_int(stmt, *stmt_count);
if (todo->start.type == CALENDAR_TIME_UTIME) {
*stmt_count = *stmt_count+1;
- todo->start.time.utime = sqlite3_column_int64(stmt,*stmt_count);
+ todo->start.time.utime = sqlite3_column_int64(stmt, *stmt_count);
*stmt_count = *stmt_count+1; /* datetime */
- }
- else {
+ } else {
*stmt_count = *stmt_count+1; /* utime */
*stmt_count = *stmt_count+1;
temp = sqlite3_column_text(stmt, *stmt_count);
todo->due.type = sqlite3_column_int(stmt, *stmt_count);
if (todo->due.type == CALENDAR_TIME_UTIME) {
*stmt_count = *stmt_count+1;
- todo->due.time.utime = sqlite3_column_int64(stmt,*stmt_count);
+ todo->due.time.utime = sqlite3_column_int64(stmt, *stmt_count);
*stmt_count = *stmt_count+1; /* datatime */
- }
- else {
+ } else {
*stmt_count = *stmt_count+1; /* utime */
*stmt_count = *stmt_count+1;
temp = sqlite3_column_text(stmt, *stmt_count);
const unsigned int *projection, const int projection_count,
calendar_record_h record)
{
- int i=0;
+ int i = 0;
int stmt_count = 0;
- for(i=0;i<projection_count;i++) {
- _cal_db_todo_get_property_stmt(stmt,projection[i],&stmt_count,record);
- }
+ for (i = 0; i < projection_count; i++)
+ _cal_db_todo_get_property_stmt(stmt, projection[i], &stmt_count, record);
}
static bool _cal_db_todo_check_calendar_book_type(calendar_record_h record)
int ret = CALENDAR_ERROR_NONE;
calendar_record_h original_record;
- ret = calendar_record_get_int(record,_calendar_todo.id, &todo_id);
+ ret = calendar_record_get_int(record, _calendar_todo.id, &todo_id);
RETV_IF(CALENDAR_ERROR_NONE != ret, ret);
- DBG("id=%d",todo_id);
+ DBG("id=%d", todo_id);
RETV_IF(false == _cal_db_todo_check_calendar_book_type(record), CALENDAR_ERROR_INVALID_PARAMETER);
cal_record_s *_record = NULL;
const cal_property_info_s* property_info = NULL;
int property_info_count = 0;
- int i=0;
+ int i = 0;
_record = (cal_record_s *)record;
property_info = cal_view_get_property_info(_record->view_uri, &property_info_count);
- for(i=0;i<property_info_count;i++) {
+ for (i = 0; i < property_info_count; i++) {
if (true == cal_record_check_property_flag(record, property_info[i].property_id , CAL_PROPERTY_FLAG_DIRTY)) {
if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_INT) == true) {
- int tmp=0;
- ret = calendar_record_get_int(record,property_info[i].property_id,&tmp);
+ int tmp = 0;
+ ret = calendar_record_get_int(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
ret = cal_record_set_int(original_record, property_info[i].property_id, tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
- char *tmp=NULL;
- ret = calendar_record_get_str_p(record,property_info[i].property_id,&tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
+ char *tmp = NULL;
+ ret = calendar_record_get_str_p(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
ret = cal_record_set_str(original_record, property_info[i].property_id, tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
- double tmp=0;
- ret = calendar_record_get_double(record,property_info[i].property_id,&tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
+ double tmp = 0;
+ ret = calendar_record_get_double(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
ret = cal_record_set_double(original_record, property_info[i].property_id, tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
- long long int tmp=0;
- ret = calendar_record_get_lli(record,property_info[i].property_id,&tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
+ long long int tmp = 0;
+ ret = calendar_record_get_lli(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
ret = cal_record_set_lli(original_record, property_info[i].property_id, tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
calendar_time_s tmp = {0,};
- ret = calendar_record_get_caltime(record,property_info[i].property_id,&tmp);
+ ret = calendar_record_get_caltime(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
ret = cal_record_set_caltime(original_record, property_info[i].property_id, tmp);
#define CAL_DB_CALTIME_FIELD_MAX 3
#define CAL_DB_ESCAPE_CHAR '\\'
-static const char* _cal_db_utime_field_name[] =
-{
+static const char* _cal_db_utime_field_name[] = {
"dtstart_utime",
"dtend_utime",
"until_utime"
};
-static const char* _cal_db_datetime_field_name[] =
-{
+static const char* _cal_db_datetime_field_name[] = {
"dtstart_datetime",
"dtend_datetime",
"until_datetime"
};
-static const char* _cal_db_timetype_field_name[] =
-{
+static const char* _cal_db_timetype_field_name[] = {
"dtstart_type",
"dtend_type",
"until_type"
if (field_name)
cal_db_append_string(&out_projection, (char*)field_name);
- for (i=1;i<query_s->projection_count;i++) {
+ for (i = 1; i < query_s->projection_count; i++) {
field_name = _cal_db_query_get_property_field_name(properties, query_s->property_count, query_s->projection[i]);
if (field_name) {
cal_db_append_string(&out_projection, ",");
if (condition) {
p_utime = _cal_db_query_get_utime_field_name(condition);
p_datetime = _cal_db_query_get_datetime_field_name(condition);
- }
- else
- {
+ } else {
DBG("No condition");
}
}
switch (type) {
case CAL_RECORD_TYPE_INSTANCE_NORMAL_EXTENDED:
case CAL_RECORD_TYPE_INSTANCE_NORMAL:
- snprintf(out_order, sizeof(out_order), "ORDER BY %s %s ", p_utime, query_s->asc==false ? "DESC":"ASC");
+ snprintf(out_order, sizeof(out_order), "ORDER BY %s %s ", p_utime, query_s->asc == false ? "DESC" : "ASC");
break;
case CAL_RECORD_TYPE_INSTANCE_ALLDAY_EXTENDED:
case CAL_RECORD_TYPE_INSTANCE_ALLDAY:
- snprintf(out_order, sizeof(out_order), "ORDER BY %s %s ", p_datetime, query_s->asc==false ? "DESC":"ASC");
+ snprintf(out_order, sizeof(out_order), "ORDER BY %s %s ", p_datetime, query_s->asc == false ? "DESC" : "ASC");
break;
default:
- snprintf(out_order, sizeof(out_order), "ORDER BY %s %s, %s %s ", p_utime, query_s->asc==false ? "DESC":"ASC", p_datetime, query_s->asc==false ? "DESC":"ASC");
+ snprintf(out_order, sizeof(out_order), "ORDER BY %s %s, %s %s ", p_utime, query_s->asc == false ? "DESC" : "ASC", p_datetime, query_s->asc == false ? "DESC" : "ASC");
break;
}
- }
- else if (p_utime && !p_datetime) {
- snprintf(out_order, sizeof(out_order), "ORDER BY %s %s ", p_utime, query_s->asc==false ? "DESC":"ASC");
- }
- else if (!p_utime && p_datetime) {
- snprintf(out_order, sizeof(out_order), "ORDER BY %s %s ", p_datetime, query_s->asc==false ? "DESC":"ASC");
- }
- else {
+ } else if (p_utime && !p_datetime) {
+ snprintf(out_order, sizeof(out_order), "ORDER BY %s %s ", p_utime, query_s->asc == false ? "DESC" : "ASC");
+ } else if (!p_utime && p_datetime) {
+ snprintf(out_order, sizeof(out_order), "ORDER BY %s %s ", p_datetime, query_s->asc == false ? "DESC" : "ASC");
+ } else {
DBG("No utime, datetime");
}
- }
- else {
- snprintf(out_order, sizeof(out_order), "ORDER BY %s %s ", field_name, query_s->asc==false ? "DESC":"ASC");
+ } else {
+ snprintf(out_order, sizeof(out_order), "ORDER BY %s %s ", field_name, query_s->asc == false ? "DESC" : "ASC");
}
*order = strdup(out_order);
/* get propety_info_s from uri */
property_info = cal_view_get_property_info(_record->view_uri, &property_info_count);
- for(i=0;i<property_info_count;i++) {
+ for (i = 0; i < property_info_count; i++) {
if (true == cal_record_check_property_flag(record, property_info[i].property_id , CAL_PROPERTY_FLAG_DIRTY)) {
field_name = property_info[i].fields;
- if (NULL == field_name) {
+ if (NULL == field_name)
continue;
- }
if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_INT) == true) {
- int tmp=0;
- ret = calendar_record_get_int(record,property_info[i].property_id,&tmp);
+ int tmp = 0;
+ ret = calendar_record_get_int(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- if (strlen(out_set) != 0) {
+ if (strlen(out_set) != 0)
len += snprintf(out_set+len, sizeof(out_set)-len, ", ");
- }
- len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%d",field_name,tmp);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
- char *tmp=NULL;
- ret = calendar_record_get_str(record,property_info[i].property_id,&tmp);
+
+ len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%d", field_name, tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
+ char *tmp = NULL;
+ ret = calendar_record_get_str(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- if (strlen(out_set) != 0) {
+ if (strlen(out_set) != 0)
len += snprintf(out_set+len, sizeof(out_set)-len, ", ");
- }
- len += snprintf(out_set+len, sizeof(out_set)-len, "%s=?",field_name);
+
+ len += snprintf(out_set+len, sizeof(out_set)-len, "%s=?", field_name);
*bind_text = g_slist_append(*bind_text, tmp);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
- double tmp=0;
- ret = calendar_record_get_double(record,property_info[i].property_id,&tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
+ double tmp = 0;
+ ret = calendar_record_get_double(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- if (strlen(out_set) != 0) {
+ if (strlen(out_set) != 0)
len += snprintf(out_set+len, sizeof(out_set)-len, ", ");
- }
- len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%lf",field_name,tmp);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
- long long int tmp=0;
- ret = calendar_record_get_lli(record,property_info[i].property_id,&tmp);
+
+ len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%lf", field_name, tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
+ long long int tmp = 0;
+ ret = calendar_record_get_lli(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- if (strlen(out_set) != 0) {
+ if (strlen(out_set) != 0)
len += snprintf(out_set+len, sizeof(out_set)-len, ", ");
- }
- len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%lld",field_name,tmp);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
+
+ len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%lld", field_name, tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
/*
* field_name
* dtstart_type, dtstart_utime, dtstart_datetime
timetype_field = _cal_db_query_get_timetype_field_name(field_name);
utime_field = _cal_db_query_get_utime_field_name(field_name);
datetime_field = _cal_db_query_get_datetime_field_name(field_name);
- ret = calendar_record_get_caltime(record,property_info[i].property_id,&tmp);
+ ret = calendar_record_get_caltime(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
if (tmp.type == CALENDAR_TIME_UTIME) {
- if (strlen(out_set) != 0) {
+ if (strlen(out_set) != 0)
len += snprintf(out_set+len, sizeof(out_set)-len, ", ");
- }
+
len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%d, %s=%lld",
timetype_field, CALENDAR_TIME_UTIME, utime_field, tmp.time.utime);
- }
- else {
+ } else {
char *bind_tmp = NULL;
char bind_datetime[CAL_STR_SHORT_LEN32] = {0};
snprintf(bind_datetime, sizeof(bind_datetime), CAL_FORMAT_LOCAL_DATETIME,
tmp.time.date.minute,
tmp.time.date.second);
- if (strlen(out_set) != 0) {
+ if (strlen(out_set) != 0)
len += snprintf(out_set+len, sizeof(out_set)-len, ", ");
- }
+
len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%d, %s=?",
timetype_field, CALENDAR_TIME_LOCALTIME, datetime_field);
- bind_tmp= strdup(bind_datetime);
+ bind_tmp = strdup(bind_datetime);
*bind_text = g_slist_append(*bind_text, bind_tmp);
}
}
}
*set = strdup(out_set);
- DBG("set=%s",*set);
+ DBG("set=%s", *set);
return CALENDAR_ERROR_NONE;
}
_record = (cal_record_s *)record;
- if (_record->properties_max_count == 0 || NULL == _record->properties_flags) {
+ if (_record->properties_max_count == 0 || NULL == _record->properties_flags)
return CALENDAR_ERROR_NONE;
- }
/* get propety_info_s from uri */
property_info = cal_view_get_property_info(_record->view_uri, &property_info_count);
- for(i=0;i<property_info_count;i++) {
- int j=0;
+ for (i = 0; i < property_info_count; i++) {
+ int j = 0;
bool flag = false;
- for(j=0;j<properties_count;j++) {
+ for (j = 0; j < properties_count; j++) {
if (property_info[i].property_id == properties[j]) {
flag = true;
break;
(true == cal_record_check_property_flag(record, property_info[i].property_id , CAL_PROPERTY_FLAG_DIRTY))) {
field_name = property_info[i].fields;
- if (NULL == field_name) {
+ if (NULL == field_name)
continue;
- }
if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_INT) == true) {
- int tmp=0;
- ret = calendar_record_get_int(record,property_info[i].property_id,&tmp);
+ int tmp = 0;
+ ret = calendar_record_get_int(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- if (strlen(out_set) != 0) {
+ if (strlen(out_set) != 0)
len += snprintf(out_set+len, sizeof(out_set)-len, ", ");
- }
- len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%d",field_name,tmp);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
- char *tmp=NULL;
- ret = calendar_record_get_str(record,property_info[i].property_id,&tmp);
+
+ len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%d", field_name, tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_STR) == true) {
+ char *tmp = NULL;
+ ret = calendar_record_get_str(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- if (strlen(out_set) != 0) {
+ if (strlen(out_set) != 0)
len += snprintf(out_set+len, sizeof(out_set)-len, ", ");
- }
- len += snprintf(out_set+len, sizeof(out_set)-len, "%s=?",field_name);
+
+ len += snprintf(out_set+len, sizeof(out_set)-len, "%s=?", field_name);
*bind_text = g_slist_append(*bind_text, tmp);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
- double tmp=0;
- ret = calendar_record_get_double(record,property_info[i].property_id,&tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_DOUBLE) == true) {
+ double tmp = 0;
+ ret = calendar_record_get_double(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- if (strlen(out_set) != 0) {
+ if (strlen(out_set) != 0)
len += snprintf(out_set+len, sizeof(out_set)-len, ", ");
- }
- len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%lf",field_name,tmp);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
- long long int tmp=0;
- ret = calendar_record_get_lli(record,property_info[i].property_id,&tmp);
+
+ len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%lf", field_name, tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_LLI) == true) {
+ long long int tmp = 0;
+ ret = calendar_record_get_lli(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
- if (strlen(out_set) != 0) {
+ if (strlen(out_set) != 0)
len += snprintf(out_set+len, sizeof(out_set)-len, ", ");
- }
- len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%lld",field_name,tmp);
- }
- else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
+
+ len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%lld", field_name, tmp);
+ } else if (CAL_PROPERTY_CHECK_DATA_TYPE(property_info[i].property_id, CAL_PROPERTY_DATA_TYPE_CALTIME) == true) {
/*
* field_name
* dtstart_type, dtstart_utime, dtstart_datetime
timetype_field = _cal_db_query_get_timetype_field_name(field_name);
utime_field = _cal_db_query_get_utime_field_name(field_name);
datetime_field = _cal_db_query_get_datetime_field_name(field_name);
- ret = calendar_record_get_caltime(record,property_info[i].property_id,&tmp);
+ ret = calendar_record_get_caltime(record, property_info[i].property_id, &tmp);
if (CALENDAR_ERROR_NONE != ret)
continue;
if (tmp.type == CALENDAR_TIME_UTIME) {
- if (strlen(out_set) != 0) {
+ if (strlen(out_set) != 0)
len += snprintf(out_set+len, sizeof(out_set)-len, ", ");
- }
+
len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%d, %s=%lld",
- timetype_field, CALENDAR_TIME_UTIME,utime_field,tmp.time.utime);
- }
- else {
+ timetype_field, CALENDAR_TIME_UTIME, utime_field, tmp.time.utime);
+ } else {
char *bind_tmp = NULL;
char bind_datetime[CAL_STR_SHORT_LEN32] = {0};
snprintf(bind_datetime, sizeof(bind_datetime), CAL_FORMAT_LOCAL_DATETIME,
tmp.time.date.minute,
tmp.time.date.second);
- if (strlen(out_set) != 0) {
+ if (strlen(out_set) != 0)
len += snprintf(out_set+len, sizeof(out_set)-len, ", ");
- }
+
len += snprintf(out_set+len, sizeof(out_set)-len, "%s=%d, %s=?",
timetype_field, CALENDAR_TIME_LOCALTIME, datetime_field);
- bind_tmp= strdup(bind_datetime);
+ bind_tmp = strdup(bind_datetime);
*bind_text = g_slist_append(*bind_text, bind_tmp);
}
}
cal_filter_s *filter;
int ret = CALENDAR_ERROR_NONE;
- if (NULL == com_filter || NULL == com_filter->filters) {
+ if (NULL == com_filter || NULL == com_filter->filters)
return CALENDAR_ERROR_INVALID_PARAMETER;
- }
filter = (cal_filter_s *)com_filter->filters->data;
- if (filter->filter_type == CAL_FILTER_COMPOSITE) {
+ if (filter->filter_type == CAL_FILTER_COMPOSITE)
ret = _cal_db_query_create_composite_condition((cal_composite_filter_s*)filter, &cond, &binds);
- }
- else {
+ else
ret = _cal_db_query_create_attribute_condition(com_filter, (cal_attribute_filter_s*)filter, &cond, &binds);
- }
if (CALENDAR_ERROR_NONE != ret) {
ERR("_cal_db_query_create_attribute_condition() Fail(%d)", ret);
CAL_FREE(cond);
- for(cursor_ops=com_filter->filter_ops; cursor_ops && cursor_filter;
- cursor_filter=cursor_filter->next, cursor_ops=cursor_ops->next) {
+ for (cursor_ops = com_filter->filter_ops; cursor_ops && cursor_filter;
+ cursor_filter = cursor_filter->next, cursor_ops = cursor_ops->next) {
filter = (cal_filter_s *)cursor_filter->data;
if (filter->filter_type == CAL_FILTER_COMPOSITE)
ret = _cal_db_query_create_composite_condition((cal_composite_filter_s*)filter, &cond, &binds2);
cal_db_append_string(&out_cond, "AND (");
cal_db_append_string(&out_cond, cond);
cal_db_append_string(&out_cond, ")");
- }
- else {
+ } else {
cal_db_append_string(&out_cond, "OR (");
cal_db_append_string(&out_cond, cond);
cal_db_append_string(&out_cond, ")");
case CAL_FILTER_CALTIME:
ret = _cal_db_query_create_caltime_condition(com_filter, filter, &cond);
break;
- default :
+ default:
ERR("The filter type is not supported (%d)", filter->filter_type);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
case CALENDAR_MATCH_NOT_EQUAL:
snprintf(out_cond, sizeof(out_cond), "%s <> %d", field_name, filter->value.i);
break;
- default :
+ default:
ERR("Invalid parameter : int match rule(%d) is not supported", filter->match);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
case CALENDAR_MATCH_NOT_EQUAL:
snprintf(out_cond, sizeof(out_cond), "%s <> %lf", field_name, filter->value.d);
break;
- default :
+ default:
ERR("Invalid parameter : int match rule(%d) is not supported", filter->match);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
case CALENDAR_MATCH_NOT_EQUAL:
snprintf(out_cond, sizeof(out_cond), "%s <> %lld", field_name, filter->value.lli);
break;
- default :
+ default:
ERR("Invalid parameter : int match rule(%d) is not supported", filter->match);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
if (filter->value.caltime.type == CALENDAR_TIME_UTIME) {
tmp = _cal_db_query_get_utime_field_name(field_name);
- if (NULL == tmp) {
+ if (NULL == tmp)
tmp = field_name;
- }
+
switch (filter->match) {
case CALENDAR_MATCH_EQUAL:
snprintf(out_cond, sizeof(out_cond), "%s = %lld", tmp, filter->value.caltime.time.utime);
case CALENDAR_MATCH_NOT_EQUAL:
snprintf(out_cond, sizeof(out_cond), "%s <> %lld", tmp, filter->value.caltime.time.utime);
break;
- default :
+ default:
ERR("Invalid parameter : int match rule(%d) is not supported", filter->match);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
- }
- else if (filter->value.caltime.type == CALENDAR_TIME_LOCALTIME) {
+ } else if (filter->value.caltime.type == CALENDAR_TIME_LOCALTIME) {
char sdate[CAL_STR_SHORT_LEN32] = {0};
snprintf(sdate, sizeof(sdate), CAL_FORMAT_LOCAL_DATETIME,
filter->value.caltime.time.date.year, filter->value.caltime.time.date.month, filter->value.caltime.time.date.mday,
filter->value.caltime.time.date.hour, filter->value.caltime.time.date.minute, filter->value.caltime.time.date.second);
tmp = _cal_db_query_get_datetime_field_name(field_name);
- if (NULL == tmp) {
+ if (NULL == tmp)
tmp = field_name;
- }
+
switch (filter->match) {
case CALENDAR_MATCH_EQUAL:
snprintf(out_cond, sizeof(out_cond), "%s = '%s'", tmp, sdate);
snprintf(out_cond, sizeof(out_cond), "%s <> '%s'", tmp, sdate);
break;
case CALENDAR_MATCH_NONE:
- default :
+ default:
ERR("Invalid parameter : int match rule(%d) is not supported", filter->match);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
- }
- else {
+ } else {
ERR("Invalid parameter : property id(%d)", filter->property_id);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
if (false == with_escape)
return strdup(str);
- for(i=0;i<len;i++) {
- if (str[i] == '\'' || str[i] == '_' || str[i] == '%' || str[i] == '\\') {
+ for (i = 0; i < len; i++) {
+ if (str[i] == '\'' || str[i] == '_' || str[i] == '%' || str[i] == '\\')
temp_str[j++] = CAL_DB_ESCAPE_CHAR;
- }
+
temp_str[j++] = str[i];
}
temp_str[j] = '\0';
case CALENDAR_MATCH_EXISTS:
snprintf(out_cond, sizeof(out_cond), "%s IS NOT NULL", field_name);
break;
- default :
+ default:
ERR("Invalid paramter : int match rule (%d) is not supported", filter->match);
return CALENDAR_ERROR_INVALID_PARAMETER;
}
int count, unsigned int property_id)
{
int i;
- for (i=0;i<count;i++) {
+ for (i = 0; i < count; i++) {
cal_property_info_s *p = (cal_property_info_s*)&(properties[i]);
if (property_id == p->property_id) {
if (p->fields)
static const char * _cal_db_query_get_utime_field_name(const char* src)
{
char *tmp1 = NULL;
- int i=0;
+ int i = 0;
- for(i=0;i<CAL_DB_CALTIME_FIELD_MAX;i++) {
- tmp1 = strstr(src,_cal_db_utime_field_name[i]);
- if (tmp1) {
+ for (i = 0; i < CAL_DB_CALTIME_FIELD_MAX; i++) {
+ tmp1 = strstr(src, _cal_db_utime_field_name[i]);
+ if (tmp1)
return _cal_db_utime_field_name[i];
- }
}
return NULL;
static const char * _cal_db_query_get_datetime_field_name(const char* src)
{
char *tmp1 = NULL;
- int i=0;
+ int i = 0;
- for(i=0;i<CAL_DB_CALTIME_FIELD_MAX;i++) {
- tmp1 = strstr(src,_cal_db_datetime_field_name[i]);
- if (tmp1) {
+ for (i = 0; i < CAL_DB_CALTIME_FIELD_MAX; i++) {
+ tmp1 = strstr(src, _cal_db_datetime_field_name[i]);
+ if (tmp1)
return _cal_db_datetime_field_name[i];
- }
}
return NULL;
static const char * _cal_db_query_get_timetype_field_name(const char* src)
{
char *tmp1 = NULL;
- int i=0;
+ int i = 0;
- for(i=0;i<CAL_DB_CALTIME_FIELD_MAX;i++) {
- tmp1 = strstr(src,_cal_db_timetype_field_name[i]);
- if (tmp1) {
+ for (i = 0; i < CAL_DB_CALTIME_FIELD_MAX; i++) {
+ tmp1 = strstr(src, _cal_db_timetype_field_name[i]);
+ if (tmp1)
return _cal_db_timetype_field_name[i];
- }
}
return NULL;
_rrule->byhour = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, index++);
- _rrule->byday= cal_strdup((const char*)temp);
+ _rrule->byday = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, index++);
- _rrule->bymonthday= cal_strdup((const char*)temp);
+ _rrule->bymonthday = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, index++);
- _rrule->byyearday= cal_strdup((const char*)temp);
+ _rrule->byyearday = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, index++);
- _rrule->byweekno= cal_strdup((const char*)temp);
+ _rrule->byweekno = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, index++);
- _rrule->bymonth= cal_strdup((const char*)temp);
+ _rrule->bymonth = cal_strdup((const char*)temp);
temp = sqlite3_column_text(stmt, index++);
_rrule->bysetpos = cal_strdup((const char*)temp);
RETVM_IF(NULL == rrule, CALENDAR_ERROR_INVALID_PARAMETER,
"Invalid argument: rrule is NULL");
- if (rrule->freq == CALENDAR_RECURRENCE_NONE) {
- }
- else {
+ if (CALENDAR_RECURRENCE_NONE != rrule->freq)
_cal_db_rrule_insert_record(id, rrule);
- }
+
return CALENDAR_ERROR_NONE;
}
DBG("freq is NONE");
_cal_db_rrule_delete_record(id);
return CALENDAR_ERROR_NONE;
- }
- else {
+ } else {
_cal_db_rrule_has_record(id, &has_record);
- if (has_record) {
+ if (has_record)
_cal_db_rrule_update_record(id, rrule);
- }
- else {
+ else
_cal_db_rrule_insert_record(id, rrule);
- }
}
return CALENDAR_ERROR_NONE;
}
static TLS int transaction_ver = 0;
static TLS bool version_up = false;
-static TLS bool event_change=false;
-static TLS bool todo_change=false;
-static TLS bool calendar_change=false;
+static TLS bool event_change = false;
+static TLS bool todo_change = false;
+static TLS bool calendar_change = false;
static void _cal_db_util_notify_event_change(void)
{
if (0 <= fd) {
close(fd);
event_change = false;
- }
- else {
+ } else {
ERR("open() Fail");
}
}
if (0 <= fd) {
close(fd);
todo_change = false;
- }
- else {
+ } else {
ERR("open() Fail");
}
}
if (0 <= fd) {
close(fd);
calendar_change = false;
- }
- else {
+ } else {
ERR("open() Fail");
}
}
return CALENDAR_ERROR_NONE;
}
- switch(type) {
+ switch (type) {
case CAL_NOTI_TYPE_EVENT:
_cal_db_util_notify_event_change();
break;
if (cal_db)
return CALENDAR_ERROR_NONE;
- if (-1 == access (DB_PATH, F_OK))
+ if (-1 == access(DB_PATH, F_OK))
mkdir(DB_PATH, 755);
- if (-1 == access (CAL_DB_FILE, F_OK))
+ if (-1 == access(CAL_DB_FILE, F_OK))
mkdir(DB_PATH, 755);
int ret = 0;
int ret = 0;
ret = db_util_close(cal_db);
- if (SQLITE_OK != ret) {
+ if (SQLITE_OK != ret)
WARN("db_util_close() Fail(%d)", ret);
- }
+
cal_db = NULL;
DBG("The database disconnected really.");
if (SQLITE_BUSY == ret || SQLITE_LOCKED == ret) {
gettimeofday(&now, NULL);
timersub(&now, &from, &diff);
- retry = (diff.tv_sec < CAL_QUERY_RETRY_TIME) ?true :false;
+ retry = (diff.tv_sec < CAL_QUERY_RETRY_TIME) ? true : false;
if (retry)
- usleep(CAL_QUERY_RETRY_INTERVAL); // 50ms
- }
- else {
+ usleep(CAL_QUERY_RETRY_INTERVAL); /* 50ms */
+ } else {
retry = false;
}
} while (retry);
if (SQLITE_BUSY == ret || SQLITE_LOCKED == ret) {
gettimeofday(&now, NULL);
timersub(&now, &from, &diff);
- retry = (diff.tv_sec < CAL_QUERY_RETRY_TIME) ?true :false;
+ retry = (diff.tv_sec < CAL_QUERY_RETRY_TIME) ? true : false;
if (retry)
usleep(CAL_QUERY_RETRY_INTERVAL); /* 50ms */
- }
- else {
+ } else {
retry = false;
}
} while (retry);
SECURE("[%s]", query);
gettimeofday(&now, NULL);
timersub(&now, &from, &diff);
- retry = (diff.tv_sec < CAL_QUERY_RETRY_TIME) ?true :false;
+ retry = (diff.tv_sec < CAL_QUERY_RETRY_TIME) ? true : false;
if (retry)
usleep(CAL_QUERY_RETRY_INTERVAL); /* 50ms */
- }
- else {
+ } else {
retry = false;
}
} while (retry);
ERR("sqlite3_step fail(%d, %s)", ret, sqlite3_errmsg(cal_db));
gettimeofday(&now, NULL);
timersub(&now, &from, &diff);
- retry = (diff.tv_sec < CAL_QUERY_RETRY_TIME) ? true : false;
+ retry = (diff.tv_sec < CAL_QUERY_RETRY_TIME) ? true : false;
if (retry)
usleep(CAL_QUERY_RETRY_INTERVAL); /* 50ms */
- }
- else {
+ } else {
retry = false;
}
} while (retry);
progress = 100000;
ret = cal_db_util_query_exec("BEGIN IMMEDIATE TRANSACTION");
- // !! check error code
- while(CALENDAR_ERROR_NONE != ret && progress < CAL_COMMIT_TRY_MAX) {
+ /* !! check error code */
+ while (CALENDAR_ERROR_NONE != ret && progress < CAL_COMMIT_TRY_MAX) {
usleep(progress);
ret = cal_db_util_query_exec("BEGIN IMMEDIATE TRANSACTION");
progress *= 2;
transaction_cnt = 0;
const char *query = "SELECT ver FROM "CAL_TABLE_VERSION;
ret = cal_db_util_query_get_first_int_result(query, NULL, &transaction_ver);
- if (CALENDAR_ERROR_NONE != ret)
- {
+ if (CALENDAR_ERROR_NONE != ret) {
ERR("cal_db_util_query_get_first_int_result() Fail");
return ret;
}
INFO("start commit");
progress = 100000;
ret = cal_db_util_query_exec("COMMIT TRANSACTION");
- // !! check error code
+ /* !! check error code */
while (CALENDAR_ERROR_NONE != ret && progress < CAL_COMMIT_TRY_MAX) {
usleep(progress);
ret = cal_db_util_query_exec("COMMIT TRANSACTION");
progress *= 2;
}
- INFO("%s", (CALENDAR_ERROR_NONE == ret)?"commit": "rollback");
+ INFO("%s", (CALENDAR_ERROR_NONE == ret) ? "commit" : "rollback");
if (CALENDAR_ERROR_NONE != ret) {
int tmp_ret;
if (todo_change) _cal_db_util_notify_todo_change();
if (calendar_change) _cal_db_util_notify_calendar_change();
- DBG("transaction_ver = %d",transaction_ver);
+ DBG("transaction_ver = %d", transaction_ver);
return CALENDAR_ERROR_NONE;
}
int count = 0;
const char *query = "SELECT ver FROM "CAL_TABLE_VERSION;
ret = cal_db_util_query_get_first_int_result(query, NULL, &count);
- if (CALENDAR_ERROR_NONE != ret) {
+ if (CALENDAR_ERROR_NONE != ret)
WARN("cal_db_util_query_get_first_int_result() Fail(%d)", ret);
- }
+
return (1 + count);
}