annotate src/img_ldr_dummy.c @ 1299:6949e2b6cae2

Add unlink clone checker. - Monitor changes of DOM-tree of the document - Unlinking a clone is actually removing the clone and copying nodes from the source. - Copy value of ID of a node to saved_id to track source of copy nodes. - For a new node with 'saved_id' is a copy of another node. - Copy vulae of 'saved_id' to 'ns0:duplicate-src' to keep the source - Change value of 'saved_id' to the value of ID of the node for later copying. - For a new node without 'saved_id' is not a copy of another node. - only set 'saved_id' to the value of its ID.
author Thinker K.F. Li <thinker@codemud.net>
date Sun, 16 Jan 2011 16:13:37 +0800
parents 1b3e295f3acb
children
rev   line source
1105
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
1 #include <stdio.h>
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
2 #include "mb_img_ldr.h"
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
3
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
4 static mb_img_data_t *img_ldr_dummy_load(mb_img_ldr_t *ldr,
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
5 const char *img_id);
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
6 static void img_ldr_dummy_free(mb_img_ldr_t *ldr);
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
7
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
8 static mb_img_ldr_t img_ldr = {
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
9 img_ldr_dummy_load,
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
10 img_ldr_dummy_free
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
11 };
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
12
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
13 #ifndef ERR
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
14 #include <stdio.h>
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
15 #include <stdlib.h>
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
16 #define ERR(msg) do { fprintf(stderr, __FILE__ ":%d: %s", __LINE__, msg); abort(); } while(0)
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
17 #endif
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
18 #ifndef NOT_IMPLEMENT
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
19 #define NOT_IMPLEMENT(func) \
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
20 ERR(func " is not impmemented\n")
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
21 #endif
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
22
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
23 static mb_img_data_t *
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
24 img_ldr_dummy_load(mb_img_ldr_t *ldr, const char *img_id) {
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
25 NOT_IMPLEMENT("img_ldr_dummy_load");
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
26 return NULL;
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
27 }
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
28
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
29 static void
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
30 img_ldr_dummy_free(mb_img_ldr_t *ldr) {
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
31 NOT_IMPLEMENT("img_ldr_dummy_free");
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
32 }
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
33
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
34 mb_img_ldr_t *
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
35 simple_mb_img_ldr_new(const char *img_repository) {
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
36 return &img_ldr;
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
37 }
1b3e295f3acb Add a dummy image loader.
Thinker K.F. Li <thinker@codemud.net>
parents:
diff changeset
38