--- /dev/null
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2025 Olaf Wintermann. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "cocoa-text.h"
+#include "cocoa-image.h"
+#include "editor.h"
+#include "note.h"
+#include "attachment.h"
+
+#include <cx/buffer.h>
+#include <cx/array_list.h>
+#include <cx/hash_map.h>
+#include <cx/string.h>
+#include <cx/printf.h>
+
+#include <libidav/utils.h>
+
+#include <ctype.h>
+#include <string.h>
+
+
+
+void editor_global_init() {
+
+}
+void editor_init_textview(UiObject *obj, UIWIDGET textview) {
+
+}
+void editor_init_textbuf(UiText *text) {
+
+}
+void editor_apply_styles(Note *note, UIWIDGET textview, UiText *text, CxList /* MDDocStyleSection */ *styles) {
+
+}
+cxmutstr editor_get_markdown(UiText *text, const CxAllocator *a) {
+ return CX_NULLSTR;
+}
+void editor_insert_image_file(UiText *text, const char *filepath) {
+
+}
+
+UiBool editor_set_style(UiText *text, const char *style, UiBool enabled) {
+ return 0;
+}
+void editor_set_paragraph_style(UiText *text, const char *style) {
+
+}
+void editor_insert_list(UiText *text, UiBool ordered) {
+
+}
\ No newline at end of file
* value: DBUField*
*/
CxMap *fields;
-
+
/*
* object fields
*
void dbuClassAddFKField(DBUClass *cls, const char *name, DBUField *field, DBUClass *fkcls);
void dbuClassAddObjField(DBUClass *cls, const char *name, DBUField *field, DBUClass *foreign_cls);
+#if !defined(__SIZEOF_LONG__) || __SIZEOF_LONG__ == 8
+#define dbuClassAddLong dbuClassAddInt64
+#define dbuClassAddULong dbuClassAddUInt64
+#define dbuClassAddLongFK dbuClassAddInt64FK
+#define dbuClassAddULongFK dbuClassAddUInt64FK
+#elif __SIZEOF_LONG__ == 4
+#define dbuClassAddLong dbuClassAddInt32
+#define dbuClassAddULong dbuClassAddUInt32
+#endif
+
#define dbuClassAdd(cls, type, member) \
dbuClassAddWithName(cls, type, member, #member)
#define dbuClassAddWithName(cls, type, member, member_name) \
_Generic(((type*)0)->member, \
- int8_t: dbuClassAddInt8, \
- uint8_t: dbuClassAddUInt8, \
- int16_t: dbuClassAddInt16, \
- uint16_t: dbuClassAddUInt16, \
- int32_t: dbuClassAddInt32, \
- uint32_t: dbuClassAddUInt32, \
- int64_t: dbuClassAddInt64, \
- uint64_t: dbuClassAddUInt64, \
- bool: dbuClassAddBool, \
- float: dbuClassAddFloat, \
- double: dbuClassAddDouble, \
- char*: dbuClassAddString, \
- cxmutstr: dbuClassAddCXMutStr) \
+ int8_t: dbuClassAddInt8, \
+ uint8_t: dbuClassAddUInt8, \
+ int16_t: dbuClassAddInt16, \
+ uint16_t: dbuClassAddUInt16, \
+ int32_t: dbuClassAddInt32, \
+ uint32_t: dbuClassAddUInt32, \
+ long: dbuClassAddLong, \
+ unsigned long: dbuClassAddULong, \
+ long long: dbuClassAddInt64, \
+ unsigned long long: dbuClassAddUInt64, \
+ bool: dbuClassAddBool, \
+ float: dbuClassAddFloat, \
+ double: dbuClassAddDouble, \
+ char*: dbuClassAddString, \
+ cxmutstr: dbuClassAddCXMutStr) \
(cls, member_name, offsetof(type, member), 0)
#define dbuClassAddForeignKey(cls, type, member, foreigncls) \
_Generic(((type*)0)->member, \
- int32_t: dbuClassAddInt32FK, \
- uint32_t: dbuClassAddUInt32FK, \
- int64_t: dbuClassAddInt64FK, \
- uint64_t: dbuClassAddUInt64FK, \
- char*: dbuClassAddStringFK, \
- cxmutstr: dbuClassAddCXMutStrFK) \
+ int32_t: dbuClassAddInt32FK, \
+ uint32_t: dbuClassAddUInt32FK, \
+ long: dbuClassAddLongFK, \
+ unsigned long: dbuClassAddULongFK, \
+ long long: dbuClassAddInt64FK, \
+ unsigned long long: dbuClassAddUInt64FK, \
+ char*: dbuClassAddStringFK, \
+ cxmutstr: dbuClassAddCXMutStrFK) \
(cls, #member, offsetof(type, member), foreigncls, 0)
void dbuClassAddInt(DBUClass *cls, const char *name, off_t offset, bool nonnull);
void dbuClassAddUInt32(DBUClass *cls, const char *name, off_t offset, bool nonnull);
void dbuClassAddInt64(DBUClass *cls, const char *name, off_t offset, bool nonnull);
void dbuClassAddUInt64(DBUClass *cls, const char *name, off_t offset, bool nonnull);
-void dbuClassAddSize(DBUClass *cls, const char *name, off_t offset, bool nonnull);
-void dbuClassAddSSize(DBUClass *cls, const char *name, off_t offset, bool nonnull);
void dbuClassAddBool(DBUClass *cls, const char *name, off_t offset, bool nonnull);
void dbuClassAddFloat(DBUClass *cls, const char *name, off_t offset, bool nonnull);
void dbuClassAddDouble(DBUClass *cls, const char *name, off_t offset, bool nonnull);