ccn_schedule.c File Reference

Support for scheduling events. More...

Go to the source code of this file.

Functions

static void update_epoch (struct ccn_schedule *sched)
static void update_time (struct ccn_schedule *sched)
struct ccn_schedule * ccn_schedule_create (void *clienth, const struct ccn_gettime *ccnclock)
void ccn_schedule_destroy (struct ccn_schedule **schedp)
struct ccn_gettimeccn_schedule_get_gettime (struct ccn_schedule *schedp)
static void heap_insert (struct ccn_schedule_heap_item *heap, int micros, struct ccn_scheduled_event *ev, int h, int n)
static void heap_sift (struct ccn_schedule_heap_item *heap, int n)
static struct ccn_scheduled_eventreschedule_event (struct ccn_schedule *sched, int micros, struct ccn_scheduled_event *ev)
struct ccn_scheduled_eventccn_schedule_event (struct ccn_schedule *sched, int micros, ccn_scheduled_action action, void *evdata, intptr_t evint)
static int ccn_schedule_cancelled_event (struct ccn_schedule *sched, void *clienth, struct ccn_scheduled_event *ev, int flags)
int ccn_schedule_cancel (struct ccn_schedule *sched, struct ccn_scheduled_event *ev)
 Cancel a scheduled event.
static void ccn_schedule_run_next (struct ccn_schedule *sched)
int ccn_schedule_run (struct ccn_schedule *sched)


Detailed Description

Support for scheduling events.

Part of the CCNx C Library.

Copyright (C) 2009 Palo Alto Research Center, Inc.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

Definition in file ccn_schedule.c.


Function Documentation

int ccn_schedule_cancel ( struct ccn_schedule *  sched,
struct ccn_scheduled_event ev 
)

Cancel a scheduled event.

Cancels the event (calling action with CCN_SCHEDULE_CANCEL set)

Returns:
0 if OK, or -1 if this is not possible.

Definition at line 254 of file ccn_schedule.c.

Referenced by ccnd_internal_client_stop(), ccnr_direct_client_stop(), ccnr_internal_client_stop(), content_queue_destroy(), destroyCompareData(), and r_sendq_content_queue_destroy().

static int ccn_schedule_cancelled_event ( struct ccn_schedule *  sched,
void *  clienth,
struct ccn_scheduled_event ev,
int  flags 
) [static]

Definition at line 241 of file ccn_schedule.c.

Referenced by ccn_schedule_cancel().

struct ccn_schedule* ccn_schedule_create ( void *  clienth,
const struct ccn_gettime ccnclock 
) [read]

Definition at line 88 of file ccn_schedule.c.

Referenced by ccnd_create(), main(), and r_init_create().

void ccn_schedule_destroy ( struct ccn_schedule **  schedp  ) 

Definition at line 103 of file ccn_schedule.c.

Referenced by ccnd_destroy(), incoming_content(), main(), and r_init_destroy().

struct ccn_scheduled_event* ccn_schedule_event ( struct ccn_schedule *  sched,
int  micros,
ccn_scheduled_action  action,
void *  evdata,
intptr_t  evint 
) [read]

struct ccn_gettime* ccn_schedule_get_gettime ( struct ccn_schedule *  schedp  )  [read]

Definition at line 129 of file ccn_schedule.c.

int ccn_schedule_run ( struct ccn_schedule *  sched  ) 

Definition at line 301 of file ccn_schedule.c.

Referenced by ccnd_run(), main(), r_dispatch_run(), and r_init_create().

static void ccn_schedule_run_next ( struct ccn_schedule *  sched  )  [static]

Definition at line 269 of file ccn_schedule.c.

Referenced by ccn_schedule_run().

static void heap_insert ( struct ccn_schedule_heap_item *  heap,
int  micros,
struct ccn_scheduled_event ev,
int  h,
int  n 
) [static]

Definition at line 139 of file ccn_schedule.c.

Referenced by reschedule_event().

static void heap_sift ( struct ccn_schedule_heap_item *  heap,
int  n 
) [static]

Definition at line 162 of file ccn_schedule.c.

Referenced by ccn_schedule_run_next().

static struct ccn_scheduled_event* reschedule_event ( struct ccn_schedule *  sched,
int  micros,
struct ccn_scheduled_event ev 
) [static, read]

Definition at line 186 of file ccn_schedule.c.

Referenced by ccn_schedule_event(), and ccn_schedule_run_next().

static void update_epoch ( struct ccn_schedule *  sched  )  [static]

Definition at line 52 of file ccn_schedule.c.

Referenced by reschedule_event(), and update_time().

static void update_time ( struct ccn_schedule *  sched  )  [static]

Definition at line 66 of file ccn_schedule.c.

Referenced by ccn_schedule_create(), ccn_schedule_event(), and ccn_schedule_run().


Generated on Thu Feb 16 00:44:23 2012 for Content-Centric Networking in C by  doxygen 1.5.6