SyncBase.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CCN_SyncBase
00022 #define CCN_SyncBase
00023
00024 #include <sys/types.h>
00025 #include <stdint.h>
00026 #include <stdio.h>
00027 #include <ccn/ccn.h>
00028 #include <ccn/indexbuf.h>
00029 #include <ccn/schedule.h>
00030 #include <ccn/uri.h>
00031 #include <ccnr/ccnr_private.h>
00032
00033 #include "SyncMacros.h"
00034
00035
00036 struct ccn_schedule;
00037 struct ccnr_handle;
00038 struct ccn;
00039 struct SyncPrivate;
00040
00041
00042
00043
00044 struct SyncBaseStruct {
00045 struct SyncErrStruct *errList;
00046 struct SyncPrivate *priv;
00047 struct ccnr_handle *ccnr;
00048 struct ccn *ccn;
00049 struct ccn_schedule *sched;
00050 int debug;
00051 unsigned lastRootId;
00052 ccnr_hwm highWater;
00053 };
00054
00055
00056
00057 enum SyncErrCode {
00058 SyncErrCode_none = 0,
00059 SyncErrCode_bug = 1,
00060 SyncErrCode_caller = 2
00061 };
00062
00063 struct SyncErrStruct {
00064 struct SyncErrStruct *next;
00065 enum SyncErrCode code;
00066 char * file;
00067 int line;
00068 };
00069
00070
00071
00072 void SyncSetErrInner(struct SyncBaseStruct *base,
00073 enum SyncErrCode code,
00074 char * file, int line);
00075
00076
00077 void SyncClearErr(struct SyncBaseStruct *base);
00078
00079
00080
00081
00082 struct SyncBaseStruct *
00083 SyncNewBase(struct ccnr_handle *ccnr,
00084 struct ccn *ccn,
00085 struct ccn_schedule *sched);
00086
00087
00088 void
00089 SyncInit(struct SyncBaseStruct *bp);
00090
00091
00092
00093
00094 void
00095 SyncFreeBase(struct SyncBaseStruct **bp);
00096
00097
00098
00099
00100
00101 int
00102 SyncNotifyContent(struct SyncBaseStruct *base,
00103 int enumeration,
00104 ccnr_accession item,
00105 struct ccn_charbuf *name);
00106
00107
00108 void
00109 SyncShutdown(struct SyncBaseStruct *bp);
00110
00111 #endif