Skip to content

Commit

Permalink
rename 'struct sched_param' to 'struct caldav_sched_param' to avoid c…
Browse files Browse the repository at this point in the history
…onflict with /usr/include/bits/sched.h
  • Loading branch information
ksmurchison committed Jun 28, 2016
1 parent 644e5ab commit a288b4f
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion imap/http_caldav.c
Expand Up @@ -2353,7 +2353,7 @@ static int caldav_post_outbox(struct transaction_t *txn, int rights)
icalproperty_method meth = 0;
icalproperty *prop = NULL;
const char *uid = NULL, *organizer = NULL;
struct sched_param sparam;
struct caldav_sched_param sparam;

/* Check Content-Type */
if ((hdr = spool_getheader(txn->req_hdrs, "Content-Type"))) {
Expand Down
28 changes: 14 additions & 14 deletions imap/http_caldav_sched.c
Expand Up @@ -71,7 +71,7 @@
#include "imap/http_err.h"
#include "imap/imap_err.h"

int caladdress_lookup(const char *addr, struct sched_param *param, const char *myuserid)
int caladdress_lookup(const char *addr, struct caldav_sched_param *param, const char *myuserid)
{
const char *userid = addr, *p;
int islocal = 1, found = 1;
Expand Down Expand Up @@ -106,7 +106,7 @@ int caladdress_lookup(const char *addr, struct sched_param *param, const char *m

if (!strncasecmp(userid, "mailto:", 7)) userid += 7;

memset(param, 0, sizeof(struct sched_param));
memset(param, 0, sizeof(struct caldav_sched_param));

if (testuser && !strcasecmp(userid, testuser)) {
param->isyou = 1;
Expand Down Expand Up @@ -602,7 +602,7 @@ struct remote_rock {
static void busytime_query_remote(const char *server __attribute__((unused)),
void *data, void *rock)
{
struct sched_param *remote = (struct sched_param *) data;
struct caldav_sched_param *remote = (struct caldav_sched_param *) data;
struct remote_rock *rrock = (struct remote_rock *) rock;
icalcomponent *comp;
struct proplist *list;
Expand Down Expand Up @@ -703,7 +703,7 @@ static void busytime_query_remote(const char *server __attribute__((unused)),

static void free_sched_param_props(void *data)
{
struct sched_param *sched_param = (struct sched_param *) data;
struct caldav_sched_param *sched_param = (struct caldav_sched_param *) data;

if (sched_param) {
struct proplist *prop, *next;
Expand All @@ -728,14 +728,14 @@ int sched_busytime_query(struct transaction_t *txn,
char mailboxname[MAX_MAILBOX_BUFFER];
icalproperty *prop = NULL, *next;
const char *uid = NULL, *organizer = NULL;
struct sched_param sparam;
struct caldav_sched_param sparam;
struct auth_state *org_authstate = NULL;
xmlNodePtr root = NULL;
xmlNsPtr ns[NUM_NAMESPACE];
struct propfind_ctx fctx;
struct freebusy_filter calfilter;
struct hash_table remote_table;
struct sched_param *remote = NULL;
struct caldav_sched_param *remote = NULL;

if (!calendarprefix) {
calendarprefix = config_getstring(IMAPOPT_CALENDARPREFIX);
Expand Down Expand Up @@ -835,7 +835,7 @@ int sched_busytime_query(struct transaction_t *txn,
remote = hash_lookup(key, &remote_table);
if (!remote) {
/* New remote - add it to the hash table */
remote = xzmalloc(sizeof(struct sched_param));
remote = xzmalloc(sizeof(struct caldav_sched_param));
if (sparam.server) remote->server = xstrdup(sparam.server);
remote->port = sparam.port;
remote->flags = sparam.flags;
Expand Down Expand Up @@ -959,7 +959,7 @@ int sched_busytime_query(struct transaction_t *txn,

/* Deliver scheduling object to a remote recipient */
static void sched_deliver_remote(const char *recipient,
struct sched_param *sparam,
struct caldav_sched_param *sparam,
struct sched_data *sched_data)
{
int r;
Expand Down Expand Up @@ -1136,7 +1136,7 @@ static int deliver_merge_pollstatus(icalcomponent *ical, icalcomponent *request)


static void sched_pollstatus(const char *organizer,
struct sched_param *sparam, icalcomponent *ical,
struct caldav_sched_param *sparam, icalcomponent *ical,
const char *voter)
{
struct auth_state *authstate;
Expand Down Expand Up @@ -1249,7 +1249,7 @@ deliver_merge_pollstatus(icalcomponent *ical __attribute__((unused)),
}

static void sched_pollstatus(const char *organizer __attribute__((unused)),
struct sched_param *sparam __attribute__((unused)),
struct caldav_sched_param *sparam __attribute__((unused)),
icalcomponent *ical __attribute__((unused)),
const char *voter __attribute__((unused)))
{
Expand Down Expand Up @@ -1569,7 +1569,7 @@ static int deliver_merge_request(const char *attendee,

/* Deliver scheduling object to local recipient */
static void sched_deliver_local(const char *recipient,
struct sched_param *sparam,
struct caldav_sched_param *sparam,
struct sched_data *sched_data,
struct auth_state *authstate)
{
Expand Down Expand Up @@ -1854,7 +1854,7 @@ void sched_deliver(const char *recipient, void *data, void *rock)
{
struct sched_data *sched_data = (struct sched_data *) data;
struct auth_state *authstate = (struct auth_state *) rock;
struct sched_param sparam;
struct caldav_sched_param sparam;
int islegal;

/* Check SCHEDULE-FORCE-SEND value */
Expand Down Expand Up @@ -2928,11 +2928,11 @@ void sched_reply(const char *userid, const char *attendee,
if (reply.itip) icalcomponent_free(reply.itip);
}

void sched_param_free(struct sched_param *sparam) {
void sched_param_free(struct caldav_sched_param *sparam) {
if (sparam->userid) free(sparam->userid);
if (sparam->server) free(sparam->server);
if (sparam->props) {
free_sched_param_props(sparam->props);
}
memset(sparam, 0, sizeof(struct sched_param));
memset(sparam, 0, sizeof(struct caldav_sched_param));
}
8 changes: 4 additions & 4 deletions imap/http_caldav_sched.h
Expand Up @@ -97,7 +97,7 @@ struct proplist {

/* Each calendar user address has the following scheduling protocol params */
/* All memory must be freed with sched_param_free. */
struct sched_param {
struct caldav_sched_param {
char *userid; /* Userid corresponding to calendar address */
char *server; /* Remote server user lives on */
unsigned port; /* Remote server port, default = 80 */
Expand All @@ -106,7 +106,7 @@ struct sched_param {
struct proplist *props; /* List of attendee iCal properties */
};

extern void sched_param_free(struct sched_param *sparam);
extern void sched_param_free(struct caldav_sched_param *sparam);

struct freebusy {
struct icalperiodtype per;
Expand Down Expand Up @@ -161,7 +161,7 @@ extern icalcomponent *busytime_query_local(struct transaction_t *txn,
const char *organizer,
const char *attendee);

extern int isched_send(struct sched_param *sparam, const char *recipient,
extern int isched_send(struct caldav_sched_param *sparam, const char *recipient,
icalcomponent *ical, xmlNodePtr *xml);

extern int sched_busytime_query(struct transaction_t *txn,
Expand All @@ -173,7 +173,7 @@ extern void sched_reply(const char *userid, const char *attendee,
extern void sched_deliver(const char *recipient, void *data, void *rock);
extern xmlNodePtr xml_add_schedresponse(xmlNodePtr root, xmlNsPtr dav_ns,
xmlChar *recipient, xmlChar *status);
extern int caladdress_lookup(const char *addr, struct sched_param *param,
extern int caladdress_lookup(const char *addr, struct caldav_sched_param *param,
const char *myuserid);


Expand Down
4 changes: 2 additions & 2 deletions imap/http_ischedule.c
Expand Up @@ -549,7 +549,7 @@ static int meth_post_isched(struct transaction_t *txn,

while ((recipient = tok_next(&tok))) {
/* Is recipient remote or local? */
struct sched_param sparam;
struct caldav_sched_param sparam;
int r = caladdress_lookup(recipient, &sparam, /*myuserid*/NULL);

/* Don't allow scheduling with remote users via iSchedule */
Expand Down Expand Up @@ -592,7 +592,7 @@ static int meth_post_isched(struct transaction_t *txn,
}


int isched_send(struct sched_param *sparam, const char *recipient,
int isched_send(struct caldav_sched_param *sparam, const char *recipient,
icalcomponent *ical, xmlNodePtr *xml)
{
int r = 0;
Expand Down
2 changes: 1 addition & 1 deletion imap/http_jmap.c
Expand Up @@ -8326,7 +8326,7 @@ static json_t* jmap_alerts_from_ical(icalcomponent *comp) {
/* Set isyou if userid matches the user looked up by caladdr. Return 0 on
* success or a Cyrus error on failure. */
static int jmap_isyou(const char *caladdr, const char *userid, short *isyou) {
struct sched_param sparam;
struct caldav_sched_param sparam;

if (userid) {
sparam.userid = NULL;
Expand Down

0 comments on commit a288b4f

Please sign in to comment.