mirror of https://gitee.com/openkylin/glib2.0.git
Merge tag 'upstream/2.74.5' into packaging/openkylin/yangtze
Upstream version 2.74.5
This commit is contained in:
commit
eba307fadf
|
@ -0,0 +1,17 @@
|
|||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
|
||||
[*.[ch]]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
# For the legacy tabs which still exist in the code:
|
||||
tab_width = 8
|
||||
|
||||
[meson.build]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
# for all subdirectories
|
||||
TAGS
|
||||
tags
|
||||
.libs
|
||||
.deps
|
||||
*.o
|
||||
*.lo
|
||||
*.la
|
||||
*.pc
|
||||
.*.swp
|
||||
.sw?
|
||||
*.rc
|
||||
*.gcno
|
||||
*.gcda
|
||||
*.gcov
|
||||
*.sourcefiles
|
||||
*.stp
|
||||
*.exe
|
||||
*.def
|
||||
*.test
|
||||
*.log
|
||||
*.trs
|
||||
|
||||
/glib-lcov.info
|
||||
/glib-lcov/
|
||||
|
||||
# Meson
|
||||
/meson-build/
|
||||
/subprojects/*/
|
|
@ -0,0 +1,586 @@
|
|||
stages:
|
||||
- style-check
|
||||
- build
|
||||
- coverage
|
||||
- analysis
|
||||
- deploy
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- _ccache/
|
||||
|
||||
variables:
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/glib/fedora:v19"
|
||||
COVERITY_IMAGE: "registry.gitlab.gnome.org/gnome/glib/coverity:v7"
|
||||
DEBIAN_IMAGE: "registry.gitlab.gnome.org/gnome/glib/debian-stable:v13"
|
||||
MINGW_IMAGE: "registry.gitlab.gnome.org/gnome/glib/mingw:v9"
|
||||
MESON_TEST_TIMEOUT_MULTIPLIER: 2
|
||||
G_MESSAGES_DEBUG: all
|
||||
MESON_COMMON_OPTIONS: "--buildtype debug --wrap-mode=nodownload --fatal-meson-warnings"
|
||||
|
||||
.only-default:
|
||||
only:
|
||||
- branches
|
||||
except:
|
||||
- tags
|
||||
|
||||
# Some jobs run on CI runners which don’t have good isolation between CI jobs,
|
||||
# and don’t have much available resource. Limit those jobs to only ones on the
|
||||
# origin repository (GNOME/glib), rather than people’s forks. Code in the origin
|
||||
# repository can be trusted.
|
||||
.only-origin:
|
||||
only:
|
||||
- branches@GNOME/glib
|
||||
except:
|
||||
- tags
|
||||
|
||||
# Some jobs take a long time and are unlikely to find failures (or will find
|
||||
# failures which are not merge-blockers to fix), so they’re executed on a weekly
|
||||
# schedule in order to save CI resources and speed up branch pipelines.
|
||||
.only-schedules:
|
||||
only:
|
||||
- schedules
|
||||
except:
|
||||
- tags
|
||||
|
||||
.build-linux:
|
||||
before_script:
|
||||
- bash .gitlab-ci/show-execution-environment.sh
|
||||
- cp -r $HOME/subprojects/* subprojects/
|
||||
|
||||
style-check-diff:
|
||||
extends: .only-default
|
||||
image: $DEBIAN_IMAGE
|
||||
stage: style-check
|
||||
allow_failure: true
|
||||
script:
|
||||
- .gitlab-ci/run-style-check-diff.sh
|
||||
- .gitlab-ci/run-shellcheck.sh
|
||||
- .gitlab-ci/run-black.sh
|
||||
- .gitlab-ci/run-flake8.sh
|
||||
- .gitlab-ci/run-check-todos.sh
|
||||
|
||||
fedora-x86_64:
|
||||
extends:
|
||||
- .build-linux
|
||||
- .only-default
|
||||
image: $FEDORA_IMAGE
|
||||
stage: build
|
||||
needs: []
|
||||
variables:
|
||||
CFLAGS: "-coverage -ftest-coverage -fprofile-arcs"
|
||||
script:
|
||||
- meson ${MESON_COMMON_OPTIONS}
|
||||
--werror
|
||||
--default-library=both
|
||||
--prefix=$HOME/glib-installed
|
||||
--localstatedir=/var
|
||||
--libdir=lib
|
||||
-Dsystemtap=true
|
||||
-Ddtrace=true
|
||||
-Dinstalled_tests=true
|
||||
-Dgtk_doc=true
|
||||
_build
|
||||
- ninja -C _build
|
||||
- mkdir -p _coverage
|
||||
- lcov --config-file .lcovrc --directory _build --capture --initial --output-file "_coverage/${CI_JOB_NAME}-baseline.lcov"
|
||||
- .gitlab-ci/run-tests.sh
|
||||
- lcov --config-file .lcovrc --directory _build --capture --output-file "_coverage/${CI_JOB_NAME}.lcov"
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog.junit.xml"
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "_build/docs/reference/"
|
||||
- "_build/config.h"
|
||||
- "_build/glib/glibconfig.h"
|
||||
- "_build/meson-logs"
|
||||
- "_build/docs/reference/glib/glib-undeclared.txt"
|
||||
- "_build/docs/reference/glib/glib-undocumented.txt"
|
||||
- "_build/docs/reference/glib/glib-unused.txt"
|
||||
- "_build/docs/reference/gobject/gobject-undeclared.txt"
|
||||
- "_build/docs/reference/gobject/gobject-undocumented.txt"
|
||||
- "_build/docs/reference/gobject/gobject-unused.txt"
|
||||
- "_build/docs/reference/gio/gio-undeclared.txt"
|
||||
- "_build/docs/reference/gio/gio-undocumented.txt"
|
||||
- "_build/docs/reference/gio/gio-unused.txt"
|
||||
- "_coverage"
|
||||
|
||||
debian-stable-x86_64:
|
||||
extends:
|
||||
- .build-linux
|
||||
- .only-default
|
||||
image: $DEBIAN_IMAGE
|
||||
stage: build
|
||||
needs: []
|
||||
script:
|
||||
- meson ${MESON_COMMON_OPTIONS}
|
||||
--werror
|
||||
--default-library=both
|
||||
--prefix=$HOME/glib-installed
|
||||
--localstatedir=/var
|
||||
--libdir=lib
|
||||
-Dsystemtap=true
|
||||
-Ddtrace=true
|
||||
-Dinstalled_tests=true
|
||||
_build
|
||||
- ninja -C _build
|
||||
- .gitlab-ci/run-tests.sh
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog.junit.xml"
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "_build/config.h"
|
||||
- "_build/glib/glibconfig.h"
|
||||
- "_build/meson-logs"
|
||||
|
||||
installed-tests:
|
||||
extends:
|
||||
- .build-linux
|
||||
- .only-schedules
|
||||
image: $FEDORA_IMAGE
|
||||
stage: build
|
||||
needs: []
|
||||
script:
|
||||
# dtrace is disabled because it breaks the static-link.py test
|
||||
- meson ${MESON_COMMON_OPTIONS}
|
||||
--werror
|
||||
--prefix=/usr --libdir=/usr/lib64
|
||||
-Dinstalled_tests=true
|
||||
-Ddefault_library=both
|
||||
-Ddtrace=false
|
||||
_build
|
||||
- ninja -C _build
|
||||
- sudo ninja -C _build install
|
||||
# Remove old headers, possibly present in current installation
|
||||
- sudo rm -f /usr/include/glib-2.0/glib/gurifuncs.h
|
||||
- sudo chown -R `id -un`:`id -gn` _build/
|
||||
# Work-around https://gitlab.gnome.org/GNOME/gnome-desktop-testing/merge_requests/2
|
||||
- mkdir -p _build/installed-tests-report/logs/
|
||||
- GLIB_TEST_COMPILATION=1 gnome-desktop-testing-runner
|
||||
--report-directory=_build/installed-tests-report/failed/
|
||||
--log-directory=_build/installed-tests-report/logs/
|
||||
--parallel=0
|
||||
glib
|
||||
artifacts:
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "_build/config.h"
|
||||
- "_build/glib/glibconfig.h"
|
||||
- "_build/meson-logs"
|
||||
- "_build/installed-tests-report/"
|
||||
|
||||
G_DISABLE_ASSERT:
|
||||
extends:
|
||||
- .build-linux
|
||||
- .only-schedules
|
||||
image: $FEDORA_IMAGE
|
||||
stage: build
|
||||
needs: []
|
||||
script:
|
||||
- meson ${MESON_COMMON_OPTIONS}
|
||||
--werror
|
||||
-Dsystemtap=true
|
||||
-Ddtrace=true
|
||||
-Dinstalled_tests=true
|
||||
-Dglib_assert=false
|
||||
_build
|
||||
- ninja -C _build
|
||||
- bash -x ./.gitlab-ci/run-tests.sh
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog.junit.xml"
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "_build/config.h"
|
||||
- "_build/glib/glibconfig.h"
|
||||
- "_build/meson-logs"
|
||||
|
||||
valgrind:
|
||||
extends:
|
||||
- .build-linux
|
||||
- .only-schedules
|
||||
image: $FEDORA_IMAGE
|
||||
stage: analysis
|
||||
needs: []
|
||||
variables:
|
||||
MESON_TEST_TIMEOUT_MULTIPLIER: 15
|
||||
script:
|
||||
- meson ${MESON_COMMON_OPTIONS}
|
||||
--werror
|
||||
-Dsystemtap=true
|
||||
-Ddtrace=true
|
||||
-Dinstalled_tests=true
|
||||
_build
|
||||
- ninja -C _build
|
||||
# Valgrind doesn’t work when the soft FD limit is set too high
|
||||
# See https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2710
|
||||
- ulimit -Sn 1024
|
||||
- bash -x ./.gitlab-ci/run-tests.sh
|
||||
--setup valgrind
|
||||
--no-suite slow
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog-valgrind.junit.xml"
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "_build/config.h"
|
||||
- "_build/glib/glibconfig.h"
|
||||
- "_build/meson-logs"
|
||||
|
||||
.cross-build-linux:
|
||||
extends: .build-linux
|
||||
stage: build
|
||||
needs: []
|
||||
artifacts:
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "_build/meson-logs"
|
||||
|
||||
cross-android_arm64:
|
||||
extends:
|
||||
- .cross-build-linux
|
||||
- .only-default
|
||||
image: $FEDORA_IMAGE
|
||||
script:
|
||||
# FIXME: add --werror
|
||||
- meson ${MESON_COMMON_OPTIONS} --cross-file=.gitlab-ci/cross_file_android_arm64_31.txt _build
|
||||
- ninja -C _build
|
||||
|
||||
cross-mingw64:
|
||||
extends:
|
||||
- .cross-build-linux
|
||||
- .only-default
|
||||
image: $MINGW_IMAGE
|
||||
script:
|
||||
# FIXME: Add --werror
|
||||
- meson ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_mingw64.txt _build
|
||||
- ninja -C _build
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog.junit.xml"
|
||||
name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- _build/meson-logs
|
||||
- _build/glib/libglib-2.0-0.dll
|
||||
- _build/gio/libgio-2.0-0.dll
|
||||
- _build/gmodule/libgmodule-2.0-0.dll
|
||||
- _build/gthread/libgthread-2.0-0.dll
|
||||
- _build/gobject/libgobject-2.0-0.dll
|
||||
|
||||
msys2-mingw32:
|
||||
extends: .only-default
|
||||
stage: build
|
||||
tags:
|
||||
- win32-ps
|
||||
needs: []
|
||||
variables:
|
||||
MSYSTEM: "MINGW32"
|
||||
CHERE_INVOKING: "yes"
|
||||
script:
|
||||
- C:\msys64\usr\bin\pacman --noconfirm -Syyuu --ask 20
|
||||
- C:\msys64\usr\bin\bash .gitlab-ci/show-execution-environment.sh
|
||||
- C:\msys64\usr\bin\bash -lc "bash -x ./.gitlab-ci/test-msys2.sh"
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog.junit.xml"
|
||||
name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- _build/meson-logs
|
||||
- _coverage/
|
||||
|
||||
vs2017-x64:
|
||||
extends: .only-default
|
||||
stage: build
|
||||
tags:
|
||||
- win32-ps
|
||||
needs: []
|
||||
script:
|
||||
# FIXME: These should use --wrap-mode=nodownload but the Windows CI machines
|
||||
# aren’t currently set up for that.
|
||||
- .gitlab-ci/test-msvc.bat ${MESON_COMMON_OPTIONS}
|
||||
--wrap-mode=default
|
||||
--python.platlibdir=C:\Python37\site-packages
|
||||
--python.purelibdir=C:\Python37\site-packages
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog.junit.xml"
|
||||
name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- _build/meson-logs
|
||||
- _build/glib/libglib-2.0-0.dll
|
||||
- _build/gio/libgio-2.0-0.dll
|
||||
- _build/gmodule/libgmodule-2.0-0.dll
|
||||
- _build/gthread/libgthread-2.0-0.dll
|
||||
- _build/gobject/libgobject-2.0-0.dll
|
||||
|
||||
vs2017-x64-static:
|
||||
extends: .only-default
|
||||
stage: build
|
||||
tags:
|
||||
- win32-ps
|
||||
needs: []
|
||||
script:
|
||||
# FIXME: These should use --wrap-mode=nodownload but the Windows CI machines
|
||||
# aren’t currently set up for that.
|
||||
- .gitlab-ci/test-msvc.bat ${MESON_COMMON_OPTIONS}
|
||||
--wrap-mode=default
|
||||
--default-library=static
|
||||
--python.platlibdir=C:\Python37\site-packages
|
||||
--python.purelibdir=C:\Python37\site-packages
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog.junit.xml"
|
||||
name: "glib-${env:CI_JOB_NAME}-${env:CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- _build/meson-logs
|
||||
|
||||
freebsd-12-x86_64:
|
||||
# The FreeBSD 13 build is run on each commit, so the FreeBSD 12 build can be
|
||||
# run less regularly to save CI resources. The chance of a regression on
|
||||
# FreeBSD 12 and not FreeBSD 13 is tiny.
|
||||
extends: .only-schedules
|
||||
stage: build
|
||||
tags:
|
||||
# To run a FreeBSD builder, install gitlab-runner package and start both
|
||||
# gitlab-runner and dbus service because we need /var/lib/dbus/machine-id.
|
||||
# To compile GLib, you still have to install the following packages:
|
||||
# desktop-file-utils gettext libiconv meson pkgconf python3 shared-mime-info
|
||||
- freebsd-12
|
||||
needs: []
|
||||
variables:
|
||||
# CPPFLAGS is required because libintl doesn't use pkg-config.
|
||||
CPPFLAGS: -I/usr/local/include
|
||||
# FIXME: Workaround meson inability to set LD_LIBRARY_PATH.
|
||||
# https://github.com/mesonbuild/meson/issues/1383
|
||||
# https://github.com/mesonbuild/meson/issues/1635
|
||||
# https://github.com/mesonbuild/meson/issues/2881
|
||||
LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags
|
||||
# FreeBSD supports C.UTF-8 locale since 12.1.
|
||||
LANG: C.UTF-8
|
||||
before_script:
|
||||
- bash .gitlab-ci/show-execution-environment.sh
|
||||
script:
|
||||
# We cannot use -Wl,--no-undefined because GLib uses 'environ' variable.
|
||||
# FreeBSD supports xattr, but its API is different from Linux xattr.
|
||||
# FIXME: extattr(2) support: https://gitlab.gnome.org/GNOME/glib/issues/1404
|
||||
# localstatedir is needed for access to /var/lib/dbus/machine-id
|
||||
- meson ${MESON_COMMON_OPTIONS} --localstatedir=/var -Db_lundef=false -Dxattr=false _build
|
||||
- ninja -C _build
|
||||
- bash -x ./.gitlab-ci/run-tests.sh
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog.junit.xml"
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "_build/config.h"
|
||||
- "_build/glib/glibconfig.h"
|
||||
- "_build/meson-logs"
|
||||
|
||||
freebsd-13-x86_64:
|
||||
extends: .only-origin
|
||||
stage: build
|
||||
tags:
|
||||
- freebsd-13
|
||||
needs: []
|
||||
variables:
|
||||
CPPFLAGS: -I/usr/local/include
|
||||
LDFLAGS: -L/usr/local/lib -Wl,--disable-new-dtags
|
||||
LANG: C.UTF-8
|
||||
before_script:
|
||||
- bash .gitlab-ci/show-execution-environment.sh
|
||||
script:
|
||||
- meson ${MESON_COMMON_OPTIONS} --localstatedir=/var -Db_lundef=false -Dxattr=false _build
|
||||
- ninja -C _build
|
||||
- bash -x ./.gitlab-ci/run-tests.sh
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog.junit.xml"
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "_build/config.h"
|
||||
- "_build/glib/glibconfig.h"
|
||||
- "_build/meson-logs"
|
||||
|
||||
macos:
|
||||
extends: .only-origin
|
||||
stage: build
|
||||
tags:
|
||||
- macos
|
||||
needs: []
|
||||
variables:
|
||||
GIT_SUBMODULE_STRATEGY: normal
|
||||
# libpcre2 gets built as a subproject, but the default Clang options on
|
||||
# macOS limit string lengths to 4095B — pcre2_error.c has a string of length
|
||||
# 4380B
|
||||
CFLAGS: '-Wno-overlength-strings'
|
||||
before_script:
|
||||
- bash .gitlab-ci/show-execution-environment.sh
|
||||
- pip3 install --user meson==0.60.1
|
||||
- pip3 install --user ninja
|
||||
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
|
||||
script:
|
||||
# FIXME: Use --wrap-mode=default so we download dependencies each time,
|
||||
# until the macOS runner is a VM where we can use a pre-made image which
|
||||
# already contains the dependencies. See:
|
||||
# - https://gitlab.gnome.org/GNOME/glib/merge_requests/388
|
||||
# - https://gitlab.gnome.org/Infrastructure/Infrastructure/issues/225
|
||||
- meson ${MESON_COMMON_OPTIONS}
|
||||
--wrap-mode=default
|
||||
--werror
|
||||
_build
|
||||
- ninja -C _build
|
||||
- .gitlab-ci/run-tests.sh
|
||||
artifacts:
|
||||
reports:
|
||||
junit: "_build/meson-logs/testlog.junit.xml"
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "_build/config.h"
|
||||
- "_build/glib/glibconfig.h"
|
||||
- "_build/meson-logs"
|
||||
|
||||
coverage:
|
||||
extends: .only-default
|
||||
image: $FEDORA_IMAGE
|
||||
stage: coverage
|
||||
needs: ['fedora-x86_64', 'msys2-mingw32']
|
||||
artifacts:
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
expire_in: 1 week
|
||||
expose_as: 'Coverage Report'
|
||||
paths:
|
||||
- _coverage/coverage/index.html
|
||||
- _coverage
|
||||
reports:
|
||||
coverage_report:
|
||||
coverage_format: cobertura
|
||||
path: _coverage/*-cobertura/cobertura-*.xml
|
||||
before_script:
|
||||
- bash .gitlab-ci/show-execution-environment.sh
|
||||
script:
|
||||
- bash -x ./.gitlab-ci/coverage-docker.sh
|
||||
coverage: '/^\s+lines\.+:\s+([\d.]+\%)\s+/'
|
||||
|
||||
scan-build:
|
||||
extends:
|
||||
- .build-linux
|
||||
- .only-schedules
|
||||
image: $FEDORA_IMAGE
|
||||
stage: analysis
|
||||
needs: []
|
||||
script:
|
||||
- meson ${MESON_COMMON_OPTIONS}
|
||||
--werror
|
||||
--default-library=both
|
||||
--prefix=$HOME/glib-installed
|
||||
--localstatedir=/var
|
||||
--libdir=lib
|
||||
-Dsystemtap=true
|
||||
-Ddtrace=true
|
||||
-Dinstalled_tests=true
|
||||
_scan_build
|
||||
- ninja -C _scan_build scan-build
|
||||
artifacts:
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "_scan_build/meson-logs/scanbuild"
|
||||
|
||||
coverity:
|
||||
extends:
|
||||
- .build-linux
|
||||
- .only-schedules
|
||||
image: $COVERITY_IMAGE
|
||||
stage: analysis
|
||||
needs: []
|
||||
variables:
|
||||
# cov-build doesn’t like GLIB_DEPRECATED_ENUMERATOR
|
||||
CFLAGS: '-DGLIB_DISABLE_DEPRECATION_WARNINGS'
|
||||
script:
|
||||
- meson ${MESON_COMMON_OPTIONS}
|
||||
--werror
|
||||
--default-library=both
|
||||
--prefix=$HOME/glib-installed
|
||||
--localstatedir=/var
|
||||
--libdir=lib
|
||||
-Dsystemtap=true
|
||||
-Ddtrace=true
|
||||
-Dinstalled_tests=true
|
||||
_coverity_build
|
||||
- $HOME/cov-analysis-linux64-*/bin/cov-build --dir cov-int ninja -C _coverity_build
|
||||
- tar cfz cov-int.tar.gz cov-int
|
||||
- curl https://scan.coverity.com/builds?project=$COVERITY_SCAN_PROJECT_NAME
|
||||
--form token=$COVERITY_SCAN_TOKEN --form email=$GITLAB_USER_EMAIL
|
||||
--form file=@cov-int.tar.gz --form version="$CI_COMMIT_SHA"
|
||||
--form description="$CI_COMMIT_SHA / $CI_COMMIT_TITLE / $CI_COMMIT_REF_NAME:$CI_PIPELINE_ID"
|
||||
artifacts:
|
||||
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
|
||||
when: always
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- "cov-int/build-log.txt"
|
||||
|
||||
pages:
|
||||
stage: deploy
|
||||
only:
|
||||
- main
|
||||
needs: ['coverage', 'style-check-diff']
|
||||
script:
|
||||
- mv _coverage/ public/
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
|
||||
dist-job:
|
||||
image: $FEDORA_IMAGE
|
||||
stage: build
|
||||
only:
|
||||
- tags
|
||||
script:
|
||||
# Ignore extra git security checks as we don't care in CI.
|
||||
- git config --global --add safe.directory "${PWD}"
|
||||
- git submodule update --init
|
||||
- for m in $(git submodule foreach -q 'echo $path'); do git config --global --add safe.directory "${PWD}/${m}"; done
|
||||
- meson subprojects download
|
||||
- meson ${MESON_COMMON_OPTIONS} --buildtype release -Dgtk_doc=true -Dman=true _build
|
||||
- cd _build
|
||||
- ninja dist
|
||||
- ninja glib-doc gobject-doc gio-doc
|
||||
- tar -c -J -f "glib-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/glib html
|
||||
- tar -c -J -f "gobject-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gobject html
|
||||
- tar -c -J -f "gio-docs-$CI_COMMIT_TAG.tar.xz" -C docs/reference/gio html
|
||||
artifacts:
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/glib-docs-$CI_COMMIT_TAG.tar.xz"
|
||||
- "${CI_PROJECT_DIR}/_build/gobject-docs-$CI_COMMIT_TAG.tar.xz"
|
||||
- "${CI_PROJECT_DIR}/_build/gio-docs-$CI_COMMIT_TAG.tar.xz"
|
||||
- "${CI_PROJECT_DIR}/_build/meson-dist/glib-*.tar.xz"
|
|
@ -0,0 +1,27 @@
|
|||
# CI support stuff
|
||||
|
||||
## Docker image
|
||||
|
||||
GitLab CI jobs run in a Docker image, defined here. To update that image
|
||||
(perhaps to install some more packages):
|
||||
|
||||
1. Edit `.gitlab-ci/Dockerfile` with the changes you want
|
||||
1. Run `.gitlab-ci/run-docker.sh build --base=debian-stable --base-version=1` to
|
||||
build the new image (bump the version from the latest listed for that `base`
|
||||
on https://gitlab.gnome.org/GNOME/glib/container_registry). If rebuilding the
|
||||
`coverity.Dockerfile` image, you’ll need to have access to [Coverity Scan][cs]
|
||||
and will need to specify your project name and access token as the environment
|
||||
variables `COVERITY_SCAN_PROJECT_NAME` and `COVERITY_SCAN_TOKEN`.
|
||||
1. Run `.gitlab-ci/run-docker.sh push --base=debian-stable --base-version=1` to
|
||||
upload the new image to the GNOME GitLab Docker registry
|
||||
* If this is the first time you're doing this, you'll need to log into the
|
||||
registry
|
||||
* If you use 2-factor authentication on your GNOME GitLab account, you'll
|
||||
need to [create a personal access token][pat] and use that rather than
|
||||
your normal password — the token should have `read_registry` and
|
||||
`write_registry` permissions
|
||||
1. Edit `.gitlab-ci.yml` (in the root of this repository) to use your new
|
||||
image
|
||||
|
||||
[pat]: https://gitlab.gnome.org/profile/personal_access_tokens
|
||||
[cs]: https://scan.coverity.com/
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
#
|
||||
# Copyright 2022 Collabora ltd.
|
||||
#
|
||||
# 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
# Author: Xavier Claessens <xavier.claessens@collabora.com>
|
||||
#
|
||||
|
||||
set -e
|
||||
|
||||
# Download Android NDK
|
||||
ANDROID_NDK_PATH=/opt/android-ndk
|
||||
ANDROID_NDK_VERSION="r23b"
|
||||
ANDROID_NDK_SHA512="5f2b58e605fc99d4fd3e9d2210e7f5e76e89245fa9428ce0d890e2e03b598c62c48ebd528fcb76556f04b46b87afea52e1e8d280f32cd1232f290e074bfa56fa"
|
||||
wget --quiet "https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
|
||||
echo "${ANDROID_NDK_SHA512} android-ndk-${ANDROID_NDK_VERSION}-linux.zip" | sha512sum -c
|
||||
unzip "android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
|
||||
rm "android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
|
||||
mv "android-ndk-${ANDROID_NDK_VERSION}" "${ANDROID_NDK_PATH}"
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
git clone --depth 1 --no-tags https://gitlab.gnome.org/GNOME/glib.git
|
||||
git -C glib submodule update --init
|
||||
meson subprojects download --sourcedir glib
|
||||
rm glib/subprojects/*.wrap
|
||||
mv glib/subprojects/ .
|
||||
rm -rf glib
|
|
@ -0,0 +1,28 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
This script checks Meson configuration logs to verify no installed file is
|
||||
missing installation tag.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("builddir", type=Path)
|
||||
args = parser.parse_args()
|
||||
|
||||
logfile = args.builddir / "meson-logs" / "meson-log.txt"
|
||||
with logfile.open(encoding="utf-8") as f:
|
||||
if "Failed to guess install tag" in f.read():
|
||||
print(
|
||||
f"Some files are missing install_tag, see {logfile} for details." # no-qa
|
||||
)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
exit(main())
|
|
@ -0,0 +1,93 @@
|
|||
#!/usr/bin/env python3
|
||||
#
|
||||
# Copyright © 2019 Endless Mobile, Inc.
|
||||
#
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
#
|
||||
# Original author: Philip Withnall
|
||||
|
||||
"""
|
||||
Checks that a merge request doesn’t add any instances of the string ‘todo’
|
||||
(in uppercase), or similar keywords. It may remove instances of that keyword,
|
||||
or move them around, according to the logic of `git log -S`.
|
||||
"""
|
||||
|
||||
import argparse
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
|
||||
# We have to specify these keywords obscurely to avoid the script matching
|
||||
# itself. The keyword ‘fixme’ (in upper case) is explicitly allowed because
|
||||
# that’s conventionally used as a way of marking a workaround which needs to
|
||||
# be merged for now, but is to be grepped for and reverted or reworked later.
|
||||
BANNED_KEYWORDS = ["TO" + "DO", "X" + "XX", "W" + "IP"]
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description="Check a range of commits to ensure they don’t contain "
|
||||
"banned keywords."
|
||||
)
|
||||
parser.add_argument("commits", help="SHA to diff from, or range of commits to diff")
|
||||
args = parser.parse_args()
|
||||
|
||||
banned_words_seen = set()
|
||||
seen_in_log = False
|
||||
seen_in_diff = False
|
||||
|
||||
# Check the log messages for banned words.
|
||||
log_process = subprocess.run(
|
||||
["git", "log", "--no-color", args.commits + "..HEAD"],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
check=True,
|
||||
)
|
||||
log_lines = log_process.stdout.strip().split("\n")
|
||||
|
||||
for line in log_lines:
|
||||
for keyword in BANNED_KEYWORDS:
|
||||
if re.search(r"(^|\W+){}(\W+|$)".format(keyword), line):
|
||||
banned_words_seen.add(keyword)
|
||||
seen_in_log = True
|
||||
|
||||
# Check the diff for banned words.
|
||||
diff_process = subprocess.run(
|
||||
["git", "diff", "-U0", "--no-color", args.commits],
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
encoding="utf-8",
|
||||
check=True,
|
||||
)
|
||||
diff_lines = diff_process.stdout.strip().split("\n")
|
||||
|
||||
for line in diff_lines:
|
||||
if not line.startswith("+ "):
|
||||
continue
|
||||
|
||||
for keyword in BANNED_KEYWORDS:
|
||||
if re.search(r"(^|\W+){}(\W+|$)".format(keyword), line):
|
||||
banned_words_seen.add(keyword)
|
||||
seen_in_diff = True
|
||||
|
||||
if banned_words_seen:
|
||||
if seen_in_log and seen_in_diff:
|
||||
where = "commit message and diff"
|
||||
elif seen_in_log:
|
||||
where = "commit message"
|
||||
elif seen_in_diff:
|
||||
where = "commit diff"
|
||||
|
||||
print(
|
||||
"Saw banned keywords in a {}: {}. "
|
||||
"This indicates the branch is a work in progress and should not "
|
||||
"be merged in its current "
|
||||
"form.".format(where, ", ".join(banned_words_seen))
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -33,50 +33,76 @@ else:
|
|||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description=__doc__,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
parser.add_argument('-i', action='store_true', default=False,
|
||||
help='apply edits to files instead of displaying a '
|
||||
'diff')
|
||||
parser.add_argument('-p', metavar='NUM', default=0,
|
||||
help='strip the smallest prefix containing P slashes')
|
||||
parser.add_argument('-regex', metavar='PATTERN', default=None,
|
||||
help='custom pattern selecting file paths to reformat '
|
||||
'(case sensitive, overrides -iregex)')
|
||||
parser.add_argument('-iregex', metavar='PATTERN',
|
||||
default=r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hh|hpp|m|mm|inc'
|
||||
r'|js|ts|proto|protodevel|java|cs)',
|
||||
help='custom pattern selecting file paths to reformat '
|
||||
'(case insensitive, overridden by -regex)')
|
||||
parser.add_argument('-sort-includes', action='store_true', default=False,
|
||||
help='let clang-format sort include blocks')
|
||||
parser.add_argument('-v', '--verbose', action='store_true',
|
||||
help='be more verbose, ineffective without -i')
|
||||
parser.add_argument('-style',
|
||||
help='formatting style to apply (LLVM, Google, '
|
||||
'Chromium, Mozilla, WebKit)')
|
||||
parser.add_argument('-binary', default='clang-format',
|
||||
help='location of binary to use for clang-format')
|
||||
description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter
|
||||
)
|
||||
parser.add_argument(
|
||||
"-i",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="apply edits to files instead of displaying a " "diff",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-p",
|
||||
metavar="NUM",
|
||||
default=0,
|
||||
help="strip the smallest prefix containing P slashes",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-regex",
|
||||
metavar="PATTERN",
|
||||
default=None,
|
||||
help="custom pattern selecting file paths to reformat "
|
||||
"(case sensitive, overrides -iregex)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-iregex",
|
||||
metavar="PATTERN",
|
||||
default=r".*\.(cpp|cc|c\+\+|cxx|c|cl|h|hh|hpp|m|mm|inc"
|
||||
r"|js|ts|proto|protodevel|java|cs)",
|
||||
help="custom pattern selecting file paths to reformat "
|
||||
"(case insensitive, overridden by -regex)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-sort-includes",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="let clang-format sort include blocks",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-v",
|
||||
"--verbose",
|
||||
action="store_true",
|
||||
help="be more verbose, ineffective without -i",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-style",
|
||||
help="formatting style to apply (LLVM, Google, " "Chromium, Mozilla, WebKit)",
|
||||
)
|
||||
parser.add_argument(
|
||||
"-binary",
|
||||
default="clang-format",
|
||||
help="location of binary to use for clang-format",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
|
||||
# Extract changed lines for each file.
|
||||
filename = None
|
||||
lines_by_file = {}
|
||||
for line in sys.stdin:
|
||||
match = re.search(r'^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line)
|
||||
match = re.search(r"^\+\+\+\ (.*?/){%s}(\S*)" % args.p, line)
|
||||
if match:
|
||||
filename = match.group(2)
|
||||
if filename is None:
|
||||
continue
|
||||
|
||||
if args.regex is not None:
|
||||
if not re.match('^%s$' % args.regex, filename):
|
||||
if not re.match("^%s$" % args.regex, filename):
|
||||
continue
|
||||
else:
|
||||
if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
|
||||
if not re.match("^%s$" % args.iregex, filename, re.IGNORECASE):
|
||||
continue
|
||||
|
||||
match = re.search(r'^@@.*\+(\d+)(,(\d+))?', line)
|
||||
match = re.search(r"^@@.*\+(\d+)(,(\d+))?", line)
|
||||
if match:
|
||||
start_line = int(match.group(1))
|
||||
line_count = 1
|
||||
|
@ -86,7 +112,8 @@ def main():
|
|||
continue
|
||||
end_line = start_line + line_count - 1
|
||||
lines_by_file.setdefault(filename, []).extend(
|
||||
['-lines', str(start_line) + ':' + str(end_line)])
|
||||
["-lines", str(start_line) + ":" + str(end_line)]
|
||||
)
|
||||
|
||||
# Reformat files containing changes in place.
|
||||
# We need to count amount of bytes generated in the output of
|
||||
|
@ -95,20 +122,22 @@ def main():
|
|||
format_line_counter = 0
|
||||
for filename, lines in lines_by_file.items():
|
||||
if args.i and args.verbose:
|
||||
print('Formatting {}'.format(filename))
|
||||
print("Formatting {}".format(filename))
|
||||
command = [args.binary, filename]
|
||||
if args.i:
|
||||
command.append('-i')
|
||||
command.append("-i")
|
||||
if args.sort_includes:
|
||||
command.append('-sort-includes')
|
||||
command.append("-sort-includes")
|
||||
command.extend(lines)
|
||||
if args.style:
|
||||
command.extend(['-style', args.style])
|
||||
p = subprocess.Popen(command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=None,
|
||||
stdin=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
command.extend(["-style", args.style])
|
||||
p = subprocess.Popen(
|
||||
command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=None,
|
||||
stdin=subprocess.PIPE,
|
||||
universal_newlines=True,
|
||||
)
|
||||
stdout, _ = p.communicate()
|
||||
if p.returncode != 0:
|
||||
sys.exit(p.returncode)
|
||||
|
@ -117,11 +146,15 @@ def main():
|
|||
with open(filename) as f:
|
||||
code = f.readlines()
|
||||
formatted_code = StringIO(stdout).readlines()
|
||||
diff = difflib.unified_diff(code, formatted_code,
|
||||
filename, filename,
|
||||
'(before formatting)',
|
||||
'(after formatting)')
|
||||
diff_string = ''.join(diff)
|
||||
diff = difflib.unified_diff(
|
||||
code,
|
||||
formatted_code,
|
||||
filename,
|
||||
filename,
|
||||
"(before formatting)",
|
||||
"(after formatting)",
|
||||
)
|
||||
diff_string = "".join(diff)
|
||||
if diff_string:
|
||||
format_line_counter += sys.stdout.write(diff_string)
|
||||
|
||||
|
@ -129,5 +162,5 @@ def main():
|
|||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
if __name__ == "__main__":
|
||||
main()
|
|
@ -0,0 +1,43 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Fixup Windows paths
|
||||
python3 ./.gitlab-ci/fixup-cov-paths.py _coverage/*.lcov
|
||||
|
||||
for path in _coverage/*.lcov; do
|
||||
# Remove coverage from generated code in the build directory
|
||||
lcov --config-file .lcovrc -r "${path}" '*/_build/*' -o "$(pwd)/${path}"
|
||||
# Remove any coverage from system files
|
||||
lcov --config-file .lcovrc -e "${path}" "$(pwd)/*" -o "$(pwd)/${path}"
|
||||
|
||||
# Convert to cobertura format for gitlab integration
|
||||
cobertura_base="${path/.lcov}-cobertura"
|
||||
cobertura_xml="${cobertura_base}.xml"
|
||||
lcov_cobertura "${path}" --output "${cobertura_xml}"
|
||||
mkdir -p "${cobertura_base}"
|
||||
cobertura-split-by-package.py "${cobertura_xml}" "${cobertura_base}"
|
||||
rm -f "${cobertura_xml}"
|
||||
done
|
||||
|
||||
genhtml \
|
||||
--ignore-errors=source \
|
||||
--config-file .lcovrc \
|
||||
_coverage/*.lcov \
|
||||
-o _coverage/coverage
|
||||
|
||||
cd _coverage
|
||||
rm -f ./*.lcov
|
||||
|
||||
cat >index.html <<EOL
|
||||
<html>
|
||||
<body>
|
||||
<ul>
|
||||
<li><a href="coverage/index.html">Coverage</a></li>
|
||||
</ul>
|
||||
</body>
|
||||
</html>
|
||||
EOL
|
||||
|
||||
# Print a handy link to the coverage report
|
||||
echo "Coverage report at: https://${CI_PROJECT_NAMESPACE}.pages.gitlab.gnome.org/-/${CI_PROJECT_NAME}/-/jobs/${CI_BUILD_ID}/artifacts/_coverage/coverage/index.html"
|
|
@ -0,0 +1,246 @@
|
|||
/*
|
||||
* Copyright © 2020 Endless OS Foundation, LLC
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* Author: Philip Withnall <withnall@endlessm.com>
|
||||
*/
|
||||
|
||||
/* This modelling file needs to be uploaded to GLib’s Coverity configuration at
|
||||
* https://scan.coverity.com/projects/glib?tab=analysis_settings
|
||||
* by someone with the appropriate permissions on Coverity. It should be kept in
|
||||
* sync with what’s there.
|
||||
*
|
||||
* Reference: https://scan.coverity.com/tune
|
||||
*/
|
||||
|
||||
/* Disable some esoteric options which Coverity doesn't understand because they
|
||||
* delve into assembly. */
|
||||
#define NVALGRIND 1
|
||||
#undef HAVE_DTRACE
|
||||
|
||||
#define TRACE(probe) /* no-op */
|
||||
|
||||
/* libc definitions */
|
||||
#define NULL ((void*)0)
|
||||
|
||||
void *malloc (size_t);
|
||||
void *calloc (size_t, size_t);
|
||||
void *realloc (void *, size_t);
|
||||
void free (void *);
|
||||
|
||||
/* Define some standard GLib types. */
|
||||
typedef size_t gsize;
|
||||
typedef char gchar;
|
||||
typedef unsigned char guchar;
|
||||
typedef int gint;
|
||||
typedef unsigned long gulong;
|
||||
typedef unsigned int guint32;
|
||||
typedef void* gpointer;
|
||||
typedef unsigned int gboolean;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
/* log flags */
|
||||
G_LOG_FLAG_RECURSION = 1 << 0,
|
||||
G_LOG_FLAG_FATAL = 1 << 1,
|
||||
|
||||
/* GLib log levels */
|
||||
G_LOG_LEVEL_ERROR = 1 << 2, /* always fatal */
|
||||
G_LOG_LEVEL_CRITICAL = 1 << 3,
|
||||
G_LOG_LEVEL_WARNING = 1 << 4,
|
||||
G_LOG_LEVEL_MESSAGE = 1 << 5,
|
||||
G_LOG_LEVEL_INFO = 1 << 6,
|
||||
G_LOG_LEVEL_DEBUG = 1 << 7,
|
||||
|
||||
G_LOG_LEVEL_MASK = ~(G_LOG_FLAG_RECURSION | G_LOG_FLAG_FATAL)
|
||||
} GLogLevelFlags;
|
||||
|
||||
typedef struct _GList GList;
|
||||
|
||||
struct _GList
|
||||
{
|
||||
gpointer data;
|
||||
GList *next;
|
||||
GList *prev;
|
||||
};
|
||||
|
||||
typedef struct _GError GError;
|
||||
|
||||
struct _GError
|
||||
{
|
||||
/* blah */
|
||||
};
|
||||
|
||||
/* Dummied from sys/stat.h. */
|
||||
struct stat {};
|
||||
extern int stat (const char *path, struct stat *buf);
|
||||
|
||||
/* g_stat() can be used to check whether a given path is safe (i.e. exists).
|
||||
* This is not a full solution for sanitising user-provided paths, but goes a
|
||||
* long way, and is the best we can do without more context about how the path
|
||||
* is used. */
|
||||
typedef struct stat GStatBuf;
|
||||
#undef g_stat
|
||||
|
||||
int
|
||||
g_stat (const char *filename, GStatBuf *buf)
|
||||
{
|
||||
__coverity_tainted_string_sanitize_content__ (filename);
|
||||
return stat (filename, buf);
|
||||
}
|
||||
|
||||
/* g_path_skip_root() can be used to validate that a @file_name is absolute. It
|
||||
* returns %NULL otherwise. */
|
||||
const char *
|
||||
g_path_skip_root (const char *file_name)
|
||||
{
|
||||
int is_ok;
|
||||
if (is_ok)
|
||||
{
|
||||
__coverity_tainted_string_sanitize_content__ (file_name);
|
||||
return file_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0; /* NULL */
|
||||
}
|
||||
}
|
||||
|
||||
/* Tainted string sanitiser. */
|
||||
int
|
||||
g_action_name_is_valid (const char *action_name)
|
||||
{
|
||||
int is_ok;
|
||||
if (is_ok)
|
||||
{
|
||||
__coverity_tainted_string_sanitize_content__ (action_name);
|
||||
return 1; /* TRUE */
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0; /* FALSE */
|
||||
}
|
||||
}
|
||||
|
||||
/* Treat this like an assert(0). */
|
||||
void
|
||||
g_return_if_fail_warning (const char *log_domain,
|
||||
const char *pretty_function,
|
||||
const char *expression)
|
||||
{
|
||||
__coverity_panic__();
|
||||
}
|
||||
|
||||
/* Treat this like an assert(0). */
|
||||
void
|
||||
g_log (const gchar *log_domain,
|
||||
GLogLevelFlags log_level,
|
||||
const gchar *format,
|
||||
...)
|
||||
{
|
||||
if (log_level & G_LOG_LEVEL_CRITICAL)
|
||||
__coverity_panic__ ();
|
||||
}
|
||||
|
||||
#define g_critical(...) __coverity_panic__ ();
|
||||
|
||||
/* Treat it as a memory sink to hide one-time allocation leaks. */
|
||||
void
|
||||
(g_once_init_leave) (volatile void *location,
|
||||
gsize result)
|
||||
{
|
||||
__coverity_escape__ (result);
|
||||
}
|
||||
|
||||
/* Coverity cannot model allocation management for linked lists, so just pretend
|
||||
* that it's a pass-through. */
|
||||
GList *
|
||||
g_list_reverse (GList *list)
|
||||
{
|
||||
return list;
|
||||
}
|
||||
|
||||
/* g_ascii_isspace() routinely throws data_index taint errors, saying that
|
||||
* tainted data is being used to index g_ascii_table. This is true, but the
|
||||
* table has defined values for all possible 8-bit indexes. */
|
||||
gboolean
|
||||
g_ascii_isspace (gchar c)
|
||||
{
|
||||
int is_space;
|
||||
__coverity_tainted_string_sink_content__ (c);
|
||||
if (is_space)
|
||||
return 1;
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Coverity treats byte-swapping operations as suspicious, and taints all data
|
||||
* which is byte-swapped (because it thinks it therefore probably comes from an
|
||||
* external source, which is reasonable). That is not the case for checksum
|
||||
* calculation, however.
|
||||
*
|
||||
* Since the definitions of these two functions depends on the host byte order,
|
||||
* just model them as no-ops. */
|
||||
void
|
||||
md5_byte_reverse (guchar *buffer,
|
||||
gulong length)
|
||||
{
|
||||
/* No-op. */
|
||||
}
|
||||
|
||||
void
|
||||
sha_byte_reverse (guint32 *buffer,
|
||||
gint length)
|
||||
{
|
||||
/* No-op. */
|
||||
}
|
||||
|
||||
/* Parse error printing does not care about sanitising the input. */
|
||||
gchar *
|
||||
g_variant_parse_error_print_context (GError *error,
|
||||
const gchar *source_str)
|
||||
{
|
||||
__coverity_tainted_data_sink__ (source_str);
|
||||
return __coverity_alloc_nosize__ ();
|
||||
}
|
||||
|
||||
/* Coverity somehow analyses G_LIKELY(x) as sometimes meaning !x, for example
|
||||
* when analysing g_try_realloc(). Ignore that. */
|
||||
#define G_LIKELY(x) x
|
||||
#define G_UNLIKELY(x) x
|
||||
|
||||
typedef struct {} DIR;
|
||||
typedef struct _GDir GDir;
|
||||
|
||||
struct _GDir
|
||||
{
|
||||
DIR *dirp;
|
||||
};
|
||||
|
||||
/* This is a private function to libglib, and Coverity can’t peek inside it when
|
||||
* analysing code in (say) GIO. */
|
||||
GDir *
|
||||
g_dir_new_from_dirp (gpointer dirp)
|
||||
{
|
||||
GDir *dir;
|
||||
|
||||
if (dirp == 0)
|
||||
__coverity_panic__();
|
||||
|
||||
dir = malloc (sizeof (GDir));
|
||||
dir->dirp = dirp;
|
||||
|
||||
return dir;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
FROM registry.gitlab.gnome.org/gnome/glib/fedora:v18
|
||||
|
||||
ARG COVERITY_SCAN_PROJECT_NAME
|
||||
ARG COVERITY_SCAN_TOKEN
|
||||
|
||||
RUN curl https://scan.coverity.com/download/cxx/linux64 \
|
||||
-o /tmp/cov-analysis-linux64.tgz \
|
||||
--form project="${COVERITY_SCAN_PROJECT_NAME}" \
|
||||
--form token="${COVERITY_SCAN_TOKEN}" \
|
||||
&& tar xfz /tmp/cov-analysis-linux64.tgz \
|
||||
&& rm /tmp/cov-analysis-linux64.tgz
|
|
@ -0,0 +1,20 @@
|
|||
[constants]
|
||||
ndk_path = '/opt/android-ndk'
|
||||
toolchain = ndk_path / 'toolchains/llvm/prebuilt/linux-x86_64'
|
||||
|
||||
[host_machine]
|
||||
system = 'android'
|
||||
cpu_family = 'aarch64'
|
||||
cpu = 'aarch64'
|
||||
endian = 'little'
|
||||
|
||||
[properties]
|
||||
sys_root = toolchain / 'sysroot'
|
||||
c_ld = 'gold'
|
||||
cpp_ld = 'gold'
|
||||
|
||||
[binaries]
|
||||
c = toolchain / 'bin/aarch64-linux-android31-clang'
|
||||
cpp = toolchain / 'bin/aarch64-linux-android31-clang++'
|
||||
ar = toolchain / 'bin/llvm-ar'
|
||||
strip = toolchain / 'bin/llvm-strip'
|
|
@ -0,0 +1,25 @@
|
|||
[host_machine]
|
||||
system = 'darwin'
|
||||
cpu_family = 'aarch64'
|
||||
cpu = 'arm64'
|
||||
endian = 'little'
|
||||
|
||||
[properties]
|
||||
c_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-miphoneos-version-min=11.0']
|
||||
cpp_args = ['-stdlib=libc++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-miphoneos-version-min=11.0']
|
||||
objc_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-miphoneos-version-min=11.0']
|
||||
objcpp_args = ['-stdlib=libc++', '-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-miphoneos-version-min=11.0']
|
||||
c_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-Wl,-iphoneos_version_min,11.0']
|
||||
cpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-Wl,-iphoneos_version_min,11.0']
|
||||
objc_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-Wl,-iphoneos_version_min,11.0']
|
||||
objcpp_link_args = ['-arch', 'arm64', '-isysroot', '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk', '-Wl,-iphoneos_version_min,11.0']
|
||||
growing_stack = true
|
||||
|
||||
|
||||
[binaries]
|
||||
c = ['clang']
|
||||
cpp = ['clang++']
|
||||
objc = ['clang']
|
||||
objcpp = ['clang++']
|
||||
ar = ['ar']
|
||||
strip = ['strip']
|
|
@ -0,0 +1,22 @@
|
|||
[host_machine]
|
||||
system = 'windows'
|
||||
cpu_family = 'x86_64'
|
||||
cpu = 'x86_64'
|
||||
endian = 'little'
|
||||
|
||||
# Fedora builds GCC with --enable-default-ssp by default, but mingw64 puts its
|
||||
# stack-protected functions in a separate library which needs to be linked
|
||||
# explicitly, hence this flag.
|
||||
[properties]
|
||||
c_args = []
|
||||
c_link_args = ['-fstack-protector']
|
||||
|
||||
[binaries]
|
||||
c = 'x86_64-w64-mingw32-gcc'
|
||||
cpp = 'x86_64-w64-mingw32-g++'
|
||||
ar = 'x86_64-w64-mingw32-ar'
|
||||
ld = 'x86_64-w64-mingw32-ld'
|
||||
objcopy = 'x86_64-w64-mingw32-objcopy'
|
||||
strip = 'x86_64-w64-mingw32-strip'
|
||||
pkgconfig = 'x86_64-w64-mingw32-pkg-config'
|
||||
windres = 'x86_64-w64-mingw32-windres'
|
|
@ -0,0 +1,81 @@
|
|||
FROM debian:bullseye
|
||||
|
||||
RUN apt-get update -qq && apt-get install --no-install-recommends -qq -y \
|
||||
bindfs \
|
||||
black \
|
||||
clang \
|
||||
clang-tools \
|
||||
clang-format \
|
||||
dbus \
|
||||
desktop-file-utils \
|
||||
elfutils \
|
||||
findutils \
|
||||
flake8 \
|
||||
fuse \
|
||||
gcc \
|
||||
gdb \
|
||||
g++ \
|
||||
gettext \
|
||||
git \
|
||||
libc6-dev \
|
||||
gtk-doc-tools \
|
||||
itstool \
|
||||
lcov \
|
||||
libattr1-dev \
|
||||
libdbus-1-dev \
|
||||
libelf-dev \
|
||||
libffi-dev \
|
||||
libmount-dev \
|
||||
libpcre2-dev \
|
||||
libselinux1-dev \
|
||||
libxml2-utils \
|
||||
libxslt1-dev \
|
||||
libz3-dev \
|
||||
locales \
|
||||
ninja-build \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-setuptools \
|
||||
python3-wheel \
|
||||
shared-mime-info \
|
||||
shellcheck \
|
||||
systemtap-sdt-dev \
|
||||
unzip \
|
||||
wget \
|
||||
xsltproc \
|
||||
xz-utils \
|
||||
zlib1g-dev \
|
||||
&& rm -rf /usr/share/doc/* /usr/share/man/*
|
||||
|
||||
# Locale for our build
|
||||
RUN locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8
|
||||
|
||||
# Locales for our tests
|
||||
RUN locale-gen de_DE.UTF-8 \
|
||||
&& locale-gen el_GR.UTF-8 \
|
||||
&& locale-gen en_US.UTF-8 \
|
||||
&& locale-gen es_ES.UTF-8 \
|
||||
&& locale-gen fa_IR.UTF-8 \
|
||||
&& locale-gen fr_FR.UTF-8 \
|
||||
&& locale-gen hr_HR.UTF-8 \
|
||||
&& locale-gen ja_JP.UTF-8 \
|
||||
&& locale-gen lt_LT.UTF-8 \
|
||||
&& locale-gen pl_PL.UTF-8 \
|
||||
&& locale-gen ru_RU.UTF-8 \
|
||||
&& locale-gen tr_TR.UTF-8
|
||||
|
||||
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
|
||||
|
||||
RUN pip3 install meson==0.60.3
|
||||
|
||||
ARG HOST_USER_ID=5555
|
||||
ENV HOST_USER_ID ${HOST_USER_ID}
|
||||
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
|
||||
|
||||
USER user
|
||||
WORKDIR /home/user
|
||||
|
||||
COPY cache-subprojects.sh .
|
||||
RUN ./cache-subprojects.sh
|
||||
|
||||
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
|
|
@ -0,0 +1,101 @@
|
|||
FROM fedora:34
|
||||
|
||||
RUN dnf -y update \
|
||||
&& dnf -y install \
|
||||
bindfs \
|
||||
clang \
|
||||
clang-analyzer \
|
||||
dbus-daemon \
|
||||
dbus-devel \
|
||||
desktop-file-utils \
|
||||
elfutils-libelf-devel \
|
||||
findutils \
|
||||
fuse \
|
||||
gcc \
|
||||
gcc-c++ \
|
||||
gdb \
|
||||
gettext \
|
||||
git \
|
||||
glibc-devel \
|
||||
glibc-headers \
|
||||
glibc-langpack-de \
|
||||
glibc-langpack-el \
|
||||
glibc-langpack-el \
|
||||
glibc-langpack-en \
|
||||
glibc-langpack-es \
|
||||
glibc-langpack-es \
|
||||
glibc-langpack-fa \
|
||||
glibc-langpack-fr \
|
||||
glibc-langpack-hr \
|
||||
glibc-langpack-ja \
|
||||
glibc-langpack-lt \
|
||||
glibc-langpack-pl \
|
||||
glibc-langpack-ru \
|
||||
glibc-langpack-tr \
|
||||
"gnome-desktop-testing >= 2018.1" \
|
||||
gtk-doc \
|
||||
itstool \
|
||||
lcov \
|
||||
libattr-devel \
|
||||
libffi-devel \
|
||||
libmount-devel \
|
||||
libselinux-devel \
|
||||
libxslt \
|
||||
ncurses-compat-libs \
|
||||
ninja-build \
|
||||
pcre2-devel \
|
||||
"python3-dbusmock >= 0.18.3-2" \
|
||||
python3-pip \
|
||||
python3-pygments \
|
||||
python3-wheel \
|
||||
shared-mime-info \
|
||||
systemtap-sdt-devel \
|
||||
unzip \
|
||||
valgrind \
|
||||
wget \
|
||||
xdg-desktop-portal \
|
||||
xz \
|
||||
zlib-devel \
|
||||
&& dnf -y install \
|
||||
meson \
|
||||
flex \
|
||||
bison \
|
||||
python3-devel \
|
||||
autoconf \
|
||||
automake \
|
||||
gettext-devel \
|
||||
libtool \
|
||||
diffutils \
|
||||
fontconfig-devel \
|
||||
json-glib-devel \
|
||||
geoclue2-devel \
|
||||
pipewire-devel \
|
||||
fuse-devel \
|
||||
make \
|
||||
&& dnf clean all
|
||||
|
||||
RUN pip3 install meson==0.60.3
|
||||
|
||||
COPY install-gitlab-cobertura-tools.sh .
|
||||
RUN ./install-gitlab-cobertura-tools.sh
|
||||
|
||||
# Set /etc/machine-id as it’s needed for some D-Bus tests
|
||||
RUN systemd-machine-id-setup
|
||||
|
||||
# Enable sudo for wheel users
|
||||
RUN sed -i -e 's/# %wheel/%wheel/' -e '0,/%wheel/{s/%wheel/# %wheel/}' /etc/sudoers
|
||||
|
||||
ARG HOST_USER_ID=5555
|
||||
ENV HOST_USER_ID ${HOST_USER_ID}
|
||||
RUN useradd -u $HOST_USER_ID -G wheel -ms /bin/bash user
|
||||
|
||||
COPY android-ndk.sh .
|
||||
RUN ./android-ndk.sh
|
||||
|
||||
USER user
|
||||
WORKDIR /home/user
|
||||
|
||||
COPY cache-subprojects.sh .
|
||||
RUN ./cache-subprojects.sh
|
||||
|
||||
ENV LANG C.UTF-8
|
|
@ -0,0 +1,26 @@
|
|||
import sys
|
||||
import os
|
||||
import io
|
||||
import re
|
||||
|
||||
|
||||
def main(argv):
|
||||
# Fix paths in lcov files generated on a Windows host so they match our
|
||||
# current source layout.
|
||||
paths = argv[1:]
|
||||
|
||||
for path in paths:
|
||||
print("cov-fixup:", path)
|
||||
text = io.open(path, "r", encoding="utf-8").read()
|
||||
text = text.replace("\\\\", "/")
|
||||
old_root = re.search(":(.*?)/glib/.*?$", text, re.MULTILINE).group(1)
|
||||
new_root = os.path.dirname(os.getcwd())
|
||||
if old_root != new_root:
|
||||
print("replacing %r with %r" % (old_root, new_root))
|
||||
text = text.replace(old_root, new_root)
|
||||
with io.open(path, "w", encoding="utf-8") as h:
|
||||
h.write(text)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
sys.exit(main(sys.argv))
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
# We need cobertura reports for gitlab-ci coverage_report,
|
||||
# so this scripts helps us doing that until we switch to gcovr
|
||||
pip3 install lcov-cobertura==2.0.2
|
||||
|
||||
# We need to split the coverage files, see:
|
||||
# https://gitlab.com/gitlab-org/gitlab/-/issues/328772#note_840831654
|
||||
SPLIT_COBERTURA_SHA512="8388ca3928a27f2ef945a7d45f1dec7253c53742a0dd1f6a3b4a07c0926b24d77f8b5c51fc7920cb07320879b7b89b0e0e13d2101117403b8c052c72e28dbcb7"
|
||||
wget -O /usr/local/bin/cobertura-split-by-package.py \
|
||||
https://gitlab.com/gitlab-org/gitlab/uploads/9d31762a33a10158f5d79d46f4102dfb/split-by-package.py
|
||||
echo "${SPLIT_COBERTURA_SHA512} /usr/local/bin/cobertura-split-by-package.py" | sha512sum -c
|
||||
chmod +x /usr/local/bin/cobertura-split-by-package.py
|
||||
sed -i "s,\(/usr/bin/env python\).*,\13," \
|
||||
/usr/local/bin/cobertura-split-by-package.py
|
|
@ -0,0 +1,72 @@
|
|||
FROM fedora:34
|
||||
|
||||
RUN dnf -y install \
|
||||
bindfs \
|
||||
clang \
|
||||
clang-analyzer \
|
||||
desktop-file-utils \
|
||||
elfutils-libelf-devel \
|
||||
findutils \
|
||||
fuse \
|
||||
gcc \
|
||||
gcc-c++ \
|
||||
gettext \
|
||||
git \
|
||||
glibc-devel \
|
||||
glibc-headers \
|
||||
glibc-langpack-de \
|
||||
glibc-langpack-el \
|
||||
glibc-langpack-el \
|
||||
glibc-langpack-en \
|
||||
glibc-langpack-es \
|
||||
glibc-langpack-es \
|
||||
glibc-langpack-fa \
|
||||
glibc-langpack-fr \
|
||||
glibc-langpack-hr \
|
||||
glibc-langpack-ja \
|
||||
glibc-langpack-lt \
|
||||
glibc-langpack-pl \
|
||||
glibc-langpack-ru \
|
||||
glibc-langpack-tr \
|
||||
gtk-doc \
|
||||
itstool \
|
||||
lcov \
|
||||
libattr-devel \
|
||||
libffi-devel \
|
||||
libmount-devel \
|
||||
libselinux-devel \
|
||||
libxslt \
|
||||
mingw64-gcc \
|
||||
mingw64-gcc-c++ \
|
||||
mingw64-gettext \
|
||||
mingw64-libffi \
|
||||
mingw64-zlib \
|
||||
ncurses-compat-libs \
|
||||
ninja-build \
|
||||
pcre2-devel \
|
||||
python3 \
|
||||
python3-pip \
|
||||
python3-wheel \
|
||||
systemtap-sdt-devel \
|
||||
unzip \
|
||||
wget \
|
||||
xz \
|
||||
zlib-devel \
|
||||
&& dnf clean all
|
||||
|
||||
WORKDIR /opt
|
||||
COPY cross_file_mingw64.txt /opt
|
||||
|
||||
RUN pip3 install meson==0.60.3
|
||||
|
||||
ARG HOST_USER_ID=5555
|
||||
ENV HOST_USER_ID ${HOST_USER_ID}
|
||||
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
|
||||
|
||||
USER user
|
||||
WORKDIR /home/user
|
||||
|
||||
COPY cache-subprojects.sh .
|
||||
RUN ./cache-subprojects.sh
|
||||
|
||||
ENV LANG C.UTF-8
|
|
@ -0,0 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# shellcheck disable=SC2046
|
||||
black --diff --check $(git ls-files '*.py')
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
source .gitlab-ci/search-common-ancestor.sh
|
||||
|
||||
./.gitlab-ci/check-todos.py "${newest_common_ancestor_sha}"
|
|
@ -0,0 +1,136 @@
|
|||
#!/bin/bash
|
||||
|
||||
read_arg() {
|
||||
# $1 = arg name
|
||||
# $2 = arg value
|
||||
# $3 = arg parameter
|
||||
local rematch='^[^=]*=(.*)$'
|
||||
if [[ $2 =~ $rematch ]]; then
|
||||
read -r "$1" <<< "${BASH_REMATCH[1]}"
|
||||
else
|
||||
read -r "$1" <<< "$3"
|
||||
# There is no way to shift our callers args, so
|
||||
# return 1 to indicate they should do it instead.
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
SUDO_CMD="sudo"
|
||||
if docker -v |& grep -q podman; then
|
||||
# Using podman
|
||||
SUDO_CMD=""
|
||||
# Docker is actually implemented by podman, and its OCI output
|
||||
# is incompatible with some of the dockerd instances on GitLab
|
||||
# CI runners.
|
||||
export BUILDAH_FORMAT=docker
|
||||
elif getent group docker | grep -q "\b${USER}\b"; then
|
||||
SUDO_CMD=""
|
||||
fi
|
||||
|
||||
set -e
|
||||
|
||||
base=""
|
||||
base_version=""
|
||||
build=0
|
||||
run=0
|
||||
push=0
|
||||
list=0
|
||||
print_help=0
|
||||
no_login=0
|
||||
|
||||
while (($# > 0)); do
|
||||
case "${1%%=*}" in
|
||||
build) build=1;;
|
||||
run) run=1;;
|
||||
push) push=1;;
|
||||
list) list=1;;
|
||||
help) print_help=1;;
|
||||
--base|-b) read_arg base "$@" || shift;;
|
||||
--base-version) read_arg base_version "$@" || shift;;
|
||||
--no-login) no_login=1;;
|
||||
*) echo -e "\\e[1;31mERROR\\e[0m: Unknown option '$1'"; exit 1;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ $print_help == 1 ]; then
|
||||
echo "$0 - Build and run Docker images"
|
||||
echo ""
|
||||
echo "Usage: $0 <command> [options] [basename]"
|
||||
echo ""
|
||||
echo "Available commands"
|
||||
echo ""
|
||||
echo " build --base=<BASENAME> - Build Docker image <BASENAME>.Dockerfile"
|
||||
echo " run --base=<BASENAME> - Run Docker image <BASENAME>"
|
||||
echo " push --base=<BASENAME> - Push Docker image <BASENAME> to the registry"
|
||||
echo " list - List available images"
|
||||
echo " help - This help message"
|
||||
echo ""
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
if [ $list == 1 ]; then
|
||||
echo "Available Docker images:"
|
||||
for f in *.Dockerfile; do
|
||||
filename=$( basename -- "$f" )
|
||||
basename="${filename%.*}"
|
||||
|
||||
echo -e " \\e[1;39m$basename\\e[0m"
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# All commands after this require --base to be set
|
||||
if [ -z "${base}" ]; then
|
||||
echo "Usage: $0 <command>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$base.Dockerfile" ]; then
|
||||
echo -e "\\e[1;31mERROR\\e[0m: Dockerfile for '$base' not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${base_version}" ]; then
|
||||
base_version="latest"
|
||||
else
|
||||
base_version="v$base_version"
|
||||
fi
|
||||
|
||||
TAG="registry.gitlab.gnome.org/gnome/glib/${base}:${base_version}"
|
||||
|
||||
if [ $build == 1 ]; then
|
||||
echo -e "\\e[1;32mBUILDING\\e[0m: ${base} as ${TAG}"
|
||||
$SUDO_CMD docker build \
|
||||
--build-arg HOST_USER_ID="$UID" \
|
||||
--build-arg COVERITY_SCAN_PROJECT_NAME="${COVERITY_SCAN_PROJECT_NAME}" \
|
||||
--build-arg COVERITY_SCAN_TOKEN="${COVERITY_SCAN_TOKEN}" \
|
||||
--tag "${TAG}" \
|
||||
--file "${base}.Dockerfile" .
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ $push == 1 ]; then
|
||||
echo -e "\\e[1;32mPUSHING\\e[0m: ${base} as ${TAG}"
|
||||
|
||||
if [ $no_login == 0 ]; then
|
||||
$SUDO_CMD docker login registry.gitlab.gnome.org
|
||||
fi
|
||||
|
||||
$SUDO_CMD docker push $TAG
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ $run == 1 ]; then
|
||||
echo -e "\\e[1;32mRUNNING\\e[0m: ${base} as ${TAG}"
|
||||
$SUDO_CMD docker run \
|
||||
--rm \
|
||||
--volume "$(pwd)/..:/home/user/app" \
|
||||
--workdir "/home/user/app" \
|
||||
--tty \
|
||||
--interactive "${TAG}" \
|
||||
bash
|
||||
exit $?
|
||||
fi
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Disable formatting warnings in flake8, as we use `black` to handle that.
|
||||
formatting_warnings=E101,E111,E114,E115,E116,E117,E12,E13,E2,E3,E401,E5,E70,W1,W2,W3,W5
|
||||
|
||||
# shellcheck disable=SC2046
|
||||
flake8 --max-line-length=88 --ignore="$formatting_warnings" $(git ls-files '*.py')
|
|
@ -0,0 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Ignoring third-party directories that we don't want to parse
|
||||
# shellcheck disable=SC2046
|
||||
shellcheck $(git ls-files '*.sh' | grep -Ev "glib/libcharset|glib/dirent")
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
ancestor_horizon=28 # days (4 weeks)
|
||||
|
||||
# Wrap everything in a subshell so we can propagate the exit status.
|
||||
(
|
||||
|
||||
source .gitlab-ci/search-common-ancestor.sh
|
||||
|
||||
git diff -U0 --no-color "${newest_common_ancestor_sha}" | .gitlab-ci/clang-format-diff.py -binary "clang-format-11" -p1
|
||||
|
||||
)
|
||||
exit_status=$?
|
||||
|
||||
# The style check is not infallible. The clang-format configuration cannot
|
||||
# perfectly describe GLib’s coding style: in particular, it cannot align
|
||||
# function arguments. The documented coding style for GLib takes priority over
|
||||
# clang-format suggestions. Hopefully we can eventually improve clang-format to
|
||||
# be configurable enough for our coding style. That’s why this CI check is OK
|
||||
# to fail: the idea is that people can look through the output and ignore it if
|
||||
# it’s wrong. (That situation can also happen if someone touches pre-existing
|
||||
# badly formatted code and it doesn’t make sense to tidy up the wider coding
|
||||
# style with the changes they’re making.)
|
||||
echo ""
|
||||
echo "Note that clang-format output is advisory and cannot always match the GLib coding style, documented at"
|
||||
echo " https://gitlab.gnome.org/GNOME/gtk/blob/HEAD/docs/CODING-STYLE.md"
|
||||
echo "Warnings from this tool can be ignored in favour of the documented coding style,"
|
||||
echo "or in favour of matching the style of existing surrounding code."
|
||||
|
||||
exit ${exit_status}
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
./.gitlab-ci/check-missing-install-tag.py _build
|
||||
|
||||
meson test \
|
||||
-C _build \
|
||||
--timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" \
|
||||
--no-suite flaky \
|
||||
"$@"
|
|
@ -0,0 +1,42 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
ancestor_horizon=28 # days (4 weeks)
|
||||
|
||||
# Recently, git is picky about directory ownership. Tell it not to worry.
|
||||
git config --global --add safe.directory "$PWD"
|
||||
|
||||
# We need to add a new remote for the upstream target branch, since this script
|
||||
# could be running in a personal fork of the repository which has out of date
|
||||
# branches.
|
||||
#
|
||||
# Limit the fetch to a certain date horizon to limit the amount of data we get.
|
||||
# If the branch was forked from origin/main before this horizon, it should
|
||||
# probably be rebased.
|
||||
if ! git ls-remote --exit-code upstream >/dev/null 2>&1 ; then
|
||||
git remote add upstream https://gitlab.gnome.org/GNOME/glib.git
|
||||
fi
|
||||
|
||||
# Work out the newest common ancestor between the detached HEAD that this CI job
|
||||
# has checked out, and the upstream target branch (which will typically be
|
||||
# `upstream/main` or `upstream/glib-2-62`).
|
||||
# `${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}` or `${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME}`
|
||||
# are only defined if we’re running in a merge request pipeline,
|
||||
# fall back to `${CI_DEFAULT_BRANCH}` or `${CI_COMMIT_BRANCH}` respectively
|
||||
# otherwise.
|
||||
|
||||
source_branch="${CI_MERGE_REQUEST_SOURCE_BRANCH_NAME:-${CI_COMMIT_BRANCH}}"
|
||||
target_branch="${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}"
|
||||
|
||||
git fetch --shallow-since="$(date --date="${ancestor_horizon} days ago" +%Y-%m-%d)" origin "${source_branch}"
|
||||
git fetch --shallow-since="$(date --date="${ancestor_horizon} days ago" +%Y-%m-%d)" upstream "${target_branch}"
|
||||
|
||||
newest_common_ancestor_sha=$(git merge-base "upstream/${target_branch}" "origin/${source_branch}")
|
||||
|
||||
if [ -z "${newest_common_ancestor_sha}" ]; then
|
||||
echo "Couldn’t find common ancestor with upstream main branch. This typically"
|
||||
echo "happens if you branched from main a long time ago. Please update"
|
||||
echo "your clone, rebase, and re-push your branch."
|
||||
exit 1
|
||||
fi
|
|
@ -0,0 +1,13 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -eux -o pipefail
|
||||
|
||||
id || :
|
||||
capsh --print || :
|
||||
env -0 | sort -z | perl -pe 's/\0/\n/g' || :
|
||||
setpriv --dump || :
|
||||
ulimit -a || :
|
||||
cat /proc/self/status || :
|
||||
cat /proc/self/mountinfo || :
|
||||
stat /etc/machine-id || :
|
||||
stat /var/lib/dbus/machine-id || :
|
|
@ -0,0 +1,27 @@
|
|||
@echo on
|
||||
:: vcvarsall.bat sets various env vars like PATH, INCLUDE, LIB, LIBPATH for the
|
||||
:: specified build architecture
|
||||
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
|
||||
|
||||
:: Remove quotes from script args
|
||||
setlocal enabledelayedexpansion
|
||||
set args=
|
||||
for %%x in (%*) do (
|
||||
set args=!args! %%~x
|
||||
)
|
||||
set args=%args:~1%
|
||||
|
||||
:: FIXME: make warnings fatal
|
||||
pip3 install --upgrade --user meson==0.60.3 || goto :error
|
||||
meson %args% _build || goto :error
|
||||
python .gitlab-ci/check-missing-install-tag.py _build || goto :error
|
||||
ninja -C _build || goto :error
|
||||
|
||||
:: FIXME: dont ignore test errors
|
||||
meson test -C _build --timeout-multiplier %MESON_TEST_TIMEOUT_MULTIPLIER% --no-suite flaky
|
||||
|
||||
:: FIXME: can we get code coverage support?
|
||||
|
||||
goto :EOF
|
||||
:error
|
||||
exit /b 1
|
|
@ -0,0 +1,61 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
export PATH="/c/msys64/$MSYSTEM/bin:$PATH"
|
||||
if [[ "$MSYSTEM" == "MINGW32" ]]; then
|
||||
export MSYS2_ARCH="i686"
|
||||
else
|
||||
export MSYS2_ARCH="x86_64"
|
||||
fi
|
||||
|
||||
pacman --noconfirm -Suy
|
||||
|
||||
pacman --noconfirm -S --needed \
|
||||
base-devel \
|
||||
lcov \
|
||||
mingw-w64-$MSYS2_ARCH-ccache \
|
||||
mingw-w64-$MSYS2_ARCH-gettext \
|
||||
mingw-w64-$MSYS2_ARCH-libffi \
|
||||
mingw-w64-$MSYS2_ARCH-meson \
|
||||
mingw-w64-$MSYS2_ARCH-pcre2 \
|
||||
mingw-w64-$MSYS2_ARCH-python3 \
|
||||
mingw-w64-$MSYS2_ARCH-python-pip \
|
||||
mingw-w64-$MSYS2_ARCH-toolchain \
|
||||
mingw-w64-$MSYS2_ARCH-zlib \
|
||||
mingw-w64-$MSYS2_ARCH-libelf
|
||||
|
||||
mkdir -p _coverage
|
||||
mkdir -p _ccache
|
||||
CCACHE_BASEDIR="$(pwd)"
|
||||
CCACHE_DIR="${CCACHE_BASEDIR}/_ccache"
|
||||
export CCACHE_BASEDIR CCACHE_DIR
|
||||
|
||||
pip3 install --upgrade --user meson==0.60.3
|
||||
|
||||
PATH="$(cygpath "$USERPROFILE")/.local/bin:$HOME/.local/bin:$PATH"
|
||||
CFLAGS="-coverage -ftest-coverage -fprofile-arcs"
|
||||
DIR="$(pwd)"
|
||||
export PATH CFLAGS
|
||||
|
||||
meson --werror --buildtype debug _build
|
||||
cd _build
|
||||
ninja
|
||||
|
||||
lcov \
|
||||
--quiet \
|
||||
--config-file "${DIR}"/.lcovrc \
|
||||
--directory "${DIR}/_build" \
|
||||
--capture \
|
||||
--initial \
|
||||
--output-file "${DIR}/_coverage/${CI_JOB_NAME}-baseline.lcov"
|
||||
|
||||
# FIXME: fix the test suite
|
||||
meson test --timeout-multiplier "${MESON_TEST_TIMEOUT_MULTIPLIER}" --no-suite flaky || true
|
||||
|
||||
lcov \
|
||||
--quiet \
|
||||
--config-file "${DIR}"/.lcovrc \
|
||||
--directory "${DIR}/_build" \
|
||||
--capture \
|
||||
--output-file "${DIR}/_coverage/${CI_JOB_NAME}.lcov"
|
|
@ -0,0 +1,5 @@
|
|||
[submodule "subprojects/gvdb"]
|
||||
path = subprojects/gvdb
|
||||
url = https://gitlab.gnome.org/GNOME/gvdb.git
|
||||
branch = 0854af0fdb6d527a8d1999835ac2c5059976c210
|
||||
shallow = true
|
|
@ -0,0 +1,13 @@
|
|||
# lcov and genhtml configuration
|
||||
# See http://ltp.sourceforge.net/coverage/lcov/lcovrc.5.php
|
||||
|
||||
# Always enable branch coverage
|
||||
lcov_branch_coverage = 1
|
||||
|
||||
# Exclude precondition assertions, as we can never reasonably get full branch
|
||||
# coverage of them, as they should never normally fail.
|
||||
# See https://github.com/linux-test-project/lcov/issues/44
|
||||
lcov_excl_br_line = LCOV_EXCL_BR_LINE|g_return_if_fail|g_return_val_if_fail|g_assert|g_assert_
|
||||
|
||||
# Similarly for unreachable assertions.
|
||||
lcov_excl_line = LCOV_EXCL_LINE|g_return_if_reached|g_return_val_if_reached|g_assert_not_reached
|
|
@ -0,0 +1,36 @@
|
|||
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
|
||||
Upstream-Name: GLib
|
||||
Upstream-Contact: https://gitlab.gnome.org/GNOME/glib/-/issues
|
||||
Source: https://gitlab.gnome.org/GNOME/glib/
|
||||
|
||||
# These test files are too simple to be copyrightable, but adding
|
||||
# copyright/licensing headers to them (or beside them in a .license file) may
|
||||
# affect the tests
|
||||
Files:
|
||||
fuzzing/*.corpus
|
||||
fuzzing/*.dict
|
||||
gio/tests/cert-tests/*.p12
|
||||
gio/tests/cert-tests/*.pem
|
||||
gio/tests/desktop-files/**.desktop
|
||||
gio/tests/schema-tests/*.gschema.xml
|
||||
gio/tests/thumbnails/*.png
|
||||
glib/tests/bookmarks/*.xbel
|
||||
glib/tests/markups/*.cdata-as-text
|
||||
glib/tests/markups/*.expected
|
||||
glib/tests/markups/*.gmarkup
|
||||
Copyright: See individual files
|
||||
License: CC0-1.0
|
||||
|
||||
# Translation files are explicitly contributed under the license of the project,
|
||||
# but by multiple authors
|
||||
Files: po/*.po
|
||||
Copyright: See individual files
|
||||
License: LGPL-2.1-or-later
|
||||
|
||||
# Subproject wrap files are too simple to be copyrightable, but adding
|
||||
# copyright/licensing headers to them will get lost when they’re next updated
|
||||
# from wrapdb
|
||||
Files:
|
||||
subprojects/*.wrap
|
||||
Copyright: Meson Wrap Database (wrapdb) contributors
|
||||
License: CC0-1.0
|
40
AUTHORS
40
AUTHORS
|
@ -1,40 +0,0 @@
|
|||
Below are just a few of the people who have contributed
|
||||
to GLib. Please don't mail these people about problems you
|
||||
have with GLib; see the README.md file for information about
|
||||
filing bugs and submitting changes.
|
||||
|
||||
GLib-2.0 Team
|
||||
-------------
|
||||
Hans Breuer <hans@breuer.org>
|
||||
Matthias Clasen <mclasen@redhat.com>
|
||||
Tor Lillqvist <tml@iki.fi>
|
||||
Tim Janik <timj@gtk.org>
|
||||
Havoc Pennington <hp@redhat.com>
|
||||
Ron Steinke <rsteinke@w-link.net>
|
||||
Owen Taylor <otaylor@redhat.com>
|
||||
Sebastian Wilhelmi <seppi@seppi.de>
|
||||
|
||||
GLib-1.2 Team
|
||||
-------------
|
||||
Shawn T. Amundson <amundson@gimp.org>
|
||||
Jeff Garzik <jgarzik@pobox.com>
|
||||
Raja R Harinath <harinath@cs.umn.edu>
|
||||
Tim Janik <timj@gtk.org>
|
||||
Elliot Lee <sopwith@redhat.com>
|
||||
Tor Lillqvist <tml@iki.fi>
|
||||
Paolo Molaro <lupus@debian.org>
|
||||
Havoc Pennington <hp@pobox.com>
|
||||
Manish Singh <yosh@gimp.org>
|
||||
Owen Taylor <otaylor@gtk.org>
|
||||
Sebastian Wilhelmi <wilhelmi@ira.uka.de>
|
||||
|
||||
The random number generator "Mersenne Twister", which is used by GLib,
|
||||
was developed and originally coded by:
|
||||
Makoto Matsumoto <matumoto@math.keio.ac.jp>
|
||||
Takuji Nishimura <nisimura@math.keio.ac.jp>
|
||||
|
||||
Original Authors
|
||||
----------------
|
||||
Peter Mattis <petm@xcf.berkeley.edu>
|
||||
Spencer Kimball <spencer@xcf.berkeley.edu>
|
||||
Josh MacDonald <jmacd@xcf.berkeley.edu>
|
|
@ -0,0 +1,5 @@
|
|||
Code of Conduct
|
||||
===
|
||||
|
||||
GLib follows the GNOME Code of Conduct, which is documented here:
|
||||
https://wiki.gnome.org/Foundation/CodeOfConduct
|
|
@ -95,7 +95,8 @@ they are imported into GLib and marked as stable.
|
|||
|
||||
Each feature should also come fully documented, and with tests which approach
|
||||
full branch coverage of the new code. GLib’s CI system generates code coverage
|
||||
reports which are viewable for each merge request.
|
||||
reports which are viewable for each merge request. See
|
||||
[the testing policy](./docs/testing.md) for more details.
|
||||
|
||||
If proposing a large feature or change, it’s better to discuss it (on the
|
||||
`#gtk` IRC channel or on [Discourse](https://discourse.gnome.org) before
|
||||
|
@ -256,7 +257,7 @@ to avoid unnecessary breakage, and to take advantage of the knowledge about GLib
|
|||
that has been built up over the years, we’d like to ask people contributing to
|
||||
GLib to follow a few rules:
|
||||
|
||||
0. Never push to the `master` branch, or any stable branches, directly; you
|
||||
0. Never push to the `main` branch, or any stable branches, directly; you
|
||||
should always go through a merge request, to ensure that the code is
|
||||
tested on the CI infrastructure at the very least. A merge request is
|
||||
also the proper place to get a comprehensive code review from the core
|
||||
|
|
502
COPYING
502
COPYING
|
@ -1,502 +0,0 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
possible use to the public, we recommend making it free software that
|
||||
everyone can redistribute and change. You can do so by permitting
|
||||
redistribution under these terms (or, alternatively, under the terms of the
|
||||
ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is
|
||||
safest to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the library's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
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
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the library, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the
|
||||
library `Frob' (a library for tweaking knobs) written by James Random Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
2
HACKING
2
HACKING
|
@ -14,4 +14,4 @@ steps at once by running:
|
|||
checkout/glib# meson _build
|
||||
|
||||
For information about submitting patches see the CONTRIBUTING.md file. For
|
||||
information about major design decisions, see the README.rationale file.
|
||||
information about major design decisions, see the docs/README.rationale file.
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
Simple install procedure
|
||||
========================
|
||||
|
||||
% tar xf glib-@GLIB_VERSION@.tar.gz # unpack the sources
|
||||
% cd glib-@GLIB_VERSION@ # change to the toplevel directory
|
||||
% meson _build # configure the build
|
||||
% ninja -C _build # build GLib
|
||||
```sh
|
||||
tar xf glib-*.tar.gz # unpack the sources
|
||||
cd glib-* # change to the toplevel directory
|
||||
meson _build # configure the build
|
||||
ninja -C _build # build GLib
|
||||
|
||||
[ Become root if necessary ]
|
||||
% ninja -C _build install # install GLib
|
||||
# Become root if necessary
|
||||
|
||||
ninja -C _build install # install GLib
|
||||
```
|
||||
|
||||
Requirements
|
||||
============
|
||||
|
@ -17,38 +20,40 @@ compiler and libc. On UNIX-like systems, it also assumes compliance
|
|||
with at least the original 1990 version of POSIX.
|
||||
|
||||
GLib-2.0 requires pkg-config, which is tool for tracking the
|
||||
compilation flags needed for libraries. (For each library, a small .pc
|
||||
compilation flags needed for libraries. (For each library, a small `.pc`
|
||||
text file is installed in a standard location that contains the
|
||||
compilation flags needed for that library along with version number
|
||||
information.) Information about pkg-config can be found at:
|
||||
|
||||
http://www.freedesktop.org/software/pkgconfig/
|
||||
|
||||
Meson (http://mesonbuild.com/) is also required.
|
||||
Meson (http://mesonbuild.com/) is also required. If your distribution does not
|
||||
package a new enough version of Meson, it can be [installed using
|
||||
`pip`](https://mesonbuild.com/Getting-meson.html#installing-meson-with-pip).
|
||||
|
||||
In order to implement conversions between character sets,
|
||||
GLib requires an implementation of the standard iconv() routine.
|
||||
GLib requires an implementation of the standard `iconv()` routine.
|
||||
Most modern systems will have a suitable implementation, however
|
||||
many older systems lack an iconv() implementation. On such systems,
|
||||
many older systems lack an `iconv()` implementation. On such systems,
|
||||
you must install the libiconv library. This can be found at:
|
||||
|
||||
http://www.gnu.org/software/libiconv/
|
||||
|
||||
If your system has an iconv implementation but you want to use
|
||||
libiconv instead, you can pass the --with-libiconv option to
|
||||
libiconv instead, you can pass the `--with-libiconv` option to
|
||||
configure. This forces libiconv to be used.
|
||||
|
||||
Note that if you have libiconv installed in your default include
|
||||
search path (for instance, in /usr/local/), but don't enable
|
||||
search path (for instance, in `/usr/local/`), but don't enable
|
||||
it, you will get an error while compiling GLib because the
|
||||
iconv.h that libiconv installs hides the system iconv.
|
||||
`iconv.h` that libiconv installs hides the system iconv.
|
||||
|
||||
If you are using the native iconv implementation on Solaris
|
||||
instead of libiconv, you'll need to make sure that you have
|
||||
the converters between locale encodings and UTF-8 installed.
|
||||
At a minimum you'll need the SUNWuiu8 package. You probably
|
||||
should also install the SUNWciu8, SUNWhiu8, SUNWjiu8, and
|
||||
SUNWkiu8 packages.
|
||||
At a minimum you'll need the `SUNWuiu8` package. You probably
|
||||
should also install the `SUNWciu8`, `SUNWhiu8`, `SUNWjiu8`, and
|
||||
`SUNWkiu8` packages.
|
||||
|
||||
The native iconv on Compaq Tru64 doesn't contain support for
|
||||
UTF-8, so you'll need to use GNU libiconv instead. (When
|
||||
|
@ -57,7 +62,7 @@ for GNU gettext as well.) This probably applies to related
|
|||
operating systems as well.
|
||||
|
||||
Finally, for message catalog handling, GLib requires an implementation
|
||||
of gettext(). If your system doesn't provide this functionality,
|
||||
of `gettext()`. If your system doesn't provide this functionality,
|
||||
you should use the libintl library from the GNU gettext package,
|
||||
available from:
|
||||
|
||||
|
@ -67,7 +72,7 @@ Support for extended attributes and SELinux in GIO requires
|
|||
libattr and libselinux.
|
||||
|
||||
Some of the mimetype-related functionality in GIO requires the
|
||||
update-mime-database and update-desktop-database utilities, which
|
||||
`update-mime-database` and `update-desktop-database` utilities, which
|
||||
are part of shared-mime-info and desktop-file-utils, respectively.
|
||||
|
||||
GObject uses libffi to implement generic marshalling functionality.
|
||||
|
@ -88,28 +93,28 @@ Or online at:
|
|||
Installation directories
|
||||
========================
|
||||
|
||||
The location of the installed files is determined by the --prefix
|
||||
and --exec-prefix options given to configure. There are also more
|
||||
The location of the installed files is determined by the `--prefix`
|
||||
and `--exec-prefix` options given to configure. There are also more
|
||||
detailed flags to control individual directories. However, the
|
||||
use of these flags is not tested.
|
||||
|
||||
One particular detail to note, is that the architecture-dependent
|
||||
include file glibconfig.h is installed in:
|
||||
include file `glibconfig.h` is installed in `$libdir/glib-2.0/include/`.
|
||||
|
||||
$exec_prefix/lib/glib/include/
|
||||
|
||||
if you have a version in $prefix/include, this is out of date
|
||||
and should be deleted.
|
||||
|
||||
.pc files for the various libraries are installed in
|
||||
$exec_prefix/lib/pkgconfig to provide information when compiling
|
||||
other packages that depend on GLib. If you set PKG_CONFIG_PATH
|
||||
`.pc` files for the various libraries are installed in
|
||||
`$libdir/pkgconfig` to provide information when compiling
|
||||
other packages that depend on GLib. If you set `PKG_CONFIG_PATH`
|
||||
so that it points to this directory, then you can get the
|
||||
correct include flags and library flags for compiling a GLib
|
||||
application with:
|
||||
|
||||
pkg-config --cflags glib-2.0
|
||||
pkg-config --libs glib-2.0
|
||||
```sh
|
||||
pkg-config --cflags glib-2.0
|
||||
pkg-config --libs glib-2.0
|
||||
```
|
||||
|
||||
This is the only supported way of determining the include and library flags
|
||||
for building against GLib.
|
||||
|
||||
|
||||
Cross-compiling GLib
|
|
@ -0,0 +1,73 @@
|
|||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
|
@ -0,0 +1,121 @@
|
|||
Creative Commons Legal Code
|
||||
|
||||
CC0 1.0 Universal
|
||||
|
||||
CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
|
||||
LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
|
||||
ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
|
||||
INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
|
||||
REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
|
||||
PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
|
||||
THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
|
||||
HEREUNDER.
|
||||
|
||||
Statement of Purpose
|
||||
|
||||
The laws of most jurisdictions throughout the world automatically confer
|
||||
exclusive Copyright and Related Rights (defined below) upon the creator
|
||||
and subsequent owner(s) (each and all, an "owner") of an original work of
|
||||
authorship and/or a database (each, a "Work").
|
||||
|
||||
Certain owners wish to permanently relinquish those rights to a Work for
|
||||
the purpose of contributing to a commons of creative, cultural and
|
||||
scientific works ("Commons") that the public can reliably and without fear
|
||||
of later claims of infringement build upon, modify, incorporate in other
|
||||
works, reuse and redistribute as freely as possible in any form whatsoever
|
||||
and for any purposes, including without limitation commercial purposes.
|
||||
These owners may contribute to the Commons to promote the ideal of a free
|
||||
culture and the further production of creative, cultural and scientific
|
||||
works, or to gain reputation or greater distribution for their Work in
|
||||
part through the use and efforts of others.
|
||||
|
||||
For these and/or other purposes and motivations, and without any
|
||||
expectation of additional consideration or compensation, the person
|
||||
associating CC0 with a Work (the "Affirmer"), to the extent that he or she
|
||||
is an owner of Copyright and Related Rights in the Work, voluntarily
|
||||
elects to apply CC0 to the Work and publicly distribute the Work under its
|
||||
terms, with knowledge of his or her Copyright and Related Rights in the
|
||||
Work and the meaning and intended legal effect of CC0 on those rights.
|
||||
|
||||
1. Copyright and Related Rights. A Work made available under CC0 may be
|
||||
protected by copyright and related or neighboring rights ("Copyright and
|
||||
Related Rights"). Copyright and Related Rights include, but are not
|
||||
limited to, the following:
|
||||
|
||||
i. the right to reproduce, adapt, distribute, perform, display,
|
||||
communicate, and translate a Work;
|
||||
ii. moral rights retained by the original author(s) and/or performer(s);
|
||||
iii. publicity and privacy rights pertaining to a person's image or
|
||||
likeness depicted in a Work;
|
||||
iv. rights protecting against unfair competition in regards to a Work,
|
||||
subject to the limitations in paragraph 4(a), below;
|
||||
v. rights protecting the extraction, dissemination, use and reuse of data
|
||||
in a Work;
|
||||
vi. database rights (such as those arising under Directive 96/9/EC of the
|
||||
European Parliament and of the Council of 11 March 1996 on the legal
|
||||
protection of databases, and under any national implementation
|
||||
thereof, including any amended or successor version of such
|
||||
directive); and
|
||||
vii. other similar, equivalent or corresponding rights throughout the
|
||||
world based on applicable law or treaty, and any national
|
||||
implementations thereof.
|
||||
|
||||
2. Waiver. To the greatest extent permitted by, but not in contravention
|
||||
of, applicable law, Affirmer hereby overtly, fully, permanently,
|
||||
irrevocably and unconditionally waives, abandons, and surrenders all of
|
||||
Affirmer's Copyright and Related Rights and associated claims and causes
|
||||
of action, whether now known or unknown (including existing as well as
|
||||
future claims and causes of action), in the Work (i) in all territories
|
||||
worldwide, (ii) for the maximum duration provided by applicable law or
|
||||
treaty (including future time extensions), (iii) in any current or future
|
||||
medium and for any number of copies, and (iv) for any purpose whatsoever,
|
||||
including without limitation commercial, advertising or promotional
|
||||
purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
|
||||
member of the public at large and to the detriment of Affirmer's heirs and
|
||||
successors, fully intending that such Waiver shall not be subject to
|
||||
revocation, rescission, cancellation, termination, or any other legal or
|
||||
equitable action to disrupt the quiet enjoyment of the Work by the public
|
||||
as contemplated by Affirmer's express Statement of Purpose.
|
||||
|
||||
3. Public License Fallback. Should any part of the Waiver for any reason
|
||||
be judged legally invalid or ineffective under applicable law, then the
|
||||
Waiver shall be preserved to the maximum extent permitted taking into
|
||||
account Affirmer's express Statement of Purpose. In addition, to the
|
||||
extent the Waiver is so judged Affirmer hereby grants to each affected
|
||||
person a royalty-free, non transferable, non sublicensable, non exclusive,
|
||||
irrevocable and unconditional license to exercise Affirmer's Copyright and
|
||||
Related Rights in the Work (i) in all territories worldwide, (ii) for the
|
||||
maximum duration provided by applicable law or treaty (including future
|
||||
time extensions), (iii) in any current or future medium and for any number
|
||||
of copies, and (iv) for any purpose whatsoever, including without
|
||||
limitation commercial, advertising or promotional purposes (the
|
||||
"License"). The License shall be deemed effective as of the date CC0 was
|
||||
applied by Affirmer to the Work. Should any part of the License for any
|
||||
reason be judged legally invalid or ineffective under applicable law, such
|
||||
partial invalidity or ineffectiveness shall not invalidate the remainder
|
||||
of the License, and in such case Affirmer hereby affirms that he or she
|
||||
will not (i) exercise any of his or her remaining Copyright and Related
|
||||
Rights in the Work or (ii) assert any associated claims and causes of
|
||||
action with respect to the Work, in either case contrary to Affirmer's
|
||||
express Statement of Purpose.
|
||||
|
||||
4. Limitations and Disclaimers.
|
||||
|
||||
a. No trademark or patent rights held by Affirmer are waived, abandoned,
|
||||
surrendered, licensed or otherwise affected by this document.
|
||||
b. Affirmer offers the Work as-is and makes no representations or
|
||||
warranties of any kind concerning the Work, express, implied,
|
||||
statutory or otherwise, including without limitation warranties of
|
||||
title, merchantability, fitness for a particular purpose, non
|
||||
infringement, or the absence of latent or other defects, accuracy, or
|
||||
the present or absence of errors, whether or not discoverable, all to
|
||||
the greatest extent permissible under applicable law.
|
||||
c. Affirmer disclaims responsibility for clearing rights of other persons
|
||||
that may apply to the Work or any use thereof, including without
|
||||
limitation any person's Copyright and Related Rights in the Work.
|
||||
Further, Affirmer disclaims responsibility for obtaining any necessary
|
||||
consents, permissions or other rights required for any use of the
|
||||
Work.
|
||||
d. Affirmer understands and acknowledges that Creative Commons is not a
|
||||
party to this document and has no duty or obligation with respect to
|
||||
this CC0 or use of the Work.
|
|
@ -0,0 +1,117 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
one line to give the program's name and an idea of what it does. Copyright (C) yyyy name of author
|
||||
|
||||
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
|
||||
|
||||
This program 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 General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
signature of Ty Coon, 1 April 1989 Ty Coon, President of Vice
|
|
@ -0,0 +1,175 @@
|
|||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License).
|
||||
|
||||
To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
one line to give the library's name and an idea of what it does.
|
||||
Copyright (C) year name of author
|
||||
|
||||
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 Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in
|
||||
the library `Frob' (a library for tweaking knobs) written
|
||||
by James Random Hacker.
|
||||
|
||||
signature of Ty Coon, 1 April 1990
|
||||
Ty Coon, President of Vice
|
||||
That's all there is to it!
|
|
@ -0,0 +1,15 @@
|
|||
---- LLVM Exceptions to the Apache 2.0 License ----
|
||||
|
||||
As an exception, if, as a result of your compiling your source code, portions
|
||||
of this Software are embedded into an Object form of such source code, you
|
||||
may redistribute such embedded portions in such Object form without complying
|
||||
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
|
||||
|
||||
In addition, if you combine or link compiled forms of this Software with
|
||||
software that is licensed under the GPLv2 ("Combined Software") and if a
|
||||
court of competent jurisdiction determines that the patent provision (Section
|
||||
3), the indemnity provision (Section 9) or other Section of the License
|
||||
conflicts with the conditions of the GPLv2, you may retroactively and
|
||||
prospectively choose to deem waived or otherwise exclude such Section(s) of
|
||||
the License, but only in their entirety and only with respect to the Combined
|
||||
Software.
|
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) <year> <copyright holders>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
211
NEWS.pre-1-3
211
NEWS.pre-1-3
|
@ -1,211 +0,0 @@
|
|||
Overview of Changes in GLib 1.2.1:
|
||||
|
||||
* g_realloc() fix for SunOS (please report further problems).
|
||||
* Continued the never ending fix vendetta regarding getpwuid(),
|
||||
this time AIX has been the culprit.
|
||||
* Upgrade to libtool 1.2f
|
||||
* Miscellaneous other buglets fixed.
|
||||
|
||||
What's new in GLib 1.2.0 (since GLib 1.0.x):
|
||||
|
||||
* GLib is distributed seperatedly from Gtk+
|
||||
* Win32 Portability
|
||||
* Threading support
|
||||
* GModule mechanism (implemented in an extra library) which wraps dynamic
|
||||
object code loading facilities in a portable manner
|
||||
* GIOChannel structure to encapsulate the IPC mechanism
|
||||
* GQuarks and datasets
|
||||
* GRelations for n-way mapping of certain data
|
||||
* An n-way tree implementation
|
||||
* GDate functionality for calendar date manipulations
|
||||
* GAllocator type and associated functions
|
||||
* Added generic callback maintenance functions (ghook)
|
||||
* Generic functions for TAB completions
|
||||
* Endian defines (G_*_ENDIAN)
|
||||
* g_log() mechanism for logging of messages at different log levels
|
||||
* Generic main-loop mechanism
|
||||
* New glib-config helper script
|
||||
* Many more API extensions
|
||||
|
||||
Overview of Changes in GLib 1.1.16:
|
||||
|
||||
* Allocate smaller pools of memory for glists, gslists, gnodes
|
||||
* Bug Fixes
|
||||
|
||||
Overview of Changes in GLib 1.1.15:
|
||||
|
||||
* HPUX 11 thread system detection should now work
|
||||
* Release the main loop lock around calls to prepare() and
|
||||
check() so it is not held over user code
|
||||
* A few Win32 fixups
|
||||
|
||||
Overview of Changes in GLib 1.1.14:
|
||||
|
||||
* Check for dlsym() in system libraries and -dl
|
||||
* FreeBSD portability fixes
|
||||
* Random bug fixes and autoconf/automake changes
|
||||
|
||||
Overview of Changes in GLib 1.1.13:
|
||||
|
||||
* Removed alloca() based function and macro variants again.
|
||||
* Improved thread related configure tests.
|
||||
* GSource destruction fixups.
|
||||
* Fixed up idle function removal based on user_data pointer.
|
||||
* Advanced Win32 portability.
|
||||
* Enforced GSource's check(), prepare() and dispatch() constrains,
|
||||
loop recursions may only happen from dispatch(), and check() as well
|
||||
as prepare() are called while the main_loop lock is being held.
|
||||
* GLib development now requires GNU autoconf 2.13, GNU automake 1.4
|
||||
and GNU libtool 1.2d.
|
||||
* Lots of random portability and bug fixes.
|
||||
|
||||
Overview of Changes in GLib 1.1.12:
|
||||
|
||||
* Added alloca functions/macros: g_strdup_a, g_strconcat3_a, g_alloca,
|
||||
g_new_a, g_new0_a
|
||||
* New tests structure. Type 'make check' on your system to run them.
|
||||
* Avoid unnecessary extra hook referencing in g_hook_list_marshal
|
||||
|
||||
Overview of Changes in GLib 1.1.11:
|
||||
|
||||
* provide defaults for POLL sysdefs
|
||||
* g_main_is_running: new function to check whether a main loop has been quitted
|
||||
* a few other enhancement/fixes
|
||||
|
||||
Overview of Changes in GLib 1.1.9:
|
||||
|
||||
* Check for pthread_attr_init in all cases, Digital Unix 4 requires this
|
||||
* For G_LOCK_DECLARE_*, if !G_THREADS_ENABLED, eat trailing semicolon better
|
||||
* Changed g_main_poll_(add|remove) to g_main_(add|remove)_poll
|
||||
|
||||
Overview of Changes in GLib 1.1.8:
|
||||
|
||||
* Added threading support
|
||||
- The ability to specify a set of functions to be used for
|
||||
locking at runtime.
|
||||
- Default implementations of locking functions for pthreads,
|
||||
Solaris threads, and (experimentally) NSPR.
|
||||
- All static variables should now properly locked.
|
||||
- Enhancements to the generic main-loop mechanism to be thread-safe.
|
||||
(It is used for the main-loop in GTK+ as of GTK+-1.1.8)
|
||||
* Portability fixes.
|
||||
|
||||
Overview of Changes in GLib 1.1.7:
|
||||
|
||||
* Removed multiple define from glibconfig.h
|
||||
|
||||
Overview of Changes in GLib 1.1.6:
|
||||
|
||||
* New GDate functionality for calendar date manipulations (g_date_*)
|
||||
* New GAllocator type and associated functions
|
||||
* New functions g_slist_copy and g_list_copy to duplicate a list with all
|
||||
its data pointers.
|
||||
* New function g_array_insert_vals and new macro g_array_insert_val to
|
||||
insert elements at an arbitrary index
|
||||
* GAllocators used for glist, gslist, gnode node allocations
|
||||
* Incremental freezing in ghash
|
||||
* New function g_hook_list_marshal_check to eventually destroy hooks after
|
||||
they got marshalled
|
||||
* Revised GIOChannel to provide generic virtual-function based interface
|
||||
* Added generic main-loop abstraction
|
||||
* Removed GListAllocator type and its g_*_allocator_*() function variants
|
||||
* Bug fixes
|
||||
|
||||
Overview of Changes in GLib 1.1.5:
|
||||
|
||||
* Win32 portability
|
||||
* GIOChannel structure to encapsulate the IPC mechanism
|
||||
* Reimplemented endian stuff, using inline asm for x86
|
||||
* New functions:
|
||||
- g_strescape: escapes backslashes
|
||||
- g_path_is_absolute and g_path_skip_root
|
||||
- g_getenv: expands environment variables that contain references
|
||||
to other environment variables
|
||||
- g_scanner_sync_file_offset: rewind the filedescriptor to the current
|
||||
buffer position and blow the file read ahead buffer
|
||||
- g_array_remove_index: remove an entry, preserving the order
|
||||
- g_array_remove_index_fast: remove an entry, order might be distorted
|
||||
- g_ptr_array_remove: remove an entry, preserving the order
|
||||
- g_ptr_array_remove_fast: remove an entry, order might be distorted
|
||||
- g_byte_array_remove_index: wrapper for g_array_remove_index
|
||||
- g_byte_array_remove_index_fast: wrapper for g_array_remove_index_fast
|
||||
- g_strncasecmp: modeled closely after g_strcasecmp
|
||||
- g_list_sort, g_slist_sort: to merge sort GLists and GSLists
|
||||
* New macros:
|
||||
- G_DIR_SEPARATOR, G_DIR_SEPARATOR_S: platform-dependant file name
|
||||
syntax elements
|
||||
- G_SEARCHPATH_SEPARATOR, G_SEARCHPATH_SEPARATOR_S: platform-dependant
|
||||
search path syntax conventions
|
||||
- G_STRUCT_OFFSET, G_STRUCT_MEMBER_P, G_STRUCT_MEMBER: for handling
|
||||
structure fields through their offsets
|
||||
* Removed G_ENUM, G_FLAGS, G_NV, and G_SV macros
|
||||
* Bug fixes
|
||||
|
||||
Overview of Changes in GLib 1.1.4:
|
||||
|
||||
* Added generic callback maintenance functions (ghook)
|
||||
* New endian defines (G_*_ENDIAN)
|
||||
* New string join/split/free routines
|
||||
* Fixes
|
||||
|
||||
Overview of Changes in GLib 1.1.3:
|
||||
|
||||
* New GModule mechanism (implemented in an extra library) which wraps dynamic
|
||||
object code loading facilities in a portable manner.
|
||||
* glib-config features extra "glib" (old behaviour remains) and "gmodule"
|
||||
(add libgmodule.so to the --libs output) arguments now. this can also
|
||||
be specified as fourth argument to the AM_PATH_GLIB() macro.
|
||||
* Overhaul of the `inline' autoconfiguration stuff, so inlining should be
|
||||
sufficiently supported on all systems that allow inlining now.
|
||||
* New g_log() mechanism for logging of messages at different log levels,
|
||||
associated with certain log domains (define -DG_LOG_DOMAIN for your library).
|
||||
* New inline functions for bit masks tests.
|
||||
* GNode macros (and functions) now return the newly allocated node.
|
||||
* New macro G_VA_COPY() to work around va_list copying oddities on some
|
||||
platforms. the non-static g_vsprintf() function vanished in favour of
|
||||
a publically exported g_strdup_vprintf().
|
||||
People that used the former g_vsprintf() would definitely want to read the
|
||||
associated ChangeLog entries (grep for printf).
|
||||
* New utility functions:
|
||||
g_strndup(), g_on_error_query(), g_on_error_stack_trace(), g_strdup_printf(),
|
||||
g_strdup_vprintf(), g_printf_string_upper_bound(), g_spaced_primes_closest(),
|
||||
g_strnfill(), g_memdup().
|
||||
* Overhaul of the array implementations, this contains some source incompatible
|
||||
changes. Again, the ChangeLog is much more informative (grep for garray.c).
|
||||
* The internals of the g_dataset mechanism are now exported through the
|
||||
new g_datalist_* API (this is also the underlying implementation for the
|
||||
keyed data of GtkObjects).
|
||||
* New function g_atexit(), use of the ATEXIT() macro is discouraged.
|
||||
* Better configure checks for ansi compliance.
|
||||
* Libtool update to version 1.2b.
|
||||
* Lotsa bug fixes and cleanups as always ;)
|
||||
|
||||
Overview of Changes in GLib 1.1.2:
|
||||
|
||||
* Fixed packaging mistake which occured in 1.1.1
|
||||
* fix 64-bitness in g_prints in glibtest
|
||||
|
||||
What is new in GLib 1.1.1:
|
||||
|
||||
* An n-way tree implementation is provided now, based on the GNode structure.
|
||||
* Bugfix for pointer arrays.
|
||||
|
||||
What is new in GLib 1.1.0:
|
||||
|
||||
* GLib is distributed seperatedly from Gtk+ now and uses a sophisticated
|
||||
shared library versioning scheme to deal with interface and binary
|
||||
incompatibilities.
|
||||
* There is a glib-config helper script installed now.
|
||||
* Fixups all over the place.
|
||||
* gboolean is now a gint, not a gchar anymore.
|
||||
* API extensions for GList and GSList.
|
||||
* New g_str*() functions for simple string handling.
|
||||
* GScanner extensions for scope, warning and error handling.
|
||||
* Minor performance improvements for GMemChunks.
|
||||
* Implementations of GQuarks and datasets (similar to GtkObjects data
|
||||
mechansim, but works for generic memory locations).
|
||||
* More convenience macros for GNU C function arguments.
|
||||
* Const correction all over the place, including a new pointer type
|
||||
gconstpointer.
|
||||
* Generic functions for TAB completions.
|
||||
* GRelations for n-way mapping of certain data.
|
350
README.md
350
README.md
|
@ -13,15 +13,41 @@ The official web site is:
|
|||
|
||||
## Installation
|
||||
|
||||
See the file '[INSTALL.in](INSTALL.in)'
|
||||
See the file '[INSTALL.md](INSTALL.md)'
|
||||
|
||||
## How to report bugs
|
||||
## Supported versions
|
||||
|
||||
Bugs should be reported to the GNOME issue tracking system.
|
||||
(<https://gitlab.gnome.org/GNOME/glib/issues/new>). You will need
|
||||
to create an account for yourself.
|
||||
Only the most recent unstable and stable release series are supported. All
|
||||
older versions are not supported upstream and may contain bugs, some of
|
||||
which may be exploitable security vulnerabilities.
|
||||
|
||||
In the bug report please include:
|
||||
See [SECURITY.md](SECURITY.md) for more details.
|
||||
|
||||
## Documentation
|
||||
|
||||
API documentation is available online for GLib for the:
|
||||
* [GLib](https://docs.gtk.org/glib/)
|
||||
* [GObject](https://docs.gtk.org/gobject/)
|
||||
* [GModule](https://docs.gtk.org/gmodule/)
|
||||
* [GIO](https://docs.gtk.org/gio/)
|
||||
|
||||
## Discussion
|
||||
|
||||
If you have a question about how to use GLib, seek help on [GNOME’s Discourse
|
||||
instance](https://discourse.gnome.org/tags/glib). Alternatively, ask a question
|
||||
on [StackOverflow and tag it `glib`](https://stackoverflow.com/questions/tagged/glib).
|
||||
|
||||
## Reporting bugs
|
||||
|
||||
Bugs should be [reported to the GNOME issue tracking system](https://gitlab.gnome.org/GNOME/glib/issues/new).
|
||||
You will need to create an account for yourself. You may also submit bugs by
|
||||
e-mail (without an account) by e-mailing <incoming+gnome-glib-658-issue-@gitlab.gnome.org>,
|
||||
but this will give you a degraded experience.
|
||||
|
||||
Bugs are for reporting problems in GLib itself, not for asking questions about
|
||||
how to use it. To ask questions, use one of our [discussion forums](#discussion).
|
||||
|
||||
In bug reports please include:
|
||||
|
||||
* Information about your system. For instance:
|
||||
* What operating system and version
|
||||
|
@ -29,305 +55,39 @@ In the bug report please include:
|
|||
* And anything else you think is relevant.
|
||||
* How to reproduce the bug.
|
||||
* If you can reproduce it with one of the test programs that are built
|
||||
in the tests/ subdirectory, that will be most convenient. Otherwise,
|
||||
in the `tests/` subdirectory, that will be most convenient. Otherwise,
|
||||
please include a short test program that exhibits the behavior.
|
||||
As a last resort, you can also provide a pointer to a larger piece
|
||||
of software that can be downloaded.
|
||||
* If the bug was a crash, the exact text that was printed out
|
||||
when the crash occured.
|
||||
when the crash occurred.
|
||||
* Further information such as stack traces may be useful, but
|
||||
is not necessary.
|
||||
|
||||
## Patches
|
||||
## Contributing to GLib
|
||||
|
||||
Patches should also be submitted as merge requests to gitlab.gnome.org. If the
|
||||
patch fixes an existing issue, please refer to the issue in your commit message
|
||||
with the following notation (for issue 123):
|
||||
Please follow the [contribution guide](./CONTRIBUTING.md) to know how to
|
||||
start contributing to GLib.
|
||||
|
||||
Patches should be [submitted as merge requests](https://gitlab.gnome.org/GNOME/glib/-/merge_requests/new)
|
||||
to gitlab.gnome.org. If the patch fixes an existing issue, please refer to the
|
||||
issue in your commit message with the following notation (for issue 123):
|
||||
```
|
||||
Closes: #123
|
||||
```
|
||||
|
||||
Otherwise, create a new merge request that introduces the change, filing a
|
||||
Otherwise, create a new merge request that introduces the change. Filing a
|
||||
separate issue is not required.
|
||||
|
||||
## Notes
|
||||
## Default branch renamed to `main`
|
||||
|
||||
### Notes about GLib 2.48
|
||||
|
||||
* The system copy of PCRE is now used by default to implement GRegex.
|
||||
Configure with --with-pcre=internal if a system PCRE version
|
||||
is unavailable or undesired.
|
||||
|
||||
### Notes about GLib 2.46
|
||||
|
||||
* GTask no longer imposes a fixed limit on the number of tasks that
|
||||
can be run_in_thread() simultaneously, since doing this inevitably
|
||||
results in deadlocks in some use cases. Instead, it now has a base
|
||||
number of threads that can be used "for free", but will gradually
|
||||
add more threads to the pool if too much time passes without any
|
||||
tasks completing.
|
||||
|
||||
The exact behavior may continue to change in the future, and it's
|
||||
possible that some future version of GLib may not do any
|
||||
rate-limiting at all. As a result, you should no longer assume that
|
||||
GTask will rate-limit tasks itself (or, by extension, that calls to
|
||||
certain async gio methods will automatically be rate-limited for
|
||||
you). If you have a very large number of tasks to run, and don't
|
||||
want them to all run at once, you should rate-limit them yourself.
|
||||
|
||||
### Notes about GLib 2.40
|
||||
|
||||
* g_test_run() no longer runs tests in exactly the order they are
|
||||
registered; instead, it groups them according to test suites (ie,
|
||||
path components) like the documentation always claimed it did. In
|
||||
some cases, this can result in a sub-optimal ordering of tests,
|
||||
relative to the old behavior. The fix is to change the test paths to
|
||||
properly group together the tests that should run together. (eg, if
|
||||
you want to run test_foo_simple(), test_bar_simple(), and
|
||||
test_foo_using_bar() in that order, they should have test paths like
|
||||
"/simple/foo", "/simple/bar", "/complex/foo-using-bar", not
|
||||
"/foo/simple", "/bar/simple", "/foo/using-bar" (which would result
|
||||
in test_foo_using_bar() running before test_bar_simple()).
|
||||
|
||||
(The behavior actually changed in GLib 2.36, but it was not
|
||||
documented at the time, since we didn't realize it mattered.)
|
||||
|
||||
### Notes about GLib 2.36
|
||||
|
||||
* It is no longer necessary to call g_type_init(). If you are
|
||||
loading GLib as a dynamic module, you should be careful to avoid
|
||||
unloading it, then subsequently loading it again. This never
|
||||
really worked before, but it is now explicitly undefined behavior.
|
||||
Note that if g_type_init() was the only explicit use of a GObject
|
||||
API and you are using linker flags such as --no-add-needed, then
|
||||
you may have to artificially use some GObject call to keep the
|
||||
linker from optimizing away -lgobject. We recommend to use
|
||||
g_type_ensure (G_TYPE_OBJECT) for this purpose.
|
||||
|
||||
* This release contains an incompatible change to the g_get_home_dir()
|
||||
function. Previously, this function would effectively ignore the HOME
|
||||
environment variable and always return the value from /etc/password.
|
||||
As of this version, the HOME variable is used if it is set and the
|
||||
value from /etc/passwd is only used as a fallback.
|
||||
|
||||
* The 'flowinfo' and 'scope_id' fields of GInetSocketAddress
|
||||
(introduced in GLib 2.32) have been fixed to be in host byte order
|
||||
rather than network byte order. This is an incompatible change, but
|
||||
the previous behavior was clearly broken, so it seems unlikely that
|
||||
anyone was using it.
|
||||
|
||||
### Notes about GLib 2.34
|
||||
|
||||
* GIO now looks for thumbnails in XDG_CACHE_HOME, following a
|
||||
recent alignment of the thumbnail spec with the basedir spec.
|
||||
|
||||
* The default values for GThreadPools max_unused_threads and
|
||||
max_idle_time settings have been changed to 2 and 15*1000,
|
||||
respectively.
|
||||
|
||||
### Notes about GLib 2.32
|
||||
|
||||
* It is no longer necessary to use g_thread_init() or to link against
|
||||
libgthread. libglib is now always thread-enabled. Custom thread
|
||||
system implementations are no longer supported (including errorcheck
|
||||
mutexes).
|
||||
|
||||
* The thread and synchronisation APIs have been updated.
|
||||
GMutex and GCond can be statically allocated without explicit
|
||||
initialisation, as can new types GRWLock and GRecMutex. The
|
||||
GStatic_______ variants of these types have been deprecated. GPrivate
|
||||
can also be statically allocated and has a nicer API (deprecating
|
||||
GStaticPrivate). Finally, g_thread_create() has been replaced with a
|
||||
substantially simplified g_thread_new().
|
||||
|
||||
* The g_once_init_enter()/_leave() functions have been replaced with
|
||||
macros that allow for a pointer to any gsize-sized object, not just a
|
||||
gsize*. The assertions to ensure that a pointer to a correctly-sized
|
||||
object is being used will not work with generic pointers (ie: (void*)
|
||||
and (gpointer) casts) which would have worked with the old version.
|
||||
|
||||
* It is now mandatory to include glib.h instead of individual headers.
|
||||
|
||||
* The -uninstalled variants of the pkg-config files have been dropped.
|
||||
|
||||
* For a long time, gobject-2.0.pc mistakenly declared a public
|
||||
dependency on gthread-2.0.pc (when the dependency should have been
|
||||
private). This means that programs got away with calling
|
||||
g_thread_init() without explicitly listing gthread-2.0.pc among their
|
||||
dependencies.
|
||||
|
||||
gthread has now been removed as a gobject dependency, which will cause
|
||||
such programs to break.
|
||||
|
||||
The fix for this problem is either to declare an explicit dependency
|
||||
on gthread-2.0.pc (if you care about compatibility with older GLib
|
||||
versions) or to stop calling g_thread_init().
|
||||
|
||||
* g_debug() output is no longer enabled by default. It can be enabled
|
||||
on a per-domain basis with the G_MESSAGES_DEBUG environment variable
|
||||
like
|
||||
G_MESSAGES_DEBUG=domain1,domain2
|
||||
or
|
||||
G_MESSAGES_DEBUG=all
|
||||
|
||||
### Notes about GLib 2.30
|
||||
|
||||
* GObject includes a generic marshaller, g_cclosure_marshal_generic.
|
||||
To use it, simply specify NULL as the marshaller in g_signal_new().
|
||||
The generic marshaller is implemented with libffi, and consequently
|
||||
GObject depends on libffi now.
|
||||
|
||||
### Notes about GLib 2.28
|
||||
|
||||
* The GApplication API has changed compared to the version that was
|
||||
included in the 2.25 development snapshots. Existing users will need
|
||||
adjustments.
|
||||
|
||||
### Notes about GLib 2.26
|
||||
|
||||
* Nothing noteworthy.
|
||||
|
||||
### Notes about GLib 2.24
|
||||
|
||||
* It is now allowed to call g_thread_init(NULL) multiple times, and
|
||||
to call glib functions before g_thread_init(NULL) is called
|
||||
(although the later is mainly a change in docs as this worked before
|
||||
too). See the GThread reference documentation for the details.
|
||||
|
||||
* GObject now links to GThread and threads are enabled automatically
|
||||
when g_type_init() is called.
|
||||
|
||||
* GObject no longer allows to call g_object_set() on construct-only properties
|
||||
while an object is being initialized. If this behavior is needed, setting a
|
||||
custom constructor that just chains up will re-enable this functionality.
|
||||
|
||||
* GMappedFile on an empty file now returns NULL for the contents instead of
|
||||
returning an empty string. The documentation specifically states that code
|
||||
may not rely on nul-termination here so any breakage caused by this change
|
||||
is a bug in application code.
|
||||
|
||||
### Notes about GLib 2.22
|
||||
|
||||
* Repeated calls to g_simple_async_result_set_op_res_gpointer used
|
||||
to leak the data. This has been fixed to always call the provided
|
||||
destroy notify.
|
||||
|
||||
### Notes about GLib 2.20
|
||||
|
||||
* The functions for launching applications (e.g. g_app_info_launch() +
|
||||
friends) now passes a FUSE file:// URI if possible (requires gvfs
|
||||
with the FUSE daemon to be running and operational). With gvfs 2.26,
|
||||
FUSE file:// URIs will be mapped back to gio URIs in the GFile
|
||||
constructors. The intent of this change is to better integrate
|
||||
POSIX-only applications, see bug #528670 for the rationale. The
|
||||
only user-visible change is when an application needs to examine an
|
||||
URI passed to it (e.g. as a positional parameter). Instead of
|
||||
looking at the given URI, the application will now need to look at
|
||||
the result of g_file_get_uri() after having constructed a GFile
|
||||
object with the given URI.
|
||||
|
||||
### Notes about GLib 2.18
|
||||
|
||||
* The recommended way of using GLib has always been to only include the
|
||||
toplevel headers glib.h, glib-object.h and gio.h. GLib enforces this by
|
||||
generating an error when individual headers are directly included.
|
||||
To help with the transition, the enforcement is not turned on by
|
||||
default for GLib headers (it is turned on for GObject and GIO).
|
||||
To turn it on, define the preprocessor symbol G_DISABLE_SINGLE_INCLUDES.
|
||||
|
||||
### Notes about GLib 2.16
|
||||
|
||||
* GLib now includes GIO, which adds optional dependencies against libattr
|
||||
and libselinux for extended attribute and SELinux support. Use
|
||||
--disable-xattr and --disable-selinux to build without these.
|
||||
|
||||
### Notes about GLib 2.10
|
||||
|
||||
* The functions g_snprintf() and g_vsnprintf() have been removed from
|
||||
the gprintf.h header, since they are already declared in glib.h. This
|
||||
doesn't break documented use of gprintf.h, but people have been known
|
||||
to include gprintf.h without including glib.h.
|
||||
|
||||
* The Unicode support has been updated to Unicode 4.1. This adds several
|
||||
new members to the GUnicodeBreakType enumeration.
|
||||
|
||||
* The support for Solaris threads has been retired. Solaris has provided
|
||||
POSIX threads for long enough now to have them available on every
|
||||
Solaris platform.
|
||||
|
||||
* 'make check' has been changed to validate translations by calling
|
||||
msgfmt with the -c option. As a result, it may fail on systems with
|
||||
older gettext implementations (GNU gettext < 0.14.1, or Solaris gettext).
|
||||
'make check' will also fail on systems where the C compiler does not
|
||||
support ELF visibility attributes.
|
||||
|
||||
* The GMemChunk API has been deprecated in favour of a new 'slice
|
||||
allocator'. See the g_slice documentation for more details.
|
||||
|
||||
* A new type, GInitiallyUnowned, has been introduced, which is
|
||||
intended to serve as a common implementation of the 'floating reference'
|
||||
concept that is e.g. used by GtkObject. Note that changing the
|
||||
inheritance hierarchy of a type can cause problems for language
|
||||
bindings and other code which needs to work closely with the type
|
||||
system. Therefore, switching to GInitiallyUnowned should be done
|
||||
carefully. g_object_compat_control() has been added to GLib 2.8.5
|
||||
to help with the transition.
|
||||
|
||||
### Notes about GLib 2.6.0
|
||||
|
||||
* GLib 2.6 introduces the concept of 'GLib filename encoding', which is the
|
||||
on-disk encoding on Unix, but UTF-8 on Windows. All GLib functions
|
||||
returning or accepting pathnames have been changed to expect
|
||||
filenames in this encoding, and the common POSIX functions dealing
|
||||
with pathnames have been wrapped. These wrappers are declared in the
|
||||
header <glib/gstdio.h> which must be included explicitly; it is not
|
||||
included through <glib.h>.
|
||||
|
||||
On current (NT-based) Windows versions, where the on-disk file names
|
||||
are Unicode, these wrappers use the wide-character API in the C
|
||||
library. Thus applications can handle file names containing any
|
||||
Unicode characters through GLib's own API and its POSIX wrappers,
|
||||
not just file names restricted to characters in the system codepage.
|
||||
|
||||
To keep binary compatibility with applications compiled against
|
||||
older versions of GLib, the Windows DLL still provides entry points
|
||||
with the old semantics using the old names, and applications
|
||||
compiled against GLib 2.6 will actually use new names for the
|
||||
functions. This is transparent to the programmer.
|
||||
|
||||
When compiling against GLib 2.6, applications intended to be
|
||||
portable to Windows must take the UTF-8 file name encoding into
|
||||
consideration, and use the gstdio wrappers to access files whose
|
||||
names have been constructed from strings returned from GLib.
|
||||
|
||||
* Likewise, g_get_user_name() and g_get_real_name() have been changed
|
||||
to return UTF-8 on Windows, while keeping the old semantics for
|
||||
applications compiled against older versions of GLib.
|
||||
|
||||
* The GLib uses an '_' prefix to indicate private symbols that
|
||||
must not be used by applications. On some platforms, symbols beginning
|
||||
with prefixes such as _g will be exported from the library, on others not.
|
||||
In no case can applications use these private symbols. In addition to that,
|
||||
GLib+ 2.6 makes several symbols private which were not in any installed
|
||||
header files and were never intended to be exported.
|
||||
|
||||
* To reduce code size and improve efficiency, GLib, when compiled
|
||||
with the GNU toolchain, has separate internal and external entry
|
||||
points for exported functions. The internal names, which begin with
|
||||
IA__, may be seen when debugging a GLib program.
|
||||
|
||||
* On Windows, GLib no longer opens a console window when printing
|
||||
warning messages if stdout or stderr are invalid, as they are in
|
||||
"Windows subsystem" (GUI) applications. Simply redirect stdout or
|
||||
stderr if you need to see them.
|
||||
|
||||
* The child watch functionality tends to reveal a bug in many
|
||||
thread implementations (in particular the older LinuxThreads
|
||||
implementation on Linux) where it's not possible to call waitpid()
|
||||
for a child created in a different thread. For this reason, for
|
||||
maximum portability, you should structure your code to fork all
|
||||
child processes that you want to wait for from the main thread.
|
||||
|
||||
* A problem was recently discovered with g_signal_connect_object();
|
||||
it doesn't actually disconnect the signal handler once the object being
|
||||
connected to dies, just disables it. See the API docs for the function
|
||||
for further details and the correct workaround that will continue to
|
||||
work with future versions of GLib.
|
||||
The default development branch of GLib has been renamed to `main`. To update
|
||||
your local checkout, use:
|
||||
```sh
|
||||
git checkout master
|
||||
git branch -m master main
|
||||
git fetch
|
||||
git branch --unset-upstream
|
||||
git branch -u origin/main
|
||||
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/main
|
||||
```
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
See README.win32.md
|
|
@ -161,22 +161,9 @@ To overcome this problem, please set your system's locale setting for non-Unicod
|
|||
English (United States), reboot, and restart the build, and the code should build
|
||||
normally.
|
||||
|
||||
### Visual Studio 2008 hacks
|
||||
### Support for pre-2012 Visual Studio
|
||||
|
||||
- You need to run the following lines from your build directory, to embed the
|
||||
manifests that are generated during the build, assuming the built binaries
|
||||
are installed to `$(PREFIX)`, after a successful build/installation:
|
||||
|
||||
```cmd
|
||||
> for /r %f in (*.dll.manifest) do if exist $(PREFIX)\bin\%~nf mt /manifest %f $(PREFIX)\bin\%~nf;2
|
||||
> for /r %f in (*.exe.manifest) do if exist $(PREFIX)\bin\%~nf mt /manifest %f $(PREFIX)\bin\%~nf;1
|
||||
```
|
||||
|
||||
|
||||
- If building for amd64/x86_64/x64, sometimes the compilation of sources may seem to hang, which
|
||||
is caused by an optimization issue in the 2008 x64 compiler. You need to use Task Manager to
|
||||
remove all running instances of `cl.exe`, which will cause the build process to terminate. Update
|
||||
the build flags of the sources that hang on compilation by changing its `"/O2"` flag to `"/O1"`
|
||||
in `build.ninja`, and retry the build, where things should continue to build normally. At the
|
||||
time of writing, this is needed for compiling `glib/gtestutils.c`, `gio/gsettings.c`,
|
||||
`gio/gsettingsschema.c` and `gio/tests/gsubprocess-testprog.c`
|
||||
This release of GLib requires at least the Windows 8 SDK in order to be built
|
||||
successfully using Visual Studio, which means that it is no longer supported to
|
||||
build GLib with Visual Studio 2008 nor 2010. People that still need to use
|
||||
Visual Studio 2008 or 2010 should continue to use glib-2.66.x.
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
# Security policy for GLib
|
||||
|
||||
* [Supported Versions](#Supported-Versions)
|
||||
* [Reporting a Vulnerability](#Reporting-a-Vulnerability)
|
||||
* [Security Announcements](#Security-Announcements)
|
||||
* [Acknowledgements](#Acknowledgements)
|
||||
|
||||
## Supported Versions
|
||||
|
||||
Upstream GLib only supports the most recent stable release series, and the
|
||||
current development release series. Any older stable release series are no
|
||||
longer supported, although they may still receive backported security updates
|
||||
in long-term support distributions. Such support is up to the distributions,
|
||||
though.
|
||||
|
||||
Under GLib’s versioning scheme, stable release series have an *even* minor
|
||||
component (for example, 2.66.0, 2.66.1, 2.68.3), and development release series
|
||||
have an *odd* minor component (2.67.1, 2.69.0).
|
||||
|
||||
## Signed Releases
|
||||
|
||||
The git tags for all releases ≥2.58.0 are signed by a maintainer using
|
||||
[git-evtag](https://github.com/cgwalters/git-evtag). The maintainer will use
|
||||
their personal GPG key; there is currently not necessarily a formal chain of
|
||||
trust for these keys. Please [create an issue](https://gitlab.gnome.org/GNOME/glib/-/issues/new)
|
||||
if you would like to work on improving this.
|
||||
|
||||
Unsigned releases ≥2.58.0 should not be trusted. Releases prior to 2.58.0 were
|
||||
not signed.
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
If you think you've identified a security issue in GLib, GObject or GIO, please
|
||||
**do not** report the issue publicly via a mailing list, IRC, a public issue on
|
||||
the GitLab issue tracker, a merge request, or any other public venue.
|
||||
|
||||
Instead, report a
|
||||
[*confidential* issue in the GitLab issue tracker](https://gitlab.gnome.org/GNOME/glib/-/issues/new?issue[confidential]=1),
|
||||
with the “This issue is confidential” box checked. Please include as many
|
||||
details as possible, including a minimal reproducible example of the issue, and
|
||||
an idea of how exploitable/severe you think it is.
|
||||
|
||||
**Do not** provide a merge request to fix the issue, as there is currently no
|
||||
way to make confidential merge requests on gitlab.gnome.org. If you have patches
|
||||
which fix the security issue, please attach them to your confidential issue as
|
||||
patch files.
|
||||
|
||||
Confidential issues are only visible to the reporter and the GLib maintainers.
|
||||
|
||||
As per the [GNOME security policy](https://security.gnome.org/), the next steps
|
||||
are then:
|
||||
* The report is triaged.
|
||||
* Code is audited to find any potential similar problems.
|
||||
* If it is determined, in consultation with the submitter, that a CVE is
|
||||
required, the submitter obtains one via [cveform.mitre.org](https://cveform.mitre.org/).
|
||||
* The fix is prepared for the development branch, and for the most recent
|
||||
stable branch.
|
||||
* The fix is submitted to the public repository.
|
||||
* On the day the issue and fix are made public, an announcement is made on the
|
||||
[public channels listed below](#Security-Announcements).
|
||||
* A new release containing the fix is issued.
|
||||
|
||||
## Security Announcements
|
||||
|
||||
Security announcements are made publicly via the
|
||||
[`distributor` tag on discourse.gnome.org](https://discourse.gnome.org/tag/distributor)
|
||||
and cross-posted to the
|
||||
[distributor-list](https://mail.gnome.org/mailman/listinfo/distributor-list).
|
||||
|
||||
Announcements for security issues with wide applicability or high impact may
|
||||
additionally be made via
|
||||
[oss-security@lists.openwall.com](https://www.openwall.com/lists/oss-security/).
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
This text was partially based on the
|
||||
[github.com/containers security policy](https://github.com/containers/common/blob/HEAD/SECURITY.md),
|
||||
and partially based on the [flatpak security policy](https://github.com/flatpak/flatpak/blob/HEAD/SECURITY.md).
|
|
@ -16,9 +16,14 @@
|
|||
#
|
||||
# If you want to be responsible for code reviews in specific sections of
|
||||
# the GLib code base, add yourself here.
|
||||
#
|
||||
# Everyone listed in this file is a co-maintainer of GLib, even if they only
|
||||
# concern themselves with one section of the code base. All usernames listed
|
||||
# here should therefore also be listed in glib.doap, so that GitLab access
|
||||
# control is correct.
|
||||
|
||||
# Overall maintainers
|
||||
* @pwithnall @ebassi
|
||||
* @pwithnall @ebassi @3v1n0
|
||||
|
||||
# Build system
|
||||
meson.build @xclaesse @nirbheek @pwithnall
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
Backports policy
|
||||
===
|
||||
|
||||
Aims
|
||||
---
|
||||
|
||||
* Known bugs should be fixed in stable versions of GLib
|
||||
* New bugs must not be introduced into stable versions of GLib
|
||||
* Users and distributors should be able to rely on micro stable releases
|
||||
working as drop-in replacements for the previous releases on that stable
|
||||
branch, requiring no packaging changes, or recompilation or build system
|
||||
changes in dependent projects
|
||||
* Effort is only spent on [supported versions](../SECURITY.md#user-content-supported-versions)
|
||||
|
||||
Policy
|
||||
---
|
||||
|
||||
* Bug fixes and documentation fixes should be backported to the current stable
|
||||
branch of GLib, from the current unstable branch
|
||||
* Backports should only be done to
|
||||
[supported versions](../SECURITY.md#user-content-supported-versions) of GLib
|
||||
* New features must not be backported
|
||||
* Any change which will require packaging changes in a distribution should not
|
||||
be backported unless unavoidable to fix a widely-occurring bug
|
||||
* If a backported change does affect packaging or use of GLib, it must be
|
||||
listed prominently in the release notes for that stable release
|
||||
* Any change which requires changes or additions to translatable strings should
|
||||
not be backported unless unavoidable to fix a widely-occurring bug
|
||||
- If possible, existing translatable strings should be reused
|
||||
- If unavoidable, liase with the GNOME Translation Team and ensure string
|
||||
changes are landed with plenty of time to allow translators to provide new
|
||||
translations
|
||||
- See https://wiki.gnome.org/TranslationProject/HandlingStringFreezes
|
||||
* API or ABI changes (including API additions) must not be backported
|
||||
- A commit which changes the documented behaviour of a function counts as an
|
||||
API break
|
||||
* It is discretionary whether fixes to test cases, or new test cases, are
|
||||
backported, based on a maintainer’s assessment of the effort required to
|
||||
backport vs the value in running those tests on a stable branch
|
||||
- The risk of backporting changes to tests is that they fail or become flaky,
|
||||
and require further work on the stable branch to fix them
|
||||
* All backports must be submitted as a merge request against the stable branch,
|
||||
must pass through continuous integration, and must be reviewed by a
|
||||
maintainer (other than the person submitting the merge request)
|
||||
- The reviewer should first assess whether the backport is necessary, and
|
||||
then review it as with any other merge request
|
||||
- The submitter must set a stable release milestone on the merge request, so
|
||||
that the next stable release can’t be accidentally made before it’s merged
|
||||
* Typically, backports are trivial cherry-picks of commits from the unstable
|
||||
branch — changes to the unstable branch which are intended to be backported
|
||||
should be structured so that backporting is easier
|
||||
- For example, by splitting changes to be backported into a separate commit
|
||||
from those which should not be backported, or splitting out changes which
|
||||
are more likely to cause conflicts when cherry-picked
|
||||
* These rules are not entirely prescriptive: there may be situations where
|
||||
maintainers agree that a backport is necessary even if it breaks some of
|
||||
these rules, due to the balance of fixing a critical bug vs keeping things
|
||||
easy for distribution maintainers
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
Traps (G_BREAKPOINT) and traces for the debuging
|
||||
================================================
|
||||
Traps (G_BREAKPOINT) and traces for the debugging
|
||||
=================================================
|
||||
|
||||
Some code portions contain trap variables that can be set during
|
||||
debugging time if G_ENABLE_DEBUG has been defined upon compilation
|
||||
|
|
|
@ -5,9 +5,14 @@ GLib's configure options and corresponding macros
|
|||
none
|
||||
--buildtype={debug,debugoptimized} [debugoptimized is the default]
|
||||
-DG_ENABLE_DEBUG -g
|
||||
|
||||
Available to define yourself:
|
||||
-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS
|
||||
-Dglib_debug=disabled
|
||||
Omits G_ENABLE_DEBUG when implied by --buildtype/-Ddebug
|
||||
-Dglib_debug=enabled
|
||||
Defines G_ENABLE_DEBUG regardless of --buildtype/-Ddebug
|
||||
-Dglib_asserts=false
|
||||
-DG_DISABLE_ASSERT
|
||||
-Dglib_checks=false
|
||||
-DG_DISABLE_CHECKS
|
||||
|
||||
Besides these, there are some local feature specific options, but my main
|
||||
focus here is to concentrate on macros that affect overall GLib behaviour
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
Meson version policy
|
||||
===
|
||||
|
||||
Aims
|
||||
---
|
||||
|
||||
* Stable versions of GLib should be buildable from source on the majority of
|
||||
systems which are still supported by their vendors, without requiring the
|
||||
user to manually build a number of dependencies
|
||||
* Unstable versions of GLib should be able to take advantage of newer build
|
||||
system features where they would make maintenance of GLib easier, without
|
||||
prejudicing the other aims
|
||||
|
||||
Policy
|
||||
---
|
||||
|
||||
* Stable branches of GLib will not change their Meson dependency after the
|
||||
first release of that stable series
|
||||
* Unstable branches of GLib can bump their Meson dependency if
|
||||
- at least that version of Meson currently available in Debian Testing; or
|
||||
- the Python version required by the new Meson dependency is available in
|
||||
Debian Stable *and* the oldest currently-supported Ubuntu LTS
|
||||
* The version of Meson used by GLib should be pinned and pre-installed in the
|
||||
CI `Dockerfile`s so that GLib is guaranteed to be built against the expected
|
||||
version
|
||||
|
||||
The reasoning behind allowing a version bump if the Python which Meson depends
|
||||
on is available in Debian Stable is that it’s [straightforward to install a more
|
||||
recent Meson version using
|
||||
`pip`](https://mesonbuild.com/Getting-meson.html#installing-meson-with-pip).
|
|
@ -8,3 +8,9 @@ giving a brief rationale of each decision, plus a link to further discussion.
|
|||
already supported by GLib and GNOME tools, and accomplish the same task as
|
||||
compiler attributes. GLib does not provide macros for attributes like
|
||||
nonnull because it would not use them.
|
||||
|
||||
* Main loop API:
|
||||
|
||||
The ID-based mainloop APIs (g_idle_add, g_timeout_add, etc) are considered
|
||||
legacy, and new features (such as g_source_set_static_name) will only be
|
||||
added to the explicit GSource APIs.
|
|
@ -18,13 +18,18 @@
|
|||
#
|
||||
# Author: Xavier Claessens <xavier.claessens@collabora.com>
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
print('Usage: {} <output file> <input file 1> ...'.format(os.path.basename(sys.argv[0])))
|
||||
sys.exit(1)
|
||||
print(
|
||||
"Usage: {} <output file> <input file 1> ...".format(
|
||||
os.path.basename(sys.argv[0])
|
||||
)
|
||||
)
|
||||
sys.exit(1)
|
||||
|
||||
with open(sys.argv[1], 'w') as outfile:
|
||||
with open(sys.argv[1], "w") as outfile:
|
||||
for fname in sys.argv[2:]:
|
||||
with open(fname) as infile:
|
||||
for line in infile:
|
||||
|
|
|
@ -35,12 +35,16 @@
|
|||
<arg><option>--c-generate-autocleanup</option> none|objects|all</arg>
|
||||
<arg><option>--output-directory</option> <replaceable>OUTDIR</replaceable></arg>
|
||||
<arg><option>--generate-docbook</option> <replaceable>OUTFILES</replaceable></arg>
|
||||
<arg><option>--generate-rst</option> <replaceable>OUTFILES</replaceable></arg>
|
||||
<arg><option>--pragma-once</option></arg>
|
||||
<arg><option>--xml-files</option> <replaceable>FILE</replaceable></arg>
|
||||
<arg><option>--header</option></arg>
|
||||
<arg><option>--body</option></arg>
|
||||
<arg><option>--interface-info-header</option></arg>
|
||||
<arg><option>--interface-info-body</option></arg>
|
||||
<arg><option>--symbol-decorator</option> <replaceable>DECORATOR</replaceable></arg>
|
||||
<arg><option>--symbol-decorator-header</option> <replaceable>HEADER</replaceable></arg>
|
||||
<arg><option>--symbol-decorator-define</option> <replaceable>DEFINE</replaceable></arg>
|
||||
<arg><option>--output</option> <replaceable>OUTFILE</replaceable></arg>
|
||||
<group choice="plain" rep="repeat">
|
||||
<arg>
|
||||
|
@ -87,7 +91,7 @@
|
|||
When generating C code, a
|
||||
#GInterface<!-- -->-derived type is generated for each D-Bus
|
||||
interface. Additionally, for every generated type,
|
||||
<type>FooBar</type>, two concrete instantiable types,
|
||||
<type>FooBar</type>, two concrete instantiatable types,
|
||||
<type>FooBarProxy</type> and <type>FooBarSkeleton</type>, implementing
|
||||
said interface are also generated. The former is derived from
|
||||
#GDBusProxy and intended for use on the client side
|
||||
|
@ -165,6 +169,16 @@
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Generating reStructuredText documentation</title>
|
||||
<para>
|
||||
Each generated reStructuredText file (see the
|
||||
<option>--generate-rst</option> option for details) is a plain text
|
||||
<ulink url="https://docutils.sourceforge.io/rst.html">reStructuredText</ulink>
|
||||
document describing the D-Bus interface.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1>
|
||||
<title>Options</title>
|
||||
<para>
|
||||
|
@ -209,8 +223,25 @@
|
|||
<listitem>
|
||||
<para>
|
||||
Generate Docbook Documentation for each D-Bus interface and
|
||||
put it in <filename>OUTFILES-NAME.xml</filename> where
|
||||
<literal>NAME</literal> is a place-holder for the interface
|
||||
put it in <filename><replaceable>OUTFILES</replaceable>-<replaceable>NAME</replaceable>.xml</filename>
|
||||
where <literal>NAME</literal> is a place-holder for the interface
|
||||
name, e.g. <literal>net.Corp.FooBar</literal> and so on.
|
||||
</para>
|
||||
<para>
|
||||
Pass <option>--output-directory</option> to specify the directory
|
||||
to put the output files in. By default the current directory
|
||||
will be used.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--generate-rst</option> <replaceable>OUTFILES</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Generate reStructuredText Documentation for each D-Bus interface and
|
||||
put it in <filename><replaceable>OUTFILES</replaceable>-<replaceanle>NAME</replaceanle>.rst</filename>
|
||||
where <literal>NAME</literal> is a place-holder for the interface
|
||||
name, e.g. <literal>net.Corp.FooBar</literal> and so on.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -372,6 +403,52 @@
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--symbol-decorator</option> <replaceable>DECORATOR</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If a <literal>DECORATOR</literal> is passed in with this option, all the
|
||||
generated function prototypes in the generated header will be marked with
|
||||
<literal>DECORATOR</literal>. This can be used, for instance, to export
|
||||
symbols from code generated with <command>gdbus-codegen</command>.
|
||||
This option is added in GLib-2.66
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--symbol-decorator-header</option> <replaceable>HEADER</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If a <literal>HEADER</literal> is passed in with this option, the
|
||||
generated header will put a <literal>#include HEADER</literal> before the rest of the
|
||||
items, except for the inclusion guards or <literal>#pragma once</literal>
|
||||
(if <option>--pragma-once</option> is used). This is used if using another header file is
|
||||
needed for the decorator passed in via <option>--symbol-decorator</option> to be defined.
|
||||
This option is added in GLib-2.66.
|
||||
</para>
|
||||
<para>
|
||||
This option can only be used if <option>--symbol-decorator</option> is used.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--symbol-decorator-define</option> <replaceable>DEFINE</replaceable></term>
|
||||
<listitem>
|
||||
<para>
|
||||
If a <literal>DEFINE</literal> is passed in with this option, the
|
||||
generated source will add a <literal>#define DEFINE</literal> before the rest of the
|
||||
items. This is used if a particular macro is needed to ensure the decorator
|
||||
passed in via <option>--symbol-decorator</option> uses the correct definition when the
|
||||
generated source is being compiled. This option is added in GLib-2.66.
|
||||
</para>
|
||||
<para>
|
||||
This option can only be used if <option>--symbol-decorator</option> is used.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--output</option> <replaceable>OUTFILE</replaceable></term>
|
||||
<listitem>
|
||||
|
@ -722,7 +799,7 @@ gdbus-codegen --generate-c-code myapp-generated \
|
|||
<filename>myapp-generated.[ch]</filename> are
|
||||
generated. The files provide an abstract
|
||||
#GTypeInterface<!-- -->-derived type called
|
||||
<type>MyAppFrobber</type> as well as two instantiable types with
|
||||
<type>MyAppFrobber</type> as well as two instantiatable types with
|
||||
the same name but suffixed with <type>Proxy</type> and
|
||||
<type>Skeleton</type>. The generated file, roughly, contains the
|
||||
following facilities:
|
||||
|
@ -903,7 +980,7 @@ my_app_frobber_proxy_new_sync (GDBusConnection *connection,
|
|||
the <function>net.Corp.MyApp.Frobber.HelloWorld()</function>
|
||||
D-Bus method, connect to the
|
||||
<function>::notification</function> GObject signal to receive
|
||||
the <function>net.Corp.MyApp.Frobber::Notication</function>
|
||||
the <function>net.Corp.MyApp.Frobber::Notification</function>
|
||||
D-Bus signal and get/set the
|
||||
<parameter>net.Corp.MyApp.Frobber:Verbose</parameter> D-Bus
|
||||
Property using either the GObject property
|
||||
|
|
|
@ -5,13 +5,15 @@
|
|||
]>
|
||||
<book lang="en" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
<part>
|
||||
<title>foo</title>
|
||||
<title>GDBus ObjctManager Example</title>
|
||||
<chapter>
|
||||
<title>bar</title>
|
||||
<title>Interfaces</title>
|
||||
<xi:include href="xml/ExampleAnimal.xml"/>
|
||||
<xi:include href="xml/ExampleCat.xml"/>
|
||||
<xi:include href="xml/ExampleObject.xml"/>
|
||||
<xi:include href="xml/ExampleObjectManagerClient.xml"/>
|
||||
</chapter>
|
||||
</part>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
</book>
|
||||
|
|
|
@ -71,6 +71,7 @@
|
|||
<arg choice="plain">--method <replaceable>org.project.InterfaceName.MethodName</replaceable></arg>
|
||||
<group>
|
||||
<arg choice="plain">--timeout <replaceable>seconds</replaceable></arg>
|
||||
<arg choice="plain">--interactive</arg>
|
||||
</group>
|
||||
<arg choice="plain">ARG1</arg>
|
||||
<arg choice="plain" rep="repeat">ARG2</arg>
|
||||
|
@ -321,6 +322,18 @@ $ gdbus call --session \
|
|||
5000
|
||||
(uint32 12,)
|
||||
</programlisting>
|
||||
<para>
|
||||
Call a method with file handle argument:
|
||||
</para>
|
||||
<programlisting>
|
||||
$ gdbus call --session \
|
||||
--dest org.example.foo \
|
||||
--object-path /org/example/foo \
|
||||
--method SendFDs \
|
||||
1 \
|
||||
10 \
|
||||
10<file.foo
|
||||
</programlisting>
|
||||
<para>
|
||||
Monitoring all objects on a service:
|
||||
</para>
|
||||
|
|
|
@ -48,8 +48,8 @@
|
|||
<title>Data conversion</title>
|
||||
<xi:include href="xml/gconverter.xml"/>
|
||||
<xi:include href="xml/gcharsetconverter.xml"/>
|
||||
<xi:include href="xml/gzcompressor.xml"/>
|
||||
<xi:include href="xml/gzdecompressor.xml"/>
|
||||
<xi:include href="xml/gzlibcompressor.xml"/>
|
||||
<xi:include href="xml/gzlibdecompressor.xml"/>
|
||||
</chapter>
|
||||
<chapter id="streaming">
|
||||
<title>Streaming I/O</title>
|
||||
|
@ -133,7 +133,7 @@
|
|||
<xi:include href="xml/gnetworking.xml"/>
|
||||
</chapter>
|
||||
<chapter id="highlevel-socket">
|
||||
<title>High-level network functionallity</title>
|
||||
<title>High-level network functionality</title>
|
||||
<xi:include href="xml/gsocketclient.xml"/>
|
||||
<xi:include href="xml/gsocketconnection.xml"/>
|
||||
<xi:include href="xml/gunixconnection.xml"/>
|
||||
|
@ -232,12 +232,15 @@
|
|||
<xi:include href="xml/gremoteactiongroup.xml"/>
|
||||
<xi:include href="xml/gactiongroupexporter.xml"/>
|
||||
<xi:include href="xml/gdbusactiongroup.xml"/>
|
||||
<xi:include href="xml/gdebugcontroller.xml"/>
|
||||
<xi:include href="xml/gdebugcontrollerdbus.xml"/>
|
||||
<xi:include href="xml/gmemorymonitor.xml"/>
|
||||
<xi:include href="xml/gmenumodel.xml"/>
|
||||
<xi:include href="xml/gmenu.xml"/>
|
||||
<xi:include href="xml/gmenuexporter.xml"/>
|
||||
<xi:include href="xml/gdbusmenumodel.xml"/>
|
||||
<xi:include href="xml/gnotification.xml"/>
|
||||
<xi:include href="xml/gpowerprofilemonitor.xml"/>
|
||||
</chapter>
|
||||
<chapter id="extending">
|
||||
<title>Extending GIO</title>
|
||||
|
@ -381,6 +384,26 @@
|
|||
<title>Index of new symbols in 2.64</title>
|
||||
<xi:include href="xml/api-index-2.64.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-66" role="2.66">
|
||||
<title>Index of new symbols in 2.66</title>
|
||||
<xi:include href="xml/api-index-2.66.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-68" role="2.68">
|
||||
<title>Index of new symbols in 2.68</title>
|
||||
<xi:include href="xml/api-index-2.68.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-70" role="2.70">
|
||||
<title>Index of new symbols in 2.70</title>
|
||||
<xi:include href="xml/api-index-2.70.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-72" role="2.72">
|
||||
<title>Index of new symbols in 2.72</title>
|
||||
<xi:include href="xml/api-index-2.72.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-74" role="2.74">
|
||||
<title>Index of new symbols in 2.74</title>
|
||||
<xi:include href="xml/api-index-2.74.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
|
|
@ -84,6 +84,10 @@ g_file_new_for_uri
|
|||
g_file_new_for_commandline_arg
|
||||
g_file_new_for_commandline_arg_and_cwd
|
||||
g_file_new_tmp
|
||||
g_file_new_tmp_async
|
||||
g_file_new_tmp_finish
|
||||
g_file_new_tmp_dir_async
|
||||
g_file_new_tmp_dir_finish
|
||||
g_file_parse_name
|
||||
g_file_new_build_filename
|
||||
g_file_dup
|
||||
|
@ -149,11 +153,15 @@ g_file_copy
|
|||
g_file_copy_async
|
||||
g_file_copy_finish
|
||||
g_file_move
|
||||
g_file_move_async
|
||||
g_file_move_finish
|
||||
g_file_make_directory
|
||||
g_file_make_directory_async
|
||||
g_file_make_directory_finish
|
||||
g_file_make_directory_with_parents
|
||||
g_file_make_symbolic_link
|
||||
g_file_make_symbolic_link_async
|
||||
g_file_make_symbolic_link_finish
|
||||
g_file_query_settable_attributes
|
||||
g_file_query_writable_namespaces
|
||||
g_file_set_attribute
|
||||
|
@ -199,6 +207,7 @@ g_file_replace_contents
|
|||
g_file_replace_contents_async
|
||||
g_file_replace_contents_bytes_async
|
||||
g_file_replace_contents_finish
|
||||
g_file_build_attribute_list_for_copy
|
||||
g_file_copy_attributes
|
||||
g_file_create_readwrite
|
||||
g_file_create_readwrite_async
|
||||
|
@ -311,12 +320,16 @@ G_FILE_ATTRIBUTE_MOUNTABLE_CAN_POLL
|
|||
G_FILE_ATTRIBUTE_MOUNTABLE_IS_MEDIA_CHECK_AUTOMATIC
|
||||
G_FILE_ATTRIBUTE_TIME_MODIFIED
|
||||
G_FILE_ATTRIBUTE_TIME_MODIFIED_USEC
|
||||
G_FILE_ATTRIBUTE_TIME_MODIFIED_NSEC
|
||||
G_FILE_ATTRIBUTE_TIME_ACCESS
|
||||
G_FILE_ATTRIBUTE_TIME_ACCESS_USEC
|
||||
G_FILE_ATTRIBUTE_TIME_ACCESS_NSEC
|
||||
G_FILE_ATTRIBUTE_TIME_CHANGED
|
||||
G_FILE_ATTRIBUTE_TIME_CHANGED_USEC
|
||||
G_FILE_ATTRIBUTE_TIME_CHANGED_NSEC
|
||||
G_FILE_ATTRIBUTE_TIME_CREATED
|
||||
G_FILE_ATTRIBUTE_TIME_CREATED_USEC
|
||||
G_FILE_ATTRIBUTE_TIME_CREATED_NSEC
|
||||
G_FILE_ATTRIBUTE_UNIX_DEVICE
|
||||
G_FILE_ATTRIBUTE_UNIX_INODE
|
||||
G_FILE_ATTRIBUTE_UNIX_MODE
|
||||
|
@ -396,6 +409,8 @@ g_file_info_get_content_type
|
|||
g_file_info_get_size
|
||||
g_file_info_get_modification_time
|
||||
g_file_info_get_modification_date_time
|
||||
g_file_info_get_access_date_time
|
||||
g_file_info_get_creation_date_time
|
||||
g_file_info_get_symlink_target
|
||||
g_file_info_get_etag
|
||||
g_file_info_get_sort_order
|
||||
|
@ -414,6 +429,8 @@ g_file_info_set_content_type
|
|||
g_file_info_set_size
|
||||
g_file_info_set_modification_time
|
||||
g_file_info_set_modification_date_time
|
||||
g_file_info_set_access_date_time
|
||||
g_file_info_set_creation_date_time
|
||||
g_file_info_set_symlink_target
|
||||
g_file_info_set_sort_order
|
||||
g_file_attribute_matcher_new
|
||||
|
@ -1360,6 +1377,7 @@ g_io_scheduler_job_send_to_mainloop_async
|
|||
G_IO_ERROR
|
||||
GIOErrorEnum
|
||||
g_io_error_from_errno
|
||||
g_io_error_from_file_error
|
||||
g_io_error_from_win32_error
|
||||
<SUBSECTION Standard>
|
||||
G_TYPE_IO_ERROR_ENUM
|
||||
|
@ -1424,7 +1442,11 @@ g_app_info_get_supported_types
|
|||
g_app_info_get_all
|
||||
g_app_info_get_all_for_type
|
||||
g_app_info_get_default_for_type
|
||||
g_app_info_get_default_for_type_async
|
||||
g_app_info_get_default_for_type_finish
|
||||
g_app_info_get_default_for_uri_scheme
|
||||
g_app_info_get_default_for_uri_scheme_async
|
||||
g_app_info_get_default_for_uri_scheme_finish
|
||||
g_app_info_get_fallback_for_type
|
||||
g_app_info_get_recommended_for_type
|
||||
g_app_info_launch_default_for_uri
|
||||
|
@ -1572,6 +1594,7 @@ g_unix_mount_point_guess_symbolic_icon
|
|||
g_unix_mount_point_guess_name
|
||||
g_unix_mount_point_guess_can_eject
|
||||
g_unix_mount_points_get
|
||||
g_unix_mount_point_at
|
||||
g_unix_mounts_get
|
||||
g_unix_mount_at
|
||||
g_unix_mount_for
|
||||
|
@ -2499,7 +2522,7 @@ g_converter_output_stream_get_type
|
|||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gzcompressor</FILE>
|
||||
<FILE>gzlibcompressor</FILE>
|
||||
<TITLE>GZlibCompressor</TITLE>
|
||||
GZlibCompressor
|
||||
GZlibCompressorFormat
|
||||
|
@ -2521,7 +2544,7 @@ g_zlib_compressor_format_get_type
|
|||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gzdecompressor</FILE>
|
||||
<FILE>gzlibdecompressor</FILE>
|
||||
<TITLE>GZlibDecompressor</TITLE>
|
||||
GZlibDecompressor
|
||||
g_zlib_decompressor_new
|
||||
|
@ -2800,8 +2823,12 @@ g_dbus_is_name
|
|||
g_dbus_is_unique_name
|
||||
g_dbus_is_member_name
|
||||
g_dbus_is_interface_name
|
||||
g_dbus_is_error_name
|
||||
g_dbus_gvalue_to_gvariant
|
||||
g_dbus_gvariant_to_gvalue
|
||||
g_dbus_escape_object_path_bytestring
|
||||
g_dbus_escape_object_path
|
||||
g_dbus_unescape_object_path
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -3025,6 +3052,8 @@ g_dbus_method_invocation_return_gerror
|
|||
g_dbus_method_invocation_return_dbus_error
|
||||
g_dbus_method_invocation_take_error
|
||||
g_dbus_method_invocation_return_value_with_unix_fd_list
|
||||
G_DBUS_METHOD_INVOCATION_HANDLED
|
||||
G_DBUS_METHOD_INVOCATION_UNHANDLED
|
||||
<SUBSECTION Standard>
|
||||
G_DBUS_METHOD_INVOCATION
|
||||
G_IS_DBUS_METHOD_INVOCATION
|
||||
|
@ -3651,16 +3680,24 @@ g_pollable_return_get_type
|
|||
<FILE>gtls</FILE>
|
||||
G_TLS_ERROR
|
||||
GTlsError
|
||||
G_TLS_CHANNEL_BINDING_ERROR
|
||||
GTlsChannelBindingError
|
||||
<SUBSECTION>
|
||||
GTlsAuthenticationMode
|
||||
GTlsCertificateFlags
|
||||
GTlsProtocolVersion
|
||||
<SUBSECTION Standard>
|
||||
G_TYPE_TLS_AUTHENTICATION_MODE
|
||||
G_TYPE_TLS_CERTIFICATE_FLAGS
|
||||
G_TYPE_TLS_CHANNEL_BINDING_ERROR
|
||||
G_TYPE_TLS_ERROR
|
||||
G_TYPE_TLS_PROTOCOL_VERSION
|
||||
g_tls_authentication_mode_get_type
|
||||
g_tls_certificate_flags_get_type
|
||||
g_tls_channel_binding_error_get_type
|
||||
g_tls_channel_binding_error_quark
|
||||
g_tls_error_get_type
|
||||
g_tls_protocol_version_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -3695,10 +3732,19 @@ g_tls_backend_get_type
|
|||
<TITLE>GTlsCertificate</TITLE>
|
||||
GTlsCertificate
|
||||
g_tls_certificate_new_from_pem
|
||||
g_tls_certificate_new_from_pkcs12
|
||||
g_tls_certificate_new_from_file
|
||||
g_tls_certificate_new_from_file_with_password
|
||||
g_tls_certificate_new_from_files
|
||||
g_tls_certificate_new_from_pkcs11_uris
|
||||
g_tls_certificate_list_new_from_file
|
||||
g_tls_certificate_get_dns_names
|
||||
g_tls_certificate_get_ip_addresses
|
||||
g_tls_certificate_get_issuer
|
||||
g_tls_certificate_get_issuer_name
|
||||
g_tls_certificate_get_not_valid_before
|
||||
g_tls_certificate_get_not_valid_after
|
||||
g_tls_certificate_get_subject_name
|
||||
g_tls_certificate_verify
|
||||
g_tls_certificate_is_same
|
||||
<SUBSECTION Standard>
|
||||
|
@ -3718,10 +3764,12 @@ g_tls_certificate_get_type
|
|||
<FILE>gtlsconnection</FILE>
|
||||
<TITLE>GTlsConnection</TITLE>
|
||||
GTlsConnection
|
||||
GTlsChannelBindingType
|
||||
g_tls_connection_set_certificate
|
||||
g_tls_connection_get_certificate
|
||||
g_tls_connection_get_peer_certificate
|
||||
g_tls_connection_get_peer_certificate_errors
|
||||
g_tls_connection_get_channel_binding_data
|
||||
g_tls_connection_set_require_close_notify
|
||||
g_tls_connection_get_require_close_notify
|
||||
GTlsRehandshakeMode
|
||||
|
@ -3735,6 +3783,8 @@ g_tls_connection_get_database
|
|||
g_tls_connection_set_database
|
||||
g_tls_connection_get_interaction
|
||||
g_tls_connection_set_interaction
|
||||
g_tls_connection_get_protocol_version
|
||||
g_tls_connection_get_ciphersuite_name
|
||||
<SUBSECTION>
|
||||
g_tls_connection_handshake
|
||||
g_tls_connection_handshake_async
|
||||
|
@ -3749,9 +3799,11 @@ G_IS_TLS_CONNECTION_CLASS
|
|||
G_TLS_CONNECTION
|
||||
G_TLS_CONNECTION_CLASS
|
||||
G_TLS_CONNECTION_GET_CLASS
|
||||
G_TYPE_TLS_CHANNEL_BINDING_TYPE
|
||||
G_TYPE_TLS_CONNECTION
|
||||
G_TYPE_TLS_REHANDSHAKE_MODE
|
||||
<SUBSECTION Private>
|
||||
g_tls_channel_binding_type_get_type
|
||||
g_tls_connection_get_type
|
||||
g_tls_rehandshake_mode_get_type
|
||||
</SECTION>
|
||||
|
@ -3916,6 +3968,7 @@ g_dtls_connection_set_certificate
|
|||
g_dtls_connection_get_certificate
|
||||
g_dtls_connection_get_peer_certificate
|
||||
g_dtls_connection_get_peer_certificate_errors
|
||||
g_dtls_connection_get_channel_binding_data
|
||||
g_dtls_connection_set_require_close_notify
|
||||
g_dtls_connection_get_require_close_notify
|
||||
g_dtls_connection_set_rehandshake_mode
|
||||
|
@ -3926,6 +3979,8 @@ g_dtls_connection_get_database
|
|||
g_dtls_connection_set_database
|
||||
g_dtls_connection_get_interaction
|
||||
g_dtls_connection_set_interaction
|
||||
g_dtls_connection_get_protocol_version
|
||||
g_dtls_connection_get_ciphersuite_name
|
||||
<SUBSECTION>
|
||||
g_dtls_connection_handshake
|
||||
g_dtls_connection_handshake_async
|
||||
|
@ -4169,6 +4224,36 @@ G_DBUS_OBJECT_MANAGER_SERVER_GET_CLASS
|
|||
GDBusObjectManagerServerPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gdebugcontroller</FILE>
|
||||
<TITLE>GDebugController</TITLE>
|
||||
GDebugController
|
||||
GDebugControllerInterface
|
||||
G_DEBUG_CONTROLLER_EXTENSION_POINT_NAME
|
||||
g_debug_controller_get_debug_enabled
|
||||
g_debug_controller_set_debug_enabled
|
||||
<SUBSECTION Standard>
|
||||
g_debug_controller_get_type
|
||||
G_TYPE_DEBUG_CONTROLLER
|
||||
G_DEBUG_CONTROLLER
|
||||
G_IS_DEBUG_CONTROLLER
|
||||
G_DEBUG_CONTROLLER_GET_INTERFACE
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gdebugcontrollerdbus</FILE>
|
||||
<TITLE>GDebugControllerDBus</TITLE>
|
||||
GDebugControllerDBus
|
||||
g_debug_controller_dbus_new
|
||||
g_debug_controller_dbus_stop
|
||||
<SUBSECTION Standard>
|
||||
g_debug_controller_dbus_get_type
|
||||
G_TYPE_DEBUG_CONTROLLER_DBUS
|
||||
G_DEBUG_CONTROLLER_DBUS
|
||||
G_IS_DEBUG_CONTROLLER_DBUS
|
||||
G_DEBUG_CONTROLLER_DBUS_GET_CLASS
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gmemorymonitor</FILE>
|
||||
<TITLE>GMemoryMonitor</TITLE>
|
||||
|
@ -4211,6 +4296,24 @@ G_NETWORK_MONITOR_GET_INTERFACE
|
|||
g_network_connectivity_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gpowerprofilemonitor</FILE>
|
||||
<TITLE>GPowerProfileMonitor</TITLE>
|
||||
GPowerProfileMonitor
|
||||
GPowerProfileMonitorInterface
|
||||
G_POWER_PROFILE_MONITOR_EXTENSION_POINT_NAME
|
||||
g_power_profile_monitor_dup_default
|
||||
g_power_profile_monitor_get_power_saver_enabled
|
||||
<SUBSECTION Standard>
|
||||
g_power_profile_monitor_get_type
|
||||
G_TYPE_POWER_PROFILE_MONITOR
|
||||
G_POWER_PROFILE_MONITOR
|
||||
G_IS_POWER_PROFILE_MONITOR
|
||||
G_POWER_PROFILE_MONITOR_GET_INTERFACE
|
||||
G_TYPE_POWER_PROFILE_LEVEL
|
||||
g_power_profile_level_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gmenuexporter</FILE>
|
||||
g_dbus_connection_export_menu_model
|
||||
|
@ -4515,7 +4618,6 @@ CMSG_LEN
|
|||
CMSG_SPACE
|
||||
GLIB_ALIGN_TO_SIZEOF
|
||||
T_SRV
|
||||
ws2funcs
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -4603,6 +4705,7 @@ g_subprocess_launcher_take_stdout_fd
|
|||
g_subprocess_launcher_set_stderr_file_path
|
||||
g_subprocess_launcher_take_stderr_fd
|
||||
g_subprocess_launcher_take_fd
|
||||
g_subprocess_launcher_close
|
||||
g_subprocess_launcher_set_child_setup
|
||||
<SUBSECTION Standard>
|
||||
G_IS_SUBPROCESS_LAUNCHER
|
||||
|
@ -4623,6 +4726,7 @@ g_notification_set_icon
|
|||
GNotificationPriority
|
||||
g_notification_set_priority
|
||||
g_notification_set_urgent
|
||||
g_notification_set_category
|
||||
<SUBSECTION>
|
||||
g_notification_set_default_action
|
||||
g_notification_set_default_action_and_target
|
||||
|
@ -4676,6 +4780,7 @@ g_list_store_splice
|
|||
g_list_store_sort
|
||||
g_list_store_find
|
||||
g_list_store_find_with_equal_func
|
||||
g_list_store_find_with_equal_func_full
|
||||
<SUBSECTION Standard>
|
||||
G_TYPE_LIST_STORE
|
||||
<SUBSECTION Private>
|
||||
|
|
|
@ -53,6 +53,12 @@
|
|||
<arg choice="opt" rep="repeat"><replaceable>OPTION</replaceable></arg>
|
||||
<arg choice="plain" rep="repeat"><replaceable>LOCATION</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
<cmdsynopsis>
|
||||
<command>gio</command>
|
||||
<arg choice="plain">launch</arg>
|
||||
<arg choice="plain"><replaceable>DESKTOP-FILE</replaceable></arg>
|
||||
<arg choice="opt" rep="repeat"><replaceable>FILE-ARG</replaceable></arg>
|
||||
</cmdsynopsis>
|
||||
<cmdsynopsis>
|
||||
<command>gio</command>
|
||||
<arg choice="plain">list</arg>
|
||||
|
@ -273,6 +279,19 @@
|
|||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<command>launch</command>
|
||||
<arg choice="plain"><replaceable>DESKTOP-FILE</replaceable></arg>
|
||||
<arg choice="opt" rep="repeat"><replaceable>FILE-ARG</replaceable></arg>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Launch a desktop file from any location given.</para>
|
||||
<para>The <command>launch</command> command extends the behavior of the <command>open</command> command by allowing
|
||||
any desktop file to be launched, not only those registered as file handlers.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term>
|
||||
<command>list</command>
|
||||
|
@ -662,6 +681,10 @@
|
|||
<para>If the type is not specified, <literal>string</literal> is assumed.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-d</option>, <option>--delete</option></term>
|
||||
<listitem><para>Unsets an attribute (same as setting it's type to <literal>unset</literal>).</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>-n</option>, <option>--nofollow-symlinks</option></term>
|
||||
<listitem><para>Don’t follow symbolic links.</para></listitem>
|
||||
|
@ -678,17 +701,18 @@
|
|||
<arg choice="opt" rep="repeat"><replaceable>LOCATION</replaceable></arg>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>Sends files or directories to the ‘Trashcan’. This can be a
|
||||
different folder depending on where the file is located, and not
|
||||
all file systems support this concept. In the common case that the
|
||||
file lives inside a user’s home directory, the trash folder is
|
||||
<para>Sends files or directories to the ‘Trashcan’ or restore them from
|
||||
‘Trashcan’. This can be a different folder depending on where the file
|
||||
is located, and not all file systems support this concept. In the common
|
||||
case that the file lives inside a user’s home directory, the trash folder is
|
||||
<filename><envar>$XDG_DATA_HOME</envar>/Trash</filename>.</para>
|
||||
<para>Note that moving files to the trash does not free up space on
|
||||
the file system until the ‘Trashcan’ is emptied. If you are interested
|
||||
in deleting a file irreversibly, see the <command>remove</command> command.</para>
|
||||
<para>Inspecting and emptying the ‘Trashcan’ is normally supported by
|
||||
graphical file managers such as Nautilus, but you can also see the
|
||||
trash with the command: <command>gio list trash://</command>.</para>
|
||||
trash with the command: <command>gio trash --list</command> or
|
||||
<command>gio list trash://</command>.</para>
|
||||
<refsect3>
|
||||
<title>Options</title>
|
||||
<variablelist>
|
||||
|
@ -700,6 +724,16 @@
|
|||
<term><option>--empty</option></term>
|
||||
<listitem><para>Empty the trash.</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--list</option></term>
|
||||
<listitem><para>List files in the trash with their original locations</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><option>--restore</option></term>
|
||||
<listitem><para>Restore a file from trash to its original location. A URI beginning
|
||||
with <literal>trash://</literal> is expected here. If the original
|
||||
directory doesn't exist, it will be recreated.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect3>
|
||||
</listitem>
|
||||
|
|
|
@ -200,6 +200,16 @@ be used with <literal>make</literal>.
|
|||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><option>--compiler=<replaceable>NAME</replaceable></option></term>
|
||||
<listitem><para>
|
||||
Generate code that is going to target the given compiler <replaceable>NAME</replaceable>.
|
||||
The current two compiler modes are "gcc", for all GCC-compatible toolchains; and "msvc",
|
||||
for the Microsoft Visual C Compiler. If this option isn't set, then the default will be
|
||||
taken from the <envar>CC</envar> environment variable.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
|
@ -219,6 +229,9 @@ searched for in the <envar>PATH</envar>.
|
|||
<varlistentry>
|
||||
<term><envar>GDK_PIXBUF_PIXDATA</envar></term>
|
||||
<listitem><para>
|
||||
Deprecated since gdk-pixbuf 2.32, as <type>GResource</type> supports embedding
|
||||
modern image formats without conversion.
|
||||
</para><para>
|
||||
The full path to the <command>gdk-pixbuf-pixdata</command> executable. This is
|
||||
used to preprocess resources with the <literal>to-pixdata</literal> preprocessing
|
||||
option. If this environment variable is not set, <command>gdk-pixbuf-pixdata</command>
|
||||
|
|
|
@ -136,7 +136,7 @@ the dconf database.
|
|||
<term><option>get</option></term>
|
||||
<listitem><para>
|
||||
Gets the value of <replaceable>KEY</replaceable>.
|
||||
The value is printed out as a serialised
|
||||
The value is printed out as a serialized
|
||||
<link linkend="GVariant"><type>GVariant</type></link>.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
@ -175,7 +175,7 @@ Queries the description of valid values for <replaceable>KEY</replaceable>.
|
|||
<term><option>set</option></term>
|
||||
<listitem><para>
|
||||
Sets the value of <replaceable>KEY</replaceable> to
|
||||
<replaceable>VALUE</replaceable>. The value is specified as a serialised
|
||||
<replaceable>VALUE</replaceable>. The value is specified as a serialized
|
||||
<link linkend="GVariant"><type>GVariant</type></link>.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -1,14 +1,9 @@
|
|||
if get_option('gtk_doc')
|
||||
if installed_tests_enabled
|
||||
subdir('gdbus-object-manager-example')
|
||||
endif
|
||||
subdir('gdbus-object-manager-example')
|
||||
subdir('xml')
|
||||
|
||||
ignore_headers = [
|
||||
'fam',
|
||||
'fen',
|
||||
'gdbus-2.0',
|
||||
'gvdb',
|
||||
'inotify',
|
||||
'kqueue',
|
||||
'libasyncns',
|
||||
|
@ -40,6 +35,7 @@ if get_option('gtk_doc')
|
|||
'ghttpproxy.h',
|
||||
'giomodule-priv.h',
|
||||
'gioprivate.h',
|
||||
'giowin32-afunix.h',
|
||||
'giowin32-priv.h',
|
||||
'gio_probes.h',
|
||||
'gio_trace.h',
|
||||
|
@ -67,6 +63,8 @@ if get_option('gtk_doc')
|
|||
'gopenuriportal.h',
|
||||
'gpollfilemonitor.h',
|
||||
'gportalsupport.h',
|
||||
'gpowerprofilemonitordbus.h',
|
||||
'gpowerprofilemonitorportal.h',
|
||||
'gproxyresolverportal.h',
|
||||
'gregistrysettingsbackend.h',
|
||||
'gresourcefile.h',
|
||||
|
@ -87,8 +85,15 @@ if get_option('gtk_doc')
|
|||
'gunixvolume.h',
|
||||
'gunixvolumemonitor.h',
|
||||
'gwin32networkmonitor.h',
|
||||
'gwin32api-application-activation-manager.h',
|
||||
'gwin32api-iterator.h',
|
||||
'gwin32api-misc.h',
|
||||
'gwin32api-package.h',
|
||||
'gwin32api-storage.h',
|
||||
'gwin32appinfo.h',
|
||||
'gwin32file-sync-stream.h',
|
||||
'gwin32mount.h',
|
||||
'gwin32packageparser.h',
|
||||
'gwin32resolver.h',
|
||||
'gwin32volumemonitor.h',
|
||||
'thumbnail-verify.h',
|
||||
|
@ -100,14 +105,11 @@ if get_option('gtk_doc')
|
|||
if host_system == 'windows'
|
||||
ignore_headers += [
|
||||
'gfiledescriptorbased.h',
|
||||
'gunixconnection.h',
|
||||
'gunixcredentialsmessage.h',
|
||||
'gunixmounts.h',
|
||||
'gunixfdlist.h',
|
||||
'gunixfdmessage.h',
|
||||
'gunixinputstream.h',
|
||||
'gunixoutputstream.h',
|
||||
'gunixsocketaddress.h',
|
||||
'gdesktopappinfo.h',
|
||||
'gosxappinfo.h',
|
||||
]
|
||||
|
@ -144,16 +146,11 @@ if get_option('gtk_doc')
|
|||
configuration: version_conf
|
||||
)
|
||||
|
||||
# FIXME: configure_file() does not support more than one file in input
|
||||
# argument. If input argument is omitted then meson checks that all items in
|
||||
# the command array are strings. But if we have an input then extra files
|
||||
# can be passed in command array.
|
||||
# See https://github.com/mesonbuild/meson/issues/5893
|
||||
concat_files_helper = find_program('concat-files-helper.py')
|
||||
configure_file(
|
||||
output : 'gio-sections.txt',
|
||||
input : sections_files[0],
|
||||
command : [concat_files_helper, '@OUTPUT@'] + sections_files,
|
||||
input : sections_files,
|
||||
command : [concat_files_helper, '@OUTPUT@', '@INPUT@'],
|
||||
)
|
||||
|
||||
configure_file(
|
||||
|
@ -178,13 +175,11 @@ if get_option('gtk_doc')
|
|||
'gdbus-codegen.xml',
|
||||
]
|
||||
|
||||
if installed_tests_enabled
|
||||
content_files += [
|
||||
gdbus_example_objectmanager_xml,
|
||||
gdbus_example_objectmanager_sources,
|
||||
gdbus_object_manager_example_doc
|
||||
]
|
||||
endif
|
||||
content_files += [
|
||||
gdbus_example_objectmanager_xml,
|
||||
gdbus_example_objectmanager_sources,
|
||||
gdbus_object_manager_example_doc
|
||||
]
|
||||
|
||||
gnome.gtkdoc('gio',
|
||||
main_xml : 'gio-docs.xml',
|
||||
|
|
|
@ -161,7 +161,7 @@
|
|||
have a GConf schema. GConf comes with a commandline tool
|
||||
gsettings-schema-convert that can help with the task of converting
|
||||
a GConf schema into an equivalent GSettings schema. The tool is not
|
||||
perfect and may need assistence in some cases.
|
||||
perfect and may need assistance in some cases.
|
||||
</para>
|
||||
<example><title>An example for using gsettings-schema-convert</title>
|
||||
<para>Running <userinput>gsettings-schema-convert --gconf --xml --schema-id "org.gnome.font-rendering" --output org.gnome.font-rendering.gschema.xml destop_gnome_font_rendering.schemas</userinput> on the following <filename>desktop_gnome_font_rendering.schemas</filename> file:
|
||||
|
|
|
@ -254,7 +254,7 @@ on_name_acquired (GDBusConnection *connection,
|
|||
linkend="gdbus-codegen">gdbus-codegen</link></command> is used and like
|
||||
its counterpart, it also takes D-Bus Introspection XML as input:
|
||||
</para>
|
||||
<example id="gdbus-example-codegen-input"><title>Example D-Bus Introspection XML</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../gdbus-example-objectmanager.xml"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
|
||||
<example id="gdbus-example-codegen-input"><title>Example D-Bus Introspection XML</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../../gio/tests/gdbus-object-manager-example/gdbus-example-objectmanager.xml"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT: gdbus-example-objectmanager.xml</xi:fallback></xi:include></programlisting></example>
|
||||
<para>
|
||||
If this XML is processed like this
|
||||
<informalexample><programlisting><![CDATA[
|
||||
|
@ -291,18 +291,19 @@ gdbus-codegen --interface-prefix org.gtk.GDBus.Example.ObjectManager. \
|
|||
#ExampleObjectManagerClient pages for documentation.
|
||||
</para>
|
||||
|
||||
<example id="gdbus-example-codegen-server"><title>Server-side application using generated code</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../gdbus-example-objectmanager-server.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
|
||||
<example id="gdbus-example-codegen-server"><title>Server-side application using generated code</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../../gio/tests/gdbus-example-objectmanager-server.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT: gdbus-example-objectmanager-server.c</xi:fallback></xi:include></programlisting></example>
|
||||
|
||||
<example id="gdbus-example-codegen-client"><title>Client-side application using generated code</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../gdbus-example-objectmanager-client.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting></example>
|
||||
<example id="gdbus-example-codegen-client"><title>Client-side application using generated code</title><programlisting><xi:include xmlns:xi="http://www.w3.org/2001/XInclude" parse="text" href="../../../../../gio/tests/gdbus-example-objectmanager-client.c"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT: gdbus-example-objectmanager-client.c</xi:fallback></xi:include></programlisting></example>
|
||||
|
||||
</section>
|
||||
|
||||
<xi:include href="../../../../gio/tests/gdbus-object-manager-example/objectmanager-gen-org.gtk.GDBus.Example.ObjectManager.Animal.xml"/>
|
||||
<xi:include href="../../../../gio/tests/gdbus-object-manager-example/objectmanager-gen-org.gtk.GDBus.Example.ObjectManager.Cat.xml"/>
|
||||
<xi:include href="../gdbus-object-manager-example/xml/ExampleAnimal.xml"/>
|
||||
<xi:include href="../gdbus-object-manager-example/xml/ExampleCat.xml"/>
|
||||
<xi:include href="../gdbus-object-manager-example/xml/ExampleObject.xml"/>
|
||||
<xi:include href="../gdbus-object-manager-example/xml/ExampleObjectManagerClient.xml"/>
|
||||
<!-- All XInclude paths are relative to the html/ directory under the build root directory -->
|
||||
<xi:include href="../../../../gio/tests/gdbus-object-manager-example/objectmanager-gen-org.gtk.GDBus.Example.ObjectManager.Animal.xml"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT: objectmanager-gen-org.gtk.GDBus.Example.ObjectManager.Animal.xml</xi:fallback></xi:include>
|
||||
<xi:include href="../../../../gio/tests/gdbus-object-manager-example/objectmanager-gen-org.gtk.GDBus.Example.ObjectManager.Cat.xml"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT: objectmanager-gen-org.gtk.GDBus.Example.ObjectManager.Cat.xml</xi:fallback></xi:include>
|
||||
<xi:include href="../gdbus-object-manager-example/xml/ExampleAnimal.xml"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT: ExampleAnimal.xml</xi:fallback></xi:include>
|
||||
<xi:include href="../gdbus-object-manager-example/xml/ExampleCat.xml"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT: ExampleCat.xml</xi:fallback></xi:include>
|
||||
<xi:include href="../gdbus-object-manager-example/xml/ExampleObject.xml"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT: ExampleObject.xml</xi:fallback></xi:include>
|
||||
<xi:include href="../gdbus-object-manager-example/xml/ExampleObjectManagerClient.xml"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT: ExampleObjectManagerClient.xml</xi:fallback></xi:include>
|
||||
|
||||
</section>
|
||||
|
||||
|
|
|
@ -161,7 +161,7 @@
|
|||
<para>
|
||||
The GIO model of I/O is stateful: if an application establishes e.g.
|
||||
a SFTP connection to a server, it becomes available to all applications
|
||||
in the session; the user does not have to enter his password over
|
||||
in the session; the user does not have to enter their password over
|
||||
and over again.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -279,9 +279,9 @@ excellent book on this topic,
|
|||
When using GIO in code that runs with elevated privileges, you have to
|
||||
be careful. GIO has extension points whose implementations get loaded
|
||||
from modules (executable code in shared objects), which could allow
|
||||
an attacker to sneak his own code into your application by tricking it
|
||||
an attacker to sneak their own code into your application by tricking it
|
||||
into loading the code as a module. However, GIO will never load modules
|
||||
from your home directory except when explictly asked to do so via an
|
||||
from your home directory except when explicitly asked to do so via an
|
||||
environment variable.
|
||||
</para>
|
||||
|
||||
|
@ -370,7 +370,7 @@ Gvfs is also heavily distributed and relies on a session bus to be present.
|
|||
The #GVfs implementation for local files that is included in GIO
|
||||
has the name "local", the implementation in the gvfs module has
|
||||
the name "gvfs". Most commonly, system software will set this to "local"
|
||||
to avoid having `GFile` APIs perform unnecessary DBus calls.
|
||||
to avoid having `GFile` APIs perform unnecessary D-Bus calls.
|
||||
</para><para>
|
||||
The special value <literal>help</literal> can be used to print a list of
|
||||
available implementations to standard output.
|
||||
|
@ -390,9 +390,9 @@ Gvfs is also heavily distributed and relies on a session bus to be present.
|
|||
This variable can be set to the name of a #GFileMonitor
|
||||
implementation to override the default for debugging purposes.
|
||||
The #GFileMonitor implementation for local files that is included
|
||||
in GIO on Linux has the name "inotify", others that are built
|
||||
in GIO on Linux has the name <literal>inotify</literal>, others that are built
|
||||
are built as modules (depending on the platform) are called
|
||||
"fam" and "fen".
|
||||
<literal>kqueue</literal> and <literal>win32filemonitor</literal>.
|
||||
</para><para>
|
||||
The special value <literal>help</literal> can be used to print a list of
|
||||
available implementations to standard output.
|
||||
|
@ -436,6 +436,9 @@ Gvfs is also heavily distributed and relies on a session bus to be present.
|
|||
modules from this alternate directory instead of the directory
|
||||
built into GIO. This is useful when running tests, for example.
|
||||
</para>
|
||||
<para>
|
||||
This environment variable is ignored when running in a setuid program.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
|
@ -446,6 +449,9 @@ Gvfs is also heavily distributed and relies on a session bus to be present.
|
|||
paths separated by a colon, GIO will attempt to load
|
||||
additional modules from within the path.
|
||||
</para>
|
||||
<para>
|
||||
This environment variable is ignored when running in a setuid program.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
|
@ -659,23 +665,7 @@ Gvfs is also heavily distributed and relies on a session bus to be present.
|
|||
</para>
|
||||
<para>
|
||||
GIO uses this extension point internally, to switch between
|
||||
its fam-based and inotify-based file monitoring implementations.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title>G_LOCAL_DIRECTORY_MONITOR_EXTENSION_POINT_NAME</title>
|
||||
|
||||
<para>
|
||||
Allows to override the directory monitor implementation for
|
||||
local files. Implementations of this extension point must be
|
||||
derived from #GLocalDirectoryMonitor. GIO uses the implementation
|
||||
with the highest priority that is supported, as determined by the
|
||||
is_supported() vfunc in #GLocalDirectoryMonitorClass.
|
||||
</para>
|
||||
<para>
|
||||
GIO uses this extension point internally, to switch between
|
||||
its fam-based and inotify-based directory monitoring implementations.
|
||||
its kqueue-based and inotify-based file monitoring implementations.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
On FreeBSD:
|
||||
<literallayout>
|
||||
<userinput>env CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib -Wl,--disable-new-dtags" meson -Dxattr=false -Dinstalled_tests=true -Diconv=external -Db_lundef=false _build</userinput>
|
||||
<userinput>env CPPFLAGS="-I/usr/local/include" LDFLAGS="-L/usr/local/lib -Wl,--disable-new-dtags" meson -Dxattr=false -Dinstalled_tests=true -Db_lundef=false _build</userinput>
|
||||
<userinput>ninja -C _build</userinput>
|
||||
</literallayout>
|
||||
</para>
|
||||
|
@ -98,16 +98,12 @@
|
|||
</para>
|
||||
<para>
|
||||
If your system has an <function>iconv()</function> implementation but
|
||||
you want to use libiconv instead, you can pass the
|
||||
<option>-Diconv=gnu</option> option to <command>meson</command>. This
|
||||
forces libiconv to be used.
|
||||
</para>
|
||||
<para>
|
||||
Note that if you have libiconv installed in your default include
|
||||
search path (for instance, in <filename>/usr/local/</filename>), but
|
||||
don't enable it, you will get an error while compiling GLib because
|
||||
the <filename>iconv.h</filename> that libiconv installs hides the
|
||||
system iconv.
|
||||
you want to use libiconv instead, make sure it is installed to the
|
||||
default compiler header/library search path (for instance, in
|
||||
<filename>/usr/local/</filename>). The <filename>iconv.h</filename>
|
||||
that libiconv installs hides the system iconv. Meson then detects
|
||||
this, recognizes that the system iconv is unusable and the external
|
||||
one is mandatory, and automatically forces it to be used.
|
||||
</para>
|
||||
<para>
|
||||
If you are using the native iconv implementation on Solaris
|
||||
|
@ -153,12 +149,9 @@
|
|||
<listitem>
|
||||
<para>
|
||||
GRegex uses the <ulink url="http://www.pcre.org/">PCRE library</ulink>
|
||||
for regular expression matching. The default is to use the system
|
||||
version of PCRE, to reduce the chances of security fixes going out
|
||||
of sync. GLib additionally provides an internal copy of PCRE in case
|
||||
the system version is too old, or does not support UTF-8; the internal
|
||||
copy is patched to use GLib for memory management and to share the
|
||||
same Unicode tables.
|
||||
for regular expression matching. The system version of PCRE is used,
|
||||
unless not available (which is the case on Android), in which case a
|
||||
fallback subproject is used.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
|
@ -212,9 +205,10 @@
|
|||
<para>
|
||||
This is a standard <application>Meson</application> option which
|
||||
specifies how much debugging and optimization to enable. If the build
|
||||
type starts with <literal>debug</literal>,
|
||||
type is <literal>debug</literal>,
|
||||
<literal>G_ENABLE_DEBUG</literal> will be defined and GLib will be built
|
||||
with additional debug code enabled.
|
||||
with additional debug code enabled. You can override this behavior using
|
||||
<option>-Dglib_debug</option>.
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
|
@ -229,45 +223,6 @@
|
|||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><option>-Dinternal_pcre=true</option></title>
|
||||
|
||||
<para>
|
||||
Normally, GLib will be configured to use the system-supplied PCRE
|
||||
library if it is suitable, falling back to an internal version
|
||||
otherwise. If this option is specified, the internal version will always
|
||||
be used.
|
||||
</para>
|
||||
<para>
|
||||
Using the internal PCRE is the preferred solution if:
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>
|
||||
your system has strict resource constraints; the system-supplied
|
||||
PCRE has a separated copy of the tables used for Unicode
|
||||
handling, whereas the internal copy shares the Unicode tables
|
||||
used by GLib.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
your system has PCRE built without some needed features,
|
||||
such as UTF-8 and Unicode support.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
you are planning to use both GRegex and PCRE API at the same
|
||||
time, either directly or indirectly through a dependency; PCRE
|
||||
uses some global variables for memory management and
|
||||
other features, and if both GLib and PCRE try to access them
|
||||
at the same time, this could lead to undefined behavior.
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</para>
|
||||
</formalpara>
|
||||
|
||||
<formalpara>
|
||||
<title><option>-Dbsymbolic_functions=false</option> and
|
||||
<option>-Dbsymbolic_functions=true</option></title>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<refnamediv>
|
||||
<refname>Changes to GLib</refname>
|
||||
<refpurpose>
|
||||
Incompatible changes made between successing versions of GLib
|
||||
Incompatible changes made between successive versions of GLib
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
|
|
|
@ -60,13 +60,13 @@ The difference between the two is that gmodule-2.0 adds
|
|||
which is often not needed.
|
||||
</para>
|
||||
<para>
|
||||
The simplest way to compile a program is to use the "backticks"
|
||||
feature of the shell. If you enclose a command in backticks
|
||||
(<emphasis>not single quotes</emphasis>), then its output will
|
||||
be substituted into the command line before execution. So to
|
||||
compile a GLib Hello, World, you would type the following:
|
||||
The simplest way to compile a program is to use command substitution
|
||||
feature of a shell. A command written in the format
|
||||
<literal>$(command)</literal> gets substituted into the command line
|
||||
before execution. So to compile a GLib Hello, World, you would type
|
||||
the following:
|
||||
<programlisting>
|
||||
$ cc hello.c `pkg-config --cflags --libs glib-2.0` -o hello
|
||||
$ cc hello.c $(pkg-config --cflags --libs glib-2.0) -o hello
|
||||
</programlisting>
|
||||
</para>
|
||||
<note><para>
|
||||
|
|
|
@ -81,7 +81,7 @@
|
|||
<xi:include href="xml/timers.xml" />
|
||||
<xi:include href="xml/spawn.xml" />
|
||||
<xi:include href="xml/fileutils.xml" />
|
||||
<xi:include href="xml/gurifuncs.xml" />
|
||||
<xi:include href="xml/guri.xml" />
|
||||
<xi:include href="xml/ghostutils.xml" />
|
||||
<xi:include href="xml/shell.xml" />
|
||||
<xi:include href="xml/option.xml" />
|
||||
|
@ -280,6 +280,26 @@
|
|||
<title>Index of new symbols in 2.64</title>
|
||||
<xi:include href="xml/api-index-2.64.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-66" role="2.66">
|
||||
<title>Index of new symbols in 2.66</title>
|
||||
<xi:include href="xml/api-index-2.66.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-68" role="2.68">
|
||||
<title>Index of new symbols in 2.68</title>
|
||||
<xi:include href="xml/api-index-2.68.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-70" role="2.70">
|
||||
<title>Index of new symbols in 2.70</title>
|
||||
<xi:include href="xml/api-index-2.70.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-72" role="2.72">
|
||||
<title>Index of new symbols in 2.72</title>
|
||||
<xi:include href="xml/api-index-2.72.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-74" role="2.74">
|
||||
<title>Index of new symbols in 2.74</title>
|
||||
<xi:include href="xml/api-index-2.74.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
|
|
@ -136,6 +136,13 @@ GLIB_VERSION_2_58
|
|||
GLIB_VERSION_2_60
|
||||
GLIB_VERSION_2_62
|
||||
GLIB_VERSION_2_64
|
||||
GLIB_VERSION_2_66
|
||||
GLIB_VERSION_2_68
|
||||
GLIB_VERSION_2_70
|
||||
GLIB_VERSION_2_72
|
||||
GLIB_VERSION_2_74
|
||||
GLIB_VERSION_CUR_STABLE
|
||||
GLIB_VERSION_PREV_STABLE
|
||||
GLIB_VERSION_MIN_REQUIRED
|
||||
GLIB_VERSION_MAX_ALLOWED
|
||||
GLIB_DISABLE_DEPRECATION_WARNINGS
|
||||
|
@ -162,6 +169,11 @@ GLIB_AVAILABLE_ENUMERATOR_IN_2_58
|
|||
GLIB_AVAILABLE_ENUMERATOR_IN_2_60
|
||||
GLIB_AVAILABLE_ENUMERATOR_IN_2_62
|
||||
GLIB_AVAILABLE_ENUMERATOR_IN_2_64
|
||||
GLIB_AVAILABLE_ENUMERATOR_IN_2_66
|
||||
GLIB_AVAILABLE_ENUMERATOR_IN_2_68
|
||||
GLIB_AVAILABLE_ENUMERATOR_IN_2_70
|
||||
GLIB_AVAILABLE_ENUMERATOR_IN_2_72
|
||||
GLIB_AVAILABLE_ENUMERATOR_IN_2_74
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GLIB_AVAILABLE_IN_2_26
|
||||
GLIB_AVAILABLE_IN_2_28
|
||||
|
@ -183,6 +195,11 @@ GLIB_AVAILABLE_IN_2_58
|
|||
GLIB_AVAILABLE_IN_2_60
|
||||
GLIB_AVAILABLE_IN_2_62
|
||||
GLIB_AVAILABLE_IN_2_64
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GLIB_AVAILABLE_IN_2_68
|
||||
GLIB_AVAILABLE_IN_2_70
|
||||
GLIB_AVAILABLE_IN_2_72
|
||||
GLIB_AVAILABLE_IN_2_74
|
||||
GLIB_AVAILABLE_MACRO_IN_2_26
|
||||
GLIB_AVAILABLE_MACRO_IN_2_28
|
||||
GLIB_AVAILABLE_MACRO_IN_2_30
|
||||
|
@ -203,6 +220,20 @@ GLIB_AVAILABLE_MACRO_IN_2_58
|
|||
GLIB_AVAILABLE_MACRO_IN_2_60
|
||||
GLIB_AVAILABLE_MACRO_IN_2_62
|
||||
GLIB_AVAILABLE_MACRO_IN_2_64
|
||||
GLIB_AVAILABLE_MACRO_IN_2_66
|
||||
GLIB_AVAILABLE_MACRO_IN_2_68
|
||||
GLIB_AVAILABLE_MACRO_IN_2_70
|
||||
GLIB_AVAILABLE_MACRO_IN_2_72
|
||||
GLIB_AVAILABLE_MACRO_IN_2_74
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_44
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_60
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_62
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_66
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_68
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_70
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_72
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_74
|
||||
GLIB_AVAILABLE_TYPE_IN_2_26
|
||||
GLIB_AVAILABLE_TYPE_IN_2_28
|
||||
GLIB_AVAILABLE_TYPE_IN_2_30
|
||||
|
@ -223,6 +254,11 @@ GLIB_AVAILABLE_TYPE_IN_2_58
|
|||
GLIB_AVAILABLE_TYPE_IN_2_60
|
||||
GLIB_AVAILABLE_TYPE_IN_2_62
|
||||
GLIB_AVAILABLE_TYPE_IN_2_64
|
||||
GLIB_AVAILABLE_TYPE_IN_2_66
|
||||
GLIB_AVAILABLE_TYPE_IN_2_68
|
||||
GLIB_AVAILABLE_TYPE_IN_2_70
|
||||
GLIB_AVAILABLE_TYPE_IN_2_72
|
||||
GLIB_AVAILABLE_TYPE_IN_2_74
|
||||
GLIB_DEPRECATED_ENUMERATOR
|
||||
GLIB_DEPRECATED_ENUMERATOR_FOR
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_26
|
||||
|
@ -265,6 +301,16 @@ GLIB_DEPRECATED_ENUMERATOR_IN_2_62
|
|||
GLIB_DEPRECATED_ENUMERATOR_IN_2_62_FOR
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_64
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_64_FOR
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_66
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_66_FOR
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_68
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_68_FOR
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_70
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_70_FOR
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_72
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_72_FOR
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_74
|
||||
GLIB_DEPRECATED_ENUMERATOR_IN_2_74_FOR
|
||||
GLIB_DEPRECATED_IN_2_26
|
||||
GLIB_DEPRECATED_IN_2_26_FOR
|
||||
GLIB_DEPRECATED_IN_2_28
|
||||
|
@ -305,6 +351,16 @@ GLIB_DEPRECATED_IN_2_62
|
|||
GLIB_DEPRECATED_IN_2_62_FOR
|
||||
GLIB_DEPRECATED_IN_2_64
|
||||
GLIB_DEPRECATED_IN_2_64_FOR
|
||||
GLIB_DEPRECATED_IN_2_66
|
||||
GLIB_DEPRECATED_IN_2_66_FOR
|
||||
GLIB_DEPRECATED_IN_2_68
|
||||
GLIB_DEPRECATED_IN_2_68_FOR
|
||||
GLIB_DEPRECATED_IN_2_70
|
||||
GLIB_DEPRECATED_IN_2_70_FOR
|
||||
GLIB_DEPRECATED_IN_2_72
|
||||
GLIB_DEPRECATED_IN_2_72_FOR
|
||||
GLIB_DEPRECATED_IN_2_74
|
||||
GLIB_DEPRECATED_IN_2_74_FOR
|
||||
GLIB_DEPRECATED_MACRO
|
||||
GLIB_DEPRECATED_MACRO_FOR
|
||||
GLIB_DEPRECATED_MACRO_IN_2_26
|
||||
|
@ -347,6 +403,16 @@ GLIB_DEPRECATED_MACRO_IN_2_62
|
|||
GLIB_DEPRECATED_MACRO_IN_2_62_FOR
|
||||
GLIB_DEPRECATED_MACRO_IN_2_64
|
||||
GLIB_DEPRECATED_MACRO_IN_2_64_FOR
|
||||
GLIB_DEPRECATED_MACRO_IN_2_66
|
||||
GLIB_DEPRECATED_MACRO_IN_2_66_FOR
|
||||
GLIB_DEPRECATED_MACRO_IN_2_68
|
||||
GLIB_DEPRECATED_MACRO_IN_2_68_FOR
|
||||
GLIB_DEPRECATED_MACRO_IN_2_70
|
||||
GLIB_DEPRECATED_MACRO_IN_2_70_FOR
|
||||
GLIB_DEPRECATED_MACRO_IN_2_72
|
||||
GLIB_DEPRECATED_MACRO_IN_2_72_FOR
|
||||
GLIB_DEPRECATED_MACRO_IN_2_74
|
||||
GLIB_DEPRECATED_MACRO_IN_2_74_FOR
|
||||
GLIB_DEPRECATED_TYPE
|
||||
GLIB_DEPRECATED_TYPE_FOR
|
||||
GLIB_DEPRECATED_TYPE_IN_2_26
|
||||
|
@ -389,6 +455,16 @@ GLIB_DEPRECATED_TYPE_IN_2_62
|
|||
GLIB_DEPRECATED_TYPE_IN_2_62_FOR
|
||||
GLIB_DEPRECATED_TYPE_IN_2_64
|
||||
GLIB_DEPRECATED_TYPE_IN_2_64_FOR
|
||||
GLIB_DEPRECATED_TYPE_IN_2_66
|
||||
GLIB_DEPRECATED_TYPE_IN_2_66_FOR
|
||||
GLIB_DEPRECATED_TYPE_IN_2_68
|
||||
GLIB_DEPRECATED_TYPE_IN_2_68_FOR
|
||||
GLIB_DEPRECATED_TYPE_IN_2_70
|
||||
GLIB_DEPRECATED_TYPE_IN_2_70_FOR
|
||||
GLIB_DEPRECATED_TYPE_IN_2_72
|
||||
GLIB_DEPRECATED_TYPE_IN_2_72_FOR
|
||||
GLIB_DEPRECATED_TYPE_IN_2_74
|
||||
GLIB_DEPRECATED_TYPE_IN_2_74_FOR
|
||||
GLIB_VERSION_CUR_STABLE
|
||||
GLIB_VERSION_PREV_STABLE
|
||||
</SECTION>
|
||||
|
@ -437,6 +513,12 @@ G_ALIGNOF
|
|||
|
||||
<SUBSECTION>
|
||||
G_CONST_RETURN
|
||||
G_NORETURN
|
||||
G_NORETURN_FUNCPTR
|
||||
|
||||
<SUBSECTION>
|
||||
G_ALWAYS_INLINE
|
||||
G_NO_INLINE
|
||||
|
||||
<SUBSECTION>
|
||||
G_N_ELEMENTS
|
||||
|
@ -688,19 +770,39 @@ G_HAVE_GNUC_VARARGS
|
|||
G_HAVE_ISO_VARARGS
|
||||
G_HAVE_GROWING_STACK
|
||||
G_VA_COPY_AS_ARRAY
|
||||
GLIB_CANNOT_IGNORE_DEPRECATIONS
|
||||
GLIB_DEPRECATED
|
||||
GLIB_DEPRECATED_FOR
|
||||
GLIB_UNAVAILABLE
|
||||
GLIB_UNAVAILABLE_ENUMERATOR
|
||||
GLIB_UNAVAILABLE_MACRO
|
||||
GLIB_UNAVAILABLE_STATIC_INLINE
|
||||
GLIB_UNAVAILABLE_TYPE
|
||||
G_ANALYZER_ANALYZING
|
||||
G_ANALYZER_NORETURN
|
||||
g_autoptr_cleanup_generic_gfree
|
||||
g_has_typeof
|
||||
glib_typeof
|
||||
g_macro__has_attribute
|
||||
g_macro__has_builtin
|
||||
g_macro__has_feature
|
||||
g_macro__has_extension
|
||||
g_macro__has_attribute___always_inline__
|
||||
g_macro__has_attribute___alloc_size__
|
||||
g_macro__has_attribute___const__
|
||||
g_macro__has_attribute___deprecated__
|
||||
g_macro__has_attribute___format__
|
||||
g_macro__has_attribute___format_arg__
|
||||
g_macro__has_attribute___malloc__
|
||||
g_macro__has_attribute___no_instrument_function__
|
||||
g_macro__has_attribute___noreturn__
|
||||
g_macro__has_attribute___pure__
|
||||
g_macro__has_attribute___sentinel__
|
||||
g_macro__has_attribute___unused__
|
||||
g_macro__has_attribute_fallthrough
|
||||
g_macro__has_attribute_may_alias
|
||||
g_macro__has_attribute___noinline__
|
||||
g_macro__has_attribute_warn_unused_result
|
||||
g_macro__has_attribute_cleanup
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -718,7 +820,15 @@ g_set_error_literal
|
|||
g_propagate_error
|
||||
g_clear_error
|
||||
g_prefix_error
|
||||
g_prefix_error_literal
|
||||
g_propagate_prefixed_error
|
||||
<SUBSECTION>
|
||||
GErrorInitFunc
|
||||
GErrorCopyFunc
|
||||
GErrorClearFunc
|
||||
G_DEFINE_EXTENDED_ERROR
|
||||
g_error_domain_register_static
|
||||
g_error_domain_register
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -751,7 +861,9 @@ G_SOURCE_REMOVE
|
|||
|
||||
<SUBSECTION>
|
||||
GMainContext
|
||||
GMainContextFlags
|
||||
g_main_context_new
|
||||
g_main_context_new_with_flags
|
||||
g_main_context_ref
|
||||
g_main_context_unref
|
||||
g_main_context_default
|
||||
|
@ -797,6 +909,7 @@ g_main_context_pop_thread_default
|
|||
g_timeout_source_new
|
||||
g_timeout_source_new_seconds
|
||||
g_timeout_add
|
||||
g_timeout_add_once
|
||||
g_timeout_add_full
|
||||
g_timeout_add_seconds
|
||||
g_timeout_add_seconds_full
|
||||
|
@ -804,6 +917,7 @@ g_timeout_add_seconds_full
|
|||
<SUBSECTION>
|
||||
g_idle_source_new
|
||||
g_idle_add
|
||||
g_idle_add_once
|
||||
g_idle_add_full
|
||||
g_idle_remove_by_data
|
||||
|
||||
|
@ -841,11 +955,13 @@ g_source_get_can_recurse
|
|||
g_source_get_id
|
||||
g_source_get_name
|
||||
g_source_set_name
|
||||
g_source_set_static_name
|
||||
g_source_set_name_by_id
|
||||
g_source_get_context
|
||||
g_source_set_callback
|
||||
GSourceFunc
|
||||
G_SOURCE_FUNC
|
||||
GSourceOnceFunc
|
||||
g_source_set_callback_indirect
|
||||
g_source_set_ready_time
|
||||
g_source_get_ready_time
|
||||
|
@ -865,6 +981,9 @@ g_source_remove_by_user_data
|
|||
GClearHandleFunc
|
||||
g_clear_handle_id
|
||||
|
||||
<SUBSECTION>
|
||||
g_steal_fd
|
||||
|
||||
<SUBSECTION Private>
|
||||
GLIB_HAVE_ALLOCA_H
|
||||
alloca
|
||||
|
@ -1093,6 +1212,7 @@ g_once_init_enter_impl
|
|||
<FILE>thread_pools</FILE>
|
||||
GThreadPool
|
||||
g_thread_pool_new
|
||||
g_thread_pool_new_full
|
||||
g_thread_pool_push
|
||||
g_thread_pool_set_max_threads
|
||||
g_thread_pool_get_max_threads
|
||||
|
@ -1158,6 +1278,8 @@ g_atomic_int_set
|
|||
g_atomic_int_inc
|
||||
g_atomic_int_dec_and_test
|
||||
g_atomic_int_compare_and_exchange
|
||||
g_atomic_int_compare_and_exchange_full
|
||||
g_atomic_int_exchange
|
||||
g_atomic_int_add
|
||||
g_atomic_int_and
|
||||
g_atomic_int_or
|
||||
|
@ -1167,6 +1289,8 @@ g_atomic_int_xor
|
|||
g_atomic_pointer_get
|
||||
g_atomic_pointer_set
|
||||
g_atomic_pointer_compare_and_exchange
|
||||
g_atomic_pointer_compare_and_exchange_full
|
||||
g_atomic_pointer_exchange
|
||||
g_atomic_pointer_add
|
||||
g_atomic_pointer_and
|
||||
g_atomic_pointer_or
|
||||
|
@ -1291,11 +1415,19 @@ g_mem_gc_friendly
|
|||
|
||||
<SUBSECTION>
|
||||
g_alloca
|
||||
g_alloca0
|
||||
g_newa
|
||||
g_newa0
|
||||
|
||||
<SUBSECTION>
|
||||
g_aligned_alloc
|
||||
g_aligned_alloc0
|
||||
g_aligned_free
|
||||
|
||||
<SUBSECTION>
|
||||
g_memmove
|
||||
g_memdup
|
||||
g_memdup2
|
||||
|
||||
<SUBSECTION>
|
||||
GMemVTable
|
||||
|
@ -1346,6 +1478,9 @@ GPatternSpec
|
|||
g_pattern_spec_new
|
||||
g_pattern_spec_free
|
||||
g_pattern_spec_equal
|
||||
g_pattern_spec_copy
|
||||
g_pattern_spec_match
|
||||
g_pattern_spec_match_string
|
||||
g_pattern_match
|
||||
g_pattern_match_string
|
||||
g_pattern_match_simple
|
||||
|
@ -1433,6 +1568,8 @@ g_log_set_always_fatal
|
|||
g_log_set_fatal_mask
|
||||
g_log_default_handler
|
||||
g_log_set_default_handler
|
||||
g_log_get_debug_enabled
|
||||
g_log_set_debug_enabled
|
||||
|
||||
<SUBSECTION>
|
||||
g_log_structured
|
||||
|
@ -1451,6 +1588,8 @@ g_log_writer_format_fields
|
|||
g_log_writer_journald
|
||||
g_log_writer_standard_streams
|
||||
g_log_writer_default
|
||||
g_log_writer_default_set_use_stderr
|
||||
g_log_writer_default_would_drop
|
||||
|
||||
<SUBSECTION Private>
|
||||
g_log_structured_standard
|
||||
|
@ -1479,9 +1618,11 @@ GSpawnFlags
|
|||
GSpawnChildSetupFunc
|
||||
g_spawn_async_with_fds
|
||||
g_spawn_async_with_pipes
|
||||
g_spawn_async_with_pipes_and_fds
|
||||
g_spawn_async
|
||||
g_spawn_sync
|
||||
G_SPAWN_EXIT_ERROR
|
||||
g_spawn_check_wait_status
|
||||
g_spawn_check_exit_status
|
||||
g_spawn_command_line_async
|
||||
g_spawn_command_line_sync
|
||||
|
@ -1564,6 +1705,7 @@ GOptionArg
|
|||
GOptionFlags
|
||||
G_OPTION_REMAINING
|
||||
GOptionEntry
|
||||
G_OPTION_ENTRY_NULL
|
||||
g_option_context_add_main_entries
|
||||
GOptionGroup
|
||||
g_option_context_add_group
|
||||
|
@ -1594,7 +1736,9 @@ G_FILE_ERROR
|
|||
GFileTest
|
||||
g_file_error_from_errno
|
||||
g_file_get_contents
|
||||
GFileSetContentsFlags
|
||||
g_file_set_contents
|
||||
g_file_set_contents_full
|
||||
g_file_test
|
||||
g_mkstemp
|
||||
g_mkstemp_full
|
||||
|
@ -1769,9 +1913,17 @@ g_strjoinv
|
|||
|
||||
<SUBSECTION>
|
||||
GStrv
|
||||
GStrvBuilder
|
||||
g_strv_length
|
||||
g_strv_contains
|
||||
g_strv_equal
|
||||
g_strv_builder_new
|
||||
g_strv_builder_ref
|
||||
g_strv_builder_unref
|
||||
g_strv_builder_add
|
||||
g_strv_builder_addv
|
||||
g_strv_builder_add_many
|
||||
g_strv_builder_end
|
||||
|
||||
<SUBSECTION>
|
||||
g_strerror
|
||||
|
@ -1896,6 +2048,7 @@ g_time_zone_unref
|
|||
g_time_zone_ref
|
||||
<SUBSECTION>
|
||||
g_time_zone_new
|
||||
g_time_zone_new_identifier
|
||||
g_time_zone_new_local
|
||||
g_time_zone_new_utc
|
||||
g_time_zone_new_offset
|
||||
|
@ -2089,6 +2242,7 @@ g_get_real_name
|
|||
g_get_user_cache_dir
|
||||
g_get_user_data_dir
|
||||
g_get_user_config_dir
|
||||
g_get_user_state_dir
|
||||
g_get_user_runtime_dir
|
||||
GUserDirectory
|
||||
g_get_user_special_dir
|
||||
|
@ -2350,11 +2504,15 @@ g_bookmark_file_get_mime_type
|
|||
g_bookmark_file_get_is_private
|
||||
g_bookmark_file_get_icon
|
||||
g_bookmark_file_get_added
|
||||
g_bookmark_file_get_added_date_time
|
||||
g_bookmark_file_get_modified
|
||||
g_bookmark_file_get_modified_date_time
|
||||
g_bookmark_file_get_visited
|
||||
g_bookmark_file_get_visited_date_time
|
||||
g_bookmark_file_get_groups
|
||||
g_bookmark_file_get_applications
|
||||
g_bookmark_file_get_app_info
|
||||
g_bookmark_file_get_application_info
|
||||
|
||||
<SUBSECTION>
|
||||
g_bookmark_file_set_title
|
||||
|
@ -2363,10 +2521,14 @@ g_bookmark_file_set_mime_type
|
|||
g_bookmark_file_set_is_private
|
||||
g_bookmark_file_set_icon
|
||||
g_bookmark_file_set_added
|
||||
g_bookmark_file_set_added_date_time
|
||||
g_bookmark_file_set_groups
|
||||
g_bookmark_file_set_modified
|
||||
g_bookmark_file_set_modified_date_time
|
||||
g_bookmark_file_set_visited
|
||||
g_bookmark_file_set_visited_date_time
|
||||
g_bookmark_file_set_app_info
|
||||
g_bookmark_file_set_application_info
|
||||
g_bookmark_file_add_group
|
||||
g_bookmark_file_add_application
|
||||
g_bookmark_file_remove_group
|
||||
|
@ -2383,9 +2545,12 @@ g_bookmark_file_error_quark
|
|||
<FILE>modules</FILE>
|
||||
<INCLUDE>gmodule.h</INCLUDE>
|
||||
GModule
|
||||
GModuleError
|
||||
G_MODULE_ERROR
|
||||
g_module_supported
|
||||
g_module_build_path
|
||||
g_module_open
|
||||
g_module_open_full
|
||||
GModuleFlags
|
||||
g_module_symbol
|
||||
g_module_name
|
||||
|
@ -2398,6 +2563,8 @@ GModuleUnload
|
|||
G_MODULE_SUFFIX
|
||||
G_MODULE_EXPORT
|
||||
G_MODULE_IMPORT
|
||||
<SUBSECTION Private>
|
||||
g_module_error_quark
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -2717,8 +2884,10 @@ g_trash_stack_height
|
|||
GHashTable
|
||||
g_hash_table_new
|
||||
g_hash_table_new_full
|
||||
g_hash_table_new_similar
|
||||
GHashFunc
|
||||
GEqualFunc
|
||||
GEqualFuncFull
|
||||
g_hash_table_insert
|
||||
g_hash_table_replace
|
||||
g_hash_table_add
|
||||
|
@ -2796,6 +2965,7 @@ g_string_insert_unichar
|
|||
g_string_insert_len
|
||||
g_string_overwrite
|
||||
g_string_overwrite_len
|
||||
g_string_replace
|
||||
g_string_erase
|
||||
g_string_truncate
|
||||
g_string_set_size
|
||||
|
@ -2867,7 +3037,9 @@ g_ptr_array_sized_new
|
|||
g_ptr_array_new_with_free_func
|
||||
g_ptr_array_copy
|
||||
g_ptr_array_new_full
|
||||
g_ptr_array_new_null_terminated
|
||||
g_ptr_array_set_free_func
|
||||
g_ptr_array_is_null_terminated
|
||||
g_ptr_array_ref
|
||||
g_ptr_array_unref
|
||||
g_ptr_array_add
|
||||
|
@ -2922,6 +3094,7 @@ g_bytes_new_static
|
|||
g_bytes_new_with_free_func
|
||||
g_bytes_new_from_bytes
|
||||
g_bytes_get_data
|
||||
g_bytes_get_region
|
||||
g_bytes_get_size
|
||||
g_bytes_hash
|
||||
g_bytes_equal
|
||||
|
@ -2939,23 +3112,39 @@ g_bytes_get_type
|
|||
<TITLE>Balanced Binary Trees</TITLE>
|
||||
<FILE>trees-binary</FILE>
|
||||
GTree
|
||||
GTreeNode
|
||||
g_tree_new
|
||||
g_tree_ref
|
||||
g_tree_unref
|
||||
g_tree_new_with_data
|
||||
g_tree_new_full
|
||||
g_tree_node_first
|
||||
g_tree_node_last
|
||||
g_tree_node_previous
|
||||
g_tree_node_next
|
||||
g_tree_insert_node
|
||||
g_tree_insert
|
||||
g_tree_replace_node
|
||||
g_tree_replace
|
||||
g_tree_node_key
|
||||
g_tree_node_value
|
||||
g_tree_nnodes
|
||||
g_tree_height
|
||||
g_tree_lookup_node
|
||||
g_tree_lookup
|
||||
g_tree_lookup_extended
|
||||
g_tree_foreach_node
|
||||
g_tree_foreach
|
||||
g_tree_traverse
|
||||
GTraverseFunc
|
||||
GTraverseNodeFunc
|
||||
g_tree_search_node
|
||||
g_tree_search
|
||||
g_tree_lower_bound
|
||||
g_tree_upper_bound
|
||||
g_tree_remove
|
||||
g_tree_steal
|
||||
g_tree_remove_all
|
||||
g_tree_destroy
|
||||
</SECTION>
|
||||
|
||||
|
@ -3045,6 +3234,7 @@ g_datalist_id_set_data_full
|
|||
g_datalist_id_get_data
|
||||
g_datalist_id_remove_data
|
||||
g_datalist_id_remove_no_notify
|
||||
g_datalist_id_remove_multiple
|
||||
GDuplicateFunc
|
||||
g_datalist_id_dup_data
|
||||
g_datalist_id_replace_data
|
||||
|
@ -3308,19 +3498,67 @@ g_base64_decode_inplace
|
|||
|
||||
<SECTION>
|
||||
<TITLE>URI Functions</TITLE>
|
||||
<FILE>gurifuncs</FILE>
|
||||
<FILE>guri</FILE>
|
||||
GUri
|
||||
g_uri_ref
|
||||
g_uri_unref
|
||||
<SUBSECTION>
|
||||
GUriFlags
|
||||
g_uri_split
|
||||
g_uri_split_with_user
|
||||
g_uri_split_network
|
||||
g_uri_is_valid
|
||||
g_uri_join
|
||||
g_uri_join_with_user
|
||||
g_uri_parse
|
||||
g_uri_parse_relative
|
||||
g_uri_resolve_relative
|
||||
g_uri_build
|
||||
g_uri_build_with_user
|
||||
g_uri_peek_scheme
|
||||
g_uri_parse_scheme
|
||||
<SUBSECTION>
|
||||
GUriHideFlags
|
||||
g_uri_to_string
|
||||
g_uri_to_string_partial
|
||||
<SUBSECTION>
|
||||
g_uri_get_scheme
|
||||
g_uri_get_userinfo
|
||||
g_uri_get_user
|
||||
g_uri_get_password
|
||||
g_uri_get_auth_params
|
||||
g_uri_get_host
|
||||
g_uri_get_port
|
||||
g_uri_get_path
|
||||
g_uri_get_query
|
||||
g_uri_get_fragment
|
||||
g_uri_get_flags
|
||||
<SUBSECTION>
|
||||
GUriParamsIter
|
||||
GUriParamsFlags
|
||||
g_uri_params_iter_init
|
||||
g_uri_params_iter_next
|
||||
g_uri_parse_params
|
||||
<SUBSECTION>
|
||||
G_URI_RESERVED_CHARS_ALLOWED_IN_PATH
|
||||
G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT
|
||||
G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO
|
||||
G_URI_RESERVED_CHARS_GENERIC_DELIMITERS
|
||||
G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS
|
||||
g_uri_parse_scheme
|
||||
g_uri_escape_string
|
||||
g_uri_unescape_string
|
||||
g_uri_escape_bytes
|
||||
g_uri_unescape_bytes
|
||||
g_uri_unescape_segment
|
||||
<SUBSECTION>
|
||||
g_uri_list_extract_uris
|
||||
g_filename_from_uri
|
||||
g_filename_to_uri
|
||||
<SUBSECTION>
|
||||
G_URI_ERROR
|
||||
GUriError
|
||||
<SUBSECTION Private>
|
||||
g_uri_error_quark
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -3382,6 +3620,7 @@ GTestDataFunc
|
|||
g_test_add_data_func
|
||||
g_test_add_data_func_full
|
||||
g_test_add
|
||||
g_test_get_path
|
||||
|
||||
GTestFileType
|
||||
g_test_build_filename
|
||||
|
@ -3389,8 +3628,11 @@ g_test_get_filename
|
|||
g_test_get_dir
|
||||
|
||||
g_test_fail
|
||||
g_test_fail_printf
|
||||
g_test_skip
|
||||
g_test_skip_printf
|
||||
g_test_incomplete
|
||||
g_test_incomplete_printf
|
||||
g_test_failed
|
||||
g_test_message
|
||||
g_test_bug_base
|
||||
|
@ -3433,6 +3675,7 @@ g_assert
|
|||
g_assert_not_reached
|
||||
|
||||
g_assert_cmpstr
|
||||
g_assert_cmpstrv
|
||||
g_assert_cmpint
|
||||
g_assert_cmpuint
|
||||
g_assert_cmphex
|
||||
|
@ -3446,6 +3689,7 @@ g_assert_true
|
|||
g_assert_false
|
||||
g_assert_null
|
||||
g_assert_nonnull
|
||||
g_assert_no_errno
|
||||
g_test_set_nonfatal_assertions
|
||||
|
||||
GTestCase
|
||||
|
@ -3457,6 +3701,8 @@ g_test_get_root
|
|||
g_test_suite_add
|
||||
g_test_suite_add_suite
|
||||
g_test_run_suite
|
||||
g_test_case_free
|
||||
g_test_suite_free
|
||||
|
||||
<SUBSECTION Private>
|
||||
g_test_trap_assertions
|
||||
|
|
|
@ -288,7 +288,7 @@
|
|||
</para>
|
||||
<para>
|
||||
Unicode escapes of the form <literal>\uxxxx</literal> and <literal>\Uxxxxxxxx</literal> are supported, in
|
||||
hexidecimal. The usual control sequence escapes <literal>\a</literal>, <literal>\b</literal>,
|
||||
hexadecimal. The usual control sequence escapes <literal>\a</literal>, <literal>\b</literal>,
|
||||
<literal>\f</literal>, <literal>\n</literal>, <literal>\r</literal>, <literal>\t</literal> and
|
||||
<literal>\v</literal> are supported. Additionally, a <literal>\</literal> before a newline character causes
|
||||
the newline to be ignored. Finally, any other character following <literal>\</literal> is copied literally
|
||||
|
@ -296,7 +296,7 @@
|
|||
additions you should only use this feature when necessary for escaping backslashes or quotes.
|
||||
</para>
|
||||
<para>
|
||||
The usual octal and hexidecimal escapes <literal>\0nnn</literal> and <literal>\xnn</literal> are not
|
||||
The usual octal and hexadecimal escapes <literal>\0nnn</literal> and <literal>\xnn</literal> are not
|
||||
supported here. Those escapes are used to encode byte values and GVariant strings are Unicode.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -309,10 +309,10 @@
|
|||
<para>
|
||||
Numbers are given by default as decimal values. Octal and hex values can be given in the usual way (by
|
||||
prefixing with <literal>0</literal> or <literal>0x</literal>). Note that GVariant considers bytes to be
|
||||
unsigned integers and will print them as a two digit hexidecimal number by default.
|
||||
unsigned integers and will print them as a two digit hexadecimal number by default.
|
||||
</para>
|
||||
<para>
|
||||
Floating point numbers can also be given in the usual ways, including scientific and hexidecimal notations.
|
||||
Floating point numbers can also be given in the usual ways, including scientific and hexadecimal notations.
|
||||
</para>
|
||||
<para>
|
||||
For lack of additional information, integers will be parsed as int32 values by default. If the number has a
|
||||
|
@ -575,7 +575,7 @@
|
|||
<para>
|
||||
Bytestrings support the full range of escapes that you would expect (ie: those supported by
|
||||
<link linkend='g-strcompress'><function>g_strcompress()</function></link>. This includes the normal control
|
||||
sequence escapes (as mentioned in the section on strings) as well as octal and hexidecimal escapes of the
|
||||
sequence escapes (as mentioned in the section on strings) as well as octal and hexadecimal escapes of the
|
||||
forms <literal>\0nnn</literal> and <literal>\xnn</literal>.
|
||||
</para>
|
||||
<para>
|
||||
|
|
|
@ -263,7 +263,7 @@
|
|||
<para>
|
||||
Used as a prefix for a GVariant type string (not a prefix for a format string, so <literal>&s</literal> is
|
||||
a valid format string but <literal>&@s</literal> is not).
|
||||
Denotes that a C pointer to serialised data
|
||||
Denotes that a C pointer to serialized data
|
||||
should be used in place of the normal C type. See
|
||||
<link linkend='gvariant-format-strings-pointers'>Pointers</link> below.
|
||||
</para>
|
||||
|
@ -532,8 +532,8 @@ value4 = g_variant_new ("x", G_GINT64_CONSTANT (998877665544332211));
|
|||
<link linkend='gchar'>gchar</link> *)</code> and makes a copy of it.
|
||||
<link linkend='NULL:CAPS'><literal>NULL</literal></link> is not a valid string; use
|
||||
<link linkend='gvariant-format-strings-maybe-types'>maybe types</link> to encode that. If the '<literal>o</literal>' or
|
||||
'<literal>g</literal>' characters are used, care must be taken to ensure that the passed string is a valid DBus
|
||||
object path or DBus type signature, respectively.
|
||||
'<literal>g</literal>' characters are used, care must be taken to ensure that the passed string is a valid D-Bus
|
||||
object path or D-Bus type signature, respectively.
|
||||
</para>
|
||||
<para>
|
||||
Upon encounting '<literal>s</literal>', '<literal>o</literal>' or '<literal>g</literal>', <link
|
||||
|
@ -658,6 +658,7 @@ g_variant_builder_unref (builder);
|
|||
gchar *str;
|
||||
|
||||
g_variant_get (value, "as", &iter);
|
||||
/* No need to free 'str' unless breaking out of the loop */
|
||||
while (g_variant_iter_loop (iter, "s", &str))
|
||||
g_print ("%s\n", str);
|
||||
g_variant_iter_free (iter);
|
||||
|
@ -690,7 +691,7 @@ g_variant_unref (value);]]></programlisting></informalexample>
|
|||
<link linkend='g-variant-get'><function>g_variant_get()</function></link> returns (by reference) a
|
||||
non-<link linkend='NULL:CAPS'><literal>NULL</literal></link> pointer. When any of these format strings are
|
||||
prefixed with an '<literal>m</literal>', the type of arguments that are collected does not change in any way, but
|
||||
<link linkend='NULL:CAPS'><literal>NULL</literal></link> becomes a permissable value, to indicate the Nothing case.
|
||||
<link linkend='NULL:CAPS'><literal>NULL</literal></link> becomes a permissible value, to indicate the Nothing case.
|
||||
</para>
|
||||
<para>
|
||||
Note that the "special exception" introduced in the array section for constructing empty arrays is ignored
|
||||
|
@ -878,7 +879,10 @@ value2 = g_variant_new ("(@(iii)*)", value1, g_variant_new_string ("foo"));
|
|||
g_variant_get (value2, "(rs)", NULL, &string); /* or "(@(iii)s)" */
|
||||
g_print ("i only got the string: %s\n", string);
|
||||
g_free (string);
|
||||
}]]></programlisting></informalexample>
|
||||
}
|
||||
|
||||
/* no need to free 'value1' as 'value2' has consumed its floating reference */
|
||||
g_variant_unref (value2);]]></programlisting></informalexample>
|
||||
</refsect3>
|
||||
</refsect2>
|
||||
|
||||
|
@ -917,7 +921,7 @@ dict = g_variant_builder_end (b);]]></programlisting></informalexample>
|
|||
gint value = 1;
|
||||
gint max = 3;
|
||||
|
||||
/* type (oa{sa{sv}) */
|
||||
/* type (oa{sa{sv}}) */
|
||||
data = g_variant_new_parsed ("(%o, {'brightness': {'value': <%i>, 'max': <%i>}})",
|
||||
"/object/path", value, max);
|
||||
{
|
||||
|
@ -928,10 +932,12 @@ data = g_variant_new_parsed ("(%o, {'brightness': {'value': <%i>, 'max': <%i>}})
|
|||
|
||||
g_variant_get (data, "(o@a{?*})", &obj, ¶ms);
|
||||
g_print ("object_path: %s\n", obj);
|
||||
g_free (obj);
|
||||
|
||||
p_brightness = g_variant_lookup_value (params, "brightness", G_VARIANT_TYPE_VARDICT);
|
||||
g_variant_lookup (p_brightness, "max", "i", &p_max);
|
||||
g_print ("max: %d\n", p_max);
|
||||
g_variant_unref (params);
|
||||
}]]></programlisting></informalexample>
|
||||
</refsect3>
|
||||
|
||||
|
@ -946,7 +952,7 @@ data = g_variant_new_parsed ("(%o, {'brightness': {'value': <%i>, 'max': <%i>}})
|
|||
</para>
|
||||
|
||||
<para>
|
||||
The '<code>&</code>' character is used to indicate that serialised data should be directly exchanged via a
|
||||
The '<code>&</code>' character is used to indicate that serialized data should be directly exchanged via a
|
||||
pointer.
|
||||
</para>
|
||||
<para>
|
||||
|
@ -954,7 +960,7 @@ data = g_variant_new_parsed ("(%o, {'brightness': {'value': <%i>, 'max': <%i>}})
|
|||
'<literal>&o</literal>' or '<code>&g</code>'). For
|
||||
<link linkend='g-variant-new'><function>g_variant_new()</function></link> this has absolutely no effect. The string
|
||||
is collected and duplicated normally. For <link linkend='g-variant-get'><function>g_variant_get()</function></link>
|
||||
it means that instead of creating a newly allocated copy of the string, a pointer to the serialised data is
|
||||
it means that instead of creating a newly allocated copy of the string, a pointer to the serialized data is
|
||||
returned. This pointer should not be freed. Validity checks are performed to ensure that the string data will
|
||||
always be properly nul-terminated.
|
||||
</para>
|
||||
|
|
|
@ -22,10 +22,9 @@ if get_option('gtk_doc')
|
|||
'gprintfint.h',
|
||||
'gmirroringtable.h',
|
||||
'gscripttable.h',
|
||||
'gtrace-private.h',
|
||||
'glib-mirroring-tab',
|
||||
'gnulib',
|
||||
'pcre',
|
||||
'update-pcre',
|
||||
'gbytesprivate.h',
|
||||
'gvariant-internal.h',
|
||||
'gvariant-serialiser.h',
|
||||
|
|
|
@ -2313,7 +2313,7 @@ refer to them instead of the whole pattern. In a larger pattern, keeping
|
|||
track of parenthesis numbers can be tricky. It may be more convenient to
|
||||
use named parentheses instead.
|
||||
The Perl syntax for this is (?&name); GRegex also supports the(?P>name)
|
||||
syntac. We could rewrite the above example as follows:
|
||||
syntax. We could rewrite the above example as follows:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
|
@ -2442,52 +2442,6 @@ processing option does not affect the called subpattern.
|
|||
</para>
|
||||
</refsect1>
|
||||
|
||||
<!-- Callouts are not supported by GRegex
|
||||
<refsect1>
|
||||
<title>Callouts</title>
|
||||
<para>
|
||||
Perl has a feature whereby using the sequence (?{...}) causes arbitrary
|
||||
Perl code to be obeyed in the middle of matching a regular expression.
|
||||
This makes it possible, amongst other things, to extract different substrings that match the same pair of parentheses when there is a repetition.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
PCRE provides a similar feature, but of course it cannot obey arbitrary
|
||||
Perl code. The feature is called "callout". The caller of PCRE provides
|
||||
an external function by putting its entry point in the global variable
|
||||
pcre_callout. By default, this variable contains NULL, which disables
|
||||
all calling out.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Within a regular expression, (?C) indicates the points at which the
|
||||
external function is to be called. If you want to identify different
|
||||
callout points, you can put a number less than 256 after the letter C.
|
||||
The default value is zero. For example, this pattern has two callout
|
||||
points:
|
||||
</para>
|
||||
|
||||
<programlisting>
|
||||
(?C1)abc(?C2)def
|
||||
</programlisting>
|
||||
|
||||
<para>
|
||||
If the PCRE_AUTO_CALLOUT flag is passed to pcre_compile(), callouts are
|
||||
automatically installed before each item in the pattern. They are all
|
||||
numbered 255.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
During matching, when PCRE reaches a callout point (and pcre_callout is
|
||||
set), the external function is called. It is provided with the number
|
||||
of the callout, the position in the pattern, and, optionally, one item
|
||||
of data originally supplied by the caller of pcre_exec(). The callout
|
||||
function may cause matching to proceed, to backtrack, or to fail altogether. A complete description of the interface to the callout function
|
||||
is given in the pcrecallout documentation.
|
||||
</para>
|
||||
</refsect1>
|
||||
-->
|
||||
|
||||
<refsect1>
|
||||
<title>Copyright</title>
|
||||
<para>
|
||||
|
|
|
@ -201,8 +201,11 @@ How to run and debug your GLib application
|
|||
reproduced with <literal>G_SLICE=always-malloc</literal>, but will
|
||||
be caught by <literal>G_SLICE=debug-blocks</literal> is as follows:
|
||||
<programlisting>
|
||||
void *slist = g_slist_alloc (); /* void* gives up type-safety */
|
||||
g_list_free (slist); /* corruption: sizeof (GSList) != sizeof (GList) */
|
||||
/* void* gives up type-safety */
|
||||
void *slist = g_slist_alloc ();
|
||||
|
||||
/* corruption: sizeof (GSList) != sizeof (GList) */
|
||||
g_list_free (slist);
|
||||
</programlisting></para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
@ -311,7 +314,7 @@ How to run and debug your GLib application
|
|||
<ulink url="https://docs.microsoft.com/en-us/windows/desktop/debug/vectored-exception-handling">Vectored Exception Handling</ulink>
|
||||
on Windows (see <link linkend="G_DEBUGGER"><envar>G_DEBUGGER</envar></link>), allowing GLib to catch more
|
||||
exceptions. Set this variable to a comma-separated list of
|
||||
hexademical exception codes that should additionally be caught.
|
||||
hexadecimal exception codes that should additionally be caught.
|
||||
</para>
|
||||
<para>
|
||||
By default GLib will only catch Access Violation, Stack Overflow and
|
||||
|
|
|
@ -44,6 +44,12 @@ input. The options specified control the text that generated, substituting vario
|
|||
keywords enclosed in <literal>@</literal> characters in the templates.
|
||||
</para>
|
||||
|
||||
<para>Since version 2.74, GLib provides the <literal>G_DEFINE_ENUM_TYPE</literal>
|
||||
and <literal>G_DEFINE_FLAGS_TYPE</literal> C pre-processor macros. These macros
|
||||
can be used to define a GType for projects that have few, small enumeration
|
||||
types without going through the complexities of generating code at build
|
||||
time.</para>
|
||||
|
||||
<refsect2><title>Production text substitutions</title>
|
||||
<para>
|
||||
Certain keywords enclosed in <literal>@</literal> characters will be substituted in the
|
||||
|
@ -172,25 +178,62 @@ in your templates, to improve the reproducibility of the build. (Since: 2.22)
|
|||
Some C comments are treated specially in the parsed enum definitions,
|
||||
such comments start out with the trigraph sequence <literal>/*<</literal>
|
||||
and end with the trigraph sequence <literal>>*/</literal>.
|
||||
Per enum definition, the options <literal>skip</literal> and <literal>flags</literal> can be specified, to
|
||||
indicate this enum definition to be skipped, or for it to be treated as
|
||||
a flags definition, or to specify the common prefix to be stripped from
|
||||
all values to generate value nicknames, respectively. The <literal>underscore_name</literal>
|
||||
option can be used to specify the word separation used in the <function>*_get_type()</function>
|
||||
</para>
|
||||
|
||||
<para>The following options can be specified per enum definition:</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>skip</literal></term>
|
||||
<listitem><para>
|
||||
Indicates this enum definition should be skipped.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>flags</literal></term>
|
||||
<listitem><para>
|
||||
Indicates this enum should be treated as a flags definition.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>underscore_name</literal></term>
|
||||
<listitem><para>
|
||||
Specifies the word separation used in the <function>*_get_type()</function>
|
||||
function. For instance, <literal>/*< underscore_name=gnome_vfs_uri_hide_options >*/</literal>.
|
||||
</para>
|
||||
<para>
|
||||
Per value definition, the options <literal>skip</literal> and <literal>nick</literal> are supported.
|
||||
The former causes the value to be skipped, and the latter can be used to
|
||||
specify the otherwise auto-generated nickname.
|
||||
Examples:
|
||||
</para>
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>since</literal></term>
|
||||
<listitem><para>
|
||||
Specifies the version tag that will be used to substitute the <literal>@enumsince@</literal>
|
||||
keyword in the template, useful when documenting methods generated from the enums
|
||||
(e.g. <literal>Since: @enumsince@</literal>). (Since: 2.66)
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>The following options can be specified per value definition:</para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><literal>skip</literal></term>
|
||||
<listitem><para>
|
||||
Indicates the value should be skipped.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><literal>nick</literal></term>
|
||||
<listitem><para>
|
||||
Specifies the otherwise auto-generated nickname.
|
||||
</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<para>Examples:</para>
|
||||
<informalexample><programlisting>
|
||||
typedef enum /*< skip >*/
|
||||
{
|
||||
PREFIX_FOO
|
||||
} PrefixThisEnumWillBeSkipped;
|
||||
typedef enum /*< flags,prefix=PREFIX >*/
|
||||
typedef enum /*< flags,prefix=PREFIX,since=1.0 >*/
|
||||
{
|
||||
PREFIX_THE_ZEROTH_VALUE, /*< skip >*/
|
||||
PREFIX_THE_FIRST_VALUE,
|
||||
|
@ -443,9 +486,9 @@ A C source template file will typically look like this:
|
|||
GType
|
||||
@enum_name@_get_type (void)
|
||||
{
|
||||
static volatile gsize g_@type@_type_id__volatile;
|
||||
static gsize static_g_@type@_type_id;
|
||||
|
||||
if (g_once_init_enter (&g_define_type_id__volatile))
|
||||
if (g_once_init_enter (&static_g_@type@_type_id))
|
||||
{
|
||||
static const G@Type@Value values[] = {
|
||||
/*** END value-header ***/
|
||||
|
@ -461,9 +504,9 @@ GType
|
|||
GType g_@type@_type_id =
|
||||
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
||||
|
||||
g_once_init_leave (&g_@type@_type_id__volatile, g_@type@_type_id);
|
||||
g_once_init_leave (&static_g_@type@_type_id, g_@type@_type_id);
|
||||
}
|
||||
return g_@type@_type_id__volatile;
|
||||
return static_g_@type@_type_id;
|
||||
}
|
||||
|
||||
/*** END value-tail ***/
|
||||
|
|
|
@ -81,9 +81,11 @@
|
|||
<xi:include href="xml/gparamspec.xml" />
|
||||
<xi:include href="xml/value_collection.xml" />
|
||||
<xi:include href="xml/signals.xml" />
|
||||
<xi:include href="xml/gsignalgroup.xml" />
|
||||
<xi:include href="xml/gclosure.xml" />
|
||||
<xi:include href="xml/value_arrays.xml" />
|
||||
<xi:include href="xml/gbinding.xml" />
|
||||
<xi:include href="xml/gbindinggroup.xml" />
|
||||
</reference>
|
||||
<reference label="III">
|
||||
<title>Tools Reference</title>
|
||||
|
@ -200,6 +202,26 @@
|
|||
<title>Index of new symbols in 2.62</title>
|
||||
<xi:include href="xml/api-index-2.62.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-66" role="2.66">
|
||||
<title>Index of new symbols in 2.66</title>
|
||||
<xi:include href="xml/api-index-2.66.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-68" role="2.68">
|
||||
<title>Index of new symbols in 2.68</title>
|
||||
<xi:include href="xml/api-index-2.68.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-70" role="2.70">
|
||||
<title>Index of new symbols in 2.70</title>
|
||||
<xi:include href="xml/api-index-2.70.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-72" role="2.72">
|
||||
<title>Index of new symbols in 2.72</title>
|
||||
<xi:include href="xml/api-index-2.72.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-2-74" role="2.74">
|
||||
<title>Index of new symbols in 2.74</title>
|
||||
<xi:include href="xml/api-index-2.74.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ G_TYPE_IS_INSTANTIATABLE
|
|||
G_TYPE_IS_DERIVABLE
|
||||
G_TYPE_IS_DEEP_DERIVABLE
|
||||
G_TYPE_IS_INTERFACE
|
||||
G_TYPE_IS_FINAL
|
||||
GTypeInterface
|
||||
GTypeInstance
|
||||
GTypeClass
|
||||
|
@ -65,6 +66,7 @@ g_type_default_interface_unref
|
|||
g_type_children
|
||||
g_type_interfaces
|
||||
g_type_interface_prerequisites
|
||||
g_type_interface_instantiatable_prerequisite
|
||||
g_type_set_qdata
|
||||
g_type_get_qdata
|
||||
g_type_query
|
||||
|
@ -112,6 +114,9 @@ G_DEFINE_TYPE_WITH_CODE
|
|||
G_DEFINE_ABSTRACT_TYPE
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE
|
||||
G_DEFINE_ABSTRACT_TYPE_WITH_CODE
|
||||
G_DEFINE_FINAL_TYPE
|
||||
G_DEFINE_FINAL_TYPE_WITH_PRIVATE
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE
|
||||
G_ADD_PRIVATE
|
||||
G_PRIVATE_OFFSET
|
||||
G_PRIVATE_FIELD
|
||||
|
@ -124,6 +129,9 @@ G_DEFINE_BOXED_TYPE
|
|||
G_DEFINE_BOXED_TYPE_WITH_CODE
|
||||
G_DEFINE_POINTER_TYPE
|
||||
G_DEFINE_POINTER_TYPE_WITH_CODE
|
||||
G_DEFINE_ENUM_VALUE
|
||||
G_DEFINE_ENUM_TYPE
|
||||
G_DEFINE_FLAGS_TYPE
|
||||
|
||||
<SUBSECTION Private>
|
||||
G_TYPE_FUNDAMENTAL_SHIFT
|
||||
|
@ -267,6 +275,7 @@ GParameter
|
|||
g_object_ref
|
||||
g_object_unref
|
||||
g_object_ref_sink
|
||||
g_object_take_ref
|
||||
g_set_object
|
||||
g_clear_object
|
||||
GInitiallyUnowned
|
||||
|
@ -408,6 +417,9 @@ G_TYPE_SOURCE
|
|||
G_TYPE_POLLFD
|
||||
G_TYPE_THREAD
|
||||
G_TYPE_OPTION_GROUP
|
||||
G_TYPE_URI
|
||||
G_TYPE_TREE
|
||||
G_TYPE_PATTERN_SPEC
|
||||
|
||||
<SUBSECTION Standard>
|
||||
G_TYPE_IS_BOXED
|
||||
|
@ -441,6 +453,9 @@ g_mapped_file_get_type
|
|||
g_markup_parse_context_get_type
|
||||
g_thread_get_type
|
||||
g_option_group_get_type
|
||||
g_uri_get_type
|
||||
g_tree_get_type
|
||||
g_pattern_spec_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
|
@ -519,8 +534,10 @@ g_param_spec_get_default_value
|
|||
g_param_value_set_default
|
||||
g_param_value_defaults
|
||||
g_param_value_validate
|
||||
g_param_value_is_valid
|
||||
g_param_value_convert
|
||||
g_param_values_cmp
|
||||
g_param_spec_is_valid_name
|
||||
g_param_spec_get_name
|
||||
g_param_spec_get_name_quark
|
||||
g_param_spec_get_nick
|
||||
|
@ -683,6 +700,8 @@ G_IS_PARAM_SPEC_STRING
|
|||
G_PARAM_SPEC_STRING
|
||||
G_VALUE_HOLDS_STRING
|
||||
G_TYPE_PARAM_STRING
|
||||
G_VALUE_IS_INTERNED_STRING
|
||||
G_VALUE_INTERNED_STRING
|
||||
GParamSpecString
|
||||
gchararray
|
||||
g_param_spec_string
|
||||
|
@ -692,6 +711,7 @@ g_value_take_string
|
|||
g_value_set_string_take_ownership
|
||||
g_value_get_string
|
||||
g_value_dup_string
|
||||
g_value_set_interned_string
|
||||
|
||||
<SUBSECTION GParamSpec>
|
||||
G_IS_PARAM_SPEC_PARAM
|
||||
|
@ -797,6 +817,7 @@ g_param_spec_types
|
|||
<INCLUDE>glib-object.h,gobject/gvaluecollector.h</INCLUDE>
|
||||
GTypeCValue
|
||||
G_VALUE_COLLECT_INIT
|
||||
G_VALUE_COLLECT_INIT2
|
||||
G_VALUE_COLLECT
|
||||
G_VALUE_COLLECT_SKIP
|
||||
G_VALUE_LCOPY
|
||||
|
@ -859,6 +880,7 @@ g_signal_override_class_handler
|
|||
g_signal_chain_from_overridden_handler
|
||||
g_signal_add_emission_hook
|
||||
g_signal_remove_emission_hook
|
||||
g_signal_is_valid_name
|
||||
g_signal_parse_name
|
||||
g_signal_get_invocation_hint
|
||||
g_signal_type_cclosure_new
|
||||
|
@ -968,8 +990,10 @@ g_io_condition_get_type
|
|||
GBinding
|
||||
GBindingFlags
|
||||
g_binding_get_source
|
||||
g_binding_dup_source
|
||||
g_binding_get_source_property
|
||||
g_binding_get_target
|
||||
g_binding_dup_target
|
||||
g_binding_get_target_property
|
||||
g_binding_get_flags
|
||||
g_binding_unbind
|
||||
|
@ -987,3 +1011,44 @@ G_IS_BINDING
|
|||
g_binding_flags_get_type
|
||||
g_binding_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gbindinggroup</FILE>
|
||||
GBindingGroup
|
||||
g_binding_group_new
|
||||
g_binding_group_dup_source
|
||||
g_binding_group_set_source
|
||||
g_binding_group_bind
|
||||
g_binding_group_bind_full
|
||||
g_binding_group_bind_with_closures
|
||||
<SUBSECTION Standard>
|
||||
G_TYPE_BINDING_GROUP
|
||||
G_TYPE_BINDING_GROUP_CLASS
|
||||
G_BINDING_GROUP
|
||||
G_IS_BINDING_GROUP
|
||||
<SUBSECTION Private>
|
||||
g_binding_group_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gsignalgroup</FILE>
|
||||
GSignalGroup
|
||||
g_signal_group_block
|
||||
g_signal_group_connect
|
||||
g_signal_group_connect_after
|
||||
g_signal_group_connect_data
|
||||
g_signal_group_connect_object
|
||||
g_signal_group_connect_swapped
|
||||
g_signal_group_connect_closure
|
||||
g_signal_group_dup_target
|
||||
g_signal_group_get_type
|
||||
g_signal_group_new
|
||||
g_signal_group_set_target
|
||||
g_signal_group_unblock
|
||||
<SUBSECTION Standard>
|
||||
G_IS_SIGNAL_GROUP
|
||||
G_SIGNAL_GROUP
|
||||
G_TYPE_SIGNAL_GROUP
|
||||
<SUBSECTION Private>
|
||||
g_signal_group_get_type
|
||||
</SECTION>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</para>
|
||||
|
||||
<para>
|
||||
<link linkend="GObject"><type>GObject</type></link> is a fundamental classed instantiable type. It implements:
|
||||
<link linkend="GObject"><type>GObject</type></link> is a fundamental classed instantiatable type. It implements:
|
||||
<itemizedlist>
|
||||
<listitem><para>Memory management with reference counting</para></listitem>
|
||||
<listitem><para>Construction/Destruction of instances</para></listitem>
|
||||
|
@ -280,7 +280,7 @@ ViewerFile *file = g_object_new (VIEWER_TYPE_FILE, NULL);
|
|||
<para>
|
||||
The reference count is initialized to one by
|
||||
<function><link linkend="g-object-new">g_object_new</link></function> which means that the caller
|
||||
is currently the sole owner of the newly-created reference.
|
||||
is currently the sole owner of the newly-created reference. (If the object is derived from <link linkend="GInitiallyUnowned"><type>GInitiallyUnowned</type></link>, this reference count is <link linkend="floating-ref">floating</link>.)
|
||||
When the reference count reaches zero, that is,
|
||||
when <function><link linkend="g-object-unref">g_object_unref</link></function> is called by the last client holding
|
||||
a reference to the object, the <emphasis>dispose</emphasis> and the
|
||||
|
@ -293,8 +293,8 @@ ViewerFile *file = g_object_new (VIEWER_TYPE_FILE, NULL);
|
|||
one of the <function>g_type_register_*</function> functions), the object's instance
|
||||
memory will be freed or returned to the object pool for this type.
|
||||
Once the object has been freed, if it was the last instance of the type, the type's class
|
||||
will be destroyed as described in <xref linkend="gtype-instantiable-classed"/> and
|
||||
<xref linkend="gtype-non-instantiable-classed"/>.
|
||||
will be destroyed as described in <xref linkend="gtype-instantiatable-classed"/> and
|
||||
<xref linkend="gtype-non-instantiatable-classed"/>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
@ -555,7 +555,7 @@ viewer_file_class_init (ViewerFileClass *klass)
|
|||
"Filename",
|
||||
"Name of the file to load and display from.",
|
||||
NULL /* default value */,
|
||||
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
|
||||
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
obj_properties[PROP_ZOOM_LEVEL] =
|
||||
g_param_spec_uint ("zoom-level",
|
||||
|
@ -564,7 +564,7 @@ viewer_file_class_init (ViewerFileClass *klass)
|
|||
0 /* minimum value */,
|
||||
10 /* maximum value */,
|
||||
2 /* default value */,
|
||||
G_PARAM_READWRITE);
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
g_object_class_install_properties (object_class,
|
||||
N_PROPERTIES,
|
||||
|
|
|
@ -188,9 +188,9 @@ g_cclosure_marshal_VOID__INT (GClosure *closure,
|
|||
Each signal is registered in the type system together with the type on which
|
||||
it can be emitted: users of the type are said to <emphasis>connect</emphasis>
|
||||
to the signal on a given type instance when they register a closure to be
|
||||
invoked upon the signal emission. Users can also emit the signal by themselves
|
||||
or stop the emission of the signal from within one of the closures connected
|
||||
to the signal.
|
||||
invoked upon the signal emission. The closure will be called synchronously on emission.
|
||||
Users can also emit the signal by themselves or stop the emission of the signal from
|
||||
within one of the closures connected to the signal.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
@ -352,7 +352,7 @@ void g_signal_emitv (const GValue *instance_and_params,
|
|||
</para>
|
||||
|
||||
<para>
|
||||
Signal emission can be decomposed in 5 steps:
|
||||
Signal emission is done synchronously and can be decomposed in 5 steps:
|
||||
<orderedlist>
|
||||
<listitem><para>
|
||||
<literal>RUN_FIRST</literal>: if the
|
||||
|
|
|
@ -108,7 +108,7 @@ GType g_type_register_fundamental (GType type_id,
|
|||
|
||||
<para>
|
||||
The major common point between <emphasis>all</emphasis> GLib types (fundamental and
|
||||
non-fundamental, classed and non-classed, instantiable and non-instantiable) is that
|
||||
non-fundamental, classed and non-classed, instantiatable and non-instantiatable) is that
|
||||
they can all be manipulated through a single API to copy/assign them.
|
||||
</para>
|
||||
|
||||
|
@ -300,11 +300,11 @@ GType viewer_file_get_type (void)
|
|||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="gtype-non-instantiable">
|
||||
<title>Non-instantiable non-classed fundamental types</title>
|
||||
<sect1 id="gtype-non-instantiatable">
|
||||
<title>Non-instantiatable non-classed fundamental types</title>
|
||||
|
||||
<para>
|
||||
A lot of types are not instantiable by the type system and do not have
|
||||
A lot of types are not instantiatable by the type system and do not have
|
||||
a class. Most of these types are fundamental trivial types such as <emphasis>gchar</emphasis>,
|
||||
and are already registered by GLib.
|
||||
</para>
|
||||
|
@ -344,7 +344,7 @@ GType viewer_file_get_type (void)
|
|||
|
||||
|
||||
<para>
|
||||
Having non-instantiable types might seem a bit useless: what good is a type
|
||||
Having non-instantiatable types might seem a bit useless: what good is a type
|
||||
if you cannot instantiate an instance of that type ? Most of these types
|
||||
are used in conjunction with <link linkend="GValue"><type>GValue</type></link>s: a GValue is initialized
|
||||
with an integer or a string and it is passed around by using the registered
|
||||
|
@ -354,8 +354,8 @@ GType viewer_file_get_type (void)
|
|||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="gtype-instantiable-classed">
|
||||
<title>Instantiable classed types: objects</title>
|
||||
<sect1 id="gtype-instantiatable-classed">
|
||||
<title>Instantiatable classed types: objects</title>
|
||||
|
||||
<para>
|
||||
This section covers the theory behind objects. See
|
||||
|
@ -364,10 +364,10 @@ GType viewer_file_get_type (void)
|
|||
</para>
|
||||
|
||||
<para>
|
||||
Types which are registered with a class and are declared instantiable are
|
||||
Types which are registered with a class and are declared instantiatable are
|
||||
what most closely resembles an <emphasis>object</emphasis>.
|
||||
Although <link linkend="GObject"><type>GObject</type></link>s (detailed in <xref linkend="chapter-gobject"/>)
|
||||
are the most well known type of instantiable
|
||||
are the most well known type of instantiatable
|
||||
classed types, other kinds of similar objects used as the base of an inheritance
|
||||
hierarchy have been externally developed and they are all built on the fundamental
|
||||
features described below.
|
||||
|
@ -498,7 +498,7 @@ B *b;
|
|||
</programlisting></informalexample>
|
||||
</para>
|
||||
|
||||
<sect2 id="gtype-instantiable-classed-init-done">
|
||||
<sect2 id="gtype-instantiatable-classed-init-done">
|
||||
<title>Initialization and Destruction</title>
|
||||
|
||||
<para>
|
||||
|
@ -599,7 +599,7 @@ B *b;
|
|||
<row>
|
||||
<!--entry>First call to <function><link linkend="g-type-create-instance">g_type_create_instance</link></function> for target type</entry-->
|
||||
<entry>interface initialization, see
|
||||
<xref linkend="gtype-non-instantiable-classed-init"/></entry>
|
||||
<xref linkend="gtype-non-instantiatable-classed-init"/></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
|
@ -610,7 +610,7 @@ B *b;
|
|||
<row>
|
||||
<entry morerows="2">Last call to <function><link linkend="g-type-free-instance">g_type_free_instance</link></function> for target type</entry>
|
||||
<entry>interface destruction, see
|
||||
<xref linkend="gtype-non-instantiable-classed-dest"/></entry>
|
||||
<xref linkend="gtype-non-instantiatable-classed-dest"/></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
|
@ -633,8 +633,8 @@ B *b;
|
|||
|
||||
</sect1>
|
||||
|
||||
<sect1 id="gtype-non-instantiable-classed">
|
||||
<title>Non-instantiable classed types: interfaces</title>
|
||||
<sect1 id="gtype-non-instantiatable-classed">
|
||||
<title>Non-instantiatable classed types: interfaces</title>
|
||||
|
||||
<para>
|
||||
This section covers the theory behind interfaces. See
|
||||
|
@ -648,7 +648,7 @@ B *b;
|
|||
Imagine the play, pause and stop buttons on hi-fi equipment — those can
|
||||
be seen as a playback interface. Once you know what they do, you can
|
||||
control your CD player, MP3 player or anything that uses these symbols.
|
||||
To declare an interface you have to register a non-instantiable
|
||||
To declare an interface you have to register a non-instantiatable
|
||||
classed type which derives from
|
||||
<link linkend="GTypeInterface"><type>GTypeInterface</type></link>. The following piece of code declares such an interface.
|
||||
<informalexample><programlisting>
|
||||
|
@ -792,14 +792,14 @@ struct _GInterfaceInfo
|
|||
</programlisting></informalexample>
|
||||
</para>
|
||||
|
||||
<sect2 id="gtype-non-instantiable-classed-init">
|
||||
<sect2 id="gtype-non-instantiatable-classed-init">
|
||||
<title>Interface Initialization</title>
|
||||
|
||||
<para>
|
||||
When an instantiable classed type which implements an interface
|
||||
When an instantiatable classed type which implements an interface
|
||||
(either directly or by inheriting an implementation from a superclass)
|
||||
is created for the first time, its class structure is initialized
|
||||
following the process described in <xref linkend="gtype-instantiable-classed"/>.
|
||||
following the process described in <xref linkend="gtype-instantiatable-classed"/>.
|
||||
After that, the interface implementations associated with
|
||||
the type are initialized.
|
||||
</para>
|
||||
|
@ -852,7 +852,7 @@ viewer_editable_default_init (ViewerEditableInterface *iface)
|
|||
GType
|
||||
viewer_editable_get_type (void)
|
||||
{
|
||||
static volatile gsize type_id = 0;
|
||||
static gsize type_id = 0;
|
||||
if (g_once_init_enter (&type_id)) {
|
||||
const GTypeInfo info = {
|
||||
sizeof (ViewerEditableInterface),
|
||||
|
@ -937,11 +937,11 @@ viewer_editable_default_init (ViewerEditableInterface *iface)
|
|||
|
||||
</sect2>
|
||||
|
||||
<sect2 id="gtype-non-instantiable-classed-dest">
|
||||
<sect2 id="gtype-non-instantiatable-classed-dest">
|
||||
<title>Interface Destruction</title>
|
||||
|
||||
<para>
|
||||
When the last instance of an instantiable type which registered
|
||||
When the last instance of an instantiatable type which registered
|
||||
an interface implementation is destroyed, the interface's
|
||||
implementations associated to the type are destroyed.
|
||||
</para>
|
||||
|
@ -955,7 +955,7 @@ viewer_editable_default_init (ViewerEditableInterface *iface)
|
|||
|
||||
<para>
|
||||
Again, it is important to understand, as in
|
||||
<xref linkend="gtype-non-instantiable-classed-init"/>,
|
||||
<xref linkend="gtype-non-instantiatable-classed-init"/>,
|
||||
that both <function>interface_finalize</function> and <function>base_finalize</function>
|
||||
are invoked exactly once for the destruction of each implementation of an interface. Thus,
|
||||
if you were to use one of these functions, you would need to use a static integer variable
|
||||
|
|
|
@ -854,7 +854,7 @@ b_method_to_call (B *obj, gint some_param)
|
|||
|
||||
<para>
|
||||
The theory behind how GObject interfaces work is given in
|
||||
<xref linkend="gtype-non-instantiable-classed"/>; this section covers how to
|
||||
<xref linkend="gtype-non-instantiatable-classed"/>; this section covers how to
|
||||
define and implement an interface.
|
||||
</para>
|
||||
|
||||
|
@ -1226,7 +1226,7 @@ viewer_editable_default_init (ViewerEditableInterface *iface)
|
|||
0.0, /* minimum */
|
||||
G_MAXDOUBLE, /* maximum */
|
||||
0.0, /* default */
|
||||
G_PARAM_READWRITE));
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
|
||||
}
|
||||
</programlisting></informalexample>
|
||||
</para>
|
||||
|
|
|
@ -1,14 +1,8 @@
|
|||
# The list of minor versions in the 2.x.x series which have had
|
||||
# GLIB_AVAILABLE_IN_* macros. This should include the current unreleased stable
|
||||
# version.
|
||||
#
|
||||
# FIXME: It would be good to be able to generate this list:
|
||||
# https://github.com/mesonbuild/meson/issues/5026
|
||||
stable_2_series_versions = [
|
||||
'26', '28', '30', '32', '34', '36', '38',
|
||||
'40', '42', '44', '46', '48', '50', '52', '54', '56', '58',
|
||||
'60', '62', '64',
|
||||
]
|
||||
first_version = 26
|
||||
last_version = minor_version.is_odd() ? minor_version + 1 : minor_version
|
||||
|
||||
ignore_decorators = [
|
||||
'GLIB_VAR',
|
||||
|
@ -17,7 +11,8 @@ ignore_decorators = [
|
|||
'GLIB_AVAILABLE_IN_ALL',
|
||||
]
|
||||
|
||||
foreach version : stable_2_series_versions
|
||||
foreach i : range(first_version, last_version + 2, 2)
|
||||
version = i.to_string()
|
||||
ignore_decorators += [
|
||||
# Note that gtkdoc is going to use those in regex, and the longest match
|
||||
# must come first. That's why '_FOR()' variant comes first.
|
||||
|
@ -26,6 +21,8 @@ foreach version : stable_2_series_versions
|
|||
'GLIB_DEPRECATED_IN_2_' + version + '_FOR()',
|
||||
'GLIB_DEPRECATED_IN_2_' + version,
|
||||
|
||||
'GLIB_AVAILABLE_STATIC_INLINE_IN_2_' + version,
|
||||
|
||||
'GLIB_AVAILABLE_ENUMERATOR_IN_2_' + version,
|
||||
'GLIB_DEPRECATED_ENUMERATOR_IN_2_' + version + '_FOR()',
|
||||
'GLIB_DEPRECATED_ENUMERATOR_IN_2_' + version,
|
||||
|
@ -45,16 +42,19 @@ gtkdoc_common_scan_args = [
|
|||
]
|
||||
|
||||
if get_option('gtk_doc')
|
||||
if not meson.version().version_compare('>=0.52.0')
|
||||
error('Building documentation requires Meson >= 0.52.0.')
|
||||
endif
|
||||
# Check we have the minimum gtk-doc version required. Older versions won't
|
||||
# generate correct documentation.
|
||||
dependency('gtk-doc', version : '>=1.32',
|
||||
dependency('gtk-doc', version : '>=1.32.1',
|
||||
fallback : ['gtk-doc', 'dummy_dep'],
|
||||
default_options : ['tests=false'])
|
||||
endif
|
||||
|
||||
# We cannot built the API reference off of a static library,
|
||||
# as symbols might get dropped by the linker
|
||||
if get_option('gtk_doc') and get_option('default_library') == 'static'
|
||||
error('The API reference can only be built against a shared library')
|
||||
endif
|
||||
|
||||
subdir('gio')
|
||||
subdir('glib')
|
||||
subdir('gobject')
|
|
@ -0,0 +1,104 @@
|
|||
Making a release
|
||||
===
|
||||
|
||||
When to make a release
|
||||
---
|
||||
|
||||
Releases are made on a schedule determined in the [roadmap](./roadmap.md). Each
|
||||
release corresponds to a [GitLab milestone](https://gitlab.gnome.org/GNOME/glib/-/milestones).
|
||||
|
||||
There is usually some scope to change a release date by plus or minus a week, to
|
||||
allow specific merge requests to land if they are deemed as more important to
|
||||
release sooner rather than waiting until the next scheduled release. However,
|
||||
there is always another release, and releasing on time is more important than
|
||||
releasing with everything landed. Releasing on time allows distributors to
|
||||
schedule their packaging work efficiently.
|
||||
|
||||
Maintainers should take it in turns to make releases so that the load is spread
|
||||
out evenly and every maintainer is practiced in the process.
|
||||
|
||||
How to make a release
|
||||
---
|
||||
|
||||
Broadly, GLib follows the same process as [every other GNOME
|
||||
module](https://wiki.gnome.org/MaintainersCorner/Releasing).
|
||||
|
||||
These instructions use the following variables:
|
||||
- `new_version`: the version number of the release you are making, for example `2.73.1`
|
||||
- `previous_version`: the version number of the most-recently released version in the same release series, for example `2.73.0`
|
||||
- `branch`: the branch which the release is based on, for example `glib-2-72` or `main`
|
||||
|
||||
Make sure your repository is up to date and doesn’t contain local changes:
|
||||
```sh
|
||||
git pull
|
||||
git status
|
||||
```
|
||||
|
||||
Check the version in `meson.build` is correct for this release.
|
||||
|
||||
Download
|
||||
[gitlab-changelog](https://gitlab.gnome.org/pwithnall/gitlab-changelog) and use
|
||||
it to write a `NEWS` entry:
|
||||
```sh
|
||||
gitlab-changelog.py GNOME/glib ${previous_version}..
|
||||
```
|
||||
|
||||
Copy this into `NEWS`, and manually write some highlights of the fixed bugs as
|
||||
bullet points at the top. Most changes won’t need to be highlighted — only the
|
||||
ones which add APIs, change dependencies or packaging requirements, or fix
|
||||
impactful bugs which might affect distros’ decisions of how to prioritise the
|
||||
GLib release or how urgent to mark it as.
|
||||
|
||||
You can get review of your `NEWS` changes from other co-maintainers if you wish.
|
||||
|
||||
Commit the release:
|
||||
```sh
|
||||
git add -p
|
||||
git commit -sm "${new_version}"
|
||||
```
|
||||
|
||||
Build the release tarball:
|
||||
```sh
|
||||
ninja -C build/ dist
|
||||
```
|
||||
|
||||
Tag, sign and push the release (see below for information about `git evtag`):
|
||||
```sh
|
||||
git evtag sign ${new_version}
|
||||
git push --atomic origin ${branch} ${new_version}
|
||||
```
|
||||
To use a specific key add an option `-u ${keyid|email}` after the `sign` argument.
|
||||
|
||||
Use `${new_version}` as the tag message.
|
||||
|
||||
Upload the release tarball (you will need a
|
||||
[GNOME LDAP account](https://wiki.gnome.org/Infrastructure/NewAccounts) for this):
|
||||
```sh
|
||||
scp build/meson-dist/glib-${new_version}.tar.xz master.gnome.org:
|
||||
ssh master.gnome.org ftpadmin install glib-${new_version}.tar.xz
|
||||
```
|
||||
|
||||
Add the release notes to GitLab and close the milestone:
|
||||
- Go to https://gitlab.gnome.org/GNOME/glib/-/tags/${new_version}/release/edit
|
||||
and upload the release notes for the new release from the `NEWS` file
|
||||
- Go to https://gitlab.gnome.org/GNOME/glib/-/releases/${new_version}/edit
|
||||
and link the milestone to it, then list the new release tarball and
|
||||
`sha256sum` file in the ‘Release Assets’ section as the ‘Other’ types.
|
||||
Get the file links from https://download.gnome.org/sources/glib/ and
|
||||
name them ‘Release tarball’ and ‘Release tarball sha256sum’
|
||||
- Go to https://gitlab.gnome.org/GNOME/glib/-/milestones/
|
||||
choose the milestone and close it, as all issues and merge requests tagged
|
||||
for this release should now be complete
|
||||
|
||||
`git-evtag`
|
||||
---
|
||||
|
||||
Releases must be done with `git evtag` rather than `git tag`, as it provides
|
||||
stronger security guarantees. See
|
||||
[its documentation](https://github.com/cgwalters/git-evtag) for more details.
|
||||
In particular, it calculates its checksum over all blobs reachable from the tag,
|
||||
including submodules; and uses a stronger checksum than SHA-1.
|
||||
|
||||
You will need a GPG key for this, ideally which has been signed by others so
|
||||
that it can be verified as being yours. However, even if your GPG key is
|
||||
unsigned, using `git evtag` is still beneficial over using `git tag`.
|
|
@ -0,0 +1,66 @@
|
|||
Roadmap
|
||||
===
|
||||
|
||||
The roadmap for development of GLib in upcoming releases is tracked in GitLab,
|
||||
using its [milestones feature](https://gitlab.gnome.org/GNOME/glib/-/milestones).
|
||||
Look on the upcoming milestones to see what features and fixes are planned for
|
||||
each release.
|
||||
|
||||
An issue being assigned to a milestone is no guarantee that it will actually be
|
||||
fixed in time for that milestone. Milestones are a rough prioritisation system
|
||||
for work, but GLib is a volunteer project with no fixed resources, so no
|
||||
guarantees can be given.
|
||||
|
||||
All releases are time-based rather than feature-based, as the development and
|
||||
stable branches of GLib should always be in a releasable state. Sometimes, at
|
||||
the discretion of the maintainers, a release may be held for a week or so in
|
||||
order to allow a particular merge request to land so that it can be made
|
||||
available to distributions or testers more rapidly.
|
||||
|
||||
When [making a release](./releasing.md), all remaining issues and merge requests
|
||||
allocated to the milestone for that release should be fixed (potentially
|
||||
delaying the release), or rescheduled to a different release, based on the
|
||||
maintainers’ assessment.
|
||||
|
||||
Unstable release planning
|
||||
---
|
||||
|
||||
At the start of a development cycle, milestones are created for each release in
|
||||
the cycle according to the [GNOME release
|
||||
schedule](https://wiki.gnome.org/Schedule). GLib roughly follows the GNOME
|
||||
release schedule, but makes its releases one or two weeks ahead of each
|
||||
corresponding GNOME release. This allows other GNOME modules to depend on the
|
||||
correct GLib version for new APIs. GLib does not follow the GNOME module
|
||||
versioning scheme.
|
||||
|
||||
As the milestones are created, maintainers will assign issues to them, based on
|
||||
what they think is possible to achieve for each milestone given the amount of
|
||||
developer time available before the release.
|
||||
|
||||
Issues affecting a lot of users (such as common crashes), and new features which
|
||||
maintainers think will have a wide benefit are prioritised.
|
||||
|
||||
As a development cycle progresses, some of the releases are timed to coincide
|
||||
with [GNOME’s API/feature, string and hard code
|
||||
freezes](https://wiki.gnome.org/ReleasePlanning/Freezes). Issues which add API
|
||||
and features are scheduled for the earlier micro releases in a development
|
||||
cycle, followed by issues which add or change translatable strings, followed by
|
||||
smaller bug fixes, documentation and unit test updates.
|
||||
|
||||
Stable release planning
|
||||
---
|
||||
|
||||
Stable micro releases are scheduled at a cadence picked by maintainers,
|
||||
depending on the rate at which bugs are being found in that stable branch. More
|
||||
bugs leads to a more frequent release cadence.
|
||||
|
||||
Historically, the rate of releases on each stable branch has decreased inversely
|
||||
proportionally to the time since the initial release of that branch.
|
||||
|
||||
There is no limit on the number of micro releases in a stable release series.
|
||||
Typically there will be around 6. Micro releases stop once there are no more
|
||||
bugs found in a stable series, or once a new stable series supercedes it.
|
||||
|
||||
The milestone for the next micro release in a stable series is created when the
|
||||
previous micro release is made, such that only one stable micro release is
|
||||
scheduled at any time.
|
|
@ -0,0 +1,95 @@
|
|||
Supported platforms
|
||||
===
|
||||
|
||||
GLib’s approach to portability is that we only support systems that we can test.
|
||||
That means that either a large number of GLib developers are regularly using
|
||||
GLib on a particular system, or we have regular builds of GLib on that system.
|
||||
|
||||
Minimum versions
|
||||
---
|
||||
|
||||
* macOS: minimum version OS X 10.7 (we
|
||||
[don’t support universal binaries](https://bugzilla.gnome.org/show_bug.cgi?id=780238);
|
||||
some features (like notification support)
|
||||
[require OS X 10.9](https://bugzilla.gnome.org/show_bug.cgi?id=747146)
|
||||
* Windows:
|
||||
[minimum version is Windows 8](https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1970),
|
||||
minimum build chain is Visual Studio 2012
|
||||
* Static builds are only supported with MinGW-based toolchains (cf
|
||||
[this comment](https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2384#note_1336662))
|
||||
* Android: [minimum NDK version 15](https://gitlab.gnome.org/GNOME/glib/issues/1113)
|
||||
* Linux: glibc newer than 2.5 (if using glibc; other forms of libc are supported)
|
||||
|
||||
Tested platforms
|
||||
---
|
||||
|
||||
GLib is regularly built on at least the following systems:
|
||||
|
||||
* GNOME OS Nightly: https://os.gnome.org/
|
||||
* Fedora: http://koji.fedoraproject.org/koji/packageinfo?packageID=382
|
||||
* Ubuntu: http://packages.ubuntu.com/source/glib2.0
|
||||
* Debian: https://packages.debian.org/experimental/libglib2.0-0
|
||||
* FreeBSD: https://wiki.gnome.org/Projects/Jhbuild/FreeBSD
|
||||
* openSUSE: https://build.opensuse.org/package/show/GNOME:Factory/glib2
|
||||
* CI runners, https://gitlab.gnome.org/GNOME/glib/blob/main/.gitlab-ci.yml:
|
||||
* Fedora (34, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/fedora.Dockerfile)
|
||||
* Debian (Bullseye, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/debian-stable.Dockerfile)
|
||||
* Windows (MinGW64)
|
||||
* Windows (msys2-mingw32)
|
||||
* Windows (Visual Studio 2017, and a static linking version)
|
||||
* Android (NDK r23b, API 31, arm64, https://gitlab.gnome.org/GNOME/glib/-/blob/main/.gitlab-ci/android-ndk.sh)
|
||||
* FreeBSD (12 and 13)
|
||||
* macOS
|
||||
|
||||
If other platforms are to be supported, we need to set up regular CI testing for
|
||||
them. Please contact us if you want to help.
|
||||
|
||||
Policy and rationale
|
||||
---
|
||||
|
||||
Due to their position in the market, we consider supporting GNU/Linux, Windows
|
||||
and macOS to be the highest priorities and we will go out of our way to
|
||||
accommodate these systems, even in places that they are contravening standards.
|
||||
|
||||
In general, we are open to the idea of supporting any Free Software UNIX-like
|
||||
system with good POSIX compliance. We are always interested in receiving
|
||||
patches that improve our POSIX compliance — if there is a good POSIX equivalent
|
||||
for a platform-specific API that we’re using, then all other things equal, we
|
||||
prefer the POSIX one.
|
||||
|
||||
We may use a non-POSIX API available on one or more of our supported systems in
|
||||
the case that it provides some advantage over the POSIX equivalent (such as the
|
||||
case with `pipe2()` solving the `O_CLOEXEC` race). In these cases, we will try
|
||||
to provide a fallback to the pure POSIX approach. If we’ve used a
|
||||
system-specific API without providing a fallback to a largely-equivalent POSIX
|
||||
API then it is likely a mistake, and we’re happy to receive a patch to fix it.
|
||||
|
||||
We are not interested in supporting other systems if it involves adding code
|
||||
paths that we cannot test. Specifically, this means that we will reject patches
|
||||
that introduce platform-specific `#ifdef` sections in the code unless we are
|
||||
actively doing builds of GLib on this platform (ie: see the lists above). We’ve
|
||||
historically accepted such patches from users of these systems on an ad hoc
|
||||
basis, but it created an unsustainable situation. Patches that fix
|
||||
platform-specific build issues in such a way that the code is improved in the
|
||||
general case are of course welcome.
|
||||
|
||||
Although we aim to support all systems with good POSIX compliance, we are not
|
||||
interested in adhering to “pure POSIX and nothing else”. If we need to add a
|
||||
feature and we can provide good support on all of the platforms that we support
|
||||
(above), we will not hold back for other systems. We will always try to provide
|
||||
a fallback to a POSIX-specified approach, if possible, or to simply replace a
|
||||
given functionality with a no-op, but even this may not be possible in cases of
|
||||
critical functionality.
|
||||
|
||||
Specific notes
|
||||
---
|
||||
|
||||
Note that we currently depend on a number of features specified in POSIX, but
|
||||
listed as optional:
|
||||
|
||||
* [`CLOCK_MONOTONIC`](http://pubs.opengroup.org/onlinepubs/009695399/functions/clock_gettime.html)
|
||||
is expected to be present and working
|
||||
* [`pthread_condattr_setclock()`](http://pubs.opengroup.org/onlinepubs/7999959899/functions/pthread_condattr_setclock.html)
|
||||
is expected to be present and working
|
||||
|
||||
Also see [toolchain requirements](./toolchain-requirements.md).
|
|
@ -0,0 +1,71 @@
|
|||
Testing policy
|
||||
===
|
||||
|
||||
Aims
|
||||
---
|
||||
|
||||
* Maintainers should be able to make a release of GLib at any time, confident
|
||||
that it will not contain regressions or obvious bugs with new functionality
|
||||
* Speed up review of submitted changes by deferring some of the review effort
|
||||
to automated testing
|
||||
* Allow fast detection of bugs in new or changed code, particularly if they are
|
||||
only present on platforms not regularly used by the maintainers
|
||||
* Allow easy dynamic and static analysis of a significant proportion of the
|
||||
GLib code
|
||||
* Statistics on tests (such as pass/failure) should be easily and mechanically
|
||||
collectable to allow analysis and highlight problems
|
||||
* Code for tests and code for production should be easily separable so that
|
||||
statistics on them can be grouped separately
|
||||
* Performance measurement tools for GLib should be reusable over time to allow
|
||||
comparable measurements to be collected and to discourage use of lower
|
||||
quality and throwaway tests when prototyping improvements to GLib
|
||||
|
||||
Policy
|
||||
---
|
||||
|
||||
* Tests must be written for all new code, and any existing code which is being
|
||||
non-trivially modified (for example to fix a bug), to give confidence to the
|
||||
author and reviewer of the changes that they are correct for all platforms
|
||||
that GLib runs CI on.
|
||||
* Tests live in the `{glib,gobject,gio}/tests` directories. This allows their
|
||||
code to be counted separately when analysing statistics such as code
|
||||
coverage.
|
||||
- Performance tests live in `{glib,gobject,gio}/tests/performance`, as they
|
||||
are executed and results interpreted differently due to giving a result on
|
||||
a continuous scale rather than a pass/fail result.
|
||||
* All tests must use the GTest framework, as it supports
|
||||
[structured output](https://testanything.org/) which exposes test results to
|
||||
the test runner for analysis.
|
||||
- Use `g_test_bug()` and `g_test_summary()` in unit tests to link them to
|
||||
contextual information in bug reports, and to provide a summary of what
|
||||
each test checks and how it goes about doing those checks. Sometimes a
|
||||
test’s behaviour can be quite complex, and needs to be explained so that
|
||||
future developers can understand and build on such tests in future.
|
||||
- Use the `g_assert_*()` functions inside unit tests, and do not use
|
||||
`g_assert()`. The latter is compiled out when GLib is built with
|
||||
`G_DISABLE_ASSERT`, and the former are not. The `g_assert_*()` functions
|
||||
also give more helpful error messages on test failure.
|
||||
* Performance tests must be able to be run unattended. In this mode they must
|
||||
choose default argument values which check that the performance test
|
||||
functions (i.e. without crashing) and doesn’t take too long to complete. This
|
||||
is used to automatically verify that performance tests still work, as they
|
||||
are typically used infrequently and are subject to bitrot.
|
||||
* Code coverage reports must be used to demonstrate that unit tests reach all
|
||||
newly submitted or significantly modified code, reaching all lines of code
|
||||
and a significant majority of branches. If this is not enforced, code ends up
|
||||
never being tested.
|
||||
* Code should be structured to be testable, which is typically only possible by
|
||||
writing tests at the same time as the code. Otherwise it is easy to design
|
||||
APIs which cannot easily be unit tested, and once those APIs are stable it is
|
||||
hard to retrofit tests to them.
|
||||
* Parsers, network-facing code or code which handles untrusted user input must
|
||||
have fuzz tests added, in the `fuzzing` directory. These are run by
|
||||
[oss-fuzz](https://github.com/google/oss-fuzz/) and are very effective at
|
||||
catching exploitable security issues. See the
|
||||
[fuzzing README](../fuzzing/README.md) for more details.
|
||||
* When fixing bugs in existing code, regression tests must be added when it is
|
||||
straightforward to do so. If it’s difficult to do so (such as if the code
|
||||
needs to be significantly restructured or APIs need to be changed), adding
|
||||
the regression tests can be deferred to a follow-up issue so as not to slow
|
||||
down bug fixing. In that case, the bug fix must be carefully manually tested
|
||||
before being merged.
|
|
@ -0,0 +1,168 @@
|
|||
Toolchain/Compiler requirements
|
||||
===
|
||||
|
||||
GLib requires a toolchain that supports C99.
|
||||
|
||||
GLib contains some fall back code that allows supporting toolchains that are not
|
||||
fully C99-compatible.
|
||||
|
||||
GLib makes some assumptions about features of the C library and C preprocessor,
|
||||
compiler and linker that may go beyond what C99 mandates. We will use features
|
||||
beyond C99 if they are substantially useful and if they are supported in a wide
|
||||
range of compilers.
|
||||
|
||||
In general, we are primarily interested in supporting these four compilers:
|
||||
|
||||
* GCC on *nix
|
||||
* Clang (LLVM)
|
||||
* MSVC
|
||||
* mingw32-w64
|
||||
|
||||
This is in keeping with our goal of primarily targetting GNU/Linux, Windows and
|
||||
Mac OS, along with Free Software POSIX-compliant operating systems. See
|
||||
[Supported platforms](./supported-platforms.md) for a bit more information and
|
||||
rationale about that.
|
||||
|
||||
In particular, we are interested in MSVC because, although there are other
|
||||
compilers which target Windows, they do not output debugging information that is
|
||||
compatible with MSVC. In interest of usability, we want users of GLib to be
|
||||
able to debug GLib along with their own code while using MSVC as their
|
||||
development environment.
|
||||
|
||||
At any given time, GLib may work with mingw32 (from mingw.org) but it is not
|
||||
specifically supported. Politics aside, it seems that mingw.org is mostly
|
||||
dormant and, at this point, all of the big distributions have switched over to
|
||||
mingw32-w64. In several cases, mingw.org has been missing APIs that we’ve
|
||||
wanted to use and upstream has not been responsive about adding them.
|
||||
|
||||
GLib will attempt to remain compatible with other compilers, but some ‘extra
|
||||
features’ are assumed. Those are detailed below.
|
||||
|
||||
GLib additionally requires Python 3 to build.
|
||||
|
||||
C99 Varargs macros
|
||||
---
|
||||
|
||||
_Hard requirement._
|
||||
|
||||
GLib requires C99 ``__VA_ARG__`` support for both C and C++ compilers.
|
||||
|
||||
Symbol visibility control
|
||||
---
|
||||
|
||||
_Not a hard requirement._
|
||||
|
||||
When available, GLib uses `__attribute__((visibility("hidden")))` and the
|
||||
`-fvisibility=hidden` compiler option to control symbol visibility, and the
|
||||
`-Bsymbolic-functions` linker flag.
|
||||
|
||||
Builtin atomic operations
|
||||
---
|
||||
|
||||
_Not a hard requirement._
|
||||
|
||||
GLib will fall back to using a mutex-based implementation if atomic builtins are
|
||||
not available.
|
||||
|
||||
C99 printf and positional parameters
|
||||
---
|
||||
|
||||
_Not a hard requirement._
|
||||
|
||||
GLib can be built with an included printf implementation (from GNUlib) if the
|
||||
system printf is deficient.
|
||||
|
||||
Constructors and destructors
|
||||
---
|
||||
|
||||
_Hard requirement._
|
||||
|
||||
GLib can work with pragma-based, as well as with attribute-based constructor
|
||||
support. There is a fallback for MSVC using a `DllMain()` instead.
|
||||
|
||||
`va_list` pass-by-reference
|
||||
---
|
||||
|
||||
_Hard requirement._
|
||||
|
||||
GLib depends on the ability to pass-by-reference a `va_list`, as mandated in
|
||||
C99 § 7.15: “It is permitted to create a pointer to a `va_list` and pass that
|
||||
pointer to another function, in which case the original function may make
|
||||
further use of the original list after the other function returns.”
|
||||
|
||||
Support for `static inline`
|
||||
---
|
||||
|
||||
_Hard requirement._
|
||||
|
||||
GLib depends on implementation of the `inline` keyword as described by
|
||||
C99 § 6.7.4.
|
||||
|
||||
GLib further assumes that functions appearing in header files and marked
|
||||
`static inline`, but not used in a particular compilation unit will:
|
||||
|
||||
* not generate warnings about being unused
|
||||
* not be emitted in the compiler’s output
|
||||
|
||||
It is possible that a compiler adheres to C99 § 6.7.4 but not to GLib’s further
|
||||
assumptions. Such compilers may produce large numbers of warnings or large
|
||||
executables when compiling GLib or programs based on GLib.
|
||||
|
||||
Support for `alloca()`
|
||||
---
|
||||
|
||||
_Hard requirement._
|
||||
|
||||
Your compiler must support `alloca()`, defined in `<alloca.h>` (or `<malloc.h>`
|
||||
on Windows) and it must accept a non-constant argument.
|
||||
|
||||
(C11) support for type redefinition
|
||||
---
|
||||
|
||||
**This requirement has been temporarily suspended (on account of OpenBSD
|
||||
carrying an old version of gcc) but it will probably return in the future.**
|
||||
|
||||
Your compiler must allow “a typedef name [to] be redefined to denote the same
|
||||
type as it currently does”, as per C11 §6.7, item 3.
|
||||
|
||||
‘Big’ enums
|
||||
---
|
||||
|
||||
_Hard requirement._
|
||||
|
||||
Some of our enum types use `1<<31` as a value. We also use negative values in
|
||||
enums. We rely on the compiler to choose a suitable storage size for the enum
|
||||
that can accommodate this.
|
||||
|
||||
Selected C99 features
|
||||
---
|
||||
|
||||
_Hard requirement._
|
||||
|
||||
Starting with GLib 2.52 and GTK+ 3.90, we will be using the following C99
|
||||
features where appropriate:
|
||||
|
||||
* Compound literals
|
||||
* Designated initializers
|
||||
* Mixed declarations
|
||||
|
||||
Function pointer conversions
|
||||
---
|
||||
|
||||
_Hard requirement._
|
||||
|
||||
GLib heavily relies on the ability to convert a function pointer to a `void*`
|
||||
and back again losslessly. Any platform or compiler which doesn’t support this
|
||||
cannot be used to compile GLib or code which uses GLib. This precludes use of
|
||||
the `-pedantic` GCC flag with GLib.
|
||||
|
||||
`stdint.h`
|
||||
---
|
||||
|
||||
_Hard requirement since GLib 2.67.x._
|
||||
|
||||
GLib [requires a C99 `stdint.h`](https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1675)
|
||||
with all the usual sized integer types (`int8_t`, `uint64_t` and so on),
|
||||
believed to be supported by all relevant Unix platforms/compilers, as well as
|
||||
Microsoft compilers since MSVC 2013.
|
||||
|
|
@ -40,7 +40,7 @@ $ DIR/fuzzing/fuzz_target_name FILE
|
|||
|
||||
Correct MSAN instrumentation is [difficult to achieve](https://clang.llvm.org/docs/MemorySanitizer.html#handling-external-code) locally, so false positives are very likely to mask the actual bug.
|
||||
|
||||
If need be, [you can still reproduce](https://github.com/google/oss-fuzz/blob/master/docs/reproducing.md#building-using-docker) those bugs with the oss-fuzz provided docker images.
|
||||
If need be, [you can still reproduce](https://google.github.io/oss-fuzz/advanced-topics/reproducing/#building-using-docker) those bugs with the oss-fuzz provided docker images.
|
||||
|
||||
###### There are no file/function names in the stack trace.
|
||||
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
/*
|
||||
* Copyright 2018 LLVM contributors
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
*
|
||||
* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
* See https://llvm.org/LICENSE.txt for license information.
|
||||
*/
|
||||
|
||||
/* Simpler gnu89 version of StandaloneFuzzTargetMain.c from LLVM */
|
||||
|
||||
#include <assert.h>
|
||||
|
@ -10,6 +19,7 @@ int
|
|||
main (int argc, char **argv)
|
||||
{
|
||||
FILE *f;
|
||||
long tell_result;
|
||||
size_t n_read, len;
|
||||
unsigned char *buf;
|
||||
|
||||
|
@ -19,7 +29,9 @@ main (int argc, char **argv)
|
|||
f = fopen (argv[1], "r");
|
||||
assert (f);
|
||||
fseek (f, 0, SEEK_END);
|
||||
len = ftell (f);
|
||||
tell_result = ftell (f);
|
||||
assert (tell_result >= 0);
|
||||
len = (size_t) tell_result;
|
||||
fseek (f, 0, SEEK_SET);
|
||||
buf = (unsigned char*) malloc (len);
|
||||
n_read = fread (buf, 1, len, f);
|
||||
|
@ -27,6 +39,7 @@ main (int argc, char **argv)
|
|||
LLVMFuzzerTestOneInput (buf, len);
|
||||
|
||||
free (buf);
|
||||
fclose (f);
|
||||
printf ("Done!\n");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/*
|
||||
* Copyright 2018 pdknsk
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "gio/gio.h"
|
||||
#include "glib/glib.h"
|
||||
|
||||
|
@ -17,6 +36,12 @@ static void
|
|||
fuzz_set_logging_func (void)
|
||||
{
|
||||
#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
|
||||
g_log_set_writer_func (empty_logging_func, NULL, NULL);
|
||||
static gboolean writer_set = FALSE;
|
||||
|
||||
if (!writer_set)
|
||||
{
|
||||
g_log_set_writer_func (empty_logging_func, NULL, NULL);
|
||||
writer_set = TRUE;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -1,3 +1,22 @@
|
|||
/*
|
||||
* Copyright 2018 pdknsk
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "fuzz.h"
|
||||
|
||||
int
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue