int cx_genCollectAnonymous(void* o, void* userData) {
    cx_ll list = userData;

    if (!cx_checkAttr(o, CX_ATTR_SCOPED)) {
        cx_llInsert(list, o);
    }

    return 1;
}
Exemple #2
0
/* ::cortex::Fast::Expression::toList() */
Fast_Expression_list Fast_Expression_toList_v(Fast_Expression _this) {
/* $begin(::cortex::Fast::Expression::toList) */
    Fast_Node_list result = NULL;
    
    if (_this) {
        result = cx_llNew();
        cx_llInsert(result, _this); cx_keep_ext(NULL, _this, "convert single expression to list");
    }
    
    return result;
/* $end */
}
Exemple #3
0
/* Register exithandler */
void cx_onexit(void(*handler)(void*), void* userData) {
    struct cx_exitHandler* h;

    h = cx_malloc(sizeof(struct cx_exitHandler));
    h->handler = handler;
    h->userData = userData;

    cx_mutexLock(&cx_adminLock);
    if (!cx_exitHandlers) {
        cx_exitHandlers = cx_llNew();
    }
    cx_llInsert(cx_exitHandlers, h);
    cx_mutexUnlock(&cx_adminLock);
}
Exemple #4
0
static void* cx_list_do_(cx_any object, cx_bool insert) {
    cx_ll list = *(cx_ll*)object.value;
    void* value = NULL;
    cx_value dst;
    
    if (cx_collection_elementRequiresAlloc(cx_collection(object.type))) {
        cx_uint32 size = cx_type_sizeof(cx_collection(object.type)->elementType);
        value = cx_calloc(size);
        cx_valueValueInit(&dst, NULL, cx_collection(object.type)->elementType, value);
        cx_initValue(&dst);
    } else {
        value = NULL;
        cx_valueValueInit(&dst, NULL, cx_collection(object.type)->elementType, &value);
        cx_initValue(&dst);
    }

    if (insert) {
        cx_llInsert(list, value);
    } else {
        cx_llAppend(list, value);
    }

    return value;
}
Exemple #5
0
static void cx_list_insertAction(cx_ll list, void *value, void *userData) {
    CX_UNUSED(userData);
    cx_llInsert(list, value);
}