Răsfoiți Sursa

rename NCDRefTarget --> BRefTarget

ambrop7 13 ani în urmă
părinte
comite
645d6456d5

+ 4 - 4
examples/ncdval_test.c

@@ -40,13 +40,13 @@
 #define FORCE(cmd) if (!(cmd)) { fprintf(stderr, "failed\n"); exit(1); }
 
 struct composed_string {
-    NCDRefTarget ref_target;
+    BRefTarget ref_target;
     size_t length;
     size_t chunk_size;
     char **chunks;
 };
 
-static void composed_string_ref_target_func_release (NCDRefTarget *ref_target)
+static void composed_string_ref_target_func_release (BRefTarget *ref_target)
 {
     struct composed_string *cs = UPPER_OBJECT(ref_target, struct composed_string, ref_target);
     
@@ -111,7 +111,7 @@ static NCDValRef build_composed_string (NCDValMem *mem, const char *data, size_t
         length -= to_copy;
     }
     
-    NCDRefTarget_Init(&cs->ref_target, composed_string_ref_target_func_release);
+    BRefTarget_Init(&cs->ref_target, composed_string_ref_target_func_release);
     
     NCDValComposedStringResource resource;
     resource.func_getptr = composed_string_func_getptr;
@@ -119,7 +119,7 @@ static NCDValRef build_composed_string (NCDValMem *mem, const char *data, size_t
     resource.ref_target = &cs->ref_target;
     
     NCDValRef val = NCDVal_NewComposedString(mem, resource, 0, cs->length);
-    NCDRefTarget_Deref(&cs->ref_target);
+    BRefTarget_Deref(&cs->ref_target);
     return val;
     
 fail2:

+ 18 - 18
misc/NCDRefTarget.h → misc/BRefTarget.h

@@ -1,5 +1,5 @@
 /**
- * @file NCDRefTarget.h
+ * @file BRefTarget.h
  * @author Ambroz Bizjak <ambrop7@gmail.com>
  * 
  * @section LICENSE
@@ -27,8 +27,8 @@
  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef BADVPN_NCD_REF_TARGET_H
-#define BADVPN_NCD_REF_TARGET_H
+#ifndef BADVPN_B_REF_TARGET_H
+#define BADVPN_B_REF_TARGET_H
 
 #include <limits.h>
 
@@ -38,18 +38,18 @@
 /**
  * Represents a reference-counted object.
  */
-typedef struct NCDRefTarget_s NCDRefTarget;
+typedef struct BRefTarget_s BRefTarget;
 
 /**
- * Callback function called after the reference count of a {@link NCDRefTarget}
- * reaches has reached zero. At this point the NCDRefTarget object has already
- * been invalidated, i.e. {@link NCDRefTarget_Ref} must not be called on this
+ * Callback function called after the reference count of a {@link BRefTarget}
+ * reaches has reached zero. At this point the BRefTarget object has already
+ * been invalidated, i.e. {@link BRefTarget_Ref} must not be called on this
  * object after this handler is called.
  */
-typedef void (*NCDRefTarget_func_release) (NCDRefTarget *o);
+typedef void (*BRefTarget_func_release) (BRefTarget *o);
 
-struct NCDRefTarget_s {
-    NCDRefTarget_func_release func_release;
+struct BRefTarget_s {
+    BRefTarget_func_release func_release;
     int refcnt;
     DebugObject d_obj;
 };
@@ -57,24 +57,24 @@ struct NCDRefTarget_s {
 /**
  * Initializes a reference target object. The initial reference count of the object
  * is 1. The \a func_release argument specifies the function to be called from
- * {@link NCDRefTarget_Deref} when the reference count reaches zero.
+ * {@link BRefTarget_Deref} when the reference count reaches zero.
  */
-static void NCDRefTarget_Init (NCDRefTarget *o, NCDRefTarget_func_release func_release);
+static void BRefTarget_Init (BRefTarget *o, BRefTarget_func_release func_release);
 
 /**
  * Decrements the reference count of a reference target object. If the reference
- * count has reached zero, the object's {@link NCDRefTarget_func_release} function
+ * count has reached zero, the object's {@link BRefTarget_func_release} function
  * is called, and the object is considered destroyed.
  */
-static void NCDRefTarget_Deref (NCDRefTarget *o);
+static void BRefTarget_Deref (BRefTarget *o);
 
 /**
  * Increments the reference count of a reference target object.
  * Returns 1 on success and 0 on failure.
  */
-static int NCDRefTarget_Ref (NCDRefTarget *o) WARN_UNUSED;
+static int BRefTarget_Ref (BRefTarget *o) WARN_UNUSED;
 
-static void NCDRefTarget_Init (NCDRefTarget *o, NCDRefTarget_func_release func_release)
+static void BRefTarget_Init (BRefTarget *o, BRefTarget_func_release func_release)
 {
     ASSERT(func_release)
     
@@ -84,7 +84,7 @@ static void NCDRefTarget_Init (NCDRefTarget *o, NCDRefTarget_func_release func_r
     DebugObject_Init(&o->d_obj);
 }
 
-static void NCDRefTarget_Deref (NCDRefTarget *o)
+static void BRefTarget_Deref (BRefTarget *o)
 {
     DebugObject_Access(&o->d_obj);
     ASSERT(o->refcnt > 0)
@@ -97,7 +97,7 @@ static void NCDRefTarget_Deref (NCDRefTarget *o)
     }
 }
 
-static int NCDRefTarget_Ref (NCDRefTarget *o)
+static int BRefTarget_Ref (BRefTarget *o)
 {
     DebugObject_Access(&o->d_obj);
     ASSERT(o->refcnt > 0)

+ 7 - 7
ncd/NCDVal.c

@@ -392,7 +392,7 @@ void NCDValMem_Free (NCDValMem *o)
     while (refidx != -1) {
         struct NCDVal__ref *ref = NCDValMem__BufAt(o, refidx);
         ASSERT(ref->target)
-        NCDRefTarget_Deref(ref->target);
+        BRefTarget_Deref(ref->target);
         refidx = ref->next;
     }
     
@@ -425,7 +425,7 @@ int NCDValMem_InitCopy (NCDValMem *o, NCDValMem *other)
     while (refidx != -1) {
         struct NCDVal__ref *ref = NCDValMem__BufAt(o, refidx);
         ASSERT(ref->target)
-        if (!NCDRefTarget_Ref(ref->target)) {
+        if (!BRefTarget_Ref(ref->target)) {
             goto fail1;
         }
         refidx = ref->next;
@@ -437,7 +437,7 @@ fail1:;
     NCDVal__idx undo_refidx = o->first_ref;
     while (undo_refidx != refidx) {
         struct NCDVal__ref *ref = NCDValMem__BufAt(o, undo_refidx);
-        NCDRefTarget_Deref(ref->target);
+        BRefTarget_Deref(ref->target);
         undo_refidx = ref->next;
     }
     if (o->buf) {
@@ -973,7 +973,7 @@ fail:
 }
 
 NCDValRef NCDVal_NewExternalString (NCDValMem *mem, const char *data, size_t len,
-                                    NCDRefTarget *ref_target)
+                                    BRefTarget *ref_target)
 {
     NCDVal__AssertMem(mem);
     ASSERT(data)
@@ -986,7 +986,7 @@ NCDValRef NCDVal_NewExternalString (NCDValMem *mem, const char *data, size_t len
     }
     
     if (ref_target) {
-        if (!NCDRefTarget_Ref(ref_target)) {
+        if (!BRefTarget_Ref(ref_target)) {
             goto fail;
         }
     }
@@ -1020,7 +1020,7 @@ NCDValRef NCDVal_NewComposedString (NCDValMem *mem, NCDValComposedStringResource
     }
     
     if (resource.ref_target) {
-        if (!NCDRefTarget_Ref(resource.ref_target)) {
+        if (!BRefTarget_Ref(resource.ref_target)) {
             goto fail;
         }
     }
@@ -1302,7 +1302,7 @@ NCDStringIndex * NCDVal_IdStringStringIndex (NCDValRef idstring)
     return ids_e->string_index;
 }
 
-NCDRefTarget * NCDVal_ExternalStringTarget (NCDValRef externalstring)
+BRefTarget * NCDVal_ExternalStringTarget (NCDValRef externalstring)
 {
     ASSERT(NCDVal_IsExternalString(externalstring))
     

+ 7 - 7
ncd/NCDVal.h

@@ -35,7 +35,7 @@
 
 #include <misc/debug.h>
 #include <misc/cstring.h>
-#include <misc/NCDRefTarget.h>
+#include <misc/BRefTarget.h>
 #include <structure/CAvl.h>
 #include <ncd/NCDStringIndex.h>
 
@@ -52,7 +52,7 @@ typedef int NCDVal__idx;
 
 struct NCDVal__ref {
     NCDVal__idx next;
-    NCDRefTarget *target;
+    BRefTarget *target;
 };
 
 struct NCDVal__string {
@@ -426,7 +426,7 @@ NCDValRef NCDVal_NewIdString (NCDValMem *mem, NCD_string_id_t string_id,
 
 /**
  * Builds a new ExternalString, pointing to the given external data. A reference to
- * the external data is taken using {@link NCDRefTarget}, unless 'ref_target' is
+ * the external data is taken using {@link BRefTarget}, unless 'ref_target' is
  * NULL. The data must not change while this value exists.
  * Returns a reference to the new value, or an invalid reference
  * on out of memory.
@@ -435,7 +435,7 @@ NCDValRef NCDVal_NewIdString (NCDValMem *mem, NCD_string_id_t string_id,
  * stored outside of the value memory object.
  */
 NCDValRef NCDVal_NewExternalString (NCDValMem *mem, const char *data, size_t len,
-                                    NCDRefTarget *ref_target);
+                                    BRefTarget *ref_target);
 
 /**
  * Callback function which is called for ComposedString's to access the underlying string resource.
@@ -457,7 +457,7 @@ typedef void (*NCDVal_ComposedString_func_getptr) (void *user, size_t offset, co
 typedef struct {
     NCDVal_ComposedString_func_getptr func_getptr;
     void *user;
-    NCDRefTarget *ref_target;
+    BRefTarget *ref_target;
 } NCDValComposedStringResource;
 
 /**
@@ -477,7 +477,7 @@ b_cstring NCDValComposedStringResource_Cstring (NCDValComposedStringResource res
 
 /**
  * Builds a new ComposedString from a string resource.
- * A reference to the underlying string resource via the {@link NCDRefTarget} object
+ * A reference to the underlying string resource via the {@link BRefTarget} object
  * specified in 'resource.ref_target'.
  * 
  * A ComposedString is a kind of String with an abstract representation exposed via the
@@ -579,7 +579,7 @@ NCDStringIndex * NCDVal_IdStringStringIndex (NCDValRef idstring);
  * Returns the reference target of an ExternalString. This may be NULL
  * if the external string is not associated with a reference target.
  */
-NCDRefTarget * NCDVal_ExternalStringTarget (NCDValRef externalstring);
+BRefTarget * NCDVal_ExternalStringTarget (NCDValRef externalstring);
 
 /**
  * Returns the underlying string resource of a ComposedString.

+ 3 - 3
ncd/extra/NCDBuf.c

@@ -33,7 +33,7 @@
 #include <misc/offset.h>
 #include <misc/debug.h>
 
-static void ref_target_func_release (NCDRefTarget *ref_target)
+static void ref_target_func_release (BRefTarget *ref_target)
 {
     NCDBuf *o = UPPER_OBJECT(ref_target, NCDBuf, ref_target);
     NCDBufStore *store = o->store;
@@ -107,12 +107,12 @@ NCDBuf * NCDBufStore_GetBuf (NCDBufStore *o)
     }
     
     LinkedList0_Prepend(&o->used_bufs_list, &buf->list_node);
-    NCDRefTarget_Init(&buf->ref_target, ref_target_func_release);
+    BRefTarget_Init(&buf->ref_target, ref_target_func_release);
     
     return buf;
 }
 
-NCDRefTarget * NCDBuf_RefTarget (NCDBuf *o)
+BRefTarget * NCDBuf_RefTarget (NCDBuf *o)
 {
     return &o->ref_target;
 }

+ 3 - 3
ncd/extra/NCDBuf.h

@@ -32,7 +32,7 @@
 
 #include <stddef.h>
 
-#include <misc/NCDRefTarget.h>
+#include <misc/BRefTarget.h>
 #include <structure/LinkedList0.h>
 #include <base/DebugObject.h>
 
@@ -46,7 +46,7 @@ typedef struct {
 typedef struct {
     NCDBufStore *store;
     LinkedList0Node list_node;
-    NCDRefTarget ref_target;
+    BRefTarget ref_target;
     char data[];
 } NCDBuf;
 
@@ -55,7 +55,7 @@ void NCDBufStore_Free (NCDBufStore *o);
 size_t NCDBufStore_BufSize (NCDBufStore *o);
 NCDBuf * NCDBufStore_GetBuf (NCDBufStore *o);
 
-NCDRefTarget * NCDBuf_RefTarget (NCDBuf *o);
+BRefTarget * NCDBuf_RefTarget (NCDBuf *o);
 char * NCDBuf_Data (NCDBuf *o);
 
 #endif

+ 5 - 5
ncd/modules/buffer.c

@@ -104,7 +104,7 @@ struct reference {
     struct chunk *first_chunk;
     size_t first_offset;
     size_t length;
-    NCDRefTarget ref_target;
+    BRefTarget ref_target;
 };
 
 struct instance {
@@ -128,7 +128,7 @@ static struct chunk * chunk_init (struct instance *inst, size_t length);
 static void chunk_unref (struct chunk *c);
 static void chunk_assert (struct chunk *c);
 static struct reference * reference_init (struct instance *inst, size_t offset, size_t length, NCDValComposedStringResource *out_resource);
-static void reference_ref_target_func_release (NCDRefTarget *ref_target);
+static void reference_ref_target_func_release (BRefTarget *ref_target);
 static void reference_assert (struct reference *ref);
 static void reference_resource_func_getptr (void *user, size_t offset, const char **out_data, size_t *out_length);
 
@@ -359,7 +359,7 @@ static struct reference * reference_init (struct instance *inst, size_t offset,
     } while (c && c->offset < offset + length);
     
     // init reference target
-    NCDRefTarget_Init(&ref->ref_target, reference_ref_target_func_release);
+    BRefTarget_Init(&ref->ref_target, reference_ref_target_func_release);
     
     // write resource
     out_resource->func_getptr = reference_resource_func_getptr;
@@ -370,7 +370,7 @@ static struct reference * reference_init (struct instance *inst, size_t offset,
     return ref;
 }
 
-static void reference_ref_target_func_release (NCDRefTarget *ref_target)
+static void reference_ref_target_func_release (BRefTarget *ref_target)
 {
     struct reference *ref = UPPER_OBJECT(ref_target, struct reference, ref_target);
     reference_assert(ref);
@@ -506,7 +506,7 @@ static int func_getvar (void *vo, NCD_string_id_t name, NCDValMem *mem, NCDValRe
                 goto fail;
             }
             *out = NCDVal_NewComposedString(mem, resource, 0, ref->length);
-            NCDRefTarget_Deref(resource.ref_target);
+            BRefTarget_Deref(resource.ref_target);
         }
         return 1;
     }

+ 5 - 5
ncd/modules/concat.c

@@ -44,7 +44,7 @@
 
 #include <misc/balloc.h>
 #include <misc/offset.h>
-#include <misc/NCDRefTarget.h>
+#include <misc/BRefTarget.h>
 #include <ncd/NCDModule.h>
 #include <ncd/static_strings.h>
 
@@ -53,7 +53,7 @@
 #define ModuleLog(i, ...) NCDModuleInst_Backend_Log((i), BLOG_CURRENT_CHANNEL, __VA_ARGS__)
 
 struct result {
-    NCDRefTarget ref_target;
+    BRefTarget ref_target;
     size_t length;
     char data[];
 };
@@ -63,7 +63,7 @@ struct instance {
     struct result *result;
 };
 
-static void result_ref_target_func_release (NCDRefTarget *ref_target)
+static void result_ref_target_func_release (BRefTarget *ref_target)
 {
     struct result *result = UPPER_OBJECT(ref_target, struct result, ref_target);
     
@@ -99,7 +99,7 @@ static void new_concat_common (void *vo, NCDModuleInst *i, NCDValRef list)
     }
     
     // init ref target
-    NCDRefTarget_Init(&o->result->ref_target, result_ref_target_func_release);
+    BRefTarget_Init(&o->result->ref_target, result_ref_target_func_release);
     
     // copy data to result
     o->result->length = 0;
@@ -147,7 +147,7 @@ static void func_die (void *vo)
     struct instance *o = vo;
     
     // release result reference
-    NCDRefTarget_Deref(&o->result->ref_target);
+    BRefTarget_Deref(&o->result->ref_target);
     
     NCDModuleInst_Backend_Dead(o->i);
 }

+ 11 - 11
ncd/modules/depend_scope.c

@@ -86,7 +86,7 @@
 #include <misc/offset.h>
 #include <misc/debug.h>
 #include <misc/balloc.h>
-#include <misc/NCDRefTarget.h>
+#include <misc/BRefTarget.h>
 #include <structure/LinkedList1.h>
 #include <ncd/NCDModule.h>
 
@@ -95,7 +95,7 @@
 #define ModuleLog(i, ...) NCDModuleInst_Backend_Log((i), BLOG_CURRENT_CHANNEL, __VA_ARGS__)
 
 struct scope {
-    NCDRefTarget ref_target;
+    BRefTarget ref_target;
     LinkedList1 provides_list;
     LinkedList1 depends_list;
 };
@@ -189,7 +189,7 @@ static void depend_update (struct depend *o)
     }
 }
 
-static void scope_ref_target_func_release (NCDRefTarget *ref_target)
+static void scope_ref_target_func_release (BRefTarget *ref_target)
 {
     struct scope *o = UPPER_OBJECT(ref_target, struct scope, ref_target);
     ASSERT(LinkedList1_IsEmpty(&o->provides_list))
@@ -220,7 +220,7 @@ static void scope_func_new (void *vo, NCDModuleInst *i, const struct NCDModuleIn
     }
     
     // init reference target
-    NCDRefTarget_Init(&o->scope->ref_target, scope_ref_target_func_release);
+    BRefTarget_Init(&o->scope->ref_target, scope_ref_target_func_release);
     
     // init provide and depend lists
     LinkedList1_Init(&o->scope->provides_list);
@@ -239,7 +239,7 @@ static void scope_func_die (void *vo)
     struct scope_instance *o = vo;
     
     // release scope reference
-    NCDRefTarget_Deref(&o->scope->ref_target);
+    BRefTarget_Deref(&o->scope->ref_target);
     
     NCDModuleInst_Backend_Dead(o->i);
 }
@@ -267,8 +267,8 @@ static void provide_func_new (void *vo, NCDModuleInst *i, const struct NCDModule
     }
     
     // grab scope reference
-    if (!NCDRefTarget_Ref(&o->scope->ref_target)) {
-        ModuleLog(o->i, BLOG_ERROR, "NCDRefTarget_Ref failed");
+    if (!BRefTarget_Ref(&o->scope->ref_target)) {
+        ModuleLog(o->i, BLOG_ERROR, "BRefTarget_Ref failed");
         goto fail0;
     }
     
@@ -306,7 +306,7 @@ static void provide_free (struct provide *o)
     LinkedList1_Remove(&o->scope->provides_list, &o->provides_list_node);
     
     // release scope reference
-    NCDRefTarget_Deref(&o->scope->ref_target);
+    BRefTarget_Deref(&o->scope->ref_target);
     
     NCDModuleInst_Backend_Dead(o->i);
 }
@@ -356,8 +356,8 @@ static void depend_func_new (void *vo, NCDModuleInst *i, const struct NCDModuleI
     o->names = names_arg;
     
     // grab scope reference
-    if (!NCDRefTarget_Ref(&o->scope->ref_target)) {
-        ModuleLog(o->i, BLOG_ERROR, "NCDRefTarget_Ref failed");
+    if (!BRefTarget_Ref(&o->scope->ref_target)) {
+        ModuleLog(o->i, BLOG_ERROR, "BRefTarget_Ref failed");
         goto fail0;
     }
     
@@ -393,7 +393,7 @@ static void depend_func_die (void *vo)
     LinkedList1_Remove(&o->scope->depends_list, &o->depends_list_node);
     
     // release scope reference
-    NCDRefTarget_Deref(&o->scope->ref_target);
+    BRefTarget_Deref(&o->scope->ref_target);
     
     NCDModuleInst_Backend_Dead(o->i);
 }

+ 1 - 1
ncd/modules/file_open.c

@@ -363,7 +363,7 @@ static void read_func_die (void *vo)
     struct read_instance *o = vo;
     
     // release buffer
-    NCDRefTarget_Deref(NCDBuf_RefTarget(o->buf));
+    BRefTarget_Deref(NCDBuf_RefTarget(o->buf));
     
     NCDModuleInst_Backend_Dead(o->i);
 }

+ 1 - 1
ncd/modules/socket.c

@@ -778,7 +778,7 @@ static void read_func_die (void *vo)
     }
     
     // release buffer
-    NCDRefTarget_Deref(NCDBuf_RefTarget(o->buf));
+    BRefTarget_Deref(NCDBuf_RefTarget(o->buf));
     
     NCDModuleInst_Backend_Dead(o->i);
 }

+ 3 - 3
ncd/modules/substr.c

@@ -55,10 +55,10 @@ struct substr_instance {
     const char *data;
     size_t length;
     int is_external;
-    NCDRefTarget *external_ref_target;
+    BRefTarget *external_ref_target;
 };
 
-static void substr_func_new_common (void *vo, NCDModuleInst *i, const char *data, size_t length, int is_external, NCDRefTarget *external_ref_target)
+static void substr_func_new_common (void *vo, NCDModuleInst *i, const char *data, size_t length, int is_external, BRefTarget *external_ref_target)
 {
     struct substr_instance *o = vo;
     o->i = i;
@@ -134,7 +134,7 @@ static void func_new_substr (void *vo, NCDModuleInst *i, const struct NCDModuleI
     }
     
     int is_external = 0;
-    NCDRefTarget *external_ref_target = NULL;
+    BRefTarget *external_ref_target = NULL;
     
     if (NCDVal_IsExternalString(str_arg)) {
         is_external = 1;

+ 1 - 1
ncd/modules/sys_start_process.c

@@ -890,7 +890,7 @@ static void read_func_die (void *vo)
     
     // release buffer
     if (o->buf) {
-        NCDRefTarget_Deref(NCDBuf_RefTarget(o->buf));
+        BRefTarget_Deref(NCDBuf_RefTarget(o->buf));
     }
     
     NCDModuleInst_Backend_Dead(o->i);

+ 13 - 13
ncd/modules/value.c

@@ -224,7 +224,7 @@ struct value {
         struct {
             const char *data;
             size_t length;
-            NCDRefTarget *ref_target;
+            BRefTarget *ref_target;
         } externalstring;
         struct {
             NCDValComposedStringResource resource;
@@ -245,7 +245,7 @@ static void value_cleanup (struct value *v);
 static void value_delete (struct value *v);
 static struct value * value_init_storedstring (NCDModuleInst *i, const char *str, size_t len);
 static struct value * value_init_idstring (NCDModuleInst *i, NCD_string_id_t id, NCDStringIndex *string_index);
-static struct value * value_init_externalstring (NCDModuleInst *i, const char *data, size_t length, NCDRefTarget *ref_target);
+static struct value * value_init_externalstring (NCDModuleInst *i, const char *data, size_t length, BRefTarget *ref_target);
 static struct value * value_init_composedstring (NCDModuleInst *i, NCDValComposedStringResource resource, size_t offset, size_t length);
 static int value_is_string (struct value *v);
 static size_t value_string_length (struct value *v);
@@ -319,13 +319,13 @@ static void value_cleanup (struct value *v)
         
         case EXTERNALSTRING_TYPE: {
             if (v->externalstring.ref_target) {
-                NCDRefTarget_Deref(v->externalstring.ref_target);
+                BRefTarget_Deref(v->externalstring.ref_target);
             }
         } break;
         
         case COMPOSEDSTRING_TYPE: {
             if (v->composedstring.resource.ref_target) {
-                NCDRefTarget_Deref(v->composedstring.resource.ref_target);
+                BRefTarget_Deref(v->composedstring.resource.ref_target);
             }
         } break;
         
@@ -382,13 +382,13 @@ static void value_delete (struct value *v)
         
         case EXTERNALSTRING_TYPE: {
             if (v->externalstring.ref_target) {
-                NCDRefTarget_Deref(v->externalstring.ref_target);
+                BRefTarget_Deref(v->externalstring.ref_target);
             }
         } break;
         
         case COMPOSEDSTRING_TYPE: {
             if (v->composedstring.resource.ref_target) {
-                NCDRefTarget_Deref(v->composedstring.resource.ref_target);
+                BRefTarget_Deref(v->composedstring.resource.ref_target);
             }
         } break;
         
@@ -466,7 +466,7 @@ fail0:
     return NULL;
 }
 
-static struct value * value_init_externalstring (NCDModuleInst *i, const char *data, size_t length, NCDRefTarget *ref_target)
+static struct value * value_init_externalstring (NCDModuleInst *i, const char *data, size_t length, BRefTarget *ref_target)
 {
     struct value *v = malloc(sizeof(*v));
     if (!v) {
@@ -475,8 +475,8 @@ static struct value * value_init_externalstring (NCDModuleInst *i, const char *d
     }
     
     if (ref_target) {
-        if (!NCDRefTarget_Ref(ref_target)) {
-            ModuleLog(i, BLOG_ERROR, "NCDRefTarget_Ref failed");
+        if (!BRefTarget_Ref(ref_target)) {
+            ModuleLog(i, BLOG_ERROR, "BRefTarget_Ref failed");
             goto fail1;
         }
     }
@@ -506,8 +506,8 @@ static struct value * value_init_composedstring (NCDModuleInst *i, NCDValCompose
     }
     
     if (resource.ref_target) {
-        if (!NCDRefTarget_Ref(resource.ref_target)) {
-            ModuleLog(i, BLOG_ERROR, "NCDRefTarget_Ref failed");
+        if (!BRefTarget_Ref(resource.ref_target)) {
+            ModuleLog(i, BLOG_ERROR, "BRefTarget_Ref failed");
             goto fail1;
         }
     }
@@ -598,13 +598,13 @@ static void value_string_set_allocd (struct value *v, char *data, size_t length)
         
         case EXTERNALSTRING_TYPE: {
             if (v->externalstring.ref_target) {
-                NCDRefTarget_Deref(v->externalstring.ref_target);
+                BRefTarget_Deref(v->externalstring.ref_target);
             }
         } break;
         
         case COMPOSEDSTRING_TYPE: {
             if (v->composedstring.resource.ref_target) {
-                NCDRefTarget_Deref(v->composedstring.resource.ref_target);
+                BRefTarget_Deref(v->composedstring.resource.ref_target);
             }
         } break;