Merge branch 'master' into coverity_scan

This commit is contained in:
lexborisov 2017-03-21 09:56:42 +03:00
parent 0708dba577
commit 7024458c55
603 changed files with 23887 additions and 10509 deletions

3
.gitignore vendored
View File

@ -1 +1,4 @@
.DS_Store
*.o
*.exe
*~

View File

@ -3,19 +3,4 @@ compiler:
- clang
- gcc
install: false
env:
global:
- secure: "gNSRCjo+hi14yLpCDEmwZfzy0DFoOR+9BmkdpJhTK8NjUvIy+RmFtXgT98QHgh+fow8v/YXl8hSnyDT2+oSmsKN9P113ssgYihwoB4IuIBLSIrAf9KPfhIh6LZC23lKltQUrP9yPo3jzdD1dte1xv2tKRImDZ1Cze987EjDBbSwuVP/Gj3JlWMAafEPrh48jCM/O4DXR4podcd1biXbyX8+lbYJSFVaIq0SuagzK5Kjv8nDAFYlNk27RdhQGemmZOsM5xQM4PpgKpcQVHh0YuObCryf/O+orCDh7dOu9QlbMijabYxz/Jx7fZ1mLQGm7Kj6ETdCcf80MrrDechjJgh7uyFE/+VPDfkdaSCm1vMJCNBRgFSM0bxXqtLAyNs9TNOIJ3TUv3M4eN98Feh7I3ip9eTU/0R36HKU7sk+yotmOuAMDaMikbTQ2UuHekKev3TD0dA5O6xatyDF3jCnTJ+8aYQ096A79ZSabWUiLe6IyV/NauqSfY+mOz2NA+TxqzW92HqStdvmeOuSqCGdkGi3o2z77jEez795l2bqnIziuZhojfxjtvc/ryaZaBMYWqjSlOzRcix/SwIt8ccDCXJ4F/aNi16mYuDdL5c2mQaxtZ5Xz1IZduU87f6pWHdhLPoRMqpd/XChJVwKSFxbKmRWynUfHTcwJePSSyn5GRNA="
addons:
coverity_scan:
project:
name: "lexborisov/Modest"
description: "Build submitted via Travis CI"
notification_email: lex.borisov@gmail.com
build_command_prepend: ""
build_command: "make -j4"
branch_pattern: coverity_scan
script: make -j4

Binary file not shown.

View File

@ -1,51 +1,47 @@
# Modest: Build and Installation
## make
## GNU Make
In root directory:
In root directory of project (`/`):
```bash
make
```
If successful copy lib/* and include/* at the right place for you
Flags that can be passed to make:
- `MODEST_OPTIMIZATION_LEVEL=-O2` set compiler optimization level. Default: -O2
- `MODEST_BUILD_WITHOUT_THREADS=YES` build without POSIX Threads. Default: NO
*for example*
```bash
make MODEST_BUILD_WITHOUT_THREADS=NO
```
and copy to the right place for you
```bash
cp lib/* /usr/local/lib
cp -r include/* /usr/local/include
```
## cmake
In `project` directory:
```bash
cmake .
make
make test
sudo make install
```
Flags that can be passed to CMake:
- `MODEST_OPTIMIZATION_LEVEL=-O2` set compiler optimization level. Default: -O2
- `CMAKE_INSTALL_LIBDIR=lib` set path to install created library. Default: lib
- `MODEST_BUILD_SHARED=ON` build shared library. Default: ON
- `MODEST_BUILD_STATIC=ON` build static library. Default: ON
- `MODEST_INSTALL_HEADER=OFF` install header files. Default OFF
- `MODEST_BUILD_WITHOUT_THREADS=YES` build without POSIX Threads. Default: NO
- `MODEST_EXTERN_MALLOC=my_malloc_func` set extern malloc function. Default: UNDEFINED
- `MODEST_EXTERN_REALLOC=my_realloc_func` set extern realloc function. Default: UNDEFINED
- `MODEST_EXTERN_CALLOC=my_calloc_func` set extern calloc function. Default: UNDEFINED
- `MODEST_EXTERN_FREE=my_free_func` set extern free function. Default: UNDEFINED
Flags that can be passed to make:
- `prefix`, default /usr/local
- `OS`, if not defined try to get from "uname -s"
- `PROJECT_OPTIMIZATION_LEVEL`, default -O2
- `MyCORE_BUILD_WITHOUT_THREADS`, YES or (NO or undefined), default undefined
- `MyCORE_BUILD_DEBUG`, YES or (NO or undefined), default undefined
- `MyCORE_WITH_PERF`, YES or (NO or undefined), default undefined, try build with timers (rdtsc or some), OS dependent, may not work on some systems,
- `PROJECT_INSTALL_HEADER`, default "include"
- `PROJECT_INSTALL_LIBRARY`, default "lib"
- `PROJECT_INSTALL_WITHOUT_HEADERS`, YES or (NO or undefined), default undefined
*for example*
*for example*:
```bash
cmake . -DCMAKE_INSTALL_LIBDIR=lib64 -DMODEST_INSTALL_HEADER=ON
make -j4 prefix=/usr MyCORE_BUILD_WITHOUT_THREADS=YES
sudo make install
```
Makefile rules:
- `all` —- build all components (libraries, examples, tests) (default)
- `library` -- build only static and shared library
- `shared` -- build only shared library
- `static` -- build only static library
- `clean` -- clean up current build directory
- `clone` -- copy all headers from source to include directories and modify local include (`#include "..."`) to global (`#include <...>`)
- `clean_api` -- remove all headers from include directory
- `create` -- create directories for binary, libraries, tests
- `test` -- run all tests
- `modules` -- print modules name, description, dependencies
- `install` -- install libraries and headers on your system
- `uninstall` -- delete libraries and headers on your system
- `make-pc-file` -- create pkg-config file
*for example*:
```bash
make shared
```

239
Makefile
View File

@ -1,83 +1,206 @@
TARGET := source
SRCDIR := source
TSTDIR := test
CC ?= gcc
LIBNAME := modest
LIBPOSTFIX := .so
LIBSTATIC_POSTFIX := _static
LIB_TMP := lib
INCLUDE_TMP := include
BIN_TMP := bin
# make rules
# all —- build all components (libraries, examples, tests) (default)
# library -- build only static and shared library
# shared -- build only shared library
# static -- build only static library
# clean -- clean up current build directory
# clone -- copy all headers from source to include directories and modify local include (#include "...") to global (#include <...>)
# clean_api -- remove all headers from include directory
# create -- create directories for binary, libraries, tests
# install -- install libraries and headers on your system
# uninstall -- delete libraries and headers on your system
# test -- run all tests
# modules -- print modules list: Module name, Description, Dependencies
# make-pc-file -- create pkg-config file
#
# ARGS
# prefix, default /usr/local
# OS, if not defined try to get from "uname -s"
# PROJECT_OPTIMIZATION_LEVEL, default -O2
# MyCORE_BUILD_WITHOUT_THREADS, YES or (NO or undefined), default undefined
# MyCORE_BUILD_DEBUG, YES or (NO or undefined), default undefined
# MyCORE_WITH_PERF, YES or (NO or undefined), default undefined, try build with timers (rdtsc or some), OS dependent, may not work on some systems,
# PROJECT_INSTALL_HEADER, default "include"
# PROJECT_INSTALL_LIBRARY, default "lib"
# PROJECT_INSTALL_WITHOUT_HEADERS, YES or (NO or undefined), default undefined
#
# If OS build rules not exists we try make library with POSIX threads
MODEST_OPTIMIZATION_LEVEL ?= -O2
.DEFAULT_GOAL := all
CFLAGS ?= -Wall -Werror
CFLAGS += $(MODEST_OPTIMIZATION_LEVEL) -Wno-unused-variable -fPIC --std=c99 -I$(SRCDIR)
DESCRIPTION := fast HTML renderer library with no outside dependency
ifdef MODEST_BUILD_DEBUG
CFLAGS += -g
#********************
# other Makefile
#***************
include Makefile.cfg
#********************
# Build
#***************
MODEST_BUILD_MODULES ?= $(dir $(wildcard $(SRCDIR)/*/))
MODEST_BUILD_MODULES := $(patsubst %myport/,%myport/$(strip $(MODEST_PORT_NAME))/,$(MODEST_BUILD_MODULES))
MODEST_BUILD_MODULES_LIST := $(foreach dir,$(MODEST_BUILD_MODULES),$(word 2, $(subst $(MODEST_DIR_SEPARATOR), , $(dir))) )
MODEST_BUILD_MODULES_LIST_WITHOUT_PORT := $(strip $(foreach dir,$(MODEST_BUILD_MODULES_LIST),$(patsubst myport,,$(dir))))
MODEST_BUILD_MODULES_MAKEFILES_LIST := $(foreach dir,$(MODEST_BUILD_MODULES),$(dir)Makefile.mk)
#********************
# Targets
#***************
MODEST_BUILD_MODULES_TARGET := $(MODEST_BUILD_MODULES_LIST)
MODEST_BUILD_MODULES_TARGET_ALL := $(foreach dir,$(MODEST_BUILD_MODULES_TARGET),$(dir)_all)
MODEST_BUILD_MODULES_TARGET_CLEAN := $(foreach dir,$(MODEST_BUILD_MODULES_TARGET),$(dir)_clean) $(myport_clean)
MODEST_BUILD_MODULES_TARGET_CLONE := $(foreach dir,$(MODEST_BUILD_MODULES_TARGET),$(dir)_clone)
#********************
# Utils
#***************
MODEST_UTILS_HDRS = $(foreach dir,$2,$(wildcard $(SRCDIR)/$1/$(dir)/*.h))
MODEST_UTILS_OBJS = $(patsubst %.c,%.o,$(foreach dir,$2,$(wildcard $(SRCDIR)/$1/$(dir)/*.c)))
MODEST_UTILS_HDRS_CLONE_CMND = $(foreach path,$(foreach dir,$2,$(wildcard $(SRCDIR)/$1/$(dir)/*.h)), cp $(path) $(patsubst $(SRCDIR)%,$(INCLUDE_DIR_API)%,$(path)) $(MODEST_UTILS_NEW_LINE))
MODEST_UTILS_HDRS_CLONE_GDIR = $(foreach dir,$2,$(INCLUDE_DIR_API)/$1/$(dir)/)
MODEST_UTILS_HDRS_CLONE_DIRS = $(foreach dir,$(strip $(patsubst %./,%,$(foreach path,$(call MODEST_UTILS_HDRS_CLONE_GDIR,$1,$2),$(dir $(path))))),mkdir -p $(dir) $(MODEST_UTILS_NEW_LINE))
MODEST_UTILS_HDRS_CLONE = $(info Clone for $1) $(call MODEST_UTILS_HDRS_CLONE_DIRS,$1,$2) $(MODEST_UTILS_NEW_LINE) $(call MODEST_UTILS_HDRS_CLONE_CMND,$1,$2)
#********************
# MyPORT
#***************
MyPORT_SELECTED_PORT = myport/$(strip $(MODEST_PORT_NAME))
#********************
# Include all modules Makefile.mk
#***************
include $(MODEST_BUILD_MODULES_MAKEFILES_LIST)
#********************
# Modules info
#***************
MODEST_BUILD_MODULES_INFO_DEP = $(foreach dep,$(strip $($1_dependencies)), $(dep))
MODEST_BUILD_MODULES_INFO := $(foreach name,$(MODEST_BUILD_MODULES_LIST_WITHOUT_PORT),$(MODEST_UTILS_NEW_LINE)Module: $(name)$(MODEST_UTILS_NEW_LINE)Description: $($(name)_description)$(MODEST_UTILS_NEW_LINE)Dependencies:$(call MODEST_BUILD_MODULES_INFO_DEP,$(name))$(MODEST_UTILS_NEW_LINE))
#********************
# Set ARGS for flags
#***************
MODEST_CFLAGS += -DMODEST_BUILD_OS=$(MODEST_BUILD_OS)
MODEST_CFLAGS += -DMODEST_PORT_NAME=$(MODEST_PORT_NAME)
MODEST_CFLAGS += $(patsubst -DMY%,-DMy%,$(call MODEST_UTILS_TO_UPCASE,-DMyCORE_OS_$(MODEST_BUILD_OS)))
override CFLAGS += $(MODEST_CFLAGS)
override LDFLAGS += $(MODEST_LDFLAGS)
#********************
# Objects
#***************
MODEST_BUILD_OBJECT_SHARED ?= $(CC) -shared $(LDFLAGS) $(MODEST_LDFLAGS) $1 -o $2
MODEST_BUILD_OBJECT_STATIC ?= $(AR) crus $2 $1
MODEST_BUILD_OBJECT_MODULES := $(foreach dir,$(MODEST_BUILD_MODULES_TARGET),$($(dir)_objs))
MODEST_BUILD_OBJECT_MODULES := $(foreach dir,$(MODEST_BUILD_MODULES_TARGET),$($(dir)_objs))
#********************
# Sub Directories
#***************
BUILD_SUB_DIRS := examples $(TEST_DIR)
#********************
# Install
#***************
PROJECT_INSTALL_LIBRARY := lib
PROJECT_INSTALL_HEADER := include
libdir ?= $(prefix)/$(PROJECT_INSTALL_LIBRARY)
includedir ?= $(prefix)/$(PROJECT_INSTALL_HEADER)
MODEST_INSTALL_CREATE_DIR := mkdir -p $(prefix)/$(PROJECT_INSTALL_LIBRARY)
MODEST_INSTALL_COMMAND := $(MODEST_INSTALL_CREATE_DIR) $(MODEST_UTILS_NEW_LINE) cp -av $(LIB_DIR_BASE)/* $(libdir)
ifneq ($(PROJECT_INSTALL_WITHOUT_HEADERS),YES)
MODEST_INSTALL_CREATE_DIR += $(prefix)/$(PROJECT_INSTALL_HEADER)
MODEST_INSTALL_COMMAND += $(MODEST_UTILS_NEW_LINE) cp -av $(INCLUDE_DIR_API)/* $(includedir)
endif
MODEST_BUILD_WITHOUT_THREADS ?= NO
ifeq ($(MODEST_BUILD_WITHOUT_THREADS),YES)
$(info Build without POSIX Threads)
CFLAGS += -DMODEST_BUILD_WITHOUT_THREADS -DMyHTML_BUILD_WITHOUT_THREADS
else
$(info Build with POSIX Threads)
CFLAGS += -pthread
#********************
# Uninstall
#***************
MODEST_UNINSTALL_MK_COMMAND :=
MODEST_UNINSTALL_FILE := uninstal.mk
ifneq ($(PROJECT_INSTALL_WITHOUT_HEADERS),YES)
MODEST_UNINSTALL_HEADERS := $(foreach name,$(MODEST_BUILD_MODULES_LIST_WITHOUT_PORT),rm -rf $(includedir)/$(name) \$$(MODEST_UTILS_NEW_LINE))
endif
ifeq ($(OS),Windows_NT)
else
UNAM := $(shell uname -s)
ifeq ($(UNAM),Darwin)
LIBPOSTFIX := .dylib
else
CFLAGS += -D_POSIX_C_SOURCE=199309L
endif
endif
MODEST_UNINSTALL_LIBRARY := $(foreach path,$(wildcard $(LIB_DIR_BASE)/lib*),rm -rf $(libdir)/$(notdir $(path)) \$$(MODEST_UTILS_NEW_LINE))
MODEST_UNINSTALL_COMMAND = echo "MODEST_UNINSTALL_MK_COMMAND = $(MODEST_UNINSTALL_HEADERS) $(MODEST_UNINSTALL_LIBRARY)" > $(MODEST_UNINSTALL_FILE)
SRCS :=
HDRS :=
EXTDIRS := examples test
-include $(MODEST_UNINSTALL_FILE)
all: create shared static
for f in $(EXTDIRS); do $(MAKE) -C $$f all; done
#********************
# PKG-CONFIG
#***************
MODEST_PKG_CONFIG_FILE := modest.pc
MODEST_PKG_CONFIG_CFLAGS := $(foreach name,$(MODEST_BUILD_MODULES_LIST_WITHOUT_PORT),-I$\{includedir}/$(name))
MODEST_PKG_CONFIG_PROCESS = \
$(SED) \
-e 's,@version\@,$(PROJECT_VERSION_STRING),g' \
-e 's,@prefix\@,$(prefix),g' \
-e 's,@exec_prefix\@,$(exec_prefix),g' \
-e 's,@libdir\@,$(PROJECT_INSTALL_LIBRARY),g' \
-e 's,@includedir\@,$(PROJECT_INSTALL_HEADER),g' \
-e 's,@cflags\@,$(MODEST_PKG_CONFIG_CFLAGS),g' \
-e 's,@libname\@,$(LIB_NAME),g' \
-e 's,@description\@,$(DESCRIPTION),g' \
$1 > $2
include $(TARGET)/myhtml/Makefile.mk
include $(TARGET)/mycss/Makefile.mk
include $(TARGET)/myfont/Makefile.mk
include $(TARGET)/modest/Makefile.mk
#********************
# Target options
#***************
all: library
for f in $(BUILD_SUB_DIRS); do $(MAKE) -C $$f all; done
OBJS := $(patsubst %.c,%.o,$(SRCS))
library: shared static
shared: $(OBJS)
$(CC) -shared $(LDFLAGS) $(OBJS) -o $(LIB_TMP)/lib$(LIBNAME)$(LIBPOSTFIX)
shared: make-pc-file create $(MODEST_BUILD_MODULES_TARGET_ALL)
$(call MODEST_BUILD_OBJECT_SHARED,$(MODEST_BUILD_OBJECT_MODULES),$(call MODEST_LIBRARY_WITH_VERSION))
$(call MODEST_BUILD_SHARED_AFTER)
static: shared
$(AR) crus $(LIB_TMP)/lib$(LIBNAME)$(LIBSTATIC_POSTFIX).a $(OBJS)
static: make-pc-file create $(MODEST_BUILD_MODULES_TARGET_ALL)
$(call MODEST_BUILD_OBJECT_STATIC,$(MODEST_BUILD_OBJECT_MODULES),$(call MODEST_LIBRARY_STATIC))
$(call MODEST_BUILD_STATIC_AFTER)
clean: $(MODEST_BUILD_MODULES_TARGET_CLEAN)
rm -f $(call MODEST_LIBRARY_WITH_VERSION) && rm -f $(call MODEST_LIBRARY_STATIC)
rm -rf $(TEST_DIR_BASE)
$(call MODEST_BUILD_CLEAN_AFTER)
for f in $(BUILD_SUB_DIRS); do $(MAKE) -C $$f clean; done
clone: clean_api $(MODEST_BUILD_MODULES_TARGET_CLONE)
$(call MODEST_CLONE_SED_HEADER_COMMAND)
find $(INCLUDE_DIR_API) -name "*.h.bak" -exec rm -f {} \;
clean_api:
rm -rf $(INCLUDE_DIR_API)
create:
mkdir -p lib bin
mkdir -p $(BINARY_DIR_BASE) $(LIB_DIR_BASE) $(TEST_DIR_BASE)
clean:
for f in $(EXTDIRS); do $(MAKE) -C $$f clean; done
rm -f $(OBJS)
rm -f $(LIB_TMP)/*
rm -f $(BIN_TMP)/*
install:
$(MODEST_INSTALL_COMMAND)
$(MODEST_UNINSTALL_COMMAND)
clean_include:
rm -rf $(INCLUDE_TMP)
uninstall:
$(MODEST_UNINSTALL_MK_COMMAND)
clone: create clean_include myhtml_clone mycss_clone modest_clone myfont_clone
find include -name "*.h" -exec sed -i '.bak' -E 's/^[ \t]*#[ \t]*include[ \t]*"([^"]+)"/#include <\1>/g' {} \;
find include -name "*.h.bak" -exec rm -f {} \;
test: library
$(MAKE) -C $(TEST_DIR) run
test:
test/mycss/declaration test/mycss/data/declaration
test/myhtml/utils/avl_tree
test/myhtml/encoding_detect_meta test/myhtml/data/encoding/detect_meta.html
make-pc-file:
$(call MODEST_PKG_CONFIG_PROCESS,$(MODEST_PKG_CONFIG_FILE).in, $(MODEST_PKG_CONFIG_FILE))
.PHONY: all clean clone test
modules:
$(info $(MODEST_BUILD_MODULES_INFO))
.PHONY: all clean clone test $(MODEST_BUILD_MODULES_TARGET_ALL)

53
Makefile.bin.cfg Normal file
View File

@ -0,0 +1,53 @@
BINARY_BUILD_OS := UNDEF
# library config
BINARY_PATH_RELATIVE ?= .
include $(BINARY_PATH_RELATIVE)/Makefile.cfg
# uses
BINARY_LIBRARIES += $(BINARY_PATH_RELATIVE)/$(call MODEST_LIBRARY_STATIC)
# flags
BINARY_OPTIMIZATION_LEVEL ?= -O2
BINARY_CFLAGS += -I$(BINARY_PATH_RELATIVE)/$(INCLUDE_DIR_API)
BINARY_LDFLAGS +=
BINARY_BUILD_OS ?= UNDEF
#*******************************
# Windows_NT
#*******************
ifeq ($(OS),Windows_NT)
BINARY_CFLAGS += -Wno-unused-variable -Wno-unused-function -std=c99
BINARY_BUILD_OS := $(OS)
endif
# end of Windows_NT
#*******************************
# Darwin, Mac OS X
#*******************
ifeq ($(OS),Darwin)
BINARY_CFLAGS += -fPIC
BINARY_CFLAGS += $(BINARY_OPTIMIZATION_LEVEL) -Wno-unused-variable -Wno-unused-function -std=c99
BINARY_BUILD_OS := $(OS)
endif
# end of Darwin, Mac OS X
#*******************************
# POSIX
#*******************
ifeq ($(BINARY_BUILD_OS),UNDEF)
BINARY_CFLAGS += -fPIC
BINARY_CFLAGS += -D_POSIX_C_SOURCE=199309L
BINARY_CFLAGS += $(BINARY_OPTIMIZATION_LEVEL) -Wno-unused-variable -Wno-unused-function -std=c99
BINARY_LIBRARIES += -lm
# build without threads
ifneq ($(MODEST_BUILD_WITHOUT_THREADS),YES)
BINARY_LIBRARIES += -pthread
endif
BINARY_BUILD_OS := $(OS)
endif
# end of POSIX

151
Makefile.cfg Normal file
View File

@ -0,0 +1,151 @@
MODEST_BUILD_OS := UNDEF
#********************
# Version
#***************
PROJECT_VERSION_MAJOR := 0
PROJECT_VERSION_MINOR := 0
PROJECT_VERSION_PATCH := 6
PROJECT_VERSION_STRING := $(PROJECT_VERSION_MAJOR).$(PROJECT_VERSION_MINOR).$(PROJECT_VERSION_PATCH)
#********************
# Flags
#***************
MODEST_CFLAGS ?= -Wall -Werror -pipe -pedantic
MODEST_LFLAGS ?=
#********************
# Include
#***************
# include dirs
INCLUDE_DIR := $(TARGET)
INCLUDE_DIR_API := include
#********************
# Libraries
#***************
# lib name
LIB_NAME := modest
LIB_NAME_SUFFIX := .so
LIB_NAME_SUFFIX_STATIC := _static.a
# lib dirs
LIB_DIR_BASE := lib
# This variables used with "call" $(call MODEST_LIBRARY_WITH_VERSION),
# for use actual variables like a LIB_NAME_SUFFIX
MODEST_LIBRARY_NAME ?= lib$(LIB_NAME)$(LIB_NAME_SUFFIX)
MODEST_LIBRARY_NAME_STATIC ?=lib$(LIB_NAME)$(LIB_NAME_SUFFIX_STATIC)
MODEST_LIBRARY_NAME_WITH_VERSION = lib$(LIB_NAME)-$(PROJECT_VERSION_STRING)$(LIB_NAME_SUFFIX)
MODEST_LIBRARY ?= $(LIB_DIR_BASE)/$(MODEST_LIBRARY_NAME)
MODEST_LIBRARY_STATIC ?= $(LIB_DIR_BASE)/$(MODEST_LIBRARY_NAME_STATIC)
MODEST_LIBRARY_WITH_VERSION = $(LIB_DIR_BASE)/$(MODEST_LIBRARY_NAME_WITH_VERSION)
MODEST_LIBRARY_WITH_VERSION_MAJOR = $(LIB_DIR_BASE)/lib$(LIB_NAME)-$(PROJECT_VERSION_MAJOR)$(LIB_NAME_SUFFIX)
MODEST_LIBRARY_WITH_VERSION_MAJOR_MINOR = $(LIB_DIR_BASE)/lib$(LIB_NAME)-$(PROJECT_VERSION_MAJOR).$(PROJECT_VERSION_MINOR)$(LIB_NAME_SUFFIX)
#********************
# Binaries
#***************
# binaries dirs
BINARY_DIR_BASE := bin
#********************
# Test
#***************
TEST_DIR := test
TEST_DIR_BASE := test_suite
#********************
# Build
#***************
MODEST_SOURCE ?= $(SRCDIR)
MODEST_BUILD_SHARED_AFTER :=
MODEST_BUILD_STATIC_AFTER :=
MODEST_BUILD_CLEAN_AFTER :=
#********************
# DEFAULT
#***************
SED ?= sed
MODEST_DIR_SEPARATOR ?= /
# flags
PROJECT_OPTIMIZATION_LEVEL ?= -O2
MODEST_CFLAGS += -I$(INCLUDE_DIR)
MODEST_LDFLAGS +=
OS ?= $(shell uname -s)
prefix ?= /usr/local
exec_prefix ?= $(prefix)
MODEST_CLONE_SED_HEADER_COMMAND = find $(INCLUDE_DIR_API) -name "*.h" -exec sed -i.bak -e 's,\s*\#\s*include\s*"\([^"]*\)",\#include <\1>,g' {} \;
#********************
# Set -D
#***************
ifeq ($(MyCORE_BUILD_DEBUG),YES)
override PROJECT_OPTIMIZATION_LEVEL :=
MODEST_CFLAGS += -g3 -ggdb3 -O0 -fno-omit-frame-pointer -DMyCORE_BUILD_DEBUG
endif
ifeq ($(MyCORE_BUILD_WITHOUT_THREADS),YES)
MODEST_CFLAGS += -DMyCORE_BUILD_WITHOUT_THREADS
endif
ifeq ($(MyCORE_WITH_PERF),YES)
MODEST_CFLAGS += -DMyCORE_WITH_PERF
endif
#********************
# Utils
#***************
define MODEST_UTILS_NEW_LINE
endef
MODEST_UTILS_TO_UPCASE = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$1))))))))))))))))))))))))))
#*******************************
# Load platform specific rules for build
# We try to include all Rules.mk file in /source/myport/*/Rules.mk
#*******************
ifndef MODEST_PORT_NAME
MYPORT_BUILD_RULES := $(foreach path,$(wildcard $(MODEST_SOURCE)/myport/*/),$(dir $(path))Rules.mk)
-include $(MYPORT_BUILD_RULES)
else
MYPORT_BUILD_RULES := $(MODEST_SOURCE)/myport/$(MODEST_PORT_NAME)/Rules.mk
-include $(MYPORT_BUILD_RULES)
endif # def MODEST_PORT_NAME
#*******************************
# POSIX
#*******************
ifeq ($(MODEST_BUILD_OS),UNDEF)
MODEST_CFLAGS += -fPIC
MODEST_CFLAGS += -D_POSIX_C_SOURCE=199309L
MODEST_CFLAGS += $(PROJECT_OPTIMIZATION_LEVEL) -Wno-unused-variable -Wno-unused-function -std=c99
MODEST_BUILD_SHARED_AFTER += ln -sf $(call MODEST_LIBRARY_NAME_WITH_VERSION) $(call MODEST_LIBRARY) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_SHARED_AFTER += ln -sf $(call MODEST_LIBRARY_NAME_WITH_VERSION) $(call MODEST_LIBRARY_WITH_VERSION_MAJOR) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_SHARED_AFTER += ln -sf $(call MODEST_LIBRARY_NAME_WITH_VERSION) $(call MODEST_LIBRARY_WITH_VERSION_MAJOR_MINOR) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_CLEAN_AFTER += rm -f $(call MODEST_LIBRARY) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_CLEAN_AFTER += rm -f $(call MODEST_LIBRARY_WITH_VERSION_MAJOR) $(MODEST_UTILS_NEW_LINE)
MODEST_BUILD_CLEAN_AFTER += rm -f $(call MODEST_LIBRARY_WITH_VERSION_MAJOR_MINOR) $(MODEST_UTILS_NEW_LINE)
# build without threads
ifneq ($(MyCORE_BUILD_WITHOUT_THREADS),YES)
MODEST_LDFLAGS += -pthread
endif
# Need set
MODEST_BUILD_OS := $(OS)
# this name eq source/myport/<namedir>
MODEST_PORT_NAME := posix
endif
# end of POSIX

View File

@ -8,15 +8,25 @@ Modest is a fast HTML renderer implemented as a pure C99 library with no outside
* Mailing List: [https://groups.google.com/forum/#!forum/modest-engine](https://groups.google.com/forum/#!forum/modest-engine)
* IRC: [#modest-engine on `irc.freenode.net <http://freenode.net>`](http://webchat.freenode.net?channels=%23modest-engine)
* Or you can ask questions on [stackoverflow.com](https://stackoverflow.com/questions/ask?tags=modest) by modest tag
* Public [tracker by trello](https://trello.com/b/sdqpT8Ep/modest)
## Now
```text
The current version is 0.0.5 - devel
The current version is 0.0.6 - devel
```
## Features
* MyCORE — base module, it is used by all other modules
* MyHTML — HTML parser by [specification](https://html.spec.whatwg.org/multipage/)
* MyCSS —  CSS parser and modules by [specification](https://drafts.csswg.org/)
* MyENCODING — work with character encodings, detecting encoding, convert encodings by [specification](https://encoding.spec.whatwg.org/)
* MyFONT — work with font, metrics, calculating size and more by [specification](https://www.microsoft.com/en-us/Typography/SpecificationsOverview.aspx)
* MyURL — URL parser by [specification](https://url.spec.whatwg.org/)
* MyPORT — system depended code: threads (if build with threads, default), work with memory, io, timers
* Modest — calculating, compare, renderer
## Introduction
[Introduction](https://lexborisov.github.io/Modest/)
@ -42,7 +52,7 @@ Alexander Borisov <lex.borisov@gmail.com>
## COPYRIGHT AND LICENSE
Copyright (C) 2015-2016 Alexander Borisov
Copyright (C) 2015-2017 Alexander Borisov
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

View File

@ -1 +0,0 @@
theme: jekyll-theme-cayman

View File

@ -1,3 +1,10 @@
0.0.5 => 0.0.6
===========
* MyHTML split to MyHTML and MyCORE
* Removed all io print functions to file: ```myhtml_tree_print_by_node```, ```myhtml_tree_print_node_children```, ```myhtml_tree_print_node```; Use serializations instead of their
* If you use encoding enum, like ```MyHTML_ENCODING_UTF8```, now it ```MyENCODING_UTF_8```, i.e ```MyHTML_ENCODING_* => MyENCODING_*```
* Functions migrated to MyCORE from MyHTML: ```myhtml_incoming_buffer_*``` => ```mycore_incoming_buffer_*```, ```myhtml_string*``` => ```mycore_string*```, ```myhtml_utils*``` => ```mycore_utils*```
0.0.1 => 0.0.4
===========
Removed all depending on the Tree. Now you can get a tree of nodes ```myhtml_node_tree```

View File

@ -18,8 +18,16 @@
0E0C91961DB1064E007A0501 /* serialization.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E0C91941DB1064E007A0501 /* serialization.c */; };
0E0C91991DB107E7007A0501 /* property.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E0C91971DB107E7007A0501 /* property.c */; };
0E0C919C1DB10866007A0501 /* raw_property.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E0C919A1DB10866007A0501 /* raw_property.c */; };
0E0D5D011E003A5E00EBFDD6 /* avl_tree.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E0D5CFF1E003A5E00EBFDD6 /* avl_tree.c */; };
0E0D738C1E2F67DB00FC97DE /* mhash.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E0D738A1E2F67DB00FC97DE /* mhash.c */; };
0E10FEE11E5F720200242B61 /* host.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E10FECB1E5F720200242B61 /* host.c */; };
0E10FEE21E5F720200242B61 /* myosi.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E10FECD1E5F720200242B61 /* myosi.c */; };
0E10FEE31E5F720200242B61 /* parser_end.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E10FECF1E5F720200242B61 /* parser_end.c */; };
0E10FEE41E5F720200242B61 /* parser.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E10FED01E5F720200242B61 /* parser.c */; };
0E10FEE51E5F720200242B61 /* path.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E10FED21E5F720200242B61 /* path.c */; };
0E10FEE61E5F720200242B61 /* punycode.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E10FED41E5F720200242B61 /* punycode.c */; };
0E10FEE71E5F720200242B61 /* scheme.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E10FED91E5F720200242B61 /* scheme.c */; };
0E10FEE81E5F720200242B61 /* serialization.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E10FEDB1E5F720200242B61 /* serialization.c */; };
0E10FEE91E5F720200242B61 /* url.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E10FEDD1E5F720200242B61 /* url.c */; };
0E10FEEA1E5F720200242B61 /* utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E10FEDF1E5F720200242B61 /* utils.c */; };
0E4B525C1DC13BBB0095026A /* parser_text_decoration.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E4B525A1DC13BBB0095026A /* parser_text_decoration.c */; };
0E5AA4BD1DA9689700FF5358 /* shared.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E5AA4BB1DA9689700FF5358 /* shared.c */; };
0E5E2AAB1DC53CC1007836AB /* entry_destroy.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E5E2AA91DC53CC1007836AB /* entry_destroy.c */; };
@ -83,34 +91,20 @@
0E750FE71D9AF27F00337E9B /* callback.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FA41D9AF27F00337E9B /* callback.c */; };
0E750FE81D9AF27F00337E9B /* charef.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FA71D9AF27F00337E9B /* charef.c */; };
0E750FE91D9AF27F00337E9B /* data_process.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FA91D9AF27F00337E9B /* data_process.c */; };
0E750FEA1D9AF27F00337E9B /* encoding_detect.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FAD1D9AF27F00337E9B /* encoding_detect.c */; };
0E750FEB1D9AF27F00337E9B /* encoding.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FAF1D9AF27F00337E9B /* encoding.c */; };
0E750FEC1D9AF27F00337E9B /* incoming.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FB11D9AF27F00337E9B /* incoming.c */; };
0E750FED1D9AF27F00337E9B /* myhtml.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FB31D9AF27F00337E9B /* myhtml.c */; };
0E750FEE1D9AF27F00337E9B /* mynamespace.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FB61D9AF27F00337E9B /* mynamespace.c */; };
0E750FEF1D9AF27F00337E9B /* myosi.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FB81D9AF27F00337E9B /* myosi.c */; };
0E750FF01D9AF27F00337E9B /* mystring.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FBA1D9AF27F00337E9B /* mystring.c */; };
0E750FF11D9AF27F00337E9B /* parser.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FBC1D9AF27F00337E9B /* parser.c */; };
0E750FF21D9AF27F00337E9B /* perf.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FBE1D9AF27F00337E9B /* perf.c */; };
0E750FF31D9AF27F00337E9B /* rules.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FBF1D9AF27F00337E9B /* rules.c */; };
0E750FF41D9AF27F00337E9B /* serialization.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FC11D9AF27F00337E9B /* serialization.c */; };
0E750FF51D9AF27F00337E9B /* stream.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FC31D9AF27F00337E9B /* stream.c */; };
0E750FF61D9AF27F00337E9B /* tag_init.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FC61D9AF27F00337E9B /* tag_init.c */; };
0E750FF71D9AF27F00337E9B /* tag.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FC71D9AF27F00337E9B /* tag.c */; };
0E750FF81D9AF27F00337E9B /* thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FC91D9AF27F00337E9B /* thread.c */; };
0E750FF91D9AF27F00337E9B /* token.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FCB1D9AF27F00337E9B /* token.c */; };
0E750FFA1D9AF27F00337E9B /* tokenizer_doctype.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FCD1D9AF27F00337E9B /* tokenizer_doctype.c */; };
0E750FFB1D9AF27F00337E9B /* tokenizer_end.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FCF1D9AF27F00337E9B /* tokenizer_end.c */; };
0E750FFC1D9AF27F00337E9B /* tokenizer_script.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FD11D9AF27F00337E9B /* tokenizer_script.c */; };
0E750FFD1D9AF27F00337E9B /* tokenizer.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FD31D9AF27F00337E9B /* tokenizer.c */; };
0E750FFE1D9AF27F00337E9B /* tree.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FD51D9AF27F00337E9B /* tree.c */; };
0E750FFF1D9AF27F00337E9B /* mchar_async.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FD81D9AF27F00337E9B /* mchar_async.c */; };
0E7510001D9AF27F00337E9B /* mcobject.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FDA1D9AF27F00337E9B /* mcobject.c */; };
0E7510011D9AF27F00337E9B /* mcobject_async.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FDC1D9AF27F00337E9B /* mcobject_async.c */; };
0E7510021D9AF27F00337E9B /* mcsimple.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FDE1D9AF27F00337E9B /* mcsimple.c */; };
0E7510031D9AF27F00337E9B /* mcsync.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FE01D9AF27F00337E9B /* mcsync.c */; };
0E7510041D9AF27F00337E9B /* mctree.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FE21D9AF27F00337E9B /* mctree.c */; };
0E7510051D9AF27F00337E9B /* utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E750FE51D9AF27F00337E9B /* utils.c */; };
0E79EE951DC8E270004FF5DC /* stack.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E79EE931DC8E270004FF5DC /* stack.c */; };
0E7F78351DD3E0D5003B6053 /* begin.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E7F78331DD3E0D5003B6053 /* begin.c */; };
0E7F78381DD3E2E5003B6053 /* glue.c in Sources */ = {isa = PBXBuildFile; fileRef = 0E7F78361DD3E2E5003B6053 /* glue.c */; };
@ -124,6 +118,28 @@
0EF2D5ED1E01E04A000570B6 /* declaration.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF2D5EB1E01E04A000570B6 /* declaration.c */; };
0EF2D5F21E01E089000570B6 /* default.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF2D5F01E01E089000570B6 /* default.c */; };
0EF2D5F71E01E0BD000570B6 /* default.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF2D5F51E01E0BD000570B6 /* default.c */; };
0EF5D1581E680D880048E3D1 /* incoming.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D14D1E680D880048E3D1 /* incoming.c */; };
0EF5D15A1E680D880048E3D1 /* mystring.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1511E680D880048E3D1 /* mystring.c */; };
0EF5D15C1E680D880048E3D1 /* mythread.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1541E680D880048E3D1 /* mythread.c */; };
0EF5D15D1E680D880048E3D1 /* utils.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1561E680D880048E3D1 /* utils.c */; };
0EF5D1701E680DA50048E3D1 /* avl_tree.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1601E680DA50048E3D1 /* avl_tree.c */; };
0EF5D1711E680DA50048E3D1 /* mchar_async.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1621E680DA50048E3D1 /* mchar_async.c */; };
0EF5D1721E680DA50048E3D1 /* mcobject_async.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1641E680DA50048E3D1 /* mcobject_async.c */; };
0EF5D1731E680DA50048E3D1 /* mcobject.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1661E680DA50048E3D1 /* mcobject.c */; };
0EF5D1741E680DA50048E3D1 /* mcsimple.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1681E680DA50048E3D1 /* mcsimple.c */; };
0EF5D1751E680DA50048E3D1 /* mcsync.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D16A1E680DA50048E3D1 /* mcsync.c */; };
0EF5D1761E680DA50048E3D1 /* mctree.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D16C1E680DA50048E3D1 /* mctree.c */; };
0EF5D1771E680DA50048E3D1 /* mhash.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D16E1E680DA50048E3D1 /* mhash.c */; };
0EF5D1791E680EA10048E3D1 /* myosi.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1781E680EA10048E3D1 /* myosi.c */; };
0EF5D17F1E6819E80048E3D1 /* detect.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D17B1E6819E80048E3D1 /* detect.c */; };
0EF5D1801E6819E80048E3D1 /* encoding.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D17D1E6819E80048E3D1 /* encoding.c */; };
0EF5D1841E6822BD0048E3D1 /* mystring.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1821E6822BD0048E3D1 /* mystring.c */; };
0EF5D1871E68362D0048E3D1 /* mystring.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1851E68362D0048E3D1 /* mystring.c */; };
0EF5D19E1E6AE8BF0048E3D1 /* thread_queue.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D19C1E6AE8BF0048E3D1 /* thread_queue.c */; };
0EF5D1A71E6DDDC20048E3D1 /* thread.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1A31E6DDDC20048E3D1 /* thread.c */; };
0EF5D1A81E6DDDC20048E3D1 /* io.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1A41E6DDDC20048E3D1 /* io.c */; };
0EF5D1A91E6DDDC20048E3D1 /* memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1A51E6DDDC20048E3D1 /* memory.c */; };
0EF5D1AC1E6DDDCD0048E3D1 /* mcsync.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF5D1AB1E6DDDCD0048E3D1 /* mcsync.c */; };
0EF68DCE1DBF6CF000B0DEA4 /* color_parser.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF68DCC1DBF6CF000B0DEA4 /* color_parser.c */; };
0EF808A31D9FF3BC001AF6EF /* sheet.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF808A11D9FF3BC001AF6EF /* sheet.c */; };
0EF808A61DA08BBE001AF6EF /* map.c in Sources */ = {isa = PBXBuildFile; fileRef = 0EF808A41DA08BBE001AF6EF /* map.c */; };
@ -167,10 +183,28 @@
0E0C91981DB107E7007A0501 /* property.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = property.h; path = ../../../source/modest/node/property.h; sourceTree = "<group>"; };
0E0C919A1DB10866007A0501 /* raw_property.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = raw_property.c; path = ../../../source/modest/node/raw_property.c; sourceTree = "<group>"; };
0E0C919B1DB10866007A0501 /* raw_property.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = raw_property.h; path = ../../../source/modest/node/raw_property.h; sourceTree = "<group>"; };
0E0D5CFF1E003A5E00EBFDD6 /* avl_tree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = avl_tree.c; sourceTree = "<group>"; };
0E0D5D001E003A5E00EBFDD6 /* avl_tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = avl_tree.h; sourceTree = "<group>"; };
0E0D738A1E2F67DB00FC97DE /* mhash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mhash.c; sourceTree = "<group>"; };
0E0D738B1E2F67DB00FC97DE /* mhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mhash.h; sourceTree = "<group>"; };
0E10FECB1E5F720200242B61 /* host.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = host.c; path = ../../source/myurl/host.c; sourceTree = "<group>"; };
0E10FECC1E5F720200242B61 /* host.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = host.h; path = ../../source/myurl/host.h; sourceTree = "<group>"; };
0E10FECD1E5F720200242B61 /* myosi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = myosi.c; path = ../../source/myurl/myosi.c; sourceTree = "<group>"; };
0E10FECE1E5F720200242B61 /* myosi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = myosi.h; path = ../../source/myurl/myosi.h; sourceTree = "<group>"; };
0E10FECF1E5F720200242B61 /* parser_end.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = parser_end.c; path = ../../source/myurl/parser_end.c; sourceTree = "<group>"; };
0E10FED01E5F720200242B61 /* parser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = parser.c; path = ../../source/myurl/parser.c; sourceTree = "<group>"; };
0E10FED11E5F720200242B61 /* parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = parser.h; path = ../../source/myurl/parser.h; sourceTree = "<group>"; };
0E10FED21E5F720200242B61 /* path.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = path.c; path = ../../source/myurl/path.c; sourceTree = "<group>"; };
0E10FED31E5F720200242B61 /* path.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = path.h; path = ../../source/myurl/path.h; sourceTree = "<group>"; };
0E10FED41E5F720200242B61 /* punycode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = punycode.c; path = ../../source/myurl/punycode.c; sourceTree = "<group>"; };
0E10FED51E5F720200242B61 /* punycode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = punycode.h; path = ../../source/myurl/punycode.h; sourceTree = "<group>"; };
0E10FED61E5F720200242B61 /* resources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = resources.h; path = ../../source/myurl/resources.h; sourceTree = "<group>"; };
0E10FED71E5F720200242B61 /* scheme_const.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scheme_const.h; path = ../../source/myurl/scheme_const.h; sourceTree = "<group>"; };
0E10FED81E5F720200242B61 /* scheme_resources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scheme_resources.h; path = ../../source/myurl/scheme_resources.h; sourceTree = "<group>"; };
0E10FED91E5F720200242B61 /* scheme.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = scheme.c; path = ../../source/myurl/scheme.c; sourceTree = "<group>"; };
0E10FEDA1E5F720200242B61 /* scheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = scheme.h; path = ../../source/myurl/scheme.h; sourceTree = "<group>"; };
0E10FEDB1E5F720200242B61 /* serialization.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = serialization.c; path = ../../source/myurl/serialization.c; sourceTree = "<group>"; };
0E10FEDC1E5F720200242B61 /* serialization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = serialization.h; path = ../../source/myurl/serialization.h; sourceTree = "<group>"; };
0E10FEDD1E5F720200242B61 /* url.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = url.c; path = ../../source/myurl/url.c; sourceTree = "<group>"; };
0E10FEDE1E5F720200242B61 /* url.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = url.h; path = ../../source/myurl/url.h; sourceTree = "<group>"; };
0E10FEDF1E5F720200242B61 /* utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = utils.c; path = ../../source/myurl/utils.c; sourceTree = "<group>"; };
0E10FEE01E5F720200242B61 /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utils.h; path = ../../source/myurl/utils.h; sourceTree = "<group>"; };
0E4B525A1DC13BBB0095026A /* parser_text_decoration.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = parser_text_decoration.c; sourceTree = "<group>"; };
0E5AA4BB1DA9689700FF5358 /* shared.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = shared.c; sourceTree = "<group>"; };
0E5AA4BC1DA9689700FF5358 /* shared.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = shared.h; sourceTree = "<group>"; };
@ -309,7 +343,6 @@
0E750F7D1D9AF27200337E9B /* units_resources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = units_resources.h; sourceTree = "<group>"; };
0E750F7E1D9AF27200337E9B /* values.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = values.c; sourceTree = "<group>"; };
0E750F7F1D9AF27200337E9B /* values.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = values.h; sourceTree = "<group>"; };
0E750FA21D9AF27F00337E9B /* api_encoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = api_encoding.h; path = ../../source/myhtml/api_encoding.h; sourceTree = "<group>"; };
0E750FA31D9AF27F00337E9B /* api.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = api.h; path = ../../source/myhtml/api.h; sourceTree = "<group>"; };
0E750FA41D9AF27F00337E9B /* callback.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = callback.c; path = ../../source/myhtml/callback.c; sourceTree = "<group>"; };
0E750FA51D9AF27F00337E9B /* callback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = callback.h; path = ../../source/myhtml/callback.h; sourceTree = "<group>"; };
@ -319,25 +352,14 @@
0E750FA91D9AF27F00337E9B /* data_process.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = data_process.c; path = ../../source/myhtml/data_process.c; sourceTree = "<group>"; };
0E750FAA1D9AF27F00337E9B /* data_process.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = data_process.h; path = ../../source/myhtml/data_process.h; sourceTree = "<group>"; };
0E750FAB1D9AF27F00337E9B /* def.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = def.h; path = ../../source/myhtml/def.h; sourceTree = "<group>"; };
0E750FAC1D9AF27F00337E9B /* encoding_detect_resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = encoding_detect_resource.h; path = ../../source/myhtml/encoding_detect_resource.h; sourceTree = "<group>"; };
0E750FAD1D9AF27F00337E9B /* encoding_detect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = encoding_detect.c; path = ../../source/myhtml/encoding_detect.c; sourceTree = "<group>"; };
0E750FAE1D9AF27F00337E9B /* encoding_resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = encoding_resource.h; path = ../../source/myhtml/encoding_resource.h; sourceTree = "<group>"; };
0E750FAF1D9AF27F00337E9B /* encoding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = encoding.c; path = ../../source/myhtml/encoding.c; sourceTree = "<group>"; };
0E750FB01D9AF27F00337E9B /* encoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = encoding.h; path = ../../source/myhtml/encoding.h; sourceTree = "<group>"; };
0E750FB11D9AF27F00337E9B /* incoming.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = incoming.c; path = ../../source/myhtml/incoming.c; sourceTree = "<group>"; };
0E750FB21D9AF27F00337E9B /* incoming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = incoming.h; path = ../../source/myhtml/incoming.h; sourceTree = "<group>"; };
0E750FB31D9AF27F00337E9B /* myhtml.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = myhtml.c; path = ../../source/myhtml/myhtml.c; sourceTree = "<group>"; };
0E750FB41D9AF27F00337E9B /* myhtml.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = myhtml.h; path = ../../source/myhtml/myhtml.h; sourceTree = "<group>"; };
0E750FB51D9AF27F00337E9B /* mynamespace_resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mynamespace_resource.h; path = ../../source/myhtml/mynamespace_resource.h; sourceTree = "<group>"; };
0E750FB61D9AF27F00337E9B /* mynamespace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mynamespace.c; path = ../../source/myhtml/mynamespace.c; sourceTree = "<group>"; };
0E750FB71D9AF27F00337E9B /* mynamespace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mynamespace.h; path = ../../source/myhtml/mynamespace.h; sourceTree = "<group>"; };
0E750FB81D9AF27F00337E9B /* myosi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = myosi.c; path = ../../source/myhtml/myosi.c; sourceTree = "<group>"; };
0E750FB91D9AF27F00337E9B /* myosi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = myosi.h; path = ../../source/myhtml/myosi.h; sourceTree = "<group>"; };
0E750FBA1D9AF27F00337E9B /* mystring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mystring.c; path = ../../source/myhtml/mystring.c; sourceTree = "<group>"; };
0E750FBB1D9AF27F00337E9B /* mystring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mystring.h; path = ../../source/myhtml/mystring.h; sourceTree = "<group>"; };
0E750FBC1D9AF27F00337E9B /* parser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = parser.c; path = ../../source/myhtml/parser.c; sourceTree = "<group>"; };
0E750FBD1D9AF27F00337E9B /* parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = parser.h; path = ../../source/myhtml/parser.h; sourceTree = "<group>"; };
0E750FBE1D9AF27F00337E9B /* perf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = perf.c; path = ../../source/myhtml/perf.c; sourceTree = "<group>"; };
0E750FBF1D9AF27F00337E9B /* rules.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = rules.c; path = ../../source/myhtml/rules.c; sourceTree = "<group>"; };
0E750FC01D9AF27F00337E9B /* rules.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rules.h; path = ../../source/myhtml/rules.h; sourceTree = "<group>"; };
0E750FC11D9AF27F00337E9B /* serialization.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = serialization.c; path = ../../source/myhtml/serialization.c; sourceTree = "<group>"; };
@ -348,8 +370,6 @@
0E750FC61D9AF27F00337E9B /* tag_init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tag_init.c; path = ../../source/myhtml/tag_init.c; sourceTree = "<group>"; };
0E750FC71D9AF27F00337E9B /* tag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tag.c; path = ../../source/myhtml/tag.c; sourceTree = "<group>"; };
0E750FC81D9AF27F00337E9B /* tag.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tag.h; path = ../../source/myhtml/tag.h; sourceTree = "<group>"; };
0E750FC91D9AF27F00337E9B /* thread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = thread.c; path = ../../source/myhtml/thread.c; sourceTree = "<group>"; };
0E750FCA1D9AF27F00337E9B /* thread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = thread.h; path = ../../source/myhtml/thread.h; sourceTree = "<group>"; };
0E750FCB1D9AF27F00337E9B /* token.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = token.c; path = ../../source/myhtml/token.c; sourceTree = "<group>"; };
0E750FCC1D9AF27F00337E9B /* token.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = token.h; path = ../../source/myhtml/token.h; sourceTree = "<group>"; };
0E750FCD1D9AF27F00337E9B /* tokenizer_doctype.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tokenizer_doctype.c; path = ../../source/myhtml/tokenizer_doctype.c; sourceTree = "<group>"; };
@ -362,21 +382,6 @@
0E750FD41D9AF27F00337E9B /* tokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tokenizer.h; path = ../../source/myhtml/tokenizer.h; sourceTree = "<group>"; };
0E750FD51D9AF27F00337E9B /* tree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = tree.c; path = ../../source/myhtml/tree.c; sourceTree = "<group>"; };
0E750FD61D9AF27F00337E9B /* tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = tree.h; path = ../../source/myhtml/tree.h; sourceTree = "<group>"; };
0E750FD81D9AF27F00337E9B /* mchar_async.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mchar_async.c; sourceTree = "<group>"; };
0E750FD91D9AF27F00337E9B /* mchar_async.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mchar_async.h; sourceTree = "<group>"; };
0E750FDA1D9AF27F00337E9B /* mcobject.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mcobject.c; sourceTree = "<group>"; };
0E750FDB1D9AF27F00337E9B /* mcobject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mcobject.h; sourceTree = "<group>"; };
0E750FDC1D9AF27F00337E9B /* mcobject_async.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mcobject_async.c; sourceTree = "<group>"; };
0E750FDD1D9AF27F00337E9B /* mcobject_async.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mcobject_async.h; sourceTree = "<group>"; };
0E750FDE1D9AF27F00337E9B /* mcsimple.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mcsimple.c; sourceTree = "<group>"; };
0E750FDF1D9AF27F00337E9B /* mcsimple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mcsimple.h; sourceTree = "<group>"; };
0E750FE01D9AF27F00337E9B /* mcsync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mcsync.c; sourceTree = "<group>"; };
0E750FE11D9AF27F00337E9B /* mcsync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mcsync.h; sourceTree = "<group>"; };
0E750FE21D9AF27F00337E9B /* mctree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = mctree.c; sourceTree = "<group>"; };
0E750FE31D9AF27F00337E9B /* mctree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mctree.h; sourceTree = "<group>"; };
0E750FE41D9AF27F00337E9B /* resources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = resources.h; sourceTree = "<group>"; };
0E750FE51D9AF27F00337E9B /* utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = utils.c; path = ../../source/myhtml/utils.c; sourceTree = "<group>"; };
0E750FE61D9AF27F00337E9B /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utils.h; path = ../../source/myhtml/utils.h; sourceTree = "<group>"; };
0E79EE931DC8E270004FF5DC /* stack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = stack.c; path = ../../source/mycss/stack.c; sourceTree = "<group>"; };
0E79EE941DC8E270004FF5DC /* stack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = stack.h; path = ../../source/mycss/stack.h; sourceTree = "<group>"; };
0E7F782C1DD3DF6C003B6053 /* layer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = layer.h; path = ../../../source/modest/layer/layer.h; sourceTree = "<group>"; };
@ -407,6 +412,49 @@
0EF2D5F41E01E0BD000570B6 /* default_resources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default_resources.h; sourceTree = "<group>"; };
0EF2D5F51E01E0BD000570B6 /* default.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = default.c; sourceTree = "<group>"; };
0EF2D5F61E01E0BD000570B6 /* default.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = default.h; sourceTree = "<group>"; };
0EF5D14D1E680D880048E3D1 /* incoming.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = incoming.c; path = ../../source/mycore/incoming.c; sourceTree = "<group>"; };
0EF5D14E1E680D880048E3D1 /* incoming.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = incoming.h; path = ../../source/mycore/incoming.h; sourceTree = "<group>"; };
0EF5D1501E680D880048E3D1 /* myosi.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = myosi.h; path = ../../source/mycore/myosi.h; sourceTree = "<group>"; };
0EF5D1511E680D880048E3D1 /* mystring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mystring.c; path = ../../source/mycore/mystring.c; sourceTree = "<group>"; };
0EF5D1521E680D880048E3D1 /* mystring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mystring.h; path = ../../source/mycore/mystring.h; sourceTree = "<group>"; };
0EF5D1541E680D880048E3D1 /* mythread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mythread.c; path = ../../source/mycore/mythread.c; sourceTree = "<group>"; };
0EF5D1551E680D880048E3D1 /* mythread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mythread.h; path = ../../source/mycore/mythread.h; sourceTree = "<group>"; };
0EF5D1561E680D880048E3D1 /* utils.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = utils.c; path = ../../source/mycore/utils.c; sourceTree = "<group>"; };
0EF5D1571E680D880048E3D1 /* utils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = utils.h; path = ../../source/mycore/utils.h; sourceTree = "<group>"; };
0EF5D15F1E680DA50048E3D1 /* resources.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = resources.h; path = ../../source/mycore/utils/resources.h; sourceTree = "<group>"; };
0EF5D1601E680DA50048E3D1 /* avl_tree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = avl_tree.c; path = ../../source/mycore/utils/avl_tree.c; sourceTree = "<group>"; };
0EF5D1611E680DA50048E3D1 /* avl_tree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = avl_tree.h; path = ../../source/mycore/utils/avl_tree.h; sourceTree = "<group>"; };
0EF5D1621E680DA50048E3D1 /* mchar_async.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mchar_async.c; path = ../../source/mycore/utils/mchar_async.c; sourceTree = "<group>"; };
0EF5D1631E680DA50048E3D1 /* mchar_async.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mchar_async.h; path = ../../source/mycore/utils/mchar_async.h; sourceTree = "<group>"; };
0EF5D1641E680DA50048E3D1 /* mcobject_async.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mcobject_async.c; path = ../../source/mycore/utils/mcobject_async.c; sourceTree = "<group>"; };
0EF5D1651E680DA50048E3D1 /* mcobject_async.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mcobject_async.h; path = ../../source/mycore/utils/mcobject_async.h; sourceTree = "<group>"; };
0EF5D1661E680DA50048E3D1 /* mcobject.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mcobject.c; path = ../../source/mycore/utils/mcobject.c; sourceTree = "<group>"; };
0EF5D1671E680DA50048E3D1 /* mcobject.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mcobject.h; path = ../../source/mycore/utils/mcobject.h; sourceTree = "<group>"; };
0EF5D1681E680DA50048E3D1 /* mcsimple.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mcsimple.c; path = ../../source/mycore/utils/mcsimple.c; sourceTree = "<group>"; };
0EF5D1691E680DA50048E3D1 /* mcsimple.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mcsimple.h; path = ../../source/mycore/utils/mcsimple.h; sourceTree = "<group>"; };
0EF5D16A1E680DA50048E3D1 /* mcsync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mcsync.c; path = ../../source/mycore/utils/mcsync.c; sourceTree = "<group>"; };
0EF5D16B1E680DA50048E3D1 /* mcsync.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mcsync.h; path = ../../source/mycore/utils/mcsync.h; sourceTree = "<group>"; };
0EF5D16C1E680DA50048E3D1 /* mctree.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mctree.c; path = ../../source/mycore/utils/mctree.c; sourceTree = "<group>"; };
0EF5D16D1E680DA50048E3D1 /* mctree.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mctree.h; path = ../../source/mycore/utils/mctree.h; sourceTree = "<group>"; };
0EF5D16E1E680DA50048E3D1 /* mhash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mhash.c; path = ../../source/mycore/utils/mhash.c; sourceTree = "<group>"; };
0EF5D16F1E680DA50048E3D1 /* mhash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mhash.h; path = ../../source/mycore/utils/mhash.h; sourceTree = "<group>"; };
0EF5D1781E680EA10048E3D1 /* myosi.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = myosi.c; path = ../../source/mycore/myosi.c; sourceTree = "<group>"; };
0EF5D17A1E6819E80048E3D1 /* detect_resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = detect_resource.h; path = ../../source/myencoding/detect_resource.h; sourceTree = "<group>"; };
0EF5D17B1E6819E80048E3D1 /* detect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = detect.c; path = ../../source/myencoding/detect.c; sourceTree = "<group>"; };
0EF5D17C1E6819E80048E3D1 /* resource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = resource.h; path = ../../source/myencoding/resource.h; sourceTree = "<group>"; };
0EF5D17D1E6819E80048E3D1 /* encoding.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = encoding.c; path = ../../source/myencoding/encoding.c; sourceTree = "<group>"; };
0EF5D17E1E6819E80048E3D1 /* encoding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = encoding.h; path = ../../source/myencoding/encoding.h; sourceTree = "<group>"; };
0EF5D1811E681FC90048E3D1 /* myosi.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = myosi.h; path = ../../source/myencoding/myosi.h; sourceTree = "<group>"; };
0EF5D1821E6822BD0048E3D1 /* mystring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mystring.c; path = ../../source/myencoding/mystring.c; sourceTree = "<group>"; };
0EF5D1831E6822BD0048E3D1 /* mystring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mystring.h; path = ../../source/myencoding/mystring.h; sourceTree = "<group>"; };
0EF5D1851E68362D0048E3D1 /* mystring.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mystring.c; path = ../../source/myhtml/mystring.c; sourceTree = "<group>"; };
0EF5D1861E68362D0048E3D1 /* mystring.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mystring.h; path = ../../source/myhtml/mystring.h; sourceTree = "<group>"; };
0EF5D19C1E6AE8BF0048E3D1 /* thread_queue.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = thread_queue.c; path = ../../source/mycore/thread_queue.c; sourceTree = "<group>"; };
0EF5D19D1E6AE8BF0048E3D1 /* thread_queue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = thread_queue.h; path = ../../source/mycore/thread_queue.h; sourceTree = "<group>"; };
0EF5D1A31E6DDDC20048E3D1 /* thread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = thread.c; path = ../../source/myport/posix/mycore/thread.c; sourceTree = "<group>"; };
0EF5D1A41E6DDDC20048E3D1 /* io.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = io.c; path = ../../source/myport/posix/mycore/io.c; sourceTree = "<group>"; };
0EF5D1A51E6DDDC20048E3D1 /* memory.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = memory.c; path = ../../source/myport/posix/mycore/memory.c; sourceTree = "<group>"; };
0EF5D1AB1E6DDDCD0048E3D1 /* mcsync.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = mcsync.c; path = ../../source/myport/posix/mycore/utils/mcsync.c; sourceTree = "<group>"; };
0EF68DCC1DBF6CF000B0DEA4 /* color_parser.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = color_parser.c; sourceTree = "<group>"; };
0EF68DCD1DBF6CF000B0DEA4 /* color_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = color_parser.h; sourceTree = "<group>"; };
0EF808A11D9FF3BC001AF6EF /* sheet.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = sheet.c; sourceTree = "<group>"; };
@ -463,14 +511,47 @@
name = node;
sourceTree = "<group>";
};
0E10FECA1E5F71CF00242B61 /* myurl */ = {
isa = PBXGroup;
children = (
0E10FECE1E5F720200242B61 /* myosi.h */,
0E10FECD1E5F720200242B61 /* myosi.c */,
0E10FEDE1E5F720200242B61 /* url.h */,
0E10FEDD1E5F720200242B61 /* url.c */,
0E10FECC1E5F720200242B61 /* host.h */,
0E10FECB1E5F720200242B61 /* host.c */,
0E10FED31E5F720200242B61 /* path.h */,
0E10FED21E5F720200242B61 /* path.c */,
0E10FED11E5F720200242B61 /* parser.h */,
0E10FED01E5F720200242B61 /* parser.c */,
0E10FECF1E5F720200242B61 /* parser_end.c */,
0E10FED51E5F720200242B61 /* punycode.h */,
0E10FED41E5F720200242B61 /* punycode.c */,
0E10FED71E5F720200242B61 /* scheme_const.h */,
0E10FEDA1E5F720200242B61 /* scheme.h */,
0E10FED91E5F720200242B61 /* scheme.c */,
0E10FED81E5F720200242B61 /* scheme_resources.h */,
0E10FEDC1E5F720200242B61 /* serialization.h */,
0E10FEDB1E5F720200242B61 /* serialization.c */,
0E10FEE01E5F720200242B61 /* utils.h */,
0E10FEDF1E5F720200242B61 /* utils.c */,
0E10FED61E5F720200242B61 /* resources.h */,
);
name = myurl;
sourceTree = "<group>";
};
0E750ED61D9AF1D500337E9B = {
isa = PBXGroup;
children = (
0E750EE21D9AF1D500337E9B /* main.c */,
0EF5D14A1E6805C90048E3D1 /* mycore */,
0EF5D14C1E6805D70048E3D1 /* myencoding */,
0E750EE11D9AF1D500337E9B /* Modest */,
0E750EEB1D9AF22E00337E9B /* myfont */,
0E750EEA1D9AF22500337E9B /* mycss */,
0E750EE91D9AF21C00337E9B /* myhtml */,
0E10FECA1E5F71CF00242B61 /* myurl */,
0EF5D1A01E6DDD8E0048E3D1 /* posix */,
0E750EE01D9AF1D500337E9B /* Products */,
);
sourceTree = "<group>";
@ -507,9 +588,7 @@
children = (
0E750FAB1D9AF27F00337E9B /* def.h */,
0E750FA31D9AF27F00337E9B /* api.h */,
0E750FA21D9AF27F00337E9B /* api_encoding.h */,
0E750FB91D9AF27F00337E9B /* myosi.h */,
0E750FB81D9AF27F00337E9B /* myosi.c */,
0E750FB41D9AF27F00337E9B /* myhtml.h */,
0E750FB31D9AF27F00337E9B /* myhtml.c */,
0E750FA51D9AF27F00337E9B /* callback.h */,
@ -519,21 +598,13 @@
0E750FA61D9AF27F00337E9B /* charef_resource.h */,
0E750FAA1D9AF27F00337E9B /* data_process.h */,
0E750FA91D9AF27F00337E9B /* data_process.c */,
0E750FB01D9AF27F00337E9B /* encoding.h */,
0E750FAF1D9AF27F00337E9B /* encoding.c */,
0E750FAD1D9AF27F00337E9B /* encoding_detect.c */,
0E750FAC1D9AF27F00337E9B /* encoding_detect_resource.h */,
0E750FAE1D9AF27F00337E9B /* encoding_resource.h */,
0E750FB21D9AF27F00337E9B /* incoming.h */,
0E750FB11D9AF27F00337E9B /* incoming.c */,
0E750FB71D9AF27F00337E9B /* mynamespace.h */,
0E750FB61D9AF27F00337E9B /* mynamespace.c */,
0E750FB51D9AF27F00337E9B /* mynamespace_resource.h */,
0E750FBB1D9AF27F00337E9B /* mystring.h */,
0E750FBA1D9AF27F00337E9B /* mystring.c */,
0EF5D1861E68362D0048E3D1 /* mystring.h */,
0EF5D1851E68362D0048E3D1 /* mystring.c */,
0E750FBD1D9AF27F00337E9B /* parser.h */,
0E750FBC1D9AF27F00337E9B /* parser.c */,
0E750FBE1D9AF27F00337E9B /* perf.c */,
0E750FC01D9AF27F00337E9B /* rules.h */,
0E750FBF1D9AF27F00337E9B /* rules.c */,
0E750FC21D9AF27F00337E9B /* serialization.h */,
@ -544,8 +615,6 @@
0E750FC71D9AF27F00337E9B /* tag.c */,
0E750FC61D9AF27F00337E9B /* tag_init.c */,
0E750FC51D9AF27F00337E9B /* tag_const.h */,
0E750FCA1D9AF27F00337E9B /* thread.h */,
0E750FC91D9AF27F00337E9B /* thread.c */,
0E750FCC1D9AF27F00337E9B /* token.h */,
0E750FCB1D9AF27F00337E9B /* token.c */,
0E750FD41D9AF27F00337E9B /* tokenizer.h */,
@ -558,9 +627,6 @@
0E750FD11D9AF27F00337E9B /* tokenizer_script.c */,
0E750FD61D9AF27F00337E9B /* tree.h */,
0E750FD51D9AF27F00337E9B /* tree.c */,
0E750FE61D9AF27F00337E9B /* utils.h */,
0E750FE51D9AF27F00337E9B /* utils.c */,
0E750FD71D9AF27F00337E9B /* utils */,
);
name = myhtml;
sourceTree = "<group>";
@ -608,34 +674,34 @@
0E750EEB1D9AF22E00337E9B /* myfont */ = {
isa = PBXGroup;
children = (
0E750EFC1D9AF26300337E9B /* cmap.c */,
0E750EFD1D9AF26300337E9B /* cmap.h */,
0E750EFE1D9AF26300337E9B /* glyf.c */,
0E750EFF1D9AF26300337E9B /* glyf.h */,
0E750F001D9AF26300337E9B /* head.c */,
0E750F011D9AF26300337E9B /* head.h */,
0E750F021D9AF26300337E9B /* hhea.c */,
0E750F031D9AF26300337E9B /* hhea.h */,
0E750F041D9AF26300337E9B /* hmtx.c */,
0E750F051D9AF26300337E9B /* hmtx.h */,
0E750F061D9AF26300337E9B /* loca.c */,
0E750F071D9AF26300337E9B /* loca.h */,
0E750F081D9AF26300337E9B /* maxp.c */,
0E750F091D9AF26300337E9B /* maxp.h */,
0E750F0A1D9AF26300337E9B /* myfont.c */,
0E750F0B1D9AF26300337E9B /* myfont.h */,
0E750F0C1D9AF26300337E9B /* myosi.c */,
0E750F0A1D9AF26300337E9B /* myfont.c */,
0E750EFD1D9AF26300337E9B /* cmap.h */,
0E750EFC1D9AF26300337E9B /* cmap.c */,
0E750EFF1D9AF26300337E9B /* glyf.h */,
0E750EFE1D9AF26300337E9B /* glyf.c */,
0E750F011D9AF26300337E9B /* head.h */,
0E750F001D9AF26300337E9B /* head.c */,
0E750F031D9AF26300337E9B /* hhea.h */,
0E750F021D9AF26300337E9B /* hhea.c */,
0E750F051D9AF26300337E9B /* hmtx.h */,
0E750F041D9AF26300337E9B /* hmtx.c */,
0E750F071D9AF26300337E9B /* loca.h */,
0E750F061D9AF26300337E9B /* loca.c */,
0E750F091D9AF26300337E9B /* maxp.h */,
0E750F081D9AF26300337E9B /* maxp.c */,
0E750F0D1D9AF26300337E9B /* myosi.h */,
0E750F0E1D9AF26300337E9B /* name.c */,
0E750F0C1D9AF26300337E9B /* myosi.c */,
0E750F0F1D9AF26300337E9B /* name.h */,
0E750F101D9AF26300337E9B /* os_2.c */,
0E750F0E1D9AF26300337E9B /* name.c */,
0E750F111D9AF26300337E9B /* os_2.h */,
0E750F121D9AF26300337E9B /* pclt.c */,
0E750F101D9AF26300337E9B /* os_2.c */,
0E750F131D9AF26300337E9B /* pclt.h */,
0E750F141D9AF26300337E9B /* vhea.c */,
0E750F121D9AF26300337E9B /* pclt.c */,
0E750F151D9AF26300337E9B /* vhea.h */,
0E750F161D9AF26300337E9B /* vmtx.c */,
0E750F141D9AF26300337E9B /* vhea.c */,
0E750F171D9AF26300337E9B /* vmtx.h */,
0E750F161D9AF26300337E9B /* vmtx.c */,
);
name = myfont;
sourceTree = "<group>";
@ -801,31 +867,6 @@
path = ../../source/mycss/values;
sourceTree = "<group>";
};
0E750FD71D9AF27F00337E9B /* utils */ = {
isa = PBXGroup;
children = (
0E0D738B1E2F67DB00FC97DE /* mhash.h */,
0E0D738A1E2F67DB00FC97DE /* mhash.c */,
0E0D5D001E003A5E00EBFDD6 /* avl_tree.h */,
0E0D5CFF1E003A5E00EBFDD6 /* avl_tree.c */,
0E750FD91D9AF27F00337E9B /* mchar_async.h */,
0E750FD81D9AF27F00337E9B /* mchar_async.c */,
0E750FDA1D9AF27F00337E9B /* mcobject.c */,
0E750FDB1D9AF27F00337E9B /* mcobject.h */,
0E750FDC1D9AF27F00337E9B /* mcobject_async.c */,
0E750FDD1D9AF27F00337E9B /* mcobject_async.h */,
0E750FDE1D9AF27F00337E9B /* mcsimple.c */,
0E750FDF1D9AF27F00337E9B /* mcsimple.h */,
0E750FE01D9AF27F00337E9B /* mcsync.c */,
0E750FE11D9AF27F00337E9B /* mcsync.h */,
0E750FE21D9AF27F00337E9B /* mctree.c */,
0E750FE31D9AF27F00337E9B /* mctree.h */,
0E750FE41D9AF27F00337E9B /* resources.h */,
);
name = utils;
path = ../../source/myhtml/utils;
sourceTree = "<group>";
};
0E7F782A1DD3DF3E003B6053 /* layer */ = {
isa = PBXGroup;
children = (
@ -850,6 +891,92 @@
name = render;
sourceTree = "<group>";
};
0EF5D14A1E6805C90048E3D1 /* mycore */ = {
isa = PBXGroup;
children = (
0EF5D1501E680D880048E3D1 /* myosi.h */,
0EF5D1781E680EA10048E3D1 /* myosi.c */,
0EF5D14E1E680D880048E3D1 /* incoming.h */,
0EF5D14D1E680D880048E3D1 /* incoming.c */,
0EF5D1521E680D880048E3D1 /* mystring.h */,
0EF5D1511E680D880048E3D1 /* mystring.c */,
0EF5D1551E680D880048E3D1 /* mythread.h */,
0EF5D1541E680D880048E3D1 /* mythread.c */,
0EF5D19D1E6AE8BF0048E3D1 /* thread_queue.h */,
0EF5D19C1E6AE8BF0048E3D1 /* thread_queue.c */,
0EF5D1571E680D880048E3D1 /* utils.h */,
0EF5D1561E680D880048E3D1 /* utils.c */,
0EF5D15E1E680D8D0048E3D1 /* utils */,
);
name = mycore;
sourceTree = "<group>";
};
0EF5D14C1E6805D70048E3D1 /* myencoding */ = {
isa = PBXGroup;
children = (
0EF5D1811E681FC90048E3D1 /* myosi.h */,
0EF5D17E1E6819E80048E3D1 /* encoding.h */,
0EF5D17D1E6819E80048E3D1 /* encoding.c */,
0EF5D1831E6822BD0048E3D1 /* mystring.h */,
0EF5D1821E6822BD0048E3D1 /* mystring.c */,
0EF5D17B1E6819E80048E3D1 /* detect.c */,
0EF5D17A1E6819E80048E3D1 /* detect_resource.h */,
0EF5D17C1E6819E80048E3D1 /* resource.h */,
);
name = myencoding;
sourceTree = "<group>";
};
0EF5D15E1E680D8D0048E3D1 /* utils */ = {
isa = PBXGroup;
children = (
0EF5D1611E680DA50048E3D1 /* avl_tree.h */,
0EF5D1601E680DA50048E3D1 /* avl_tree.c */,
0EF5D1631E680DA50048E3D1 /* mchar_async.h */,
0EF5D1621E680DA50048E3D1 /* mchar_async.c */,
0EF5D1651E680DA50048E3D1 /* mcobject_async.h */,
0EF5D1641E680DA50048E3D1 /* mcobject_async.c */,
0EF5D1671E680DA50048E3D1 /* mcobject.h */,
0EF5D1661E680DA50048E3D1 /* mcobject.c */,
0EF5D1691E680DA50048E3D1 /* mcsimple.h */,
0EF5D1681E680DA50048E3D1 /* mcsimple.c */,
0EF5D16B1E680DA50048E3D1 /* mcsync.h */,
0EF5D16A1E680DA50048E3D1 /* mcsync.c */,
0EF5D16D1E680DA50048E3D1 /* mctree.h */,
0EF5D16C1E680DA50048E3D1 /* mctree.c */,
0EF5D16F1E680DA50048E3D1 /* mhash.h */,
0EF5D16E1E680DA50048E3D1 /* mhash.c */,
0EF5D15F1E680DA50048E3D1 /* resources.h */,
);
name = utils;
sourceTree = "<group>";
};
0EF5D1A01E6DDD8E0048E3D1 /* posix */ = {
isa = PBXGroup;
children = (
0EF5D1A11E6DDDA50048E3D1 /* mycore */,
);
name = posix;
sourceTree = "<group>";
};
0EF5D1A11E6DDDA50048E3D1 /* mycore */ = {
isa = PBXGroup;
children = (
0EF5D1A31E6DDDC20048E3D1 /* thread.c */,
0EF5D1A41E6DDDC20048E3D1 /* io.c */,
0EF5D1A51E6DDDC20048E3D1 /* memory.c */,
0EF5D1A21E6DDDAF0048E3D1 /* utils */,
);
name = mycore;
sourceTree = "<group>";
};
0EF5D1A21E6DDDAF0048E3D1 /* utils */ = {
isa = PBXGroup;
children = (
0EF5D1AB1E6DDDCD0048E3D1 /* mcsync.c */,
);
name = utils;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
@ -907,42 +1034,51 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
0EF5D1771E680DA50048E3D1 /* mhash.c in Sources */,
0EA033771DB6AFBA009CB2B9 /* raw.c in Sources */,
0EF5D1AC1E6DDDCD0048E3D1 /* mcsync.c in Sources */,
0EF2D5E91E01DFD5000570B6 /* tree_node.c in Sources */,
0E750FF71D9AF27F00337E9B /* tag.c in Sources */,
0E750FF21D9AF27F00337E9B /* perf.c in Sources */,
0E750FFF1D9AF27F00337E9B /* mchar_async.c in Sources */,
0E750F1C1D9AF26300337E9B /* hmtx.c in Sources */,
0E750F981D9AF27200337E9B /* state.c in Sources */,
0E0239881D9FEBE10084A81A /* modest.c in Sources */,
0E0239851D9FEAB90084A81A /* node.c in Sources */,
0EF5D1741E680DA50048E3D1 /* mcsimple.c in Sources */,
0E750F201D9AF26300337E9B /* myosi.c in Sources */,
0EF5D1A91E6DDDC20048E3D1 /* memory.c in Sources */,
0E750F181D9AF26300337E9B /* cmap.c in Sources */,
0E750F911D9AF27200337E9B /* parser.c in Sources */,
0E750FEC1D9AF27F00337E9B /* incoming.c in Sources */,
0E750F931D9AF27200337E9B /* function_parser.c in Sources */,
0E750FF91D9AF27F00337E9B /* token.c in Sources */,
0E10FEE51E5F720200242B61 /* path.c in Sources */,
0E750F841D9AF27200337E9B /* init.c in Sources */,
0E750F891D9AF27200337E9B /* state.c in Sources */,
0E10FEE91E5F720200242B61 /* url.c in Sources */,
0E750F1A1D9AF26300337E9B /* head.c in Sources */,
0EF5D15C1E680D880048E3D1 /* mythread.c in Sources */,
0E750F1B1D9AF26300337E9B /* hhea.c in Sources */,
0E0C91991DB107E7007A0501 /* property.c in Sources */,
0E750EFB1D9AF25300337E9B /* type.c in Sources */,
0E5E2AB21DC76D67007836AB /* parser_image.c in Sources */,
0E750F191D9AF26300337E9B /* glyf.c in Sources */,
0E750F8B1D9AF27200337E9B /* mystring.c in Sources */,
0E7510031D9AF27F00337E9B /* mcsync.c in Sources */,
0EF5D1761E680DA50048E3D1 /* mctree.c in Sources */,
0EF5D1581E680D880048E3D1 /* incoming.c in Sources */,
0EF5D1A81E6DDDC20048E3D1 /* io.c in Sources */,
0E750F231D9AF26300337E9B /* pclt.c in Sources */,
0E750F8C1D9AF27200337E9B /* init.c in Sources */,
0E10FEE11E5F720200242B61 /* host.c in Sources */,
0EF68DCE1DBF6CF000B0DEA4 /* color_parser.c in Sources */,
0E10FEE81E5F720200242B61 /* serialization.c in Sources */,
0E750F1F1D9AF26300337E9B /* myfont.c in Sources */,
0E750FF81D9AF27F00337E9B /* thread.c in Sources */,
0E750FE71D9AF27F00337E9B /* callback.c in Sources */,
0EF5D1791E680EA10048E3D1 /* myosi.c in Sources */,
0EF2D5EA1E01DFD5000570B6 /* tree.c in Sources */,
0EF5D1721E680DA50048E3D1 /* mcobject_async.c in Sources */,
0E79EE951DC8E270004FF5DC /* stack.c in Sources */,
0E750F8D1D9AF27200337E9B /* parser.c in Sources */,
0EF5D1701E680DA50048E3D1 /* avl_tree.c in Sources */,
0E750F971D9AF27200337E9B /* pseudo.c in Sources */,
0E750FEA1D9AF27F00337E9B /* encoding_detect.c in Sources */,
0E750EFA1D9AF25300337E9B /* pseudo_class.c in Sources */,
0E0C91961DB1064E007A0501 /* serialization.c in Sources */,
0E5E2AB01DC7682A007836AB /* parser_url.c in Sources */,
@ -959,66 +1095,72 @@
0E0C918C1DAECB56007A0501 /* serialization.c in Sources */,
0E750FFE1D9AF27F00337E9B /* tree.c in Sources */,
0E750FEE1D9AF27F00337E9B /* mynamespace.c in Sources */,
0E7510021D9AF27F00337E9B /* mcsimple.c in Sources */,
0E750F861D9AF27200337E9B /* state.c in Sources */,
0E750F251D9AF26300337E9B /* vmtx.c in Sources */,
0E750F801D9AF27200337E9B /* an_plus_b.c in Sources */,
0E750FEF1D9AF27F00337E9B /* myosi.c in Sources */,
0E0D738C1E2F67DB00FC97DE /* mhash.c in Sources */,
0E750F9B1D9AF27200337E9B /* tokenizer_end.c in Sources */,
0E750F851D9AF27200337E9B /* parser.c in Sources */,
0EF5D1A71E6DDDC20048E3D1 /* thread.c in Sources */,
0E750F871D9AF27200337E9B /* entry.c in Sources */,
0E818EF61DAE6F8F005B0C77 /* serialization.c in Sources */,
0E0239811D9FE8EC0084A81A /* type.c in Sources */,
0E750F811D9AF27200337E9B /* check.c in Sources */,
0E0D5D011E003A5E00EBFDD6 /* avl_tree.c in Sources */,
0E750EF91D9AF25300337E9B /* match.c in Sources */,
0E7F78351DD3E0D5003B6053 /* begin.c in Sources */,
0E750F9E1D9AF27200337E9B /* consume.c in Sources */,
0E750F9A1D9AF27200337E9B /* stylesheet.c in Sources */,
0E750F9D1D9AF27200337E9B /* tokenizer.c in Sources */,
0EF5D1871E68362D0048E3D1 /* mystring.c in Sources */,
0EF5D1751E680DA50048E3D1 /* mcsync.c in Sources */,
0E750FF11D9AF27F00337E9B /* parser.c in Sources */,
0E750F221D9AF26300337E9B /* os_2.c in Sources */,
0E0460221DBE1B0D00685A80 /* color.c in Sources */,
0E750F991D9AF27200337E9B /* value.c in Sources */,
0E0C919C1DB10866007A0501 /* raw_property.c in Sources */,
0E750FF01D9AF27F00337E9B /* mystring.c in Sources */,
0E750F961D9AF27200337E9B /* parser.c in Sources */,
0E5AA4BD1DA9689700FF5358 /* shared.c in Sources */,
0E7510041D9AF27F00337E9B /* mctree.c in Sources */,
0E750F9F1D9AF27200337E9B /* serialization.c in Sources */,
0E750FF51D9AF27F00337E9B /* stream.c in Sources */,
0E10FEEA1E5F720200242B61 /* utils.c in Sources */,
0E750F951D9AF27200337E9B /* list.c in Sources */,
0E7510051D9AF27F00337E9B /* utils.c in Sources */,
0E750F881D9AF27200337E9B /* init.c in Sources */,
0E7510001D9AF27F00337E9B /* mcobject.c in Sources */,
0E10FEE41E5F720200242B61 /* parser.c in Sources */,
0E750FFB1D9AF27F00337E9B /* tokenizer_end.c in Sources */,
0EF5D1841E6822BD0048E3D1 /* mystring.c in Sources */,
0E750FA01D9AF27200337E9B /* units.c in Sources */,
0E10FEE71E5F720200242B61 /* scheme.c in Sources */,
0E750F211D9AF26300337E9B /* name.c in Sources */,
0E750F241D9AF26300337E9B /* vhea.c in Sources */,
0EF5D1731E680DA50048E3D1 /* mcobject.c in Sources */,
0EF2D5F71E01E0BD000570B6 /* default.c in Sources */,
0E750F831D9AF27200337E9B /* entry.c in Sources */,
0E10FEE61E5F720200242B61 /* punycode.c in Sources */,
0E750FF31D9AF27F00337E9B /* rules.c in Sources */,
0E750FFD1D9AF27F00337E9B /* tokenizer.c in Sources */,
0EF2D5E81E01DFD5000570B6 /* binding.c in Sources */,
0E10FEE31E5F720200242B61 /* parser_end.c in Sources */,
0E750FF41D9AF27F00337E9B /* serialization.c in Sources */,
0EF808A61DA08BBE001AF6EF /* map.c in Sources */,
0E750F8F1D9AF27200337E9B /* parser.c in Sources */,
0E750FA11D9AF27200337E9B /* values.c in Sources */,
0E0C918F1DAED006007A0501 /* serialization.c in Sources */,
0EF5D15D1E680D880048E3D1 /* utils.c in Sources */,
0E750FED1D9AF27F00337E9B /* myhtml.c in Sources */,
0E750F821D9AF27200337E9B /* convert.c in Sources */,
0E750FE91D9AF27F00337E9B /* data_process.c in Sources */,
0EF5D15A1E680D880048E3D1 /* mystring.c in Sources */,
0EF5D1711E680DA50048E3D1 /* mchar_async.c in Sources */,
0E4B525C1DC13BBB0095026A /* parser_text_decoration.c in Sources */,
0EF2D5F21E01E089000570B6 /* default.c in Sources */,
0E7510011D9AF27F00337E9B /* mcobject_async.c in Sources */,
0EF5D1801E6819E80048E3D1 /* encoding.c in Sources */,
0E750FE81D9AF27F00337E9B /* charef.c in Sources */,
0EE852811DC94891003BB21C /* parser_background.c in Sources */,
0E750EE31D9AF1D500337E9B /* main.c in Sources */,
0E750F941D9AF27200337E9B /* init.c in Sources */,
0EF5D19E1E6AE8BF0048E3D1 /* thread_queue.c in Sources */,
0E750F1E1D9AF26300337E9B /* maxp.c in Sources */,
0E750F8A1D9AF27200337E9B /* mycss.c in Sources */,
0E750FEB1D9AF27F00337E9B /* encoding.c in Sources */,
0E10FEE21E5F720200242B61 /* myosi.c in Sources */,
0E0C91921DAED0F5007A0501 /* serialization.c in Sources */,
0EF2D5ED1E01E04A000570B6 /* declaration.c in Sources */,
0E7F78381DD3E2E5003B6053 /* glue.c in Sources */,
@ -1027,6 +1169,7 @@
0E0239731D9D97150084A81A /* thread.c in Sources */,
0E750FFC1D9AF27F00337E9B /* tokenizer_script.c in Sources */,
0E750EF81D9AF25300337E9B /* finder.c in Sources */,
0EF5D17F1E6819E80048E3D1 /* detect.c in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -1060,7 +1203,7 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_C_LANGUAGE_STANDARD = c99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
@ -1082,8 +1225,8 @@
HEADER_SEARCH_PATHS = ../../source;
ONLY_ACTIVE_ARCH = YES;
OTHER_CFLAGS = (
"-DMyHTML_WITH_PERF",
"-DMyHTML_FORCE_RDTSC",
"-DMyCORE_WITH_PERF",
"-DMyCORE_FORCE_RDTSC",
);
PRODUCT_NAME = "$(TARGET_NAME)";
};

View File

@ -2,4 +2,22 @@
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../../source/myfont/glyf.c"
timestampString = "511106642.54925"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "71"
endingLineNumber = "71"
landmarkName = "myfont_glyf_load_data()"
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -49,7 +49,6 @@
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
enableAddressSanitizer = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable

File diff suppressed because it is too large Load Diff

View File

@ -1 +0,0 @@
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36" version="6.0.2.6" editor="www.draw.io" type="device"><diagram name="Страница 1">7VvLcuI6EP0alqEsyzbxMpBkZjFJTVVSNXeWChagO8bi2iLAfP2VbMm2kEIAP8g8sgioLUt2d5+jVrcYwMly+ylFq8UDjXA8cJ1oO4C3A9e99iH/LwS7QhD4YSGYpyQqRKASPJGfWAodKV2TCGdaR0ZpzMhKF05pkuAp02QoTelG7zajsT7rCs2xIXiaotiUfiMRW8jXcoNK/hmT+ULNDAL5fi9o+mOe0nUi5xu4cJb/FZeXSI0lXzRboIhuaiJ4N4CTlFJWfFtuJzgWqlVqK+67f+Nq+dwpTtgxN7jFDa8oXstXf9h9fn74wmVfyAzzj8luGovPDeGP7jrPixSjKBu4QcwnGEfklX+di69ATOM6IFDXeLN2Wb4v2ykdM7wV8gVbxlwA+NeMpfQHntCYplyS0IT3HM9IHO+JUEzmCW+mhQXGrzhlhBvvRsqXJIrELOPNgjD8tEJTMeWGe2r5HHUNSaWJUfC2JpIa+4TpErN0x7vIq34orae8G/pFe1P5SmnhRc1PoJQh6Z7zcujKRPyLtJLdYiNDkTjiviubNGULOqcJiu8q6Th3SCwGcHSNcx2ku3+kPG98F42hz5v/YsZ2EppozSgXVaN/oXQlx5jRhMluwDuk4Iyu06l8ZskPDKVzLHtJbIm3OWiEFMeIkVcdqU00Ct12VRrdCAaq3JVL7omYPe96rlpFW+GAs0oY3t9DmIMGpUzNOI1RlpGpEstpQQOrKH9rzyz5rfyB0a7WYUVJwrLayF+FoIIc9HXIKcKtTFyMWBm8fLTjfMDgQY3har4R/LcW5DwW9HUlmehGLEVcsTitrivee+aUlnA7pkfSYuVY4A0GqzmbYkI5ufQaOZhzCjiPZz83hJopRiOD/ICN/IIWyM//6OSHt4TlQw5Dx5ftalTR+opTwt9bWCuf+ChgeiYwYc+41Ex0Grg8A1y3iCEuGe8YzgyTFmGAirvAXoywQCvRb7mdi8hzOIvpZrrgXDeMxJh2xOxbyYBNxvuTZM5FbjsgAUDnKxtIvI5AEhjqfsSbPILmTNSMb0zTvKvaFpTpjd5XZleMExrKLCLggvQfEDE1aga2Kc7IT/RSsrJEFe/tjwf+rVAb55hMqrGmxRjPbAEuE/yjnPY5J6Mrz2KMFnS/t+7C0FS9Y1G924LqFYTe0D0YDh//KN27vmcoP+xK99eWgKi9pbfTvQWwrJag9TD2aE2aq1/+guYG+hsiIuJN6mTdfsh4mMLdjigcXHs6jwBzy9wZh7smkfw6zjyyOHN4MWceGZr8mtIpzngU5xRB3a8XXuz7pterbwJDZR92S1Pf0BydU7AlFRQnXjip4Hq64d3Qr5vO6A/8Zv2h5++5RrOkBTCD0ycs5n8uFg9nFqO5LVV7KxJTva8tfeHX7xW/rmGDYlPgsCJW5Qs6FTbJcCIaKOHDB2gpNJe8ZEVG2jAQSWY0XXLXp/lINL+RsoXIIsmBs+HZefazQ+LSahcMiqFKtqtMYGhJvgOLtb02rB10wtZlozlbv5Umfi8tfT6Xtx6MnJcghnsk0DLXWjPEe64Qk1yxOgt6us1XtfSfKBa+cGPUUoIWLNI1EwNPylKnLa9rTQTbywX1Ghu/EgSTiXPQA05gYl9PDbshMJn42jWxCVrAJuwokirCHoXOS5R4jsOmZaPQeknNjr39eijwR/oQxXPKuyqLnopxH9rneSv+eqd/c04wd0N/OcFYr43KXWDhBNARJ5isXU8hPg7csckav1UO0QOXSyKqSO1XzLvAwKRTeN02nx6tSbOm8wcmEf1LJhG93kJ/7USHDDDqxzkcPQSpznxUUci58HCbRiEKInXYeK1ne462mblAf7cUnM8i/Pe2xOUhtBi94HhcngusqVaeDHzXBE7+ZzWB8koDROXZSPkWg/r5Qhu4nCHQwCWN1jA0DLQxr3z9fjqbZZgZFj0tClPxRbdxv/PhgHnAK44FpnMpYPqK+2tnFOjvhEvllM1xeeUMXR1EoBkyWwUfNOvEj5jjiq/JRSDCaqlo/pF3caIcO/ddxiCwpxik12KRF3ZDdR89BimB1rAW5VlOBrRPgmflNrxgpPlV2/lL9epH7yAUcEmmANv7PqIrDHuOruteMQx7w/CFCr6ea4IMdpOJPBVkwYkFX//Egu9+/7YLvp7tIEuBymyFEoXJm9UqzpW5jsVux15t5HPV77EQwYzT72+fQ+i1WOy1WqLou0R4KGdxNjN0tPwa0Bzt/WrBG+3VKIqHalyjGHVch1Q6/FtzOATyHuuQvFn9XLMwaPWTWHj3Pw==</diagram></mxfile>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 55 KiB

View File

@ -1 +0,0 @@
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36" version="6.0.2.6" editor="www.draw.io" type="device"><diagram name="Страница 1">3VhLc5swEP41HONBYGP76EfSHJJOZpKZtkcFZFAjIyrk2OTXdwUSDwsnmdjOtPHBoI/VStrdb3fB8Rfr3TeBs+SWR4Q5nhvtHH/peN4U+fCvgKICxoFbAbGgUQWhBrinL0SDRmxDI5J3BCXnTNKsC4Y8TUkoOxgWgm+7YivOuqtmOCYWcB9iZqM/aCSTCp14QYNfExonZmUUTKsnjzh8igXfpHo9x/NX5a96vMZGlz5onuCIb1uQf+n4C8G5rO7WuwVhyrTGbNW8qwNP630Lksr3TPCqCc+YbYjZccBg6jyiz2p/stA2Cf5s1KbmkuzkBWY0Th1/BhKiNEP9GO5ifS3V5BlODXZbXD/c3sCcG7oicFkUIVPXLZUJ34AS9yERBEe5mQz7bs9vweXuuuiRG0bKSp6LgkOreB3tnlILeCLXDACkjioFfyILzrgAJOUpSM5XlLE9SO9lychKaXgmQlIIvZmG1zSK1CLzbUIluc9wqFbcAs/qbagpZHfQ5agOJOAn4WsiRQEiesJoomNPc9M3sbhtIr2Oz6QV5b7GsCZXXKtuAgxudIz1x9vYsiOJgHl6yAUEQsxTzC4bdF7SiSgFbtfgcGBR/NR4OfilBoMRDH8TKQudWPBGcoAa7TecZ1rHiqdSi6FhbWC1qdfNC2fgGxFqKZ3uJBYx0VJBvxMEYVjS5672YyzqH83gEE5GhM2IB4jmFEwj3smIxk/oQPS2fGdIoBfXjtDK3IOOOSry/UnQifzx2Ap81Bf4wQkCf/SvBz7ZUVmqHEzdkR43WtXojggK51beKhf+GFWGNlX8I6lSTp0JgYuWQMZpKnPLRbX+d3ltaJFriSUGZF5IklsurSqA6RjQXnlIcKbk1rtY9UyDFePbMMFCDiKls58x+16yaAP1MaRpDJB3GpJ4rv8mSYbnIsmZykMVwjVPyloNhp+pTrGpyyV2RdXuNLEiIxEynOc0rEAtgj5INk+PTVcALaJb/j5MqcCmFBp/UvkJLIZ8J9uyXYficVyJsNn0JhtO0R4Fb8f/uYrE1DJm1RBXdfoWU9uidhsqSE5f8GNdSHUiBOnR3BktldkgUnNtxrf7Uami2OSZhzKkL4bnKdBo2LW9P7Vt7/bY3jtF7pmcNPeYampXUpOVkGPV7i+VldDYTktDt9//J09LZvEWle4ED0kORdutavj/n5rQZPJ5uWk0PQs/Bp1e85Wqjb4aP0wTdcpO+L3ONGv3vDW2P7jMsoyV62+Y6nYDvFY8SB/zrPs1pu8jTetNcQUWqzuC079Kvk5G70xk3H+ZPCcZYdh8EqxeY5rPrv7lXw==</diagram></mxfile>

View File

@ -1,49 +1,84 @@
TARGET := examples
SRCDIR := examples
SRCDIR := .
CC ?= gcc
LIBS := ../lib/libmodest_static.a
LDLIBS := $(LIBS)
INCLUDE_TMP := include
# ARGS
#
# BINARY_OPTIMIZATION_LEVEL, default -O2
# MODEST_BUILD_WITHOUT_THREADS, YES or (NO or undefined), default undefined
#
MODEST_OPTIMIZATION_LEVEL ?= -O2
.DEFAULT_GOAL := all
CFLAGS ?= -Wall -Werror
CFLAGS += $(MODEST_OPTIMIZATION_LEVEL) -Wno-unused-variable -fPIC --std=c99 -I../include
#********************
# other Makefile
#***************
BINARY_PATH_RELATIVE := ..
MODEST_SOURCE := $(BINARY_PATH_RELATIVE)/source
include $(BINARY_PATH_RELATIVE)/Makefile.bin.cfg
MODEST_BUILD_WITHOUT_THREADS ?= NO
ifeq ($(MODEST_BUILD_WITHOUT_THREADS),YES)
$(info Build Examples without POSIX Threads)
else
$(info Build Examples with POSIX Threads)
CFLAGS += -pthread
endif
BINARY_TO_DIR := $(BINARY_PATH_RELATIVE)/$(BINARY_DIR_BASE)
ifeq ($(OS),Windows_NT)
else
UNAM := $(shell uname -s)
ifeq ($(UNAM),Darwin)
else
CFLAGS += -D_POSIX_C_SOURCE=199309L
endif
endif
#********************
# Build
#***************
BINARY_BUILD_MODULES ?= $(dir $(wildcard $(SRCDIR)/*/))
BINARY_BUILD_MODULES_LIST := $(strip $(foreach dir,$(BINARY_BUILD_MODULES),$(word 2, $(subst $(MODEST_DIR_SEPARATOR), , $(dir))) ))
BINARY_BUILD_MODULES_MAKEFILES_LIST := $(foreach dir,$(BINARY_BUILD_MODULES_LIST),$(dir)/Makefile.mk)
find_files_h = $(wildcard $(dir)/*.h)
find_files_c = $(wildcard $(dir)/*.c)
#********************
# Targets
#***************
BINARY_BUILD_MODULES_TARGET := $(BINARY_BUILD_MODULES_LIST)
BINARY_BUILD_MODULES_TARGET_ALL := $(foreach dir,$(BINARY_BUILD_MODULES_TARGET),$(dir)_all)
BINARY_BUILD_MODULES_TARGET_CLEAN := $(foreach dir,$(BINARY_BUILD_MODULES_TARGET),$(dir)_clean)
SUBDIRS := selectors declarations myfont modest mycss myhtml
HDRS += $(foreach dir,$(SUBDIRS),$(find_files_h))
SRCS += $(foreach dir,$(SUBDIRS),$(find_files_c))
#********************
# Utils
#***************
define BYNARY_UTILS_NEW_LINE
OBJS := $(patsubst %.c,%,$(SRCS))
all: $(TARGET)
endef
BINARY_UTILS_OBJS = $(patsubst %.c,%,$(foreach dir,$2,$(wildcard $(SRCDIR)/$1/$(dir)/*.c)))
BINARY_UTILS_CREATE_DIRS = $(foreach dir,$(BINARY_BUILD_MODULES_LIST),mkdir -p $(BINARY_TO_DIR)/$(dir) $(BYNARY_UTILS_NEW_LINE))
$(TARGET): $(OBJS)
cp -r $(OBJS) ../bin/
#********************
# Include all modules Makefile.mk
#***************
include $(BINARY_BUILD_MODULES_MAKEFILES_LIST)
clean:
rm -f $(OBJS)
#********************
# Set ARGS for flags
#***************
override CFLAGS += $(BINARY_CFLAGS)
override LDFLAGS += $(BINARY_LDFLAGS)
override LDLIBS += $(BINARY_LIBRARIES)
.PHONY: all
#********************
# Objects
#***************
BINARY_BUILD_EXECUTE ?= $(foreach dir,$(BINARY_BUILD_MODULES_TARGET),$($(dir)_objs))
BINARY_BUILD_EXECUTE_CLEAN := $(foreach path,$(BINARY_BUILD_EXECUTE),$(subst ./,,$(path)))
BINARY_BUILD_EXECUTE_TO_CLEAN := $(foreach path,$(BINARY_BUILD_EXECUTE_CLEAN),rm -rf $(BINARY_TO_DIR)/$(path) $(BYNARY_UTILS_NEW_LINE))
BINARY_BUILD_DIRS_TO_CLEAN := $(foreach path,$(BINARY_BUILD_MODULES_LIST),rm -rf $(BINARY_TO_DIR)/$(path) $(BYNARY_UTILS_NEW_LINE))
BINARY_BUILD_EXECUTE_COPY := $(foreach path,$(BINARY_BUILD_EXECUTE_CLEAN),cp $(path) $(BINARY_TO_DIR)/$(dir $(path)) $(BYNARY_UTILS_NEW_LINE))
BINARY_BUILD_EXECUTE_COPY_ALL := $(BINARY_UTILS_CREATE_DIRS) $(BINARY_BUILD_EXECUTE_COPY)
#********************
# Target options
#***************
all: build
$(BINARY_BUILD_EXECUTE_COPY_ALL)
build: $(BINARY_BUILD_EXECUTE_CLEAN)
clean: $(BINARY_BUILD_MODULES_TARGET_CLEAN)
$(BINARY_BUILD_EXECUTE_TO_CLEAN)
$(BINARY_BUILD_DIRS_TO_CLEAN)
copy:
$(BINARY_BUILD_EXECUTE_COPY_ALL)
.PHONY: all copy clean $(BINARY_BUILD_MODULES_TARGET_ALL)

View File

@ -0,0 +1,7 @@
modest_dirs := .
modest_objs := $(call BINARY_UTILS_OBJS,modest,$(modest_dirs))
modest_all: $(modest_objs)
modest_clean:
rm -f $(modest_objs)

View File

@ -31,7 +31,7 @@
myhtml_tree_t * parse_html(const char* data, size_t data_size, myhtml_callback_tree_node_f cai, void* cai_ctx)
{
myhtml_t* myhtml = myhtml_create();
myhtml_status_t status = myhtml_init(myhtml, MyHTML_OPTIONS_DEFAULT, 1, 0);
mystatus_t status = myhtml_init(myhtml, MyHTML_OPTIONS_DEFAULT, 1, 0);
check_status("Can't init MyHTML object\n");
@ -42,7 +42,7 @@ myhtml_tree_t * parse_html(const char* data, size_t data_size, myhtml_callback_t
myhtml_callback_tree_node_insert_set(tree, cai, cai_ctx);
status = myhtml_parse(tree, MyHTML_ENCODING_UTF_8, data, data_size);
status = myhtml_parse(tree, MyENCODING_UTF_8, data, data_size);
check_status("Can't parse HTML:\n%s\n", data);
return tree;
@ -52,7 +52,7 @@ mycss_entry_t * parse_css(const char* data, size_t data_size)
{
// base init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
check_status("Can't init MyCSS object\n");
@ -62,15 +62,16 @@ mycss_entry_t * parse_css(const char* data, size_t data_size)
check_status("Can't init MyCSS Entry object\n");
status = mycss_parse(entry, MyHTML_ENCODING_UTF_8, data, data_size);
status = mycss_parse(entry, MyENCODING_UTF_8, data, data_size);
check_status("Can't parse CSS:\n%s\n", data);
return entry;
}
void serialization_callback(const char* data, size_t len, void* ctx)
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
void print_result(modest_t* modest, myhtml_tree_t* myhtml_tree, myhtml_tree_node_t* scope_node, mycss_entry_t *mycss_entry)
@ -111,7 +112,7 @@ int main(int argc, const char * argv[])
/* init Modest */
modest_t *modest = modest_create();
modest_status_t status = modest_init(modest);
mystatus_t status = modest_init(modest);
check_status("Can't init Modest object\n");

View File

@ -29,15 +29,16 @@
#define DIE(msg, ...) do { fprintf(stderr, msg, ##__VA_ARGS__); exit(EXIT_FAILURE); } while(0)
#define check_status(msg, ...) do {if(status) DIE(msg, ##__VA_ARGS__);} while(0)
void serialization_callback(const char* data, size_t len, void* ctx)
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
myhtml_tree_t * parse_html(const char* data, size_t data_size, myhtml_callback_tree_node_f cai, void* cai_ctx)
{
myhtml_t* myhtml = myhtml_create();
myhtml_status_t status = myhtml_init(myhtml, MyHTML_OPTIONS_DEFAULT, 1, 0);
mystatus_t status = myhtml_init(myhtml, MyHTML_OPTIONS_DEFAULT, 1, 0);
check_status("Can't init MyHTML object\n");
@ -48,7 +49,7 @@ myhtml_tree_t * parse_html(const char* data, size_t data_size, myhtml_callback_t
myhtml_callback_tree_node_insert_set(tree, cai, cai_ctx);
status = myhtml_parse(tree, MyHTML_ENCODING_UTF_8, data, data_size);
status = myhtml_parse(tree, MyENCODING_UTF_8, data, data_size);
check_status("Can't parse HTML:\n%s\n", data);
return tree;
@ -58,7 +59,7 @@ mycss_entry_t * parse_css(const char* data, size_t data_size)
{
// base init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
check_status("Can't init MyCSS object\n");
@ -68,7 +69,7 @@ mycss_entry_t * parse_css(const char* data, size_t data_size)
check_status("Can't init MyCSS Entry object\n");
status = mycss_parse(entry, MyHTML_ENCODING_UTF_8, data, data_size);
status = mycss_parse(entry, MyENCODING_UTF_8, data, data_size);
check_status("Can't parse CSS:\n%s\n", data);
return entry;
@ -108,7 +109,7 @@ int main(int argc, const char * argv[])
/* init Modest */
modest_t *modest = modest_create();
modest_status_t status = modest_init(modest);
mystatus_t status = modest_init(modest);
check_status("Can't init Modest object\n");

View File

@ -32,19 +32,22 @@
#define DIE(msg, ...) do { fprintf(stderr, msg, ##__VA_ARGS__); exit(EXIT_FAILURE); } while(0)
#define CHECK_STATUS(msg, ...) do {if(status) DIE(msg, ##__VA_ARGS__);} while(0)
void serialization_callback(const char* data, size_t len, void* ctx)
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
void serialization_bad_selectors(const char* buffer, size_t size, void* ctx) {
mystatus_t serialization_bad_selectors(const char* buffer, size_t size, void* ctx)
{
printf("%.*s", (int)size, buffer);
return MyCORE_STATUS_OK;
}
myhtml_tree_t * parse_html(const char* data, size_t data_size)
{
myhtml_t* myhtml = myhtml_create();
myhtml_status_t status = myhtml_init(myhtml, MyHTML_OPTIONS_DEFAULT, 1, 0);
mystatus_t status = myhtml_init(myhtml, MyHTML_OPTIONS_DEFAULT, 1, 0);
CHECK_STATUS("Can't init MyHTML object\n");
@ -53,7 +56,7 @@ myhtml_tree_t * parse_html(const char* data, size_t data_size)
CHECK_STATUS("Can't init MyHTML Tree object\n");
status = myhtml_parse(tree, MyHTML_ENCODING_UTF_8, data, data_size);
status = myhtml_parse(tree, MyENCODING_UTF_8, data, data_size);
CHECK_STATUS("Can't parse HTML:\n%s\n", data);
return tree;
@ -63,7 +66,7 @@ mycss_entry_t * create_css_parser(void)
{
// base init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
CHECK_STATUS("Can't init MyCSS object\n");
@ -78,9 +81,9 @@ mycss_entry_t * create_css_parser(void)
mycss_selectors_list_t * prepare_selector(mycss_entry_t *css_entry, const char* selector, size_t selector_size)
{
mycss_status_t out_status;
mystatus_t out_status;
mycss_selectors_list_t *list = mycss_selectors_parse(mycss_entry_selectors(css_entry),
MyHTML_ENCODING_UTF_8,
MyENCODING_UTF_8,
selector, selector_size,
&out_status);
/* check parsing errors */

View File

@ -29,13 +29,16 @@
#include <mycss/selectors/init.h>
#include <mycss/selectors/serialization.h>
void serialization_callback(const char* data, size_t len, void* ctx)
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
void serialization_bad_selectors(const char* buffer, size_t size, void* ctx) {
printf("%.*s", (int)size, buffer);
mystatus_t serialization_bad_selectors(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
myhtml_tree_t * parse_html(myhtml_t* myhtml, const char* data, size_t data_size)
@ -43,7 +46,7 @@ myhtml_tree_t * parse_html(myhtml_t* myhtml, const char* data, size_t data_size)
myhtml_tree_t* tree = myhtml_tree_create();
myhtml_tree_init(tree, myhtml);
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, data, data_size);
myhtml_parse(tree, MyENCODING_UTF_8, data, data_size);
return tree;
}
@ -52,7 +55,7 @@ mycss_entry_t * create_css_parser(void)
{
// base init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
if(status) {
fprintf(stderr, "Can't init CSS Parser\n");
@ -73,9 +76,9 @@ mycss_entry_t * create_css_parser(void)
mycss_selectors_list_t * prepare_selector(mycss_entry_t *css_entry, const char* selector, size_t selector_size)
{
mycss_status_t out_status;
mystatus_t out_status;
mycss_selectors_list_t *list = mycss_selectors_parse(mycss_entry_selectors(css_entry),
MyHTML_ENCODING_UTF_8, selector, selector_size,
MyENCODING_UTF_8, selector, selector_size,
&out_status);
/* check parsing errors */
if(list == NULL || (list->flags & MyCSS_SELECTORS_FLAGS_SELECTOR_BAD)) {

View File

@ -33,15 +33,16 @@
#define DIE(msg, ...) do { fprintf(stderr, msg, ##__VA_ARGS__); exit(EXIT_FAILURE); } while(0)
#define CHECK_STATUS(msg, ...) do {if(status) DIE(msg, ##__VA_ARGS__);} while(0)
void serialization_callback(const char* data, size_t len, void* ctx)
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
myhtml_tree_t * parse_html(const char* data, size_t data_size)
{
myhtml_t* myhtml = myhtml_create();
myhtml_status_t status = myhtml_init(myhtml, MyHTML_OPTIONS_DEFAULT, 1, 0);
mystatus_t status = myhtml_init(myhtml, MyHTML_OPTIONS_DEFAULT, 1, 0);
CHECK_STATUS("Can't init MyHTML object\n");
@ -50,7 +51,7 @@ myhtml_tree_t * parse_html(const char* data, size_t data_size)
CHECK_STATUS("Can't init MyHTML Tree object\n");
status = myhtml_parse(tree, MyHTML_ENCODING_UTF_8, data, data_size);
status = myhtml_parse(tree, MyENCODING_UTF_8, data, data_size);
CHECK_STATUS("Can't parse HTML:\n%s\n", data);
return tree;
@ -60,7 +61,7 @@ mycss_entry_t * create_css_parser(void)
{
// base init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
CHECK_STATUS("Can't init MyCSS object\n");
@ -101,7 +102,7 @@ void parse_style_of_node_and_print(myhtml_tree_t *html_tree, mycss_entry_t *css_
myhtml_tree_attr_t *attr_style = myhtml_attribute_by_key(node, "style", 5);
if(attr_style) {
mycss_declaration_entry_t *dec_entry = mycss_declaration_parse(css_entry->declaration, MyHTML_ENCODING_UTF_8,
mycss_declaration_entry_t *dec_entry = mycss_declaration_parse(css_entry->declaration, MyENCODING_UTF_8,
attr_style->value.data, attr_style->value.length, NULL);
if(dec_entry) {

View File

@ -0,0 +1,7 @@
mycss_dirs := .
mycss_objs := $(call BINARY_UTILS_OBJS,mycss,$(mycss_dirs))
mycss_all: $(mycss_objs)
mycss_clean:
rm -f $(mycss_objs)

View File

@ -24,6 +24,8 @@
#include <mycss/mycss.h>
#include "example.h"
struct res_data {
char *data;
size_t size;
@ -62,7 +64,7 @@ struct res_data load_data_file(const char* filename)
size_t nread = fread(data, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -72,9 +74,10 @@ struct res_data load_data_file(const char* filename)
return res;
}
void serialization_callback(const char* data, size_t len, void* ctx)
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
@ -93,14 +96,14 @@ int main(int argc, const char * argv[])
// basic init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
// current entry work init
mycss_entry_t *entry = mycss_entry_create();
status = mycss_entry_init(mycss, entry);
// parse selectors
status = mycss_parse(entry, MyHTML_ENCODING_UTF_8, res.data, res.size);
status = mycss_parse(entry, MyENCODING_UTF_8, res.data, res.size);
if(status) {
fprintf(stderr, "Parse error!\n");

View File

@ -25,9 +25,10 @@
#include <mycss/mycss.h>
#include <mycss/declaration/init.h>
void serialization_callback(const char* data, size_t len, void* ctx)
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
@ -36,7 +37,7 @@ int main(int argc, const char * argv[])
// basic init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
// check initialization
if (MyCSS_FAILED(status)) return EXIT_FAILURE;
@ -50,8 +51,8 @@ int main(int argc, const char * argv[])
printf("\t%s", declaration);
printf("\n");
mycss_status_t out_status;
mycss_declaration_entry_t *dec_entry = mycss_declaration_parse(entry->declaration, MyHTML_ENCODING_UTF_8,
mystatus_t out_status;
mycss_declaration_entry_t *dec_entry = mycss_declaration_parse(entry->declaration, MyENCODING_UTF_8,
declaration, strlen(declaration), &out_status);
/* print result */

View File

@ -28,9 +28,9 @@ int main(int argc, const char * argv[])
{
char *css = "@charset \"cp1251\"; #best-id {}";
myhtml_encoding_t encoding = mycss_encoding_check_charset_rule(css, strlen(css));
myencoding_t encoding = mycss_encoding_check_charset_rule(css, strlen(css));
if(encoding == MyHTML_ENCODING_WINDOWS_1251)
if(encoding == MyENCODING_WINDOWS_1251)
printf("Detected Encoding: windows-1251\n");
else
printf("Detected Encoding: something wrong\n");

32
examples/mycss/example.h Normal file
View File

@ -0,0 +1,32 @@
/*
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Author: vincent.torri@gmail.com (Vincent Torri)
*/
#ifndef MyCSS_EXAMPLE_EXAMPLE_H
#define MyCSS_EXAMPLE_EXAMPLE_H
#pragma once
/* Format */
#ifdef _WIN32
#define MyCORE_FMT_Z "%Iu"
#else
#define MyCORE_FMT_Z "%zu"
#endif
#endif /* MyCSS_EXAMPLE_EXAMPLE_H */

View File

@ -24,6 +24,8 @@
#include <mycss/api.h>
#include "example.h"
// see tokenizer_buffer_high_level
mycss_token_t * token_ready_callback(mycss_entry_t* entry, mycss_token_t* token)
@ -32,21 +34,21 @@ mycss_token_t * token_ready_callback(mycss_entry_t* entry, mycss_token_t* token)
size_t tokens_count = mycss_entry_token_count(entry);
mycss_token_type_t token_type = mycss_token_type(token);
printf("Token %zu; %s; \"", tokens_count, mycss_token_name_by_type(token_type));
printf("Token " MyCORE_FMT_Z "; %s; \"", tokens_count, mycss_token_name_by_type(token_type));
// print data
myhtml_incoming_buffer_t *buffer = mycss_entry_incoming_buffer_current(entry);
buffer = myhtml_incoming_buffer_find_by_position(buffer, mycss_token_begin(token));
mycore_incoming_buffer_t *buffer = mycss_entry_incoming_buffer_current(entry);
buffer = mycore_incoming_buffer_find_by_position(buffer, mycss_token_begin(token));
//
size_t absolute_begin = mycss_token_begin(token);
size_t relative_begin = absolute_begin - myhtml_incoming_buffer_offset(buffer);
size_t relative_begin = absolute_begin - mycore_incoming_buffer_offset(buffer);
size_t length = mycss_token_length(token);
// if token data length in one buffer then print them all at once
if((relative_begin + length) <= myhtml_incoming_buffer_size(buffer))
if((relative_begin + length) <= mycore_incoming_buffer_size(buffer))
{
const char *data = myhtml_incoming_buffer_data(buffer);
const char *data = mycore_incoming_buffer_data(buffer);
printf("%.*s\"\n", (int)length, &data[relative_begin]);
return token;
@ -54,17 +56,17 @@ mycss_token_t * token_ready_callback(mycss_entry_t* entry, mycss_token_t* token)
// if the data are spread across multiple buffers that join them
while(buffer) {
const char *data = myhtml_incoming_buffer_data(buffer);
const char *data = mycore_incoming_buffer_data(buffer);
if((relative_begin + length) > myhtml_incoming_buffer_size(buffer))
if((relative_begin + length) > mycore_incoming_buffer_size(buffer))
{
size_t relative_end = (myhtml_incoming_buffer_size(buffer) - relative_begin);
size_t relative_end = (mycore_incoming_buffer_size(buffer) - relative_begin);
length -= relative_end;
printf("%.*s", (int)relative_end, &data[relative_begin]);
relative_begin = 0;
buffer = myhtml_incoming_buffer_next(buffer);
buffer = mycore_incoming_buffer_next(buffer);
}
else {
printf("%.*s", (int)length, &data[relative_begin]);
@ -86,7 +88,7 @@ int main(int argc, const char * argv[])
// basic init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
// check initialization
if (MyCSS_FAILED(status)) return EXIT_FAILURE;
@ -98,8 +100,8 @@ int main(int argc, const char * argv[])
// set custom callback for token is ready
mycss_entry_token_ready_callback(entry, token_ready_callback);
// this is example, you can not specify, dy default MyHTML_ENCODING_UTF_8
mycss_encoding_set(entry, MyHTML_ENCODING_UTF_8);
// this is example, you can not specify, dy default MyENCODING_UTF_8
mycss_encoding_set(entry, MyENCODING_UTF_8);
// parse css chunks
mycss_parse_chunk(entry, css_chunk_1, strlen(css_chunk_1));

View File

@ -25,9 +25,10 @@
#include <mycss/mycss.h>
#include <mycss/selectors/init.h>
void serialization_callback(const char* data, size_t len, void* ctx)
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
@ -36,7 +37,7 @@ int main(int argc, const char * argv[])
// basic init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
// check initialization
if (MyCSS_FAILED(status)) return EXIT_FAILURE;
@ -50,8 +51,8 @@ int main(int argc, const char * argv[])
printf("\t%s", selector);
printf("\n");
mycss_status_t out_status;
mycss_selectors_list_t *list = mycss_selectors_parse(entry->selectors, MyHTML_ENCODING_UTF_8, selector, strlen(selector), &out_status);
mystatus_t out_status;
mycss_selectors_list_t *list = mycss_selectors_parse(entry->selectors, MyENCODING_UTF_8, selector, strlen(selector), &out_status);
/* print result */
printf("Result:\n\t");

View File

@ -24,9 +24,10 @@
#include <mycss/mycss.h>
void serialization_callback(const char* data, size_t len, void* ctx)
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
@ -39,7 +40,7 @@ body > div[id*=mu i]:not(:nth-child(2n+1)) {width: 1.4%}";
// basic init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
// check initialization
if (MyCSS_FAILED(status)) return EXIT_FAILURE;
@ -53,7 +54,7 @@ body > div[id*=mu i]:not(:nth-child(2n+1)) {width: 1.4%}";
printf("%s", css);
printf("\n\n");
status = mycss_parse(entry, MyHTML_ENCODING_UTF_8, css, strlen(css));
status = mycss_parse(entry, MyENCODING_UTF_8, css, strlen(css));
/* print result */
printf("Result:\n");

View File

@ -24,31 +24,33 @@
#include <mycss/api.h>
#include "example.h"
mycss_token_t * token_ready_callback(mycss_entry_t* entry, mycss_token_t* token)
{
myhtml_string_t str;
mycore_string_t str;
mycss_token_data_to_string(entry, token, &str, true);
if(mycss_token_type(token) == MyCSS_TOKEN_TYPE_NUMBER)
{
double return_num;
mycss_convert_data_to_double(myhtml_string_data(&str), myhtml_string_length(&str), &return_num, NULL);
mycss_convert_data_to_double(mycore_string_data(&str), mycore_string_length(&str), &return_num, NULL);
printf("Number %s: %f\n", myhtml_string_data(&str), return_num);
printf("Number %s: %f\n", mycore_string_data(&str), return_num);
}
else if(mycss_token_type(token) == MyCSS_TOKEN_TYPE_UNICODE_RANGE)
{
size_t start, end;
mycss_convert_unicode_range_to_codepoint(myhtml_string_data(&str), myhtml_string_length(&str),
mycss_convert_unicode_range_to_codepoint(mycore_string_data(&str), mycore_string_length(&str),
&start, &end);
if(end)
printf("Unicode range U+%s: %zu-%zu\n", myhtml_string_data(&str), start, end);
printf("Unicode range U+%s: " MyCORE_FMT_Z "-" MyCORE_FMT_Z "\n", mycore_string_data(&str), start, end);
else
printf("Unicode range U+%s: %zu\n", myhtml_string_data(&str), start);
printf("Unicode range U+%s: " MyCORE_FMT_Z "\n", mycore_string_data(&str), start);
}
myhtml_string_destroy(&str, false);
mycore_string_destroy(&str, false);
return token;
}
@ -59,7 +61,7 @@ int main(int argc, const char * argv[])
// basic init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
// check initialization
if (MyCSS_FAILED(status)) return EXIT_FAILURE;
@ -72,7 +74,7 @@ int main(int argc, const char * argv[])
mycss_entry_token_ready_callback(entry, token_ready_callback);
// parse css
mycss_parse(entry, MyHTML_ENCODING_UTF_8, css, strlen(css));
mycss_parse(entry, MyENCODING_UTF_8, css, strlen(css));
// release resurces
mycss_entry_destroy(entry, true);

View File

@ -24,20 +24,22 @@
#include <mycss/api.h>
#include "example.h"
mycss_token_t * token_ready_callback(mycss_entry_t* entry, mycss_token_t* token)
{
// print token name
size_t tokens_count = mycss_entry_token_count(entry);
mycss_token_type_t token_type = mycss_token_type(token);
myhtml_string_t str;
mycore_string_t str;
mycss_token_data_to_string(entry, token, &str, true);
printf("Token %zu; %s; \"%s\"\n", tokens_count,
printf("Token " MyCORE_FMT_Z "; %s; \"%s\"\n", tokens_count,
mycss_token_name_by_type(token_type),
myhtml_string_data(&str));
mycore_string_data(&str));
myhtml_string_destroy(&str, false);
mycore_string_destroy(&str, false);
return token;
}
@ -50,7 +52,7 @@ int main(int argc, const char * argv[])
// basic init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
// check initialization
if (MyCSS_FAILED(status)) return EXIT_FAILURE;
@ -62,8 +64,8 @@ int main(int argc, const char * argv[])
// set custom callback for token is ready
mycss_entry_token_ready_callback(entry, token_ready_callback);
// this is example, you can not specify, dy default MyHTML_ENCODING_UTF_8
mycss_encoding_set(entry, MyHTML_ENCODING_UTF_8);
// this is example, you can not specify, dy default MyENCODING_UTF_8
mycss_encoding_set(entry, MyENCODING_UTF_8);
// parse css chunks
mycss_parse_chunk(entry, css_chunk_1, strlen(css_chunk_1));

View File

@ -24,12 +24,14 @@
#include <mycss/api.h>
#include "example.h"
mycss_token_t * token_ready_callback(mycss_entry_t* entry, mycss_token_t* token)
{
size_t tokens_count = mycss_entry_token_count(entry);
mycss_token_type_t token_type = mycss_token_type(token);
printf("Token %zu: <%s>\n", tokens_count, mycss_token_name_by_type(token_type));
printf("Token " MyCORE_FMT_Z ": <%s>\n", tokens_count, mycss_token_name_by_type(token_type));
return token;
}
@ -42,7 +44,7 @@ int main(int argc, const char * argv[])
// basic init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
// check initialization
if (MyCSS_FAILED(status)) return EXIT_FAILURE;
@ -54,8 +56,8 @@ int main(int argc, const char * argv[])
// set custom callback for token is ready
mycss_entry_token_ready_callback(entry, token_ready_callback);
// this is example, you can not specify, dy default MyHTML_ENCODING_UTF_8
mycss_encoding_set(entry, MyHTML_ENCODING_UTF_8);
// this is example, you can not specify, dy default MyENCODING_UTF_8
mycss_encoding_set(entry, MyENCODING_UTF_8);
// parse css chunks
mycss_parse_chunk(entry, css_chunk_1, strlen(css_chunk_1));

View File

@ -24,12 +24,14 @@
#include <mycss/api.h>
#include "example.h"
mycss_token_t * token_ready_callback(mycss_entry_t* entry, mycss_token_t* token)
{
size_t tokens_count = mycss_entry_token_count(entry);
mycss_token_type_t token_type = mycss_token_type(token);
printf("Token %zu: <%s>\n", tokens_count, mycss_token_name_by_type(token_type));
printf("Token " MyCORE_FMT_Z ": <%s>\n", tokens_count, mycss_token_name_by_type(token_type));
return token;
}
@ -40,7 +42,7 @@ int main(int argc, const char * argv[])
// basic init
mycss_t *mycss = mycss_create();
mycss_status_t status = mycss_init(mycss);
mystatus_t status = mycss_init(mycss);
// check initialization
if (MyCSS_FAILED(status)) return EXIT_FAILURE;
@ -53,7 +55,7 @@ int main(int argc, const char * argv[])
mycss_entry_token_ready_callback(entry, token_ready_callback);
// parse css
mycss_parse(entry, MyHTML_ENCODING_UTF_8, css, strlen(css));
mycss_parse(entry, MyENCODING_UTF_8, css, strlen(css));
// release resurces
mycss_entry_destroy(entry, true);

View File

@ -0,0 +1,7 @@
myencoding_dirs := .
myencoding_objs := $(call BINARY_UTILS_OBJS,myencoding,$(myencoding_dirs))
myencoding_all: $(myencoding_objs)
myencoding_clean:
rm -f $(myencoding_objs)

View File

@ -20,7 +20,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <myhtml/api.h>
#include <myencoding/encoding.h>
#include "example.h"
struct res_html {
char *html;
@ -60,7 +63,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -70,19 +73,19 @@ struct res_html load_html_file(const char* filename)
return res;
}
void print_encoding(myhtml_encoding_t encoding)
void print_encoding(myencoding_t encoding)
{
printf("Character encoding is ");
switch (encoding) {
case MyHTML_ENCODING_UTF_8: printf("UTF-8"); break;
case MyHTML_ENCODING_UTF_16LE: printf("UTF_16LE"); break;
case MyHTML_ENCODING_UTF_16BE: printf("UTF_16BE"); break;
case MyHTML_ENCODING_KOI8_R: printf("KOI8_R"); break;
case MyHTML_ENCODING_WINDOWS_1251: printf("WINDOWS_1251"); break;
case MyHTML_ENCODING_X_MAC_CYRILLIC: printf("X_MAC_CYRILLIC"); break;
case MyHTML_ENCODING_IBM866: printf("IBM866"); break;
case MyHTML_ENCODING_ISO_8859_5: printf("ISO_8859_5"); break;
case MyENCODING_UTF_8: printf("UTF-8"); break;
case MyENCODING_UTF_16LE: printf("UTF_16LE"); break;
case MyENCODING_UTF_16BE: printf("UTF_16BE"); break;
case MyENCODING_KOI8_R: printf("KOI8_R"); break;
case MyENCODING_WINDOWS_1251: printf("WINDOWS_1251"); break;
case MyENCODING_X_MAC_CYRILLIC: printf("X_MAC_CYRILLIC"); break;
case MyENCODING_IBM866: printf("IBM866"); break;
case MyENCODING_ISO_8859_5: printf("ISO_8859_5"); break;
default:
printf("UNKNOWN");
break;
@ -105,14 +108,14 @@ int main(int argc, const char * argv[])
struct res_html res = load_html_file(path);
myhtml_encoding_t encoding;
myencoding_t encoding;
// try detect by BOM
if (myhtml_encoding_detect_bom(res.html, res.size, &encoding)) {
if (myencoding_detect_bom(res.html, res.size, &encoding)) {
print_encoding(encoding);
} else if (myhtml_encoding_detect(res.html, res.size, &encoding)) {
} else if (myencoding_detect(res.html, res.size, &encoding)) {
print_encoding(encoding);
} else if (encoding != MyHTML_ENCODING_DEFAULT) {
} else if (encoding != MyENCODING_DEFAULT) {
printf("It is possible that ");
print_encoding(encoding);
} else {

View File

@ -20,7 +20,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <myhtml/api.h>
#include <myencoding/encoding.h>
#include "example.h"
struct res_html {
char *html;
@ -60,7 +63,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -79,13 +82,13 @@ int main(int argc, const char * argv[])
struct res_html res = load_html_file(argv[1]);
myhtml_encoding_t encoding = myhtml_encoding_prescan_stream_to_determine_encoding(res.html, res.size);
myencoding_t encoding = myencoding_prescan_stream_to_determine_encoding(res.html, res.size);
if(encoding == MyHTML_ENCODING_NOT_DETERMINED) {
if(encoding == MyENCODING_NOT_DETERMINED) {
printf("Can't detect encoding\n");
}
else {
const char *encoding_name = myhtml_encoding_name_by_id(encoding, NULL);
const char *encoding_name = myencoding_name_by_id(encoding, NULL);
printf("Encoding: %s\n", encoding_name);
}

View File

@ -22,16 +22,16 @@
#include <stdlib.h>
#include <string.h>
#include <myhtml/api.h>
#include <myencoding/encoding.h>
int main(int argc, const char * argv[])
{
const char *name = "cp1251";
myhtml_encoding_t encoding;
myencoding_t encoding;
if(myhtml_encoding_by_name(name, strlen(name), &encoding))
if(myencoding_by_name(name, strlen(name), &encoding))
{
if(encoding == MyHTML_ENCODING_WINDOWS_1251) {
if(encoding == MyENCODING_WINDOWS_1251) {
printf("Detected Encoding: windows-1251\n");
return 0;
}

View File

@ -0,0 +1,32 @@
/*
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Author: vincent.torri@gmail.com (Vincent Torri)
*/
#ifndef MyHTML_EXAMPLE_EXAMPLE_H
#define MyHTML_EXAMPLE_EXAMPLE_H
#pragma once
/* Format */
#ifdef _WIN32
#define MyCORE_FMT_Z "%Iu"
#else
#define MyCORE_FMT_Z "%zu"
#endif
#endif /* MyHTML_EXAMPLE_EXAMPLE_H */

View File

@ -0,0 +1,7 @@
myfont_dirs := .
myfont_objs := $(call BINARY_UTILS_OBJS,myfont,$(myfont_dirs))
myfont_all: $(myfont_objs)
myfont_clean:
rm -f $(myfont_objs)

View File

@ -23,9 +23,9 @@
#include <string.h>
#include <myfont/myfont.h>
#include <myhtml/encoding.h>
#include <myencoding/encoding.h>
void usage(const char *path, float font_size, unsigned long codepoint)
void usage(const char *path, float font_size, size_t codepoint)
{
printf("Usage:\n");
printf("\tprogram [char in UTF-8] [font fize in px] [font path]\n");
@ -35,14 +35,14 @@ void usage(const char *path, float font_size, unsigned long codepoint)
int main(int argc, const char * argv[])
{
/* set and get params */
const char *path = "../third_party/font/Arkhip.ttf";
const char *path = "third_party/font/Arkhip.ttf";
float font_size = 200.0f;
unsigned long codepoint;
myhtml_encoding_ascii_utf_8_to_codepoint((unsigned char*)"x", &codepoint);
size_t codepoint;
myencoding_ascii_utf_8_to_codepoint((unsigned char*)"x", &codepoint);
if (argc == 2) {
if(myhtml_encoding_ascii_utf_8_to_codepoint((const unsigned char*)argv[1], &codepoint) == 0) {
if(myencoding_ascii_utf_8_to_codepoint((const unsigned char*)argv[1], &codepoint) == 0) {
fprintf(stderr, "Bad char code point\n");
return EXIT_FAILURE;
}
@ -67,7 +67,8 @@ int main(int argc, const char * argv[])
myfont_font_t *mf = myfont_create();
myfont_init(mf);
myfont_status_t mf_status = myfont_load(mf, path);
uint8_t *font_data;
mystatus_t mf_status = myfont_load_from_file(mf, path, &font_data, NULL);
if(mf_status) {
myfont_destroy(mf, true);
@ -83,7 +84,7 @@ int main(int argc, const char * argv[])
}
char data[5];
size_t len = myhtml_encoding_codepoint_to_ascii_utf_8(codepoint, data);
size_t len = myencoding_codepoint_to_ascii_utf_8(codepoint, data);
data[len] = '\0';
/* work code */
@ -102,7 +103,7 @@ int main(int argc, const char * argv[])
printf("Font file: %s\n", path);
printf("Font size: %.fpx\n\n", font_size);
printf("Metrics for code point %lu (%s):\n", codepoint, data);
printf("Metrics for code point " MyCORE_FORMAT_Z " (%s):\n", codepoint, data);
printf("\tBaseline: %.05f\n", baseline);
printf("\tAscender: %.05f\n", ascender);
printf("\tDescender: %.05f\n", descender);
@ -135,6 +136,7 @@ int main(int argc, const char * argv[])
printf("</svg>\n");
myfont_destroy_font_data(mf, font_data);
myfont_destroy(mf, true);
return 0;

View File

@ -0,0 +1,7 @@
myhtml_dirs := .
myhtml_objs := $(call BINARY_UTILS_OBJS,myhtml,$(myhtml_dirs))
myhtml_all: $(myhtml_objs)
myhtml_clean:
rm -f $(myhtml_objs)

View File

@ -23,6 +23,11 @@
#include <string.h>
#include <myhtml/api.h>
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
{
@ -37,7 +42,7 @@ int main(int argc, const char * argv[])
myhtml_tree_init(tree, myhtml);
// parse html
myhtml_parse_fragment(tree, MyHTML_ENCODING_UTF_8, html, strlen(html), MyHTML_TAG_DIV, MyHTML_NAMESPACE_HTML);
myhtml_parse_fragment(tree, MyENCODING_UTF_8, html, strlen(html), MyHTML_TAG_DIV, MyHTML_NAMESPACE_HTML);
// get first DIV from index
myhtml_collection_t *div_list = myhtml_get_nodes_by_name(tree, NULL, "div", 3, NULL);
@ -45,19 +50,19 @@ int main(int argc, const char * argv[])
// print original tree
printf("Original tree:\n");
myhtml_tree_print_node_children(tree, myhtml_tree_get_document(tree), stdout, 0);
myhtml_serialization_tree_callback(myhtml_tree_get_node_html(tree), serialization_callback, NULL);
printf("For a test; Create and delete 100000 attrs...\n");
for(size_t j = 0; j < 100000; j++) {
myhtml_tree_attr_t *attr = myhtml_attribute_add(node, "key", 3, "value", 5, MyHTML_ENCODING_UTF_8);
myhtml_tree_attr_t *attr = myhtml_attribute_add(node, "key", 3, "value", 5, MyENCODING_UTF_8);
myhtml_attribute_delete(tree, node, attr);
}
// add first attr in first div in tree
myhtml_attribute_add(node, "key", 3, "value", 5, MyHTML_ENCODING_UTF_8);
myhtml_attribute_add(node, "key", 3, "value", 5, MyENCODING_UTF_8);
printf("Modified tree:\n");
myhtml_tree_print_node_children(tree, myhtml_tree_get_document(tree), stdout, 0);
myhtml_serialization_tree_callback(myhtml_tree_get_node_html(tree), serialization_callback, NULL);
// get attr by key name
myhtml_tree_attr_t *gets_attr = myhtml_attribute_by_key(node, "key", 3);

View File

@ -23,6 +23,8 @@
#include <myhtml/api.h>
#include "example.h"
struct res_html {
char *html;
size_t size;
@ -61,7 +63,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -115,7 +117,7 @@ int main(int argc, const char * argv[])
myhtml_callback_tree_node_remove_set(tree, callback_node_remove, NULL);
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, res.html, res.size);
myhtml_parse(tree, MyENCODING_UTF_8, res.html, res.size);
// release resources
myhtml_tree_destroy(tree);

View File

@ -21,8 +21,15 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <myhtml/api.h>
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
{
char html[][64] = {
@ -53,7 +60,7 @@ int main(int argc, const char * argv[])
myhtml_tree_t* tree = myhtml_tree_create();
myhtml_tree_init(tree, myhtml);
myhtml_encoding_set(tree, MyHTML_ENCODING_UTF_8);
myhtml_encoding_set(tree, MyENCODING_UTF_8);
for(size_t i = 0; html[i][0]; i++)
{
@ -67,7 +74,7 @@ int main(int argc, const char * argv[])
myhtml_parse_chunk_end(tree);
// print fragment
myhtml_tree_print_node_children(tree, myhtml_tree_get_document(tree), stdout, 0);
myhtml_serialization_tree_callback(myhtml_tree_get_document(tree), serialization_callback, NULL);
// release resources
myhtml_tree_destroy(tree);

View File

@ -24,6 +24,14 @@
#include <myhtml/api.h>
#include "example.h"
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
{
// basic init
@ -36,7 +44,7 @@ int main(int argc, const char * argv[])
myhtml_tree_t* tree = myhtml_tree_create();
myhtml_tree_init(tree, myhtml);
myhtml_encoding_set(tree, MyHTML_ENCODING_UTF_8);
myhtml_encoding_set(tree, MyENCODING_UTF_8);
// create nodes
printf("Create DIV element\n");
@ -55,19 +63,19 @@ int main(int argc, const char * argv[])
myhtml_tree_node_t* new_text_node = myhtml_node_create(tree, MyHTML_TAG__TEXT, MyHTML_NAMESPACE_HTML);
myhtml_node_append_child(new_p_node, new_text_node);
sprintf(tmp_buf_key, "best_key_for_%zu", i);
sprintf(tmp_buf_value, "for best value %zu", i);
sprintf(tmp_buf_text, "Text! Entity &#x26;#%zu = &#%zu", i, i);
sprintf(tmp_buf_key, "best_key_for_" MyCORE_FMT_Z, i);
sprintf(tmp_buf_value, "for best value " MyCORE_FMT_Z, i);
sprintf(tmp_buf_text, "Text! Entity &#x26;#" MyCORE_FMT_Z " = &#" MyCORE_FMT_Z, i, i);
myhtml_node_text_set_with_charef(new_text_node, tmp_buf_text, strlen(tmp_buf_text), MyHTML_ENCODING_UTF_8);
myhtml_node_text_set_with_charef(new_text_node, tmp_buf_text, strlen(tmp_buf_text), MyENCODING_UTF_8);
myhtml_attribute_add(new_p_node, tmp_buf_key, strlen(tmp_buf_key),
tmp_buf_value, strlen(tmp_buf_value), MyHTML_ENCODING_UTF_8);
tmp_buf_value, strlen(tmp_buf_value), MyENCODING_UTF_8);
}
// print
printf("Print result:\n");
myhtml_tree_print_node_children(tree, myhtml_tree_get_document(tree), stdout, 0);
myhtml_serialization_tree_callback(myhtml_tree_get_document(tree), serialization_callback, NULL);
// release resources
myhtml_tree_destroy(tree);

32
examples/myhtml/example.h Normal file
View File

@ -0,0 +1,32 @@
/*
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Author: vincent.torri@gmail.com (Vincent Torri)
*/
#ifndef MyHTML_EXAMPLE_EXAMPLE_H
#define MyHTML_EXAMPLE_EXAMPLE_H
#pragma once
/* Format */
#ifdef _WIN32
#define MyCORE_FMT_Z "%Iu"
#else
#define MyCORE_FMT_Z "%zu"
#endif
#endif /* MyHTML_EXAMPLE_EXAMPLE_H */

View File

@ -23,6 +23,11 @@
#include <string.h>
#include <myhtml/api.h>
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
{
@ -37,10 +42,10 @@ int main(int argc, const char * argv[])
myhtml_tree_init(tree, myhtml);
// parse html
myhtml_parse_fragment(tree, MyHTML_ENCODING_UTF_8, html, strlen(html), MyHTML_TAG_DIV, MyHTML_NAMESPACE_HTML);
myhtml_parse_fragment(tree, MyENCODING_UTF_8, html, strlen(html), MyHTML_TAG_DIV, MyHTML_NAMESPACE_HTML);
// print fragment
myhtml_tree_print_node_children(tree, myhtml_tree_get_document(tree), stdout, 0);
myhtml_serialization_tree_callback(myhtml_tree_get_document(tree), serialization_callback, NULL);
// release resources
myhtml_tree_destroy(tree);

View File

@ -22,6 +22,8 @@
#include <stdlib.h>
#include <myhtml/api.h>
#include "example.h"
struct res_html {
char *html;
size_t size;
@ -60,7 +62,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -93,7 +95,7 @@ int main(int argc, const char * argv[])
myhtml_tree_init(tree, myhtml);
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, res.html, res.size);
myhtml_parse(tree, MyENCODING_UTF_8, res.html, res.size);
// parse html
myhtml_collection_t *collection = myhtml_get_nodes_by_tag_id(tree, NULL, MyHTML_TAG_TITLE, NULL);

View File

@ -23,6 +23,8 @@
#include <myhtml/myhtml.h>
#include <myhtml/serialization.h>
#include "example.h"
struct res_html {
char *html;
size_t size;
@ -61,7 +63,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -94,18 +96,18 @@ int main(int argc, const char * argv[])
myhtml_tree_init(tree, myhtml);
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, res.html, res.size);
myhtml_parse(tree, MyENCODING_UTF_8, res.html, res.size);
// get title from index
myhtml_collection_t *titles_list = myhtml_get_nodes_by_tag_id(tree, NULL, MyHTML_TAG_TITLE, NULL);
if(titles_list && titles_list->length != 0 && titles_list->list[0]->child) {
myhtml_string_raw_t str = {0};
mycore_string_raw_t str = {0};
myhtml_serialization_node(titles_list->list[0]->child, &str);
printf("%s\n", str.data);
myhtml_string_raw_destroy(&str, false);
mycore_string_raw_destroy(&str, false);
}
// release resources

View File

@ -28,6 +28,8 @@
#include <myhtml/api.h>
#include "example.h"
#define DIE(msg, ...) do { fprintf(stderr, msg, ##__VA_ARGS__); exit(EXIT_FAILURE); } while(0)
static bool filter_node(myhtml_tree_node_t* node)
@ -117,7 +119,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
DIE("could not read %ld bytes (%zu bytes done)\n", size, nread);
DIE("could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
}
fclose(fh);
@ -139,7 +141,7 @@ int main(int argc, char** argv)
}
struct res_html data = load_html_file(argv[1]);
myhtml_status_t res;
mystatus_t res;
// basic init
myhtml_t* myhtml = myhtml_create();
@ -164,7 +166,7 @@ int main(int argc, char** argv)
}
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, data.html, data.size);
myhtml_parse(tree, MyENCODING_UTF_8, data.html, data.size);
walk_subtree(tree, myhtml_tree_get_node_html(tree), 0);
printf("\n");

View File

@ -23,6 +23,11 @@
#include <string.h>
#include <myhtml/api.h>
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
{
@ -37,7 +42,7 @@ int main(int argc, const char * argv[])
myhtml_tree_init(tree, myhtml);
// parse html
myhtml_parse_fragment(tree, MyHTML_ENCODING_UTF_8, html, strlen(html), MyHTML_TAG_DIV, MyHTML_NAMESPACE_HTML);
myhtml_parse_fragment(tree, MyENCODING_UTF_8, html, strlen(html), MyHTML_TAG_DIV, MyHTML_NAMESPACE_HTML);
// get text node by index
myhtml_collection_t *collection = myhtml_get_nodes_by_tag_id(tree, NULL, MyHTML_TAG_TABLE, NULL);
@ -51,7 +56,7 @@ int main(int argc, const char * argv[])
}
// print fragment
myhtml_tree_print_node_children(tree, myhtml_tree_get_document(tree), stdout, 0);
myhtml_serialization_tree_callback(myhtml_tree_get_document(tree), serialization_callback, NULL);
// release resources
myhtml_collection_destroy(collection);

View File

@ -22,9 +22,10 @@
* @param size
* @param ptr
*/
void write_output(const char *buffer, size_t size, void *ptr)
mystatus_t write_output(const char* data, size_t len, void* ctx)
{
fwrite(buffer, 1, size, stdout);
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
/**
@ -45,7 +46,7 @@ int main()
const char *input = "<html><head></head><body><a href=http://nu.nl></body></html>";
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, input, strlen(input));
myhtml_parse(tree, MyENCODING_UTF_8, input, strlen(input));
// collection of links
myhtml_collection_t *collection = myhtml_get_nodes_by_name(tree, NULL, "a", 1, NULL);
@ -54,7 +55,7 @@ int main()
for (size_t i = 0; i < collection->length; ++i)
{
// add attribute
myhtml_attribute_add(collection->list[i], "title", 5, "my value", 8, MyHTML_ENCODING_UTF_8);
myhtml_attribute_add(collection->list[i], "title", 5, "my value", 8, MyENCODING_UTF_8);
}

View File

@ -24,6 +24,8 @@
#include <myhtml/api.h>
#include "example.h"
struct res_html {
char *html;
size_t size;
@ -62,7 +64,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -72,6 +74,12 @@ struct res_html load_html_file(const char* filename)
return res;
}
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
{
const char* path;
@ -97,15 +105,15 @@ int main(int argc, const char * argv[])
myhtml_tree_init(tree, myhtml);
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, res.html, res.size);
myhtml_parse(tree, MyENCODING_UTF_8, res.html, res.size);
// get and print
myhtml_collection_t *collection = myhtml_get_nodes_by_attribute_key(tree, NULL, NULL, attr_key, strlen(attr_key), NULL);
for(size_t i = 0; i < collection->length; i++)
myhtml_tree_print_node(tree, collection->list[i], stdout);
myhtml_serialization_node_callback(collection->list[i], serialization_callback, NULL);
printf("Total found: %zu\n", collection->length);
printf("Total found: " MyCORE_FMT_Z "\n", collection->length);
myhtml_collection_destroy(collection);

View File

@ -26,6 +26,8 @@
#include <myhtml/api.h>
#include "example.h"
struct res_html {
char *html;
size_t size;
@ -73,7 +75,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -155,6 +157,12 @@ struct res_argv get_argv(int len, int argc, const char ** argv)
return rargv;
}
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
{
const char* path;
@ -184,7 +192,7 @@ int main(int argc, const char * argv[])
myhtml_tree_init(tree, myhtml);
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, res.html, res.size);
myhtml_parse(tree, MyENCODING_UTF_8, res.html, res.size);
// get and print
myhtml_collection_t* collection = NULL;
@ -228,9 +236,9 @@ int main(int argc, const char * argv[])
if(collection) {
for(size_t i = 0; i < collection->length; i++)
myhtml_tree_print_node(tree, collection->list[i], stdout);
myhtml_serialization_node_callback(collection->list[i], serialization_callback, NULL);
printf("Total found: %zu\n", collection->length);
printf("Total found: " MyCORE_FMT_Z "\n", collection->length);
}
myhtml_collection_destroy(collection);

View File

@ -23,6 +23,8 @@
#include <myhtml/api.h>
#include "example.h"
struct res_html {
char *html;
size_t size;
@ -61,7 +63,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -71,6 +73,12 @@ struct res_html load_html_file(const char* filename)
return res;
}
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
{
const char* path;
@ -99,10 +107,10 @@ int main(int argc, const char * argv[])
MyHTML_TREE_PARSE_FLAGS_WITHOUT_DOCTYPE_IN_TREE);
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, res.html, res.size);
myhtml_parse(tree, MyENCODING_UTF_8, res.html, res.size);
if(myhtml_tree_get_node_html(tree))
myhtml_tree_print_by_node(tree, myhtml_tree_get_node_html(tree), stdout, 0);
myhtml_serialization_tree_callback(myhtml_tree_get_node_html(tree), serialization_callback, NULL);
// release resources
myhtml_tree_destroy(tree);

View File

@ -22,6 +22,8 @@
#include <stdlib.h>
#include <myhtml/api.h>
#include "example.h"
struct res_html {
char *html;
size_t size;
@ -60,7 +62,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -151,7 +153,7 @@ int main(int argc, const char * argv[])
myhtml_tree_init(tree, myhtml);
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, res.html, res.size);
myhtml_parse(tree, MyENCODING_UTF_8, res.html, res.size);
// print tree
myhtml_tree_node_t *node = myhtml_tree_get_document(tree);

View File

@ -22,6 +22,8 @@
#include <stdlib.h>
#include <myhtml/api.h>
#include "example.h"
struct res_html {
char *html;
size_t size;
@ -60,7 +62,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -93,10 +95,10 @@ int main(int argc, const char * argv[])
myhtml_tree_init(tree, myhtml);
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, res.html, res.size);
myhtml_parse(tree, MyENCODING_UTF_8, res.html, res.size);
myhtml_string_raw_t str_raw;
myhtml_string_raw_clean_all(&str_raw);
mycore_string_raw_t str_raw;
mycore_string_raw_clean_all(&str_raw);
if(myhtml_serialization_tree_buffer(myhtml_tree_get_document(tree), &str_raw)) {
/*
@ -105,7 +107,7 @@ int main(int argc, const char * argv[])
*/
printf("%s", str_raw.data);
myhtml_string_raw_destroy(&str_raw, false);
mycore_string_raw_destroy(&str_raw, false);
}
// release resources

View File

@ -23,6 +23,11 @@
#include <string.h>
#include <myhtml/api.h>
mystatus_t serialization_callback(const char* data, size_t len, void* ctx)
{
printf("%.*s", (int)len, data);
return MyCORE_STATUS_OK;
}
int main(int argc, const char * argv[])
{
@ -37,11 +42,11 @@ int main(int argc, const char * argv[])
myhtml_tree_init(tree, myhtml);
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, html, strlen(html));
myhtml_parse(tree, MyENCODING_UTF_8, html, strlen(html));
// print original tree
printf("Original Tree:\n");
myhtml_tree_print_node_children(tree, myhtml_tree_get_document(tree), stdout, 0);
myhtml_serialization_tree_callback(myhtml_tree_get_node_html(tree), serialization_callback, NULL);
printf("Change word: manipulate => test\n");
@ -51,18 +56,18 @@ int main(int argc, const char * argv[])
if(collection && collection->list && collection->length)
{
myhtml_tree_node_t *text_node = collection->list[0];
myhtml_string_t *str = myhtml_node_string(text_node);
mycore_string_t *str = myhtml_node_string(text_node);
// change data
char *data = myhtml_string_data(str);
char *data = mycore_string_data(str);
for (size_t i = 0; i < myhtml_string_length(str); i++)
for (size_t i = 0; i < mycore_string_length(str); i++)
{
if(data[i] == 'm') {
sprintf(&data[i], "test");
// set new length
myhtml_string_length_set(str, (i + 4));
mycore_string_length_set(str, (i + 4));
break;
}
}
@ -70,7 +75,7 @@ int main(int argc, const char * argv[])
printf("Changed Tree:\n");
// print tree
myhtml_tree_print_node_children(tree, myhtml_tree_get_document(tree), stdout, 0);
myhtml_serialization_tree_callback(myhtml_tree_get_node_html(tree), serialization_callback, NULL);
// release resources
myhtml_tree_destroy(tree);

View File

@ -23,6 +23,8 @@
#include <myhtml/api.h>
#include "example.h"
struct res_html {
char *html;
size_t size;
@ -61,7 +63,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -71,19 +73,19 @@ struct res_html load_html_file(const char* filename)
return res;
}
void colorize_print(myhtml_incoming_buffer_t *inc_buf, size_t begin, size_t length, const char* color)
void colorize_print(mycore_incoming_buffer_t *inc_buf, size_t begin, size_t length, const char* color)
{
if(length) {
inc_buf = myhtml_incoming_buffer_find_by_position(inc_buf, begin);
inc_buf = mycore_incoming_buffer_find_by_position(inc_buf, begin);
size_t between_begin = (begin - myhtml_incoming_buffer_offset(inc_buf));
const char* between_data = myhtml_incoming_buffer_data(inc_buf);
size_t between_begin = (begin - mycore_incoming_buffer_offset(inc_buf));
const char* between_data = mycore_incoming_buffer_data(inc_buf);
printf("%s%.*s\e[0m", color, (int)length, &between_data[between_begin]);
}
}
size_t colorize_print_attributes(myhtml_tree_t* tree, myhtml_tree_attr_t* attr, myhtml_incoming_buffer_t *inc_buf, size_t last_pos)
size_t colorize_print_attributes(myhtml_tree_t* tree, myhtml_tree_attr_t* attr, mycore_incoming_buffer_t *inc_buf, size_t last_pos)
{
while(attr)
{
@ -133,7 +135,7 @@ size_t colorize_print_attributes(myhtml_tree_t* tree, myhtml_tree_attr_t* attr,
void * colorize_callback_before_token_done(myhtml_tree_t* tree, myhtml_token_node_t* token, void* ctx)
{
myhtml_incoming_buffer_t *inc_buf = myhtml_tree_incoming_buffer_first(tree);
mycore_incoming_buffer_t *inc_buf = myhtml_tree_incoming_buffer_first(tree);
myhtml_position_t token_pos = myhtml_token_node_raw_pasition(token);
myhtml_position_t token_element_pos = myhtml_token_node_element_pasition(token);
@ -210,7 +212,7 @@ int main(int argc, const char * argv[])
myhtml_callback_before_token_done_set(tree, colorize_callback_before_token_done, NULL);
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, res.html, res.size);
myhtml_parse(tree, MyENCODING_UTF_8, res.html, res.size);
printf("\n");

View File

@ -23,6 +23,8 @@
#include <myhtml/myhtml.h>
#include "example.h"
struct res_html {
char *html;
size_t size;
@ -61,7 +63,7 @@ struct res_html load_html_file(const char* filename)
size_t nread = fread(html, 1, size, fh);
if (nread != size) {
fprintf(stderr, "could not read %ld bytes (%zu bytes done)\n", size, nread);
fprintf(stderr, "could not read %ld bytes (" MyCORE_FMT_Z " bytes done)\n", size, nread);
exit(EXIT_FAILURE);
}
@ -71,15 +73,15 @@ struct res_html load_html_file(const char* filename)
return res;
}
void colorize_print(myhtml_incoming_buffer_t *inc_buf, size_t begin, size_t length, const char* color)
void colorize_print(mycore_incoming_buffer_t *inc_buf, size_t begin, size_t length, const char* color)
{
if(length) {
inc_buf = myhtml_incoming_buffer_find_by_position(inc_buf, begin);
inc_buf = mycore_incoming_buffer_find_by_position(inc_buf, begin);
printf("%s%.*s\e[0m", color, (int)length, &inc_buf->data[(begin - inc_buf->offset)]);
}
}
size_t colorize_print_attributes(myhtml_tree_t* tree, myhtml_tree_attr_t* attr, myhtml_incoming_buffer_t *inc_buf, size_t last_pos)
size_t colorize_print_attributes(myhtml_tree_t* tree, myhtml_tree_attr_t* attr, mycore_incoming_buffer_t *inc_buf, size_t last_pos)
{
while(attr) {
if(attr->raw_key_length)
@ -125,7 +127,7 @@ size_t colorize_print_attributes(myhtml_tree_t* tree, myhtml_tree_attr_t* attr,
void * colorize_callback_before_token_done(myhtml_tree_t* tree, myhtml_token_node_t* token, void* ctx)
{
myhtml_incoming_buffer_t *inc_buf = tree->incoming_buf_first;
mycore_incoming_buffer_t *inc_buf = tree->incoming_buf_first;
size_t last_pos = token->raw_begin + token->raw_length;
@ -200,7 +202,7 @@ int main(int argc, const char * argv[])
myhtml_callback_before_token_done_set(tree, colorize_callback_before_token_done, NULL);
// parse html
myhtml_parse(tree, MyHTML_ENCODING_UTF_8, res.html, res.size);
myhtml_parse(tree, MyENCODING_UTF_8, res.html, res.size);
printf("\n");

View File

@ -0,0 +1,7 @@
myurl_dirs := .
myurl_objs := $(call BINARY_UTILS_OBJS,myurl,$(myurl_dirs))
myurl_all: $(myurl_objs)
myurl_clean:
rm -f $(myurl_objs)

51
examples/myurl/url_data.c Normal file
View File

@ -0,0 +1,51 @@
/*
Copyright (C) 2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Author: lex.borisov@gmail.com (Alexander Borisov)
*/
#include <string.h>
#include <myurl/url.h>
int main(int argc, const char * argv[])
{
const char* data_base = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAOCAYAAAAmL5yKAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAGlSURBVDhPnZDfS1NhGMfff8oLEUE0FBfqmrigi/DKrvKqiNDEKYjCUJdH3I/Q5WoLdYmlU1FP0LQoEclYOCcoMbJuDAUVA/v0vK8/QssL98AH3u97zud7Ho4ajr8i2P8sJ2JDcVSwf5BcR7sqEHpqQpF/60ro0e5Zwb1FiPyAoW14tAIVE5fjGDPKaUHYhOQhTO1DYu+Y/4mn/C0Io3oDAyasCYtHsPALRmUL5+R56j9AdwbsA4jJpnq0q6y+JyboO11ibUBt8jxpuV8VPgn6I5M7cpDRrhSETKiXf3BXuPP+X8Zlo3V5JyUs/4aZXaNIQQj12AqY0CBPL9KW+kIwbWF/b2MqW8d09iZzW27mf0aNo13lOynwpPZpTHpotstpfVOK9105oeUKnqeqiK06iWduMLbhIvG1Gvub2zjaVV09fhPqRgq5nyimYaaEptlrtCfL6Fu6TvhzJREpeZF28nLdxevNamazNcbRrvJ2WiY4/Hm4w/ncihRwO1pwVqjLWuxS2t+W0SVbWR8dDK5UGke7qsPrMyGX0a7y9fSaQy48eNjIH2VPyHZqSIx2AAAAAElFTkSuQmCC";
myurl_t *url = myurl_create();
if(url == NULL) {
printf("Can't create URL object\n");
return EXIT_FAILURE;
}
if(myurl_init(url)) {
printf("Can't init URL object\n");
return EXIT_FAILURE;
}
printf("Parse URL: %s\n\n", data_base);
myurl_entry_t *url_base = myurl_parse(url, data_base, strlen(data_base), NULL, NULL);
char *path = myurl_entry_path_as_string(url_base, NULL);
printf("Result data from URL: %s\n", path);
myurl_entry_free_string(url_base, path);
myurl_entry_destroy(url_base, true);
myurl_destroy(url, true);
return EXIT_SUCCESS;
}

View File

@ -0,0 +1,72 @@
/*
Copyright (C) 2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Author: lex.borisov@gmail.com (Alexander Borisov)
*/
#include <string.h>
#include <myurl/url.h>
int main(int argc, const char * argv[])
{
const char* data_base = "https://lastmac:12345@www.emaple.com:4433/programming/?id=777888999#somehash";
myurl_t *url = myurl_create();
if(url == NULL) {
printf("Can't create URL object\n");
return EXIT_FAILURE;
}
if(myurl_init(url)) {
printf("Can't init URL object\n");
return EXIT_FAILURE;
}
printf("Parse url \"%s\":\n", data_base);
myurl_entry_t *url_base = myurl_parse(url, data_base, strlen(data_base), NULL, NULL);
const char *scheme = myurl_entry_scheme_name(url_base, NULL);
char *authority = myurl_entry_authority_as_string(url_base, NULL);
const char *username = myurl_entry_username(url_base, NULL);
const char *password = myurl_entry_password(url_base, NULL);
char *host = myurl_entry_host_as_string(url_base, NULL);
char *path = myurl_entry_path_as_string(url_base, NULL);
const char *query = myurl_entry_query(url_base, NULL);
const char *fragment = myurl_entry_fragment(url_base, NULL);
printf("\tScheme: %s\n" , (scheme ? scheme : ""));
printf("\tScheme port: %u\n" , myurl_entry_scheme_port(url_base));
printf("\tAuthority (%s):\n" , authority);
printf("\t\tUsername: %s\n" , username);
printf("\t\tPassword: %s\n" , password);
printf("\tHost: %s\n" , host);
printf("\tPort is defined: %s\n", (myurl_entry_port_is_defined(url_base) ? "true" : "false"));
printf("\tPort: %u\n" , myurl_entry_port(url_base));
printf("\tPath: %s\n" , path);
printf("\tQuery: %s\n" , (query ? query : ""));
printf("\tFragment: %s\n" , (fragment ? fragment : ""));
myurl_entry_free_string(url_base, authority);
myurl_entry_free_string(url_base, host);
myurl_entry_free_string(url_base, path);
myurl_entry_destroy(url_base, true);
myurl_destroy(url, true);
return 0;
}

View File

@ -0,0 +1,56 @@
/*
Copyright (C) 2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Author: lex.borisov@gmail.com (Alexander Borisov)
*/
#include <string.h>
#include <myurl/url.h>
int main(int argc, const char * argv[])
{
const char* data_base = "https://www.reddit.com/r/programming/";
const char* data_relative = "../gaming/?count=25";
myurl_t *url = myurl_create();
if(url == NULL) {
printf("Can't create URL object\n");
return EXIT_FAILURE;
}
if(myurl_init(url)) {
printf("Can't init URL object\n");
return EXIT_FAILURE;
}
myurl_entry_t *url_base = myurl_parse(url, data_base, strlen(data_base), NULL, NULL);
myurl_entry_t *url_relative = myurl_parse(url, data_relative, strlen(data_relative), url_base, NULL);
char *result = myurl_entry_as_string(url_relative, NULL);
printf("Relative URL: %s\n", data_relative);
printf("Base URL: %s\n", data_base);
printf("Result URL: %s\n", result);
myurl_entry_free_string(url_base, result);
myurl_entry_destroy(url_base, true);
myurl_entry_destroy(url_relative, true);
myurl_destroy(url, true);
return EXIT_SUCCESS;
}

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -38,7 +38,7 @@ typedef myhtml_tree_node_t * (*modest_finder_selector_combinator_f)(modest_finde
/* init */
modest_finder_t * modest_finder_create(void);
modest_status_t modest_finder_init(modest_finder_t* finder);
mystatus_t modest_finder_init(modest_finder_t* finder);
void modest_finder_clean(modest_finder_t* finder);
modest_finder_t * modest_finder_destroy(modest_finder_t* finder, bool self_destroy);
@ -59,7 +59,7 @@ void modest_finder_specificity_inc(mycss_selectors_entry_t* selector, mycss_sele
/* base api */
modest_finder_t * modest_finder_by_stylesheet(mycss_stylesheet_t *stylesheet, myhtml_collection_t** collection, myhtml_tree_node_t* base_node);
modest_status_t modest_finder_by_selectors_list(modest_finder_t* finder, myhtml_tree_node_t* scope_node,
mystatus_t modest_finder_by_selectors_list(modest_finder_t* finder, myhtml_tree_node_t* scope_node,
mycss_selectors_list_t* selector_list, myhtml_collection_t** collection);
/* process */

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -29,8 +29,8 @@
#include <modest/finder/myosi.h>
#include <modest/finder/finder.h>
#include <myhtml/thread.h>
#include <myhtml/utils/mcobject_async.h>
#include <mycore/mythread.h>
#include <mycore/utils/mcobject_async.h>
#include <mycss/declaration/myosi.h>
@ -85,13 +85,16 @@ struct modest_finder_thread_found_context {
modest_finder_thread_t * modest_finder_thread_create(void);
modest_status_t modest_finder_thread_init(modest_finder_t* finder, modest_finder_thread_t* finder_thread, size_t thread_count);
mystatus_t modest_finder_thread_init(modest_finder_t* finder, modest_finder_thread_t* finder_thread, size_t thread_count);
void modest_finder_thread_clean(modest_finder_thread_t* finder_thread, bool self_destroy);
modest_finder_thread_t * modest_finder_thread_destroy(modest_finder_thread_t* finder_thread, bool self_destroy);
modest_status_t modest_finder_thread_process(modest_t* modest, modest_finder_thread_t* finder_thread, myhtml_tree_node_t* scope_node, mycss_selectors_list_t* selector_list);
mystatus_t modest_finder_thread_process(modest_t* modest, modest_finder_thread_t* finder_thread, myhtml_tree_node_t* scope_node, mycss_selectors_list_t* selector_list);
#ifndef MyCORE_BUILD_WITHOUT_THREADS
void modest_finder_thread_wait_for_all_done(modest_finder_thread_t* finder_thread);
#endif
bool modest_finder_thread_spec_is_up(modest_style_raw_specificity_t* spec_f, modest_style_raw_specificity_t* spec_t);
#ifdef __cplusplus

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -27,7 +27,7 @@
#include <modest/finder/pseudo_class.h>
#include <modest/finder/match.h>
#include <myhtml/tree.h>
#include <myhtml/utils.h>
#include <mycore/utils.h>
#include <mycss/selectors/value.h>
#ifdef __cplusplus

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -23,7 +23,7 @@
#pragma once
#include <modest/myosi.h>
#include <myhtml/utils/mcobject.h>
#include <mycore/utils/mcobject.h>
#ifdef __cplusplus
extern "C" {
@ -47,7 +47,7 @@ struct modest_layout {
};
modest_layout_t * modest_layers_create(void);
modest_status_t modest_layers_init(modest_layout_t* layout);
mystatus_t modest_layers_init(modest_layout_t* layout);
void modest_layers_clean_all(modest_layout_t* layout);
modest_layout_t * modest_layers_destroy(modest_layout_t* layout, bool self_destroy);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -24,10 +24,10 @@
#include <modest/myosi.h>
#include <modest/layer/layer.h>
#include <myhtml/utils/mcobject.h>
#include <myhtml/utils/mcobject_async.h>
#include <myhtml/utils/mchar_async.h>
#include <myhtml/utils/avl_tree.h>
#include <mycore/utils/mcobject.h>
#include <mycore/utils/mcobject_async.h>
#include <mycore/utils/mchar_async.h>
#include <mycore/utils/avl_tree.h>
#ifdef __cplusplus
extern "C" {
@ -47,7 +47,7 @@ struct modest {
modest_layout_t* layout;
myhtml_utils_avl_tree_t* style_avl_tree;
mycore_utils_avl_tree_t* style_avl_tree;
/* refs */
myhtml_tree_t* myhtml_tree;
@ -56,7 +56,7 @@ struct modest {
modest_t * modest_create(void);
modest_status_t modest_init(modest_t* modest);
mystatus_t modest_init(modest_t* modest);
void modest_clean(modest_t* modest);
modest_t * modest_destroy(modest_t* modest, bool self_destroy);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -22,9 +22,16 @@
#define MODEST_MYOSI_H
#pragma once
#include <mycore/myosi.h>
#include <myhtml/myhtml.h>
#include <mycss/mycss.h>
#define MODEST_VERSION_MAJOR 0
#define MODEST_VERSION_MINOR 0
#define MODEST_VERSION_PATCH 6
#define MODEST_VERSION_STRING MyCORE_STR(MODEST_VERSION_MAJOR) MyCORE_STR(.) MyCORE_STR(MODEST_VERSION_MINOR) MyCORE_STR(.) MyCORE_STR(MODEST_VERSION_PATCH)
#ifdef __cplusplus
extern "C" {
#endif
@ -36,12 +43,14 @@ extern "C" {
for myhtml 0..00ffff; MyHTML_STATUS_OK == 0x000000
for mycss and modules 010000..01ffff; MyCSS_STATUS_OK == 0x000000
for modest 020000..02ffff; MODEST_STATUS_OK == 0x000000
for myrender 030000..03ffff; MyRENDER_STATUS_OK == 0x000000
for myrender 030000..037777; MyRENDER_STATUS_OK == 0x000000
for myurl 038888..0388ff; MyURL_STATUS_OK == 0x000000
for myunicode 038900..038bff; MyUNICODE_STATUS_OK == 0x000000
not occupied 038c00..03ffff;
for mydom 040000..04ffff; MyDOM_STATUS_OK == 0x000000
for mynetwork 050000..05ffff; MyNETWORK_STATUS_OK == 0x000000
for myecma 060000..06ffff; MyECMA_STATUS_OK == 0x000000
for myfont 070000..07ffff; MyFONT_STATUS_OK == 0x000000
not occupied 080000..
not occupied 070000..
*/
enum modest_status {
MODEST_STATUS_OK = 0x000000,

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -26,7 +26,7 @@
#include <modest/modest.h>
#include <modest/style/raw.h>
#include <modest/render/tree_node.h>
#include <myhtml/utils/avl_tree.h>
#include <mycore/utils/avl_tree.h>
#ifdef __cplusplus
extern "C" {
@ -35,7 +35,7 @@ extern "C" {
struct modest_node {
modest_style_sheet_t* stylesheet;
#ifndef MODEST_NODE_FULL_RAW
myhtml_utils_avl_tree_node_t *avl_tree_node;
mycore_utils_avl_tree_node_t *avl_tree_node;
#else
modest_style_raw_declaration_t * raw_declaration[MyCSS_PROPERTY_TYPE_LAST_ENTRY];
#endif /* MODEST_NODE_FULL_RAW */
@ -44,7 +44,7 @@ struct modest_node {
};
modest_node_t * modest_node_create(modest_t* modest);
modest_status_t modest_node_init(modest_t* modest, modest_node_t *mnode);
mystatus_t modest_node_init(modest_t* modest, modest_node_t *mnode);
mycss_declaration_entry_t * modest_node_declaration_by_type(modest_t* modest, modest_node_t *mnode, mycss_property_type_t type);

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -34,13 +34,13 @@ extern "C" {
struct modest_node_serialization_context {
modest_t* modest;
mycss_callback_serialization_f callback;
mycore_callback_serialize_f callback;
void* context;
bool is_use;
}
typedef modest_node_serialization_context_t;
bool modest_node_raw_serialization(modest_t* modest, modest_node_t* mnode, mycss_callback_serialization_f callback, void* context);
bool modest_node_raw_serialization(modest_t* modest, modest_node_t* mnode, mycore_callback_serialize_f callback, void* context);
#ifdef __cplusplus
} /* extern "C" */

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -25,7 +25,7 @@
typedef struct modest_render_tree modest_render_tree_t;
#include <modest/modest.h>
#include <myhtml/utils/mcobject.h>
#include <mycore/utils/mcobject.h>
#include <modest/render/tree_node.h>
#ifdef __cplusplus
@ -37,12 +37,12 @@ struct modest_render_tree {
};
modest_render_tree_t * modest_render_tree_create(void);
modest_status_t modest_render_tree_init(modest_render_tree_t* render_tree);
mystatus_t modest_render_tree_init(modest_render_tree_t* render_tree);
void modest_render_tree_clean_all(modest_render_tree_t* render_tree);
modest_render_tree_t * modest_render_tree_destroy(modest_render_tree_t* render_tree, bool self_destroy);
void modest_render_tree_serialization(myhtml_tree_t* html_tree, modest_render_tree_t* tree,
modest_render_tree_node_t* scope_node, mycss_callback_serialization_f callback, void* context);
modest_render_tree_node_t* scope_node, mycore_callback_serialize_f callback, void* context);
#ifdef __cplusplus
} /* extern "C" */

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -28,7 +28,7 @@ typedef struct modest_render_tree_node modest_render_tree_node_t;
#include <modest/render/tree.h>
#include <myhtml/tree.h>
#include <myhtml/utils/mcobject.h>
#include <mycore/utils/mcobject.h>
#ifdef __cplusplus
extern "C" {
@ -62,7 +62,7 @@ void modest_render_tree_node_remove(modest_render_tree_node_t* node);
void modest_render_tree_node_append_after(modest_render_tree_node_t* target, modest_render_tree_node_t* node);
void modest_render_tree_node_append_before(modest_render_tree_node_t* target, modest_render_tree_node_t* node);
void modest_render_tree_node_serialization(myhtml_tree_t* html_tree, modest_render_tree_node_t* node, mycss_callback_serialization_f callback, void* context);
void modest_render_tree_node_serialization(myhtml_tree_t* html_tree, modest_render_tree_node_t* node, mycore_callback_serialize_f callback, void* context);
#ifdef __cplusplus
} /* extern "C" */

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -24,7 +24,7 @@
#include <modest/myosi.h>
#include <modest/modest.h>
#include <myhtml/utils/mcobject.h>
#include <mycore/utils/mcobject.h>
#ifdef __cplusplus
extern "C" {

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -53,7 +53,7 @@ struct modest_style_sheet {
};
modest_style_sheet_t * modest_style_sheet_create(modest_t* modest);
modest_status_t modest_style_sheet_init(modest_t* modest, modest_style_sheet_t* m_stylesheet);
mystatus_t modest_style_sheet_init(modest_t* modest, modest_style_sheet_t* m_stylesheet);
#ifdef __cplusplus
} /* extern "C" */

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -25,7 +25,7 @@
#include <modest/myosi.h>
#include <modest/modest.h>
#include <mycss/declaration/myosi.h>
#include <myhtml/utils/mchar_async.h>
#include <mycore/utils/mchar_async.h>
#ifdef __cplusplus
extern "C" {
@ -44,7 +44,7 @@ struct modest_style_type_display {
void * modest_style_type_create(modest_t* modest, size_t size);
modest_status_t modest_style_type_init(modest_t* modest, void *data);
mystatus_t modest_style_type_init(modest_t* modest, void *data);
#ifdef __cplusplus
} /* extern "C" */

View File

@ -1,5 +1,5 @@
/*
Copyright (C) 2016 Alexander Borisov
Copyright (C) 2016-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@ -18,51 +18,48 @@
Author: lex.borisov@gmail.com (Alexander Borisov)
*/
#ifndef MyHTML_INCOMING_H
#define MyHTML_INCOMING_H
#ifndef MyCORE_INCOMING_H
#define MyCORE_INCOMING_H
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include "myhtml/myosi.h"
#include "myhtml/tree.h"
#include "myhtml/utils/mcobject.h"
#include <mycore/myosi.h>
#include <mycore/utils/mcobject.h>
struct myhtml_incoming_buffer {
struct mycore_incoming_buffer {
const char* data;
size_t length; // use of data
size_t size; // size of data
size_t offset; // begin global offset
struct myhtml_incoming_buffer* prev;
struct myhtml_incoming_buffer* next;
struct mycore_incoming_buffer* prev;
struct mycore_incoming_buffer* next;
};
mycore_incoming_buffer_t * mycore_incoming_buffer_add(mycore_incoming_buffer_t *current, mcobject_t *mcobject, const char *html, size_t html_size);
void mycore_incoming_buffer_clean(mycore_incoming_buffer_t *current);
mycore_incoming_buffer_t * mycore_incoming_buffer_split(mycore_incoming_buffer_t *current, mcobject_t *mcobject, size_t global_pos);
// incoming buffer
myhtml_incoming_buffer_t * myhtml_incoming_buffer_add(myhtml_incoming_buffer_t *current, mcobject_t *mcobject, const char *html, size_t html_size);
void myhtml_incoming_buffer_clean(myhtml_incoming_buffer_t *current);
myhtml_incoming_buffer_t * myhtml_incoming_buffer_split(myhtml_incoming_buffer_t *current, mcobject_t *mcobject, size_t global_pos);
mycore_incoming_buffer_t * mycore_incoming_buffer_find_by_position(mycore_incoming_buffer_t *inc_buf, size_t begin);
myhtml_incoming_buffer_t * myhtml_incoming_buffer_find_by_position(myhtml_incoming_buffer_t *inc_buf, size_t begin);
const char * mycore_incoming_buffer_data(mycore_incoming_buffer_t *inc_buf);
size_t mycore_incoming_buffer_length(mycore_incoming_buffer_t *inc_buf);
size_t mycore_incoming_buffer_size(mycore_incoming_buffer_t *inc_buf);
size_t mycore_incoming_buffer_offset(mycore_incoming_buffer_t *inc_buf);
size_t mycore_incoming_buffer_relative_begin(mycore_incoming_buffer_t *inc_buf, size_t begin);
size_t mycore_incoming_buffer_available_length(mycore_incoming_buffer_t *inc_buf, size_t relative_begin, size_t length);
const char * myhtml_incoming_buffer_data(myhtml_incoming_buffer_t *inc_buf);
size_t myhtml_incoming_buffer_length(myhtml_incoming_buffer_t *inc_buf);
size_t myhtml_incoming_buffer_size(myhtml_incoming_buffer_t *inc_buf);
size_t myhtml_incoming_buffer_offset(myhtml_incoming_buffer_t *inc_buf);
size_t myhtml_incoming_buffer_relative_begin(myhtml_incoming_buffer_t *inc_buf, size_t begin);
size_t myhtml_incoming_buffer_available_length(myhtml_incoming_buffer_t *inc_buf, size_t relative_begin, size_t length);
mycore_incoming_buffer_t * mycore_incoming_buffer_next(mycore_incoming_buffer_t *inc_buf);
mycore_incoming_buffer_t * mycore_incoming_buffer_prev(mycore_incoming_buffer_t *inc_buf);
myhtml_incoming_buffer_t * myhtml_incoming_buffer_next(myhtml_incoming_buffer_t *inc_buf);
myhtml_incoming_buffer_t * myhtml_incoming_buffer_prev(myhtml_incoming_buffer_t *inc_buf);
size_t myhtml_incoming_buffer_convert_one_escaped_to_code_point(myhtml_incoming_buffer_t **inc_buf, size_t *relative_pos);
size_t myhtml_incoming_buffer_escaped_case_cmp(myhtml_incoming_buffer_t **inc_buf, const char *to, size_t to_size, size_t *relative_pos);
size_t mycore_incoming_buffer_convert_one_escaped_to_code_point(mycore_incoming_buffer_t **inc_buf, size_t *relative_pos);
size_t mycore_incoming_buffer_escaped_case_cmp(mycore_incoming_buffer_t **inc_buf, const char *to, size_t to_size, size_t *relative_pos);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MyHTML_INCOMING_H */
#endif /* MyCORE_INCOMING_H */

169
include/mycore/myosi.h Normal file
View File

@ -0,0 +1,169 @@
/*
Copyright (C) 2015-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Author: lex.borisov@gmail.com (Alexander Borisov)
*/
#ifndef MyCORE_MYOSI_H
#define MyCORE_MYOSI_H
#pragma once
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
#include <stdint.h>
#include <inttypes.h>
#define MyCORE_STR_HELPER(x) #x
#define MyCORE_STR(x) MyCORE_STR_HELPER(x)
#define MyCORE_VERSION_MAJOR 0
#define MyCORE_VERSION_MINOR 1
#define MyCORE_VERSION_PATCH 0
#define MyCORE_VERSION_STRING MyCORE_STR(MyCORE_VERSION_MAJOR) MyCORE_STR(.) MyCORE_STR(MyCORE_VERSION_MINOR) MyCORE_STR(.) MyCORE_STR(MyCORE_VERSION_PATCH)
#ifdef __cplusplus
extern "C" {
#endif
/* Format */
#ifdef MyCORE_OS_WINDOWS_NT
#define MyCORE_FORMAT_Z "%Iu"
#else
#define MyCORE_FORMAT_Z "%zu"
#endif
#if defined(_MSC_VER)
# define MyCORE_DEPRECATED(func) __declspec(deprecated) func
#elif defined(__GNUC__) || defined(__INTEL_COMPILER)
# define MyCORE_DEPRECATED(func) func __attribute__((deprecated))
#else
# define MyCORE_DEPRECATED(func) func
#endif
/* Debug */
#define MyCORE_DEBUG(...) do {} while(0)
#define MyCORE_DEBUG_ERROR(...) do {} while(0)
#define MyCORE_FAILED(_status_) ((_status_) != MyCORE_STATUS_OK)
// base
/*
Very important!!!
for mycore 0..008fff; MyCORE_STATUS_OK == 0x000000
for myhtml 009000..0093ff; MyHTML_STATUS_OK == 0x000000
for myencoding 009400..00942f; MyENCODING_STATUS_OK == 0x000000
not occupied 009430..00ffff;
for mycss and modules 010000..01ffff; MyCSS_STATUS_OK == 0x000000
for modest 020000..02ffff; MODEST_STATUS_OK == 0x000000
for myrender 030000..037777; MyRENDER_STATUS_OK == 0x000000
for myurl 038888..0388ff; MyURL_STATUS_OK == 0x000000
for myunicode 038900..038bff; MyUNICODE_STATUS_OK == 0x000000
not occupied 038c00..03ffff;
for mydom 040000..04ffff; MyDOM_STATUS_OK == 0x000000
for mynetwork 050000..05ffff; MyNETWORK_STATUS_OK == 0x000000
for myecma 060000..06ffff; MyECMA_STATUS_OK == 0x000000
not occupied 070000..
*/
enum mycore_status {
MyCORE_STATUS_OK = 0x0000,
MyCORE_STATUS_ERROR = 0x0001,
MyCORE_STATUS_ERROR_MEMORY_ALLOCATION = 0x0002,
MyCORE_STATUS_THREAD_ERROR_MEMORY_ALLOCATION = 0x0009,
MyCORE_STATUS_THREAD_ERROR_LIST_INIT = 0x000a,
MyCORE_STATUS_THREAD_ERROR_ATTR_MALLOC = 0x000b,
MyCORE_STATUS_THREAD_ERROR_ATTR_INIT = 0x000c,
MyCORE_STATUS_THREAD_ERROR_ATTR_SET = 0x000d,
MyCORE_STATUS_THREAD_ERROR_ATTR_DESTROY = 0x000e,
MyCORE_STATUS_THREAD_ERROR_NO_SLOTS = 0x000f,
MyCORE_STATUS_THREAD_ERROR_BATCH_INIT = 0x0010,
MyCORE_STATUS_THREAD_ERROR_WORKER_MALLOC = 0x0011,
MyCORE_STATUS_THREAD_ERROR_WORKER_SEM_CREATE = 0x0012,
MyCORE_STATUS_THREAD_ERROR_WORKER_THREAD_CREATE = 0x0013,
MyCORE_STATUS_THREAD_ERROR_MASTER_THREAD_CREATE = 0x0014,
MyCORE_STATUS_THREAD_ERROR_SEM_PREFIX_MALLOC = 0x0032,
MyCORE_STATUS_THREAD_ERROR_SEM_CREATE = 0x0033,
MyCORE_STATUS_THREAD_ERROR_QUEUE_MALLOC = 0x003c,
MyCORE_STATUS_THREAD_ERROR_QUEUE_NODES_MALLOC = 0x003d,
MyCORE_STATUS_THREAD_ERROR_QUEUE_NODE_MALLOC = 0x003e,
MyCORE_STATUS_THREAD_ERROR_MUTEX_MALLOC = 0x0046,
MyCORE_STATUS_THREAD_ERROR_MUTEX_INIT = 0x0047,
MyCORE_STATUS_THREAD_ERROR_MUTEX_LOCK = 0x0048,
MyCORE_STATUS_THREAD_ERROR_MUTEX_UNLOCK = 0x0049,
MyCORE_STATUS_PERF_ERROR_COMPILED_WITHOUT_PERF = 0x0050,
MyCORE_STATUS_PERF_ERROR_FIND_CPU_CLOCK = 0x0051,
MyCORE_STATUS_MCOBJECT_ERROR_CACHE_CREATE = 0x0055,
MyCORE_STATUS_MCOBJECT_ERROR_CHUNK_CREATE = 0x0056,
MyCORE_STATUS_MCOBJECT_ERROR_CHUNK_INIT = 0x0057,
MyCORE_STATUS_MCOBJECT_ERROR_CACHE_REALLOC = 0x0058,
MyCORE_STATUS_ASYNC_ERROR_LOCK = 0x0060,
MyCORE_STATUS_ASYNC_ERROR_UNLOCK = 0x0061,
MyCORE_STATUS_ERROR_NO_FREE_SLOT = 0x0062,
}
typedef mycore_status_t;
typedef unsigned int mystatus_t;
/* thread */
typedef struct mythread_queue_list_entry mythread_queue_list_entry_t;
typedef struct mythread_queue_thread_param mythread_queue_thread_param_t;
typedef struct mythread_queue_list mythread_queue_list_t;
typedef struct mythread_queue_node mythread_queue_node_t;
typedef struct mythread_queue mythread_queue_t;
typedef size_t mythread_id_t;
typedef struct mythread_context mythread_context_t;
typedef struct mythread_entry mythread_entry_t;
typedef struct mythread mythread_t;
/* mystring */
typedef struct mycore_string_raw mycore_string_raw_t;
typedef struct mycore_string mycore_string_t;
/* incoming buffer */
typedef struct mycore_incoming_buffer mycore_incoming_buffer_t;
/* callbacks */
typedef mystatus_t (*mycore_callback_serialize_f)(const char* buffer, size_t size, void* ctx);
void * mycore_malloc(size_t size);
void * mycore_realloc(void* dst, size_t size);
void * mycore_calloc(size_t num, size_t size);
void * mycore_free(void* dst);
/* io */
FILE * mycore_fopen(const char *filename, const char *mode);
int mycore_fclose(FILE *stream);
size_t mycore_fread(void *buffer, size_t size, size_t count, FILE *stream);
size_t mycore_fwrite(const void *buffer, size_t size, size_t count, FILE *stream);
int mycore_fflush(FILE *stream);
int mycore_fseek(FILE* stream, long offset, int origin);
long mycore_ftell(FILE* stream);
int mycore_ferror(FILE *stream);
void mycore_setbuf(FILE *stream, char *buffer);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* MyCORE_MYOSI_H */

125
include/mycore/mystring.h Normal file
View File

@ -0,0 +1,125 @@
/*
Copyright (C) 2015-2017 Alexander Borisov
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Author: lex.borisov@gmail.com (Alexander Borisov)
*/
#ifndef MyCORE_MYSTRING_H
#define MyCORE_MYSTRING_H
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <mycore/myosi.h>
#include <mycore/utils/mchar_async.h>
#include <mycore/utils.h>
#define mycore_string_get(str, attr) str->attr
#define mycore_string_set(str, attr) mycore_string_get(str, attr)
#define mycore_string_len(str) mycore_string_get(str, length)
#define MyCORE_STRING_PREPROCESSOR_CHECK_BUFFER_SIZE(str, unsigned_data) \
if(str->length >= str->size) { \
mycore_string_realloc(str, (str->length + 5)); \
\
unsigned_data = (unsigned char*)str->data; \
}
#define MyCORE_STRING_REALLOC_IF_NEED(str, need_length, upto) \
if((str->length + need_length) >= str->size) { \
mycore_string_realloc(str, (str->length + need_length + upto)); \
} \
#define MyCORE_STRING_APPEND_BYTE_WITHOUT_REALLOC(onechar, str) \
str->data[str->length] = onechar; \
str->length++
#define MyCORE_STRING_APPEND_BYTE_WITHOUT_INCREMENT(onechar, str, upto) \
if(str->length >= str->size) { \
mycore_string_realloc(str, (str->length + upto)); \
} \
str->data[str->length] = onechar
#define MyCORE_STRING_APPEND_BYTE_WITHOUT_INCREMENT_REALLOC(onechar, str) \
str->data[str->length] = onechar
#define MyCORE_STRING_APPEND_BYTE(onechar, str, upto) \
MyCORE_STRING_APPEND_BYTE_WITHOUT_INCREMENT(onechar, str, upto); \
str->length++
struct mycore_string {
char* data;
size_t size;
size_t length;
mchar_async_t *mchar;
size_t node_idx;
};
struct mycore_string_raw {
char* data;
size_t size;
size_t length;
};
typedef size_t mycore_string_index_t;
char * mycore_string_init(mchar_async_t *mchar, size_t node_idx, mycore_string_t* str, size_t size);
char * mycore_string_realloc(mycore_string_t *str, size_t new_size);
void mycore_string_clean(mycore_string_t* str);
void mycore_string_clean_all(mycore_string_t* str);
mycore_string_t * mycore_string_destroy(mycore_string_t* str, bool destroy_obj);
void mycore_string_raw_clean(mycore_string_raw_t* str_raw);
void mycore_string_raw_clean_all(mycore_string_raw_t* str_raw);
mycore_string_raw_t * mycore_string_raw_destroy(mycore_string_raw_t* str_raw, bool destroy_obj);
/* basic api */
char * mycore_string_data_alloc(mchar_async_t *mchar, size_t node_id, size_t size);
char * mycore_string_data_realloc(mchar_async_t *mchar, size_t node_id, char *data, size_t len_to_copy, size_t size);
void mycore_string_data_free(mchar_async_t *mchar, size_t node_id, char *data);
char * mycore_string_data(mycore_string_t *str);
size_t mycore_string_length(mycore_string_t *str);
size_t mycore_string_size(mycore_string_t *str);
char * mycore_string_data_set(mycore_string_t *str, char *data);
size_t mycore_string_size_set(mycore_string_t *str, size_t size);
size_t mycore_string_length_set(mycore_string_t *str, size_t length);
/* append */
void mycore_string_append(mycore_string_t* str, const char* data, size_t length);
void mycore_string_append_one(mycore_string_t* str, const char data);
void mycore_string_append_lowercase(mycore_string_t* str, const char* data, size_t length);
void mycore_string_append_with_replacement_null_characters(mycore_string_t* str, const char* buff, size_t length);
size_t mycore_string_raw_set_replacement_character(mycore_string_t* target, size_t position);
/* other functions */
void mycore_string_copy(mycore_string_t* dest, mycore_string_t* target);
size_t mycore_string_raw_copy(char* str1, const char* str2, size_t size);
void mycore_string_stay_only_whitespace(mycore_string_t* target);
size_t mycore_string_crop_whitespace_from_begin(mycore_string_t* target);
size_t mycore_string_whitespace_from_begin(mycore_string_t* target);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* mycore_mystring_h */

Some files were not shown because too many files have changed in this diff Show More