JNIEXPORT void JNICALL Java_zconfig__1_1set_name (JNIEnv *env, jclass c, jlong self, jstring name) { char *name_ = (char *) (*env)->GetStringUTFChars (env, name, NULL); zconfig_set_name ((zconfig_t *) self, name_); (*env)->ReleaseStringUTFChars (env, name, name_); }
zconfig_t * zconfig_new (char *name, zconfig_t *parent) { zconfig_t *self = (zconfig_t *) zmalloc (sizeof (zconfig_t)); zconfig_set_name (self, name); if (parent) { if (parent->child) { // Attach as last child of parent zconfig_t *last = parent->child; while (last->next) last = last->next; last->next = self; } else // Attach as first child of parent parent->child = self; } self->parent = parent; return self; }
/// // Set config item name, name may be NULL void QmlZconfig::setName (const QString &name) { zconfig_set_name (self, name.toUtf8().data()); };