mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-21 19:41:15 +00:00
update glib to 2.66.3
add gthread library and .pc files
This commit is contained in:
parent
2c90e7a175
commit
6c1ffea7b8
118 changed files with 2780 additions and 133 deletions
1069
deps/glib/bin/glib-genmarshal
vendored
Executable file
1069
deps/glib/bin/glib-genmarshal
vendored
Executable file
File diff suppressed because it is too large
Load diff
187
deps/glib/bin/glib-gettextize
vendored
Executable file
187
deps/glib/bin/glib-gettextize
vendored
Executable file
|
@ -0,0 +1,187 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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, 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, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
# - Modified in October 2001 by jacob berkman <jacob@ximian.com> to
|
||||
# work with glib's Makefile.in.in and po2tbl.sed.in, to not copy in
|
||||
# intl/, and to not add ChangeLog entries to po/ChangeLog
|
||||
|
||||
# This file is meant for authors or maintainers which want to
|
||||
# internationalize their package with the help of GNU gettext. For
|
||||
# further information how to use it consult the GNU gettext manual.
|
||||
|
||||
echo=echo
|
||||
progname=$0
|
||||
force=0
|
||||
configstatus=0
|
||||
origdir=`pwd`
|
||||
usage="\
|
||||
Usage: glib-gettextize [OPTION]... [package-dir]
|
||||
--help print this help and exit
|
||||
--version print version information and exit
|
||||
-c, --copy copy files instead of making symlinks
|
||||
-f, --force force writing of new files even if old exist
|
||||
Report bugs to https://gitlab.gnome.org/GNOME/glib/issues/new."
|
||||
package=glib
|
||||
version=2.66.3
|
||||
try_ln_s=:
|
||||
|
||||
# Directory where the sources are stored.
|
||||
prefix=/Volumes/ramdisk/zdoom-macos-deps/deps/glib
|
||||
case `uname` in
|
||||
MINGW32*)
|
||||
prefix="`dirname $0`/.."
|
||||
;;
|
||||
esac
|
||||
|
||||
datarootdir=/Volumes/ramdisk/zdoom-macos-deps/deps/glib/share
|
||||
datadir=/Volumes/ramdisk/zdoom-macos-deps/deps/glib/share
|
||||
|
||||
gettext_dir=$datadir/glib-2.0/gettext
|
||||
|
||||
while test $# -gt 0; do
|
||||
case "$1" in
|
||||
-c | --copy | --c* )
|
||||
shift
|
||||
try_ln_s=false ;;
|
||||
-f | --force | --f* )
|
||||
shift
|
||||
force=1 ;;
|
||||
-r | --run | --r* )
|
||||
shift
|
||||
configstatus=1 ;;
|
||||
--help | --h* )
|
||||
$echo "$usage"; exit 0 ;;
|
||||
--version | --v* )
|
||||
echo "$progname (GNU $package) $version"
|
||||
$echo "Copyright (C) 1995-1998, 2000, 2001 Free Software Foundation, Inc.
|
||||
This is free software; see the source for copying conditions. There is NO
|
||||
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
|
||||
$echo "Written by" "Ulrich Drepper"
|
||||
exit 0 ;;
|
||||
-- ) # Stop option processing
|
||||
shift; break ;;
|
||||
-* )
|
||||
$echo "glib-gettextize: unknown option $1"
|
||||
$echo "Try \`glib-gettextize --help' for more information."; exit 1 ;;
|
||||
* )
|
||||
break ;;
|
||||
esac
|
||||
done
|
||||
|
||||
if test $# -gt 1; then
|
||||
$echo "$usage"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Fill in the command line options value.
|
||||
if test $# -eq 1; then
|
||||
srcdir=$1
|
||||
if cd "$srcdir"; then
|
||||
srcdir=`pwd`
|
||||
else
|
||||
$echo "Cannot change directory to \`$srcdir'"
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
srcdir=$origdir
|
||||
fi
|
||||
|
||||
test -f configure.in || test -f configure.ac || {
|
||||
$echo "Missing configure.in or configure.ac, please cd to your package first."
|
||||
exit 1
|
||||
}
|
||||
|
||||
configure_in=NONE
|
||||
if test -f configure.in; then
|
||||
configure_in=configure.in
|
||||
else
|
||||
if test -f configure.ac; then
|
||||
configure_in=configure.ac
|
||||
fi
|
||||
fi
|
||||
# Check in which directory config.rpath, mkinstalldirs etc. belong.
|
||||
auxdir=`cat "$configure_in" | grep '^AC_CONFIG_AUX_DIR' | sed -n -e 's/AC_CONFIG_AUX_DIR(\([^()]*\))/\1/p' | sed -e 's/^\[\(.*\)\]$/\1/' | sed -e 1q`
|
||||
if test -n "$auxdir"; then
|
||||
auxdir="$auxdir/"
|
||||
fi
|
||||
|
||||
if test -f po/Makefile.in.in && test $force -eq 0; then
|
||||
$echo "\
|
||||
po/Makefile.in.in exists: use option -f if you really want to delete it."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
test -d po || {
|
||||
$echo "Creating po/ subdirectory"
|
||||
mkdir po || {
|
||||
$echo "failed to create po/ subdirectory"
|
||||
exit 1
|
||||
}
|
||||
}
|
||||
|
||||
# For simplicity we changed to the gettext source directory.
|
||||
cd $gettext_dir || {
|
||||
$echo "gettext source directory '${gettext_dir}' doesn't exist"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Now copy all files. Take care for the destination directories.
|
||||
for file in *; do
|
||||
case $file in
|
||||
intl | po)
|
||||
;;
|
||||
mkinstalldirs)
|
||||
rm -f "$srcdir/$auxdir$file"
|
||||
($try_ln_s && ln -s $gettext_dir/$file "$srcdir/$auxdir$file" && $echo "Symlinking file $file") 2>/dev/null ||
|
||||
{ $echo "Copying file $file"; cp $file "$srcdir/$auxdir$file"; }
|
||||
;;
|
||||
*)
|
||||
rm -f "$srcdir/$file"
|
||||
($try_ln_s && ln -s $gettext_dir/$file "$srcdir/$file" && $echo "Symlinking file $file") 2>/dev/null ||
|
||||
{ $echo "Copying file $file"; cp $file "$srcdir/$file"; }
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Copy files to po/ subdirectory.
|
||||
cd po
|
||||
for file in *; do
|
||||
rm -f "$srcdir/po/$file"
|
||||
($try_ln_s && ln -s $gettext_dir/po/$file "$srcdir/po/$file" && $echo "Symlinking file po/$file") 2>/dev/null ||
|
||||
{ $echo "Copying file po/$file"; cp $file "$srcdir/po/$file"; }
|
||||
done
|
||||
if test -f "$srcdir/po/cat-id-tbl.c"; then
|
||||
$echo "Removing po/cat-id-tbl.c"
|
||||
rm -f "$srcdir/po/cat-id-tbl.c"
|
||||
fi
|
||||
if test -f "$srcdir/po/stamp-cat-id"; then
|
||||
$echo "Removing po/stamp-cat-id"
|
||||
rm -f "$srcdir/po/stamp-cat-id"
|
||||
fi
|
||||
|
||||
echo
|
||||
echo "Please add the files"
|
||||
echo " codeset.m4 gettext.m4 glibc21.m4 iconv.m4 isc-posix.m4 lcmessage.m4"
|
||||
echo " progtest.m4"
|
||||
echo "from the $datadir/aclocal directory to your autoconf macro directory"
|
||||
echo "or directly to your aclocal.m4 file."
|
||||
echo "You will also need config.guess and config.sub, which you can get from"
|
||||
echo "ftp://ftp.gnu.org/pub/gnu/config/."
|
||||
echo
|
||||
|
||||
exit 0
|
783
deps/glib/bin/glib-mkenums
vendored
Executable file
783
deps/glib/bin/glib-mkenums
vendored
Executable file
|
@ -0,0 +1,783 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
# If the code below looks horrible and unpythonic, do not panic.
|
||||
#
|
||||
# It is.
|
||||
#
|
||||
# This is a manual conversion from the original Perl script to
|
||||
# Python. Improvements are welcome.
|
||||
#
|
||||
from __future__ import print_function, unicode_literals
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
import tempfile
|
||||
import io
|
||||
import errno
|
||||
import codecs
|
||||
import locale
|
||||
|
||||
VERSION_STR = '''glib-mkenums version 2.66.3
|
||||
glib-mkenums comes with ABSOLUTELY NO WARRANTY.
|
||||
You may redistribute copies of glib-mkenums under the terms of
|
||||
the GNU General Public License which can be found in the
|
||||
GLib source package. Sources, examples and contact
|
||||
information are available at http://www.gtk.org'''
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
class Color:
|
||||
'''ANSI Terminal colors'''
|
||||
GREEN = '\033[1;32m'
|
||||
BLUE = '\033[1;34m'
|
||||
YELLOW = '\033[1;33m'
|
||||
RED = '\033[1;31m'
|
||||
END = '\033[0m'
|
||||
|
||||
|
||||
def print_color(msg, color=Color.END, prefix='MESSAGE'):
|
||||
'''Print a string with a color prefix'''
|
||||
if os.isatty(sys.stderr.fileno()):
|
||||
real_prefix = '{start}{prefix}{end}'.format(start=color, prefix=prefix, end=Color.END)
|
||||
else:
|
||||
real_prefix = prefix
|
||||
print('{prefix}: {msg}'.format(prefix=real_prefix, msg=msg), file=sys.stderr)
|
||||
|
||||
|
||||
def print_error(msg):
|
||||
'''Print an error, and terminate'''
|
||||
print_color(msg, color=Color.RED, prefix='ERROR')
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def print_warning(msg, fatal=False):
|
||||
'''Print a warning, and optionally terminate'''
|
||||
if fatal:
|
||||
color = Color.RED
|
||||
prefix = 'ERROR'
|
||||
else:
|
||||
color = Color.YELLOW
|
||||
prefix = 'WARNING'
|
||||
print_color(msg, color, prefix)
|
||||
if fatal:
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def print_info(msg):
|
||||
'''Print a message'''
|
||||
print_color(msg, color=Color.GREEN, prefix='INFO')
|
||||
|
||||
|
||||
def get_rspfile_args(rspfile):
|
||||
'''
|
||||
Response files are useful on Windows where there is a command-line character
|
||||
limit of 8191 because when passing sources as arguments to glib-mkenums this
|
||||
limit can be exceeded in large codebases.
|
||||
|
||||
There is no specification for response files and each tool that supports it
|
||||
generally writes them out in slightly different ways, but some sources are:
|
||||
https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-response-files
|
||||
https://docs.microsoft.com/en-us/windows/desktop/midl/the-response-file-command
|
||||
'''
|
||||
import shlex
|
||||
if not os.path.isfile(rspfile):
|
||||
sys.exit('Response file {!r} does not exist'.format(rspfile))
|
||||
try:
|
||||
with open(rspfile, 'r') as f:
|
||||
cmdline = f.read()
|
||||
except OSError as e:
|
||||
sys.exit('Response file {!r} could not be read: {}'
|
||||
.format(rspfile, e.strerror))
|
||||
return shlex.split(cmdline)
|
||||
|
||||
|
||||
def write_output(output):
|
||||
global output_stream
|
||||
print(output, file=output_stream)
|
||||
|
||||
|
||||
# Python 2 defaults to ASCII in case stdout is redirected.
|
||||
# This should make it match Python 3, which uses the locale encoding.
|
||||
if sys.stdout.encoding is None:
|
||||
output_stream = codecs.getwriter(
|
||||
locale.getpreferredencoding())(sys.stdout)
|
||||
else:
|
||||
output_stream = sys.stdout
|
||||
|
||||
|
||||
# Some source files aren't UTF-8 and the old perl version didn't care.
|
||||
# Replace invalid data with a replacement character to keep things working.
|
||||
# https://bugzilla.gnome.org/show_bug.cgi?id=785113#c20
|
||||
def replace_and_warn(err):
|
||||
# 7 characters of context either side of the offending character
|
||||
print_warning('UnicodeWarning: {} at {} ({})'.format(
|
||||
err.reason, err.start,
|
||||
err.object[err.start - 7:err.end + 7]))
|
||||
return ('?', err.end)
|
||||
|
||||
codecs.register_error('replace_and_warn', replace_and_warn)
|
||||
|
||||
|
||||
# glib-mkenums.py
|
||||
# Information about the current enumeration
|
||||
flags = None # Is enumeration a bitmask?
|
||||
option_underscore_name = '' # Overridden underscore variant of the enum name
|
||||
# for example to fix the cases we don't get the
|
||||
# mixed-case -> underscorized transform right.
|
||||
option_lowercase_name = '' # DEPRECATED. A lower case name to use as part
|
||||
# of the *_get_type() function, instead of the
|
||||
# one that we guess. For instance, when an enum
|
||||
# uses abnormal capitalization and we can not
|
||||
# guess where to put the underscores.
|
||||
option_since = '' # User provided version info for the enum.
|
||||
seenbitshift = 0 # Have we seen bitshift operators?
|
||||
enum_prefix = None # Prefix for this enumeration
|
||||
enumname = '' # Name for this enumeration
|
||||
enumshort = '' # $enumname without prefix
|
||||
enumname_prefix = '' # prefix of $enumname
|
||||
enumindex = 0 # Global enum counter
|
||||
firstenum = 1 # Is this the first enumeration per file?
|
||||
entries = [] # [ name, val ] for each entry
|
||||
sandbox = None # sandbox for safe evaluation of expressions
|
||||
|
||||
output = '' # Filename to write result into
|
||||
|
||||
def parse_trigraph(opts):
|
||||
result = {}
|
||||
|
||||
for opt in re.split(r'\s*,\s*', opts):
|
||||
opt = re.sub(r'^\s*', '', opt)
|
||||
opt = re.sub(r'\s*$', '', opt)
|
||||
m = re.search(r'(\w+)(?:=(.+))?', opt)
|
||||
assert m is not None
|
||||
groups = m.groups()
|
||||
key = groups[0]
|
||||
if len(groups) > 1:
|
||||
val = groups[1]
|
||||
else:
|
||||
val = 1
|
||||
result[key] = val
|
||||
return result
|
||||
|
||||
def parse_entries(file, file_name):
|
||||
global entries, enumindex, enumname, seenbitshift, flags
|
||||
looking_for_name = False
|
||||
|
||||
while True:
|
||||
line = file.readline()
|
||||
if not line:
|
||||
break
|
||||
|
||||
line = line.strip()
|
||||
|
||||
# read lines until we have no open comments
|
||||
while re.search(r'/\*([^*]|\*(?!/))*$', line):
|
||||
line += file.readline()
|
||||
|
||||
# strip comments w/o options
|
||||
line = re.sub(r'''/\*(?!<)
|
||||
([^*]+|\*(?!/))*
|
||||
\*/''', '', line, flags=re.X)
|
||||
|
||||
line = line.rstrip()
|
||||
|
||||
# skip empty lines
|
||||
if len(line.strip()) == 0:
|
||||
continue
|
||||
|
||||
if looking_for_name:
|
||||
m = re.match(r'\s*(\w+)', line)
|
||||
if m:
|
||||
enumname = m.group(1)
|
||||
return True
|
||||
|
||||
# Handle include files
|
||||
m = re.match(r'\#include\s*<([^>]*)>', line)
|
||||
if m:
|
||||
newfilename = os.path.join("..", m.group(1))
|
||||
newfile = io.open(newfilename, encoding="utf-8",
|
||||
errors="replace_and_warn")
|
||||
|
||||
if not parse_entries(newfile, newfilename):
|
||||
return False
|
||||
else:
|
||||
continue
|
||||
|
||||
m = re.match(r'\s*\}\s*(\w+)', line)
|
||||
if m:
|
||||
enumname = m.group(1)
|
||||
enumindex += 1
|
||||
return 1
|
||||
|
||||
m = re.match(r'\s*\}', line)
|
||||
if m:
|
||||
enumindex += 1
|
||||
looking_for_name = True
|
||||
continue
|
||||
|
||||
m = re.match(r'''\s*
|
||||
(\w+)\s* # name
|
||||
(?:=( # value
|
||||
\s*\w+\s*\(.*\)\s* # macro with multiple args
|
||||
| # OR
|
||||
(?:[^,/]|/(?!\*))* # anything but a comma or comment
|
||||
))?,?\s*
|
||||
(?:/\*< # options
|
||||
(([^*]|\*(?!/))*)
|
||||
>\s*\*/)?,?
|
||||
\s*$''', line, flags=re.X)
|
||||
if m:
|
||||
groups = m.groups()
|
||||
name = groups[0]
|
||||
value = None
|
||||
options = None
|
||||
if len(groups) > 1:
|
||||
value = groups[1]
|
||||
if len(groups) > 2:
|
||||
options = groups[2]
|
||||
if flags is None and value is not None and '<<' in value:
|
||||
seenbitshift = 1
|
||||
|
||||
if options is not None:
|
||||
options = parse_trigraph(options)
|
||||
if 'skip' not in options:
|
||||
entries.append((name, value, options.get('nick')))
|
||||
else:
|
||||
entries.append((name, value))
|
||||
elif re.match(r's*\#', line):
|
||||
pass
|
||||
else:
|
||||
print_warning('Failed to parse "{}" in {}'.format(line, file_name))
|
||||
return False
|
||||
|
||||
help_epilog = '''Production text substitutions:
|
||||
\u0040EnumName\u0040 PrefixTheXEnum
|
||||
\u0040enum_name\u0040 prefix_the_xenum
|
||||
\u0040ENUMNAME\u0040 PREFIX_THE_XENUM
|
||||
\u0040ENUMSHORT\u0040 THE_XENUM
|
||||
\u0040ENUMPREFIX\u0040 PREFIX
|
||||
\u0040enumsince\u0040 the user-provided since value given
|
||||
\u0040VALUENAME\u0040 PREFIX_THE_XVALUE
|
||||
\u0040valuenick\u0040 the-xvalue
|
||||
\u0040valuenum\u0040 the integer value (limited support, Since: 2.26)
|
||||
\u0040type\u0040 either enum or flags
|
||||
\u0040Type\u0040 either Enum or Flags
|
||||
\u0040TYPE\u0040 either ENUM or FLAGS
|
||||
\u0040filename\u0040 name of current input file
|
||||
\u0040basename\u0040 base name of the current input file (Since: 2.22)
|
||||
'''
|
||||
|
||||
|
||||
# production variables:
|
||||
idprefix = "" # "G", "Gtk", etc
|
||||
symprefix = "" # "g", "gtk", etc, if not just lc($idprefix)
|
||||
fhead = "" # output file header
|
||||
fprod = "" # per input file production
|
||||
ftail = "" # output file trailer
|
||||
eprod = "" # per enum text (produced prior to value itarations)
|
||||
vhead = "" # value header, produced before iterating over enum values
|
||||
vprod = "" # value text, produced for each enum value
|
||||
vtail = "" # value tail, produced after iterating over enum values
|
||||
comment_tmpl = "" # comment template
|
||||
|
||||
def read_template_file(file):
|
||||
global idprefix, symprefix, fhead, fprod, ftail, eprod, vhead, vprod, vtail, comment_tmpl
|
||||
tmpl = {'file-header': fhead,
|
||||
'file-production': fprod,
|
||||
'file-tail': ftail,
|
||||
'enumeration-production': eprod,
|
||||
'value-header': vhead,
|
||||
'value-production': vprod,
|
||||
'value-tail': vtail,
|
||||
'comment': comment_tmpl,
|
||||
}
|
||||
in_ = 'junk'
|
||||
|
||||
ifile = io.open(file, encoding="utf-8", errors="replace_and_warn")
|
||||
for line in ifile:
|
||||
m = re.match(r'\/\*\*\*\s+(BEGIN|END)\s+([\w-]+)\s+\*\*\*\/', line)
|
||||
if m:
|
||||
if in_ == 'junk' and m.group(1) == 'BEGIN' and m.group(2) in tmpl:
|
||||
in_ = m.group(2)
|
||||
continue
|
||||
elif in_ == m.group(2) and m.group(1) == 'END' and m.group(2) in tmpl:
|
||||
in_ = 'junk'
|
||||
continue
|
||||
else:
|
||||
sys.exit("Malformed template file " + file)
|
||||
|
||||
if in_ != 'junk':
|
||||
tmpl[in_] += line
|
||||
|
||||
if in_ != 'junk':
|
||||
sys.exit("Malformed template file " + file)
|
||||
|
||||
fhead = tmpl['file-header']
|
||||
fprod = tmpl['file-production']
|
||||
ftail = tmpl['file-tail']
|
||||
eprod = tmpl['enumeration-production']
|
||||
vhead = tmpl['value-header']
|
||||
vprod = tmpl['value-production']
|
||||
vtail = tmpl['value-tail']
|
||||
comment_tmpl = tmpl['comment']
|
||||
|
||||
parser = argparse.ArgumentParser(epilog=help_epilog,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
|
||||
parser.add_argument('--identifier-prefix', default='', dest='idprefix',
|
||||
help='Identifier prefix')
|
||||
parser.add_argument('--symbol-prefix', default='', dest='symprefix',
|
||||
help='Symbol prefix')
|
||||
parser.add_argument('--fhead', default=[], dest='fhead', action='append',
|
||||
help='Output file header')
|
||||
parser.add_argument('--ftail', default=[], dest='ftail', action='append',
|
||||
help='Output file footer')
|
||||
parser.add_argument('--fprod', default=[], dest='fprod', action='append',
|
||||
help='Put out TEXT every time a new input file is being processed.')
|
||||
parser.add_argument('--eprod', default=[], dest='eprod', action='append',
|
||||
help='Per enum text, produced prior to value iterations')
|
||||
parser.add_argument('--vhead', default=[], dest='vhead', action='append',
|
||||
help='Value header, produced before iterating over enum values')
|
||||
parser.add_argument('--vprod', default=[], dest='vprod', action='append',
|
||||
help='Value text, produced for each enum value.')
|
||||
parser.add_argument('--vtail', default=[], dest='vtail', action='append',
|
||||
help='Value tail, produced after iterating over enum values')
|
||||
parser.add_argument('--comments', default='', dest='comment_tmpl',
|
||||
help='Comment structure')
|
||||
parser.add_argument('--template', default='', dest='template',
|
||||
help='Template file')
|
||||
parser.add_argument('--output', default=None, dest='output')
|
||||
parser.add_argument('--version', '-v', default=False, action='store_true', dest='version',
|
||||
help='Print version information')
|
||||
parser.add_argument('args', nargs='*',
|
||||
help='One or more input files, or a single argument @rspfile_path '
|
||||
'pointing to a file that contains the actual arguments')
|
||||
|
||||
# Support reading an rspfile of the form @filename which contains the args
|
||||
# to be parsed
|
||||
if len(sys.argv) == 2 and sys.argv[1].startswith('@'):
|
||||
args = get_rspfile_args(sys.argv[1][1:])
|
||||
else:
|
||||
args = sys.argv[1:]
|
||||
|
||||
options = parser.parse_args(args)
|
||||
|
||||
if options.version:
|
||||
print(VERSION_STR)
|
||||
sys.exit(0)
|
||||
|
||||
def unescape_cmdline_args(arg):
|
||||
arg = arg.replace('\\n', '\n')
|
||||
arg = arg.replace('\\r', '\r')
|
||||
return arg.replace('\\t', '\t')
|
||||
|
||||
if options.template != '':
|
||||
read_template_file(options.template)
|
||||
|
||||
idprefix += options.idprefix
|
||||
symprefix += options.symprefix
|
||||
|
||||
# This is a hack to maintain some semblance of backward compatibility with
|
||||
# the old, Perl-based glib-mkenums. The old tool had an implicit ordering
|
||||
# on the arguments and templates; each argument was parsed in order, and
|
||||
# all the strings appended. This allowed developers to write:
|
||||
#
|
||||
# glib-mkenums \
|
||||
# --fhead ... \
|
||||
# --template a-template-file.c.in \
|
||||
# --ftail ...
|
||||
#
|
||||
# And have the fhead be prepended to the file-head stanza in the template,
|
||||
# as well as the ftail be appended to the file-tail stanza in the template.
|
||||
# Short of throwing away ArgumentParser and going over sys.argv[] element
|
||||
# by element, we can simulate that behaviour by ensuring some ordering in
|
||||
# how we build the template strings:
|
||||
#
|
||||
# - the head stanzas are always prepended to the template
|
||||
# - the prod stanzas are always appended to the template
|
||||
# - the tail stanzas are always appended to the template
|
||||
#
|
||||
# Within each instance of the command line argument, we append each value
|
||||
# to the array in the order in which it appears on the command line.
|
||||
fhead = ''.join([unescape_cmdline_args(x) for x in options.fhead]) + fhead
|
||||
vhead = ''.join([unescape_cmdline_args(x) for x in options.vhead]) + vhead
|
||||
|
||||
fprod += ''.join([unescape_cmdline_args(x) for x in options.fprod])
|
||||
eprod += ''.join([unescape_cmdline_args(x) for x in options.eprod])
|
||||
vprod += ''.join([unescape_cmdline_args(x) for x in options.vprod])
|
||||
|
||||
ftail = ftail + ''.join([unescape_cmdline_args(x) for x in options.ftail])
|
||||
vtail = vtail + ''.join([unescape_cmdline_args(x) for x in options.vtail])
|
||||
|
||||
if options.comment_tmpl != '':
|
||||
comment_tmpl = unescape_cmdline_args(options.comment_tmpl)
|
||||
elif comment_tmpl == "":
|
||||
# default to C-style comments
|
||||
comment_tmpl = "/* \u0040comment\u0040 */"
|
||||
|
||||
output = options.output
|
||||
|
||||
if output is not None:
|
||||
(out_dir, out_fn) = os.path.split(options.output)
|
||||
out_suffix = '_' + os.path.splitext(out_fn)[1]
|
||||
if out_dir == '':
|
||||
out_dir = '.'
|
||||
fd, filename = tempfile.mkstemp(dir=out_dir)
|
||||
os.close(fd)
|
||||
tmpfile = io.open(filename, "w", encoding="utf-8")
|
||||
output_stream = tmpfile
|
||||
else:
|
||||
tmpfile = None
|
||||
|
||||
# put auto-generation comment
|
||||
comment = comment_tmpl.replace('\u0040comment\u0040',
|
||||
'This file is generated by glib-mkenums, do '
|
||||
'not modify it. This code is licensed under '
|
||||
'the same license as the containing project. '
|
||||
'Note that it links to GLib, so must comply '
|
||||
'with the LGPL linking clauses.')
|
||||
write_output("\n" + comment + '\n')
|
||||
|
||||
def replace_specials(prod):
|
||||
prod = prod.replace(r'\\a', r'\a')
|
||||
prod = prod.replace(r'\\b', r'\b')
|
||||
prod = prod.replace(r'\\t', r'\t')
|
||||
prod = prod.replace(r'\\n', r'\n')
|
||||
prod = prod.replace(r'\\f', r'\f')
|
||||
prod = prod.replace(r'\\r', r'\r')
|
||||
prod = prod.rstrip()
|
||||
return prod
|
||||
|
||||
|
||||
def warn_if_filename_basename_used(section, prod):
|
||||
for substitution in ('\u0040filename\u0040',
|
||||
'\u0040basename\u0040'):
|
||||
if substitution in prod:
|
||||
print_warning('{} used in {} section.'.format(substitution,
|
||||
section))
|
||||
|
||||
if len(fhead) > 0:
|
||||
prod = fhead
|
||||
warn_if_filename_basename_used('file-header', prod)
|
||||
prod = replace_specials(prod)
|
||||
write_output(prod)
|
||||
|
||||
def process_file(curfilename):
|
||||
global entries, flags, seenbitshift, enum_prefix
|
||||
firstenum = True
|
||||
|
||||
try:
|
||||
curfile = io.open(curfilename, encoding="utf-8",
|
||||
errors="replace_and_warn")
|
||||
except IOError as e:
|
||||
if e.errno == errno.ENOENT:
|
||||
print_warning('No file "{}" found.'.format(curfilename))
|
||||
return
|
||||
raise
|
||||
|
||||
while True:
|
||||
line = curfile.readline()
|
||||
if not line:
|
||||
break
|
||||
|
||||
line = line.strip()
|
||||
|
||||
# read lines until we have no open comments
|
||||
while re.search(r'/\*([^*]|\*(?!/))*$', line):
|
||||
line += curfile.readline()
|
||||
|
||||
# strip comments w/o options
|
||||
line = re.sub(r'''/\*(?!<)
|
||||
([^*]+|\*(?!/))*
|
||||
\*/''', '', line)
|
||||
|
||||
# ignore forward declarations
|
||||
if re.match(r'\s*typedef\s+enum.*;', line):
|
||||
continue
|
||||
|
||||
m = re.match(r'''\s*typedef\s+enum\s*[_A-Za-z]*[_A-Za-z0-9]*\s*
|
||||
({)?\s*
|
||||
(?:/\*<
|
||||
(([^*]|\*(?!/))*)
|
||||
>\s*\*/)?
|
||||
\s*({)?''', line, flags=re.X)
|
||||
if m:
|
||||
groups = m.groups()
|
||||
if len(groups) >= 2 and groups[1] is not None:
|
||||
options = parse_trigraph(groups[1])
|
||||
if 'skip' in options:
|
||||
continue
|
||||
enum_prefix = options.get('prefix', None)
|
||||
flags = options.get('flags', None)
|
||||
if 'flags' in options:
|
||||
if flags is None:
|
||||
flags = 1
|
||||
else:
|
||||
flags = int(flags)
|
||||
option_lowercase_name = options.get('lowercase_name', None)
|
||||
option_underscore_name = options.get('underscore_name', None)
|
||||
option_since = options.get('since', None)
|
||||
else:
|
||||
enum_prefix = None
|
||||
flags = None
|
||||
option_lowercase_name = None
|
||||
option_underscore_name = None
|
||||
option_since = None
|
||||
|
||||
if option_lowercase_name is not None:
|
||||
if option_underscore_name is not None:
|
||||
print_warning("lowercase_name overridden with underscore_name")
|
||||
option_lowercase_name = None
|
||||
else:
|
||||
print_warning("lowercase_name is deprecated, use underscore_name")
|
||||
|
||||
# Didn't have trailing '{' look on next lines
|
||||
if groups[0] is None and (len(groups) < 4 or groups[3] is None):
|
||||
while True:
|
||||
line = curfile.readline()
|
||||
if not line:
|
||||
print_error("Syntax error when looking for opening { in enum")
|
||||
if re.match(r'\s*\{', line):
|
||||
break
|
||||
|
||||
seenbitshift = 0
|
||||
entries = []
|
||||
|
||||
# Now parse the entries
|
||||
parse_entries(curfile, curfilename)
|
||||
|
||||
# figure out if this was a flags or enums enumeration
|
||||
if flags is None:
|
||||
flags = seenbitshift
|
||||
|
||||
# Autogenerate a prefix
|
||||
if enum_prefix is None:
|
||||
for entry in entries:
|
||||
if len(entry) < 3 or entry[2] is None:
|
||||
name = entry[0]
|
||||
if enum_prefix is not None:
|
||||
enum_prefix = os.path.commonprefix([name, enum_prefix])
|
||||
else:
|
||||
enum_prefix = name
|
||||
if enum_prefix is None:
|
||||
enum_prefix = ""
|
||||
else:
|
||||
# Trim so that it ends in an underscore
|
||||
enum_prefix = re.sub(r'_[^_]*$', '_', enum_prefix)
|
||||
else:
|
||||
# canonicalize user defined prefixes
|
||||
enum_prefix = enum_prefix.upper()
|
||||
enum_prefix = enum_prefix.replace('-', '_')
|
||||
enum_prefix = re.sub(r'(.*)([^_])$', r'\1\2_', enum_prefix)
|
||||
|
||||
fixed_entries = []
|
||||
for e in entries:
|
||||
name = e[0]
|
||||
num = e[1]
|
||||
if len(e) < 3 or e[2] is None:
|
||||
nick = re.sub(r'^' + enum_prefix, '', name)
|
||||
nick = nick.replace('_', '-').lower()
|
||||
e = (name, num, nick)
|
||||
fixed_entries.append(e)
|
||||
entries = fixed_entries
|
||||
|
||||
# Spit out the output
|
||||
if option_underscore_name is not None:
|
||||
enumlong = option_underscore_name.upper()
|
||||
enumsym = option_underscore_name.lower()
|
||||
enumshort = re.sub(r'^[A-Z][A-Z0-9]*_', '', enumlong)
|
||||
|
||||
enumname_prefix = re.sub('_' + enumshort + '$', '', enumlong)
|
||||
elif symprefix == '' and idprefix == '':
|
||||
# enumname is e.g. GMatchType
|
||||
enspace = re.sub(r'^([A-Z][a-z]*).*$', r'\1', enumname)
|
||||
|
||||
enumshort = re.sub(r'^[A-Z][a-z]*', '', enumname)
|
||||
enumshort = re.sub(r'([^A-Z])([A-Z])', r'\1_\2', enumshort)
|
||||
enumshort = re.sub(r'([A-Z][A-Z])([A-Z][0-9a-z])', r'\1_\2', enumshort)
|
||||
enumshort = enumshort.upper()
|
||||
|
||||
enumname_prefix = re.sub(r'^([A-Z][a-z]*).*$', r'\1', enumname).upper()
|
||||
|
||||
enumlong = enspace.upper() + "_" + enumshort
|
||||
enumsym = enspace.lower() + "_" + enumshort.lower()
|
||||
|
||||
if option_lowercase_name is not None:
|
||||
enumsym = option_lowercase_name
|
||||
else:
|
||||
enumshort = enumname
|
||||
if idprefix:
|
||||
enumshort = re.sub(r'^' + idprefix, '', enumshort)
|
||||
else:
|
||||
enumshort = re.sub(r'/^[A-Z][a-z]*', '', enumshort)
|
||||
|
||||
enumshort = re.sub(r'([^A-Z])([A-Z])', r'\1_\2', enumshort)
|
||||
enumshort = re.sub(r'([A-Z][A-Z])([A-Z][0-9a-z])', r'\1_\2', enumshort)
|
||||
enumshort = enumshort.upper()
|
||||
|
||||
if symprefix:
|
||||
enumname_prefix = symprefix.upper()
|
||||
else:
|
||||
enumname_prefix = idprefix.upper()
|
||||
|
||||
enumlong = enumname_prefix + "_" + enumshort
|
||||
enumsym = enumlong.lower()
|
||||
|
||||
if option_since is not None:
|
||||
enumsince = option_since
|
||||
else:
|
||||
enumsince = ""
|
||||
|
||||
if firstenum:
|
||||
firstenum = False
|
||||
|
||||
if len(fprod) > 0:
|
||||
prod = fprod
|
||||
base = os.path.basename(curfilename)
|
||||
|
||||
prod = prod.replace('\u0040filename\u0040', curfilename)
|
||||
prod = prod.replace('\u0040basename\u0040', base)
|
||||
prod = replace_specials(prod)
|
||||
|
||||
write_output(prod)
|
||||
|
||||
if len(eprod) > 0:
|
||||
prod = eprod
|
||||
|
||||
prod = prod.replace('\u0040enum_name\u0040', enumsym)
|
||||
prod = prod.replace('\u0040EnumName\u0040', enumname)
|
||||
prod = prod.replace('\u0040ENUMSHORT\u0040', enumshort)
|
||||
prod = prod.replace('\u0040ENUMNAME\u0040', enumlong)
|
||||
prod = prod.replace('\u0040ENUMPREFIX\u0040', enumname_prefix)
|
||||
prod = prod.replace('\u0040enumsince\u0040', enumsince)
|
||||
if flags:
|
||||
prod = prod.replace('\u0040type\u0040', 'flags')
|
||||
else:
|
||||
prod = prod.replace('\u0040type\u0040', 'enum')
|
||||
if flags:
|
||||
prod = prod.replace('\u0040Type\u0040', 'Flags')
|
||||
else:
|
||||
prod = prod.replace('\u0040Type\u0040', 'Enum')
|
||||
if flags:
|
||||
prod = prod.replace('\u0040TYPE\u0040', 'FLAGS')
|
||||
else:
|
||||
prod = prod.replace('\u0040TYPE\u0040', 'ENUM')
|
||||
prod = replace_specials(prod)
|
||||
write_output(prod)
|
||||
|
||||
if len(vhead) > 0:
|
||||
prod = vhead
|
||||
prod = prod.replace('\u0040enum_name\u0040', enumsym)
|
||||
prod = prod.replace('\u0040EnumName\u0040', enumname)
|
||||
prod = prod.replace('\u0040ENUMSHORT\u0040', enumshort)
|
||||
prod = prod.replace('\u0040ENUMNAME\u0040', enumlong)
|
||||
prod = prod.replace('\u0040ENUMPREFIX\u0040', enumname_prefix)
|
||||
prod = prod.replace('\u0040enumsince\u0040', enumsince)
|
||||
if flags:
|
||||
prod = prod.replace('\u0040type\u0040', 'flags')
|
||||
else:
|
||||
prod = prod.replace('\u0040type\u0040', 'enum')
|
||||
if flags:
|
||||
prod = prod.replace('\u0040Type\u0040', 'Flags')
|
||||
else:
|
||||
prod = prod.replace('\u0040Type\u0040', 'Enum')
|
||||
if flags:
|
||||
prod = prod.replace('\u0040TYPE\u0040', 'FLAGS')
|
||||
else:
|
||||
prod = prod.replace('\u0040TYPE\u0040', 'ENUM')
|
||||
prod = replace_specials(prod)
|
||||
write_output(prod)
|
||||
|
||||
if len(vprod) > 0:
|
||||
prod = vprod
|
||||
next_num = 0
|
||||
|
||||
prod = replace_specials(prod)
|
||||
for name, num, nick in entries:
|
||||
tmp_prod = prod
|
||||
|
||||
if '\u0040valuenum\u0040' in prod:
|
||||
# only attempt to eval the value if it is requested
|
||||
# this prevents us from throwing errors otherwise
|
||||
if num is not None:
|
||||
# use sandboxed evaluation as a reasonable
|
||||
# approximation to C constant folding
|
||||
inum = eval(num, {}, {})
|
||||
|
||||
# make sure it parsed to an integer
|
||||
if not isinstance(inum, int):
|
||||
sys.exit("Unable to parse enum value '%s'" % num)
|
||||
num = inum
|
||||
else:
|
||||
num = next_num
|
||||
|
||||
tmp_prod = tmp_prod.replace('\u0040valuenum\u0040', str(num))
|
||||
next_num = int(num) + 1
|
||||
|
||||
tmp_prod = tmp_prod.replace('\u0040VALUENAME\u0040', name)
|
||||
tmp_prod = tmp_prod.replace('\u0040valuenick\u0040', nick)
|
||||
if flags:
|
||||
tmp_prod = tmp_prod.replace('\u0040type\u0040', 'flags')
|
||||
else:
|
||||
tmp_prod = tmp_prod.replace('\u0040type\u0040', 'enum')
|
||||
if flags:
|
||||
tmp_prod = tmp_prod.replace('\u0040Type\u0040', 'Flags')
|
||||
else:
|
||||
tmp_prod = tmp_prod.replace('\u0040Type\u0040', 'Enum')
|
||||
if flags:
|
||||
tmp_prod = tmp_prod.replace('\u0040TYPE\u0040', 'FLAGS')
|
||||
else:
|
||||
tmp_prod = tmp_prod.replace('\u0040TYPE\u0040', 'ENUM')
|
||||
tmp_prod = tmp_prod.rstrip()
|
||||
|
||||
write_output(tmp_prod)
|
||||
|
||||
if len(vtail) > 0:
|
||||
prod = vtail
|
||||
prod = prod.replace('\u0040enum_name\u0040', enumsym)
|
||||
prod = prod.replace('\u0040EnumName\u0040', enumname)
|
||||
prod = prod.replace('\u0040ENUMSHORT\u0040', enumshort)
|
||||
prod = prod.replace('\u0040ENUMNAME\u0040', enumlong)
|
||||
prod = prod.replace('\u0040ENUMPREFIX\u0040', enumname_prefix)
|
||||
prod = prod.replace('\u0040enumsince\u0040', enumsince)
|
||||
if flags:
|
||||
prod = prod.replace('\u0040type\u0040', 'flags')
|
||||
else:
|
||||
prod = prod.replace('\u0040type\u0040', 'enum')
|
||||
if flags:
|
||||
prod = prod.replace('\u0040Type\u0040', 'Flags')
|
||||
else:
|
||||
prod = prod.replace('\u0040Type\u0040', 'Enum')
|
||||
if flags:
|
||||
prod = prod.replace('\u0040TYPE\u0040', 'FLAGS')
|
||||
else:
|
||||
prod = prod.replace('\u0040TYPE\u0040', 'ENUM')
|
||||
prod = replace_specials(prod)
|
||||
write_output(prod)
|
||||
|
||||
for fname in sorted(options.args):
|
||||
process_file(fname)
|
||||
|
||||
if len(ftail) > 0:
|
||||
prod = ftail
|
||||
warn_if_filename_basename_used('file-tail', prod)
|
||||
prod = replace_specials(prod)
|
||||
write_output(prod)
|
||||
|
||||
# put auto-generation comment
|
||||
comment = comment_tmpl
|
||||
comment = comment.replace('\u0040comment\u0040', 'Generated data ends here')
|
||||
write_output("\n" + comment + "\n")
|
||||
|
||||
if tmpfile is not None:
|
||||
tmpfilename = tmpfile.name
|
||||
tmpfile.close()
|
||||
|
||||
try:
|
||||
os.unlink(options.output)
|
||||
except OSError as error:
|
||||
if error.errno != errno.ENOENT:
|
||||
raise error
|
||||
|
||||
os.rename(tmpfilename, options.output)
|
|
@ -91,7 +91,7 @@
|
|||
#include <glib/gtree.h>
|
||||
#include <glib/gtypes.h>
|
||||
#include <glib/gunicode.h>
|
||||
#include <glib/gurifuncs.h>
|
||||
#include <glib/guri.h>
|
||||
#include <glib/gutils.h>
|
||||
#include <glib/guuid.h>
|
||||
#include <glib/gvariant.h>
|
|
@ -115,7 +115,7 @@ G_BEGIN_DECLS
|
|||
*
|
||||
* Returns: %TRUE if any events are pending.
|
||||
*
|
||||
* Deprected: 2.2: Use g_main_context_pending() instead.
|
||||
* Deprecated: 2.2: Use g_main_context_pending() instead.
|
||||
*/
|
||||
#define g_main_pending() g_main_context_pending (NULL) GLIB_DEPRECATED_MACRO_IN_2_26_FOR(g_main_context_pending)
|
||||
|
|
@ -61,7 +61,7 @@ void g_on_error_stack_trace (const gchar *prg_name);
|
|||
# define G_BREAKPOINT() G_STMT_START{ __debugbreak(); }G_STMT_END
|
||||
#elif defined (__alpha__) && !defined(__osf__) && defined (__GNUC__) && __GNUC__ >= 2
|
||||
# define G_BREAKPOINT() G_STMT_START{ __asm__ __volatile__ ("bpt"); }G_STMT_END
|
||||
#elif defined (__APPLE__)
|
||||
#elif defined (__APPLE__) || (defined(_WIN32) && (defined(__clang__) || defined(__GNUC__)))
|
||||
# define G_BREAKPOINT() G_STMT_START{ __builtin_trap(); }G_STMT_END
|
||||
#else /* !__i386__ && !__alpha__ */
|
||||
# define G_BREAKPOINT() G_STMT_START{ raise (SIGTRAP); }G_STMT_END
|
|
@ -23,6 +23,7 @@
|
|||
#error "Only <glib.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib/gdatetime.h>
|
||||
#include <glib/gerror.h>
|
||||
#include <time.h>
|
||||
|
||||
|
@ -162,7 +163,7 @@ gchar ** g_bookmark_file_get_applications (GBookmarkFile *bookmark,
|
|||
const gchar *uri,
|
||||
gsize *length,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_set_application_info)
|
||||
gboolean g_bookmark_file_set_app_info (GBookmarkFile *bookmark,
|
||||
const gchar *uri,
|
||||
const gchar *name,
|
||||
|
@ -170,7 +171,15 @@ gboolean g_bookmark_file_set_app_info (GBookmarkFile *bookmark,
|
|||
gint count,
|
||||
time_t stamp,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gboolean g_bookmark_file_set_application_info (GBookmarkFile *bookmark,
|
||||
const char *uri,
|
||||
const char *name,
|
||||
const char *exec,
|
||||
int count,
|
||||
GDateTime *stamp,
|
||||
GError **error);
|
||||
GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_get_application_info)
|
||||
gboolean g_bookmark_file_get_app_info (GBookmarkFile *bookmark,
|
||||
const gchar *uri,
|
||||
const gchar *name,
|
||||
|
@ -178,6 +187,14 @@ gboolean g_bookmark_file_get_app_info (GBookmarkFile *bookmark,
|
|||
guint *count,
|
||||
time_t *stamp,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gboolean g_bookmark_file_get_application_info (GBookmarkFile *bookmark,
|
||||
const char *uri,
|
||||
const char *name,
|
||||
char **exec,
|
||||
unsigned int *count,
|
||||
GDateTime **stamp,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
void g_bookmark_file_set_is_private (GBookmarkFile *bookmark,
|
||||
const gchar *uri,
|
||||
|
@ -197,30 +214,54 @@ gboolean g_bookmark_file_get_icon (GBookmarkFile *bookmark,
|
|||
gchar **href,
|
||||
gchar **mime_type,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_set_added_date_time)
|
||||
void g_bookmark_file_set_added (GBookmarkFile *bookmark,
|
||||
const gchar *uri,
|
||||
time_t added);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
void g_bookmark_file_set_added_date_time (GBookmarkFile *bookmark,
|
||||
const char *uri,
|
||||
GDateTime *added);
|
||||
GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_get_added_date_time)
|
||||
time_t g_bookmark_file_get_added (GBookmarkFile *bookmark,
|
||||
const gchar *uri,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GDateTime *g_bookmark_file_get_added_date_time (GBookmarkFile *bookmark,
|
||||
const char *uri,
|
||||
GError **error);
|
||||
GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_set_modified_date_time)
|
||||
void g_bookmark_file_set_modified (GBookmarkFile *bookmark,
|
||||
const gchar *uri,
|
||||
time_t modified);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
void g_bookmark_file_set_modified_date_time (GBookmarkFile *bookmark,
|
||||
const char *uri,
|
||||
GDateTime *modified);
|
||||
GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_get_modified_date_time)
|
||||
time_t g_bookmark_file_get_modified (GBookmarkFile *bookmark,
|
||||
const gchar *uri,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GDateTime *g_bookmark_file_get_modified_date_time (GBookmarkFile *bookmark,
|
||||
const char *uri,
|
||||
GError **error);
|
||||
GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_set_visited_date_time)
|
||||
void g_bookmark_file_set_visited (GBookmarkFile *bookmark,
|
||||
const gchar *uri,
|
||||
time_t visited);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
void g_bookmark_file_set_visited_date_time (GBookmarkFile *bookmark,
|
||||
const char *uri,
|
||||
GDateTime *visited);
|
||||
GLIB_DEPRECATED_IN_2_66_FOR(g_bookmark_file_get_visited_date_time)
|
||||
time_t g_bookmark_file_get_visited (GBookmarkFile *bookmark,
|
||||
const gchar *uri,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GDateTime *g_bookmark_file_get_visited_date_time (GBookmarkFile *bookmark,
|
||||
const char *uri,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
gboolean g_bookmark_file_has_item (GBookmarkFile *bookmark,
|
||||
const gchar *uri);
|
|
@ -72,6 +72,39 @@ typedef enum
|
|||
G_FILE_TEST_EXISTS = 1 << 4
|
||||
} GFileTest;
|
||||
|
||||
/**
|
||||
* GFileSetContentsFlags:
|
||||
* @G_FILE_SET_CONTENTS_NONE: No guarantees about file consistency or durability.
|
||||
* The most dangerous setting, which is slightly faster than other settings.
|
||||
* @G_FILE_SET_CONTENTS_CONSISTENT: Guarantee file consistency: after a crash,
|
||||
* either the old version of the file or the new version of the file will be
|
||||
* available, but not a mixture. On Unix systems this equates to an `fsync()`
|
||||
* on the file and use of an atomic `rename()` of the new version of the file
|
||||
* over the old.
|
||||
* @G_FILE_SET_CONTENTS_DURABLE: Guarantee file durability: after a crash, the
|
||||
* new version of the file will be available. On Unix systems this equates to
|
||||
* an `fsync()` on the file (if %G_FILE_SET_CONTENTS_CONSISTENT is unset), or
|
||||
* the effects of %G_FILE_SET_CONTENTS_CONSISTENT plus an `fsync()` on the
|
||||
* directory containing the file after calling `rename()`.
|
||||
* @G_FILE_SET_CONTENTS_ONLY_EXISTING: Only apply consistency and durability
|
||||
* guarantees if the file already exists. This may speed up file operations
|
||||
* if the file doesn’t currently exist, but may result in a corrupted version
|
||||
* of the new file if the system crashes while writing it.
|
||||
*
|
||||
* Flags to pass to g_file_set_contents_full() to affect its safety and
|
||||
* performance.
|
||||
*
|
||||
* Since: 2.66
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
G_FILE_SET_CONTENTS_NONE = 0,
|
||||
G_FILE_SET_CONTENTS_CONSISTENT = 1 << 0,
|
||||
G_FILE_SET_CONTENTS_DURABLE = 1 << 1,
|
||||
G_FILE_SET_CONTENTS_ONLY_EXISTING = 1 << 2
|
||||
} GFileSetContentsFlags
|
||||
GLIB_AVAILABLE_ENUMERATOR_IN_2_66;
|
||||
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GQuark g_file_error_quark (void);
|
||||
/* So other code can generate a GFileError */
|
||||
|
@ -91,6 +124,15 @@ gboolean g_file_set_contents (const gchar *filename,
|
|||
const gchar *contents,
|
||||
gssize length,
|
||||
GError **error);
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gboolean g_file_set_contents_full (const gchar *filename,
|
||||
const gchar *contents,
|
||||
gssize length,
|
||||
GFileSetContentsFlags flags,
|
||||
int mode,
|
||||
GError **error);
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
gchar *g_file_read_link (const gchar *filename,
|
||||
GError **error);
|
|
@ -96,6 +96,7 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantDict, g_variant_dict_unref)
|
|||
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GVariantDict, g_variant_dict_clear)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GVariantType, g_variant_type_free)
|
||||
G_DEFINE_AUTO_CLEANUP_FREE_FUNC(GStrv, g_strfreev, NULL)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GRefString, g_ref_string_release)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GRefString, g_ref_string_release)
|
||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GUri, g_uri_unref)
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
|
@ -89,7 +89,7 @@
|
|||
* in a compatible way before this feature was supported in all
|
||||
* compilers. These days, GLib requires inlining support from the
|
||||
* compiler, so your GLib-using programs can safely assume that the
|
||||
* "inline" keywork works properly.
|
||||
* "inline" keyword works properly.
|
||||
*
|
||||
* Never use this macro anymore. Just say "static inline".
|
||||
*
|
||||
|
@ -532,7 +532,7 @@
|
|||
/**
|
||||
* G_GNUC_FALLTHROUGH:
|
||||
*
|
||||
* Expands to the GNU C `fallthrough` statement attribute if the compiler is gcc.
|
||||
* Expands to the GNU C `fallthrough` statement attribute if the compiler supports it.
|
||||
* This allows declaring case statement to explicitly fall through in switch
|
||||
* statements. To enable this feature, use `-Wimplicit-fallthrough` during
|
||||
* compilation.
|
||||
|
@ -559,6 +559,8 @@
|
|||
*/
|
||||
#if __GNUC__ > 6
|
||||
#define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
|
||||
#elif g_macro__has_attribute (fallthrough)
|
||||
#define G_GNUC_FALLTHROUGH __attribute__((fallthrough))
|
||||
#else
|
||||
#define G_GNUC_FALLTHROUGH
|
||||
#endif /* __GNUC__ */
|
||||
|
@ -976,10 +978,12 @@
|
|||
#define GLIB_DEPRECATED _GLIB_EXTERN
|
||||
#define GLIB_DEPRECATED_FOR(f) _GLIB_EXTERN
|
||||
#define GLIB_UNAVAILABLE(maj,min) _GLIB_EXTERN
|
||||
#define GLIB_UNAVAILABLE_STATIC_INLINE(maj,min)
|
||||
#else
|
||||
#define GLIB_DEPRECATED G_DEPRECATED _GLIB_EXTERN
|
||||
#define GLIB_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _GLIB_EXTERN
|
||||
#define GLIB_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _GLIB_EXTERN
|
||||
#define GLIB_UNAVAILABLE_STATIC_INLINE(maj,min) G_UNAVAILABLE(maj,min)
|
||||
#endif
|
||||
|
||||
#if !defined(GLIB_DISABLE_DEPRECATION_WARNINGS) && \
|
|
@ -499,6 +499,7 @@ typedef void GMainContextPusher GLIB_AVAILABLE_TYPE_IN_2_64;
|
|||
* Since: 2.64
|
||||
*/
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
|
||||
static inline GMainContextPusher *
|
||||
g_main_context_pusher_new (GMainContext *main_context)
|
||||
{
|
||||
|
@ -520,6 +521,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
|||
* Since: 2.64
|
||||
*/
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
|
||||
static inline void
|
||||
g_main_context_pusher_free (GMainContextPusher *pusher)
|
||||
{
|
|
@ -197,6 +197,7 @@ gpointer g_try_realloc_n (gpointer mem,
|
|||
*
|
||||
* Since: 2.44
|
||||
*/
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_44
|
||||
static inline gpointer
|
||||
g_steal_pointer (gpointer pp)
|
||||
{
|
|
@ -37,7 +37,7 @@ typedef struct _GRand GRand;
|
|||
|
||||
/* GRand - a good and fast random number generator: Mersenne Twister
|
||||
* see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html for more info.
|
||||
* The range functions return a value in the intervall [begin, end).
|
||||
* The range functions return a value in the interval [begin, end).
|
||||
* int -> [0..2^32-1]
|
||||
* int_range -> [begin..end-1]
|
||||
* double -> [0..1)
|
|
@ -23,6 +23,7 @@
|
|||
#endif
|
||||
|
||||
#include <glib/gtypes.h>
|
||||
#include <string.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
@ -43,7 +44,22 @@ void g_slice_free_chain_with_offset (gsize block_size,
|
|||
gpointer mem_chain,
|
||||
gsize next_offset);
|
||||
#define g_slice_new(type) ((type*) g_slice_alloc (sizeof (type)))
|
||||
#define g_slice_new0(type) ((type*) g_slice_alloc0 (sizeof (type)))
|
||||
|
||||
/* Allow the compiler to inline memset(). Since the size is a constant, this
|
||||
* can significantly improve performance. */
|
||||
#if defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__)
|
||||
# define g_slice_new0(type) \
|
||||
(type *) (G_GNUC_EXTENSION ({ \
|
||||
gsize __s = sizeof (type); \
|
||||
gpointer __p; \
|
||||
__p = g_slice_alloc (__s); \
|
||||
memset (__p, 0, __s); \
|
||||
__p; \
|
||||
}))
|
||||
#else
|
||||
# define g_slice_new0(type) ((type*) g_slice_alloc0 (sizeof (type)))
|
||||
#endif
|
||||
|
||||
/* MemoryBlockType *
|
||||
* g_slice_dup (MemoryBlockType,
|
||||
* MemoryBlockType *mem_block);
|
|
@ -157,7 +157,7 @@ typedef void (* GSpawnChildSetupFunc) (gpointer user_data);
|
|||
* execute, while the remaining elements are the actual argument vector
|
||||
* to pass to the file. Normally g_spawn_async_with_pipes() uses `argv[0]`
|
||||
* as the file to execute, and passes all of `argv` to the child.
|
||||
* @G_SPAWN_SEARCH_PATH_FROM_ENVP: if `argv[0]` is not an abolute path,
|
||||
* @G_SPAWN_SEARCH_PATH_FROM_ENVP: if `argv[0]` is not an absolute path,
|
||||
* it will be looked for in the `PATH` from the passed child environment.
|
||||
* Since: 2.34
|
||||
* @G_SPAWN_CLOEXEC_PIPES: create all pipes with the `O_CLOEXEC` flag set.
|
|
@ -27,6 +27,7 @@
|
|||
#include <glib/gstring.h>
|
||||
#include <glib/gerror.h>
|
||||
#include <glib/gslist.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
@ -110,6 +111,20 @@ typedef void (*GTestFixtureFunc) (gpointer fixture,
|
|||
} \
|
||||
} \
|
||||
G_STMT_END
|
||||
#define g_assert_no_errno(expr) G_STMT_START { \
|
||||
int __ret, __errsv; \
|
||||
errno = 0; \
|
||||
__ret = expr; \
|
||||
__errsv = errno; \
|
||||
if (__ret < 0) \
|
||||
{ \
|
||||
gchar *__msg; \
|
||||
__msg = g_strdup_printf ("assertion failed (" #expr " >= 0): errno %i: %s", __errsv, g_strerror (__errsv)); \
|
||||
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, __msg); \
|
||||
g_free (__msg); \
|
||||
} \
|
||||
} G_STMT_END \
|
||||
GLIB_AVAILABLE_MACRO_IN_2_66
|
||||
#define g_assert_no_error(err) G_STMT_START { \
|
||||
if (err) \
|
||||
g_assertion_message_error (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
|
||||
|
@ -452,7 +467,7 @@ void g_assertion_message (const char *domain,
|
|||
const char *file,
|
||||
int line,
|
||||
const char *func,
|
||||
const char *message);
|
||||
const char *message) G_ANALYZER_NORETURN;
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
void g_assertion_message_expr (const char *domain,
|
||||
const char *file,
|
||||
|
@ -467,7 +482,7 @@ void g_assertion_message_cmpstr (const char *domain,
|
|||
const char *expr,
|
||||
const char *arg1,
|
||||
const char *cmp,
|
||||
const char *arg2);
|
||||
const char *arg2) G_ANALYZER_NORETURN;
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
void g_assertion_message_cmpnum (const char *domain,
|
||||
const char *file,
|
||||
|
@ -477,7 +492,7 @@ void g_assertion_message_cmpnum (const char *domain,
|
|||
long double arg1,
|
||||
const char *cmp,
|
||||
long double arg2,
|
||||
char numtype);
|
||||
char numtype) G_ANALYZER_NORETURN;
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
void g_assertion_message_error (const char *domain,
|
||||
const char *file,
|
||||
|
@ -486,7 +501,7 @@ void g_assertion_message_error (const char *domain,
|
|||
const char *expr,
|
||||
const GError *error,
|
||||
GQuark error_domain,
|
||||
int error_code);
|
||||
int error_code) G_ANALYZER_NORETURN;
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
void g_test_add_vtable (const char *testpath,
|
||||
gsize data_size,
|
|
@ -234,14 +234,23 @@ GLIB_AVAILABLE_IN_ALL
|
|||
void g_once_init_leave (volatile void *location,
|
||||
gsize result);
|
||||
|
||||
#ifdef G_ATOMIC_OP_MEMORY_BARRIER_NEEDED
|
||||
# define g_once(once, func, arg) g_once_impl ((once), (func), (arg))
|
||||
#else /* !G_ATOMIC_OP_MEMORY_BARRIER_NEEDED*/
|
||||
/* Use C11-style atomic extensions to check the fast path for status=ready. If
|
||||
* they are not available, fall back to using a mutex and condition variable in
|
||||
* g_once_impl().
|
||||
*
|
||||
* On the C11-style codepath, only the load of once->status needs to be atomic,
|
||||
* as the writes to it and once->retval in g_once_impl() are related by a
|
||||
* happens-before relation. Release-acquire semantics are defined such that any
|
||||
* atomic/non-atomic write which happens-before a store/release is guaranteed to
|
||||
* be seen by the load/acquire of the same atomic variable. */
|
||||
#if defined(G_ATOMIC_LOCK_FREE) && defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) && defined(__ATOMIC_SEQ_CST)
|
||||
# define g_once(once, func, arg) \
|
||||
(((once)->status == G_ONCE_STATUS_READY) ? \
|
||||
((__atomic_load_n (&(once)->status, __ATOMIC_ACQUIRE) == G_ONCE_STATUS_READY) ? \
|
||||
(once)->retval : \
|
||||
g_once_impl ((once), (func), (arg)))
|
||||
#endif /* G_ATOMIC_OP_MEMORY_BARRIER_NEEDED */
|
||||
#else
|
||||
# define g_once(once, func, arg) g_once_impl ((once), (func), (arg))
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define g_once_init_enter(location) \
|
||||
|
@ -317,6 +326,7 @@ typedef void GMutexLocker;
|
|||
* Returns: a #GMutexLocker
|
||||
* Since: 2.44
|
||||
*/
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_44
|
||||
static inline GMutexLocker *
|
||||
g_mutex_locker_new (GMutex *mutex)
|
||||
{
|
||||
|
@ -334,6 +344,7 @@ g_mutex_locker_new (GMutex *mutex)
|
|||
*
|
||||
* Since: 2.44
|
||||
*/
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_44
|
||||
static inline void
|
||||
g_mutex_locker_free (GMutexLocker *locker)
|
||||
{
|
||||
|
@ -391,6 +402,7 @@ typedef void GRecMutexLocker;
|
|||
* Since: 2.60
|
||||
*/
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_60
|
||||
static inline GRecMutexLocker *
|
||||
g_rec_mutex_locker_new (GRecMutex *rec_mutex)
|
||||
{
|
||||
|
@ -410,6 +422,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
|||
* Since: 2.60
|
||||
*/
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_60
|
||||
static inline void
|
||||
g_rec_mutex_locker_free (GRecMutexLocker *locker)
|
||||
{
|
||||
|
@ -499,6 +512,7 @@ typedef void GRWLockWriterLocker;
|
|||
* Since: 2.62
|
||||
*/
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_62
|
||||
static inline GRWLockWriterLocker *
|
||||
g_rw_lock_writer_locker_new (GRWLock *rw_lock)
|
||||
{
|
||||
|
@ -519,6 +533,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
|||
* Since: 2.62
|
||||
*/
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_62
|
||||
static inline void
|
||||
g_rw_lock_writer_locker_free (GRWLockWriterLocker *locker)
|
||||
{
|
||||
|
@ -552,6 +567,7 @@ typedef void GRWLockReaderLocker;
|
|||
* Since: 2.62
|
||||
*/
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_62
|
||||
static inline GRWLockReaderLocker *
|
||||
g_rw_lock_reader_locker_new (GRWLock *rw_lock)
|
||||
{
|
||||
|
@ -572,6 +588,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
|||
* Since: 2.62
|
||||
*/
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
GLIB_AVAILABLE_STATIC_INLINE_IN_2_62
|
||||
static inline void
|
||||
g_rw_lock_reader_locker_free (GRWLockReaderLocker *locker)
|
||||
{
|
|
@ -424,6 +424,10 @@ typedef enum
|
|||
* @G_UNICODE_SCRIPT_NANDINAGARI: Nand. Since: 2.62
|
||||
* @G_UNICODE_SCRIPT_NYIAKENG_PUACHUE_HMONG: Rohg. Since: 2.62
|
||||
* @G_UNICODE_SCRIPT_WANCHO: Wcho. Since: 2.62
|
||||
* @G_UNICODE_SCRIPT_CHORASMIAN: Chorasmian. Since: 2.66
|
||||
* @G_UNICODE_SCRIPT_DIVES_AKURU: Dives Akuru. Since: 2.66
|
||||
* @G_UNICODE_SCRIPT_KHITAN_SMALL_SCRIPT: Khitan small script. Since: 2.66
|
||||
* @G_UNICODE_SCRIPT_YEZIDI: Yezidi. Since: 2.66
|
||||
*
|
||||
* The #GUnicodeScript enumeration identifies different writing
|
||||
* systems. The values correspond to the names as defined in the
|
||||
|
@ -615,7 +619,13 @@ typedef enum
|
|||
G_UNICODE_SCRIPT_ELYMAIC, /* Elym */
|
||||
G_UNICODE_SCRIPT_NANDINAGARI, /* Nand */
|
||||
G_UNICODE_SCRIPT_NYIAKENG_PUACHUE_HMONG, /* Rohg */
|
||||
G_UNICODE_SCRIPT_WANCHO /* Wcho */
|
||||
G_UNICODE_SCRIPT_WANCHO, /* Wcho */
|
||||
|
||||
/* Unicode 13.0 additions */
|
||||
G_UNICODE_SCRIPT_CHORASMIAN, /* Chrs */
|
||||
G_UNICODE_SCRIPT_DIVES_AKURU, /* Diak */
|
||||
G_UNICODE_SCRIPT_KHITAN_SMALL_SCRIPT, /* Kits */
|
||||
G_UNICODE_SCRIPT_YEZIDI /* Yezi */
|
||||
} GUnicodeScript;
|
||||
|
||||
GLIB_AVAILABLE_IN_ALL
|
413
deps/glib/include/glib-2.0/glib/guri.h
vendored
Normal file
413
deps/glib/include/glib-2.0/glib/guri.h
vendored
Normal file
|
@ -0,0 +1,413 @@
|
|||
/* GLIB - Library of useful routines for C programming
|
||||
* Copyright © 2020 Red Hat, Inc.
|
||||
*
|
||||
* 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 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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
|
||||
#error "Only <glib.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib/gtypes.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
|
||||
typedef struct _GUri GUri;
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GUri * g_uri_ref (GUri *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
void g_uri_unref (GUri *uri);
|
||||
|
||||
/**
|
||||
* GUriFlags:
|
||||
* @G_URI_FLAGS_NONE: No flags set.
|
||||
* @G_URI_FLAGS_PARSE_RELAXED: Parse the URI more relaxedly than the
|
||||
* [RFC 3986](https://tools.ietf.org/html/rfc3986) grammar specifies,
|
||||
* fixing up or ignoring common mistakes in URIs coming from external
|
||||
* sources. This is also needed for some obscure URI schemes where `;`
|
||||
* separates the host from the path. Don’t use this flag unless you need to.
|
||||
* @G_URI_FLAGS_HAS_PASSWORD: The userinfo field may contain a password,
|
||||
* which will be separated from the username by `:`.
|
||||
* @G_URI_FLAGS_HAS_AUTH_PARAMS: The userinfo may contain additional
|
||||
* authentication-related parameters, which will be separated from
|
||||
* the username and/or password by `;`.
|
||||
* @G_URI_FLAGS_NON_DNS: The host component should not be assumed to be a
|
||||
* DNS hostname or IP address (for example, for `smb` URIs with NetBIOS
|
||||
* hostnames).
|
||||
* @G_URI_FLAGS_ENCODED: When parsing a URI, this indicates that `%`-encoded
|
||||
* characters in the userinfo, path, query, and fragment fields
|
||||
* should not be decoded. (And likewise the host field if
|
||||
* %G_URI_FLAGS_NON_DNS is also set.) When building a URI, it indicates
|
||||
* that you have already `%`-encoded the components, and so #GUri
|
||||
* should not do any encoding itself.
|
||||
* @G_URI_FLAGS_ENCODED_QUERY: Same as %G_URI_FLAGS_ENCODED, for the query
|
||||
* field only.
|
||||
* @G_URI_FLAGS_ENCODED_PATH: Same as %G_URI_FLAGS_ENCODED, for the path only.
|
||||
* @G_URI_FLAGS_ENCODED_FRAGMENT: Same as %G_URI_FLAGS_ENCODED, for the
|
||||
* fragment only.
|
||||
*
|
||||
* Flags that describe a URI.
|
||||
*
|
||||
* When parsing a URI, if you need to choose different flags based on
|
||||
* the type of URI, you can use g_uri_peek_scheme() on the URI string
|
||||
* to check the scheme first, and use that to decide what flags to
|
||||
* parse it with.
|
||||
*
|
||||
* Since: 2.66
|
||||
*/
|
||||
GLIB_AVAILABLE_TYPE_IN_2_66
|
||||
typedef enum {
|
||||
G_URI_FLAGS_NONE = 0,
|
||||
G_URI_FLAGS_PARSE_RELAXED = 1 << 0,
|
||||
G_URI_FLAGS_HAS_PASSWORD = 1 << 1,
|
||||
G_URI_FLAGS_HAS_AUTH_PARAMS = 1 << 2,
|
||||
G_URI_FLAGS_ENCODED = 1 << 3,
|
||||
G_URI_FLAGS_NON_DNS = 1 << 4,
|
||||
G_URI_FLAGS_ENCODED_QUERY = 1 << 5,
|
||||
G_URI_FLAGS_ENCODED_PATH = 1 << 6,
|
||||
G_URI_FLAGS_ENCODED_FRAGMENT = 1 << 7,
|
||||
} GUriFlags;
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gboolean g_uri_split (const gchar *uri_ref,
|
||||
GUriFlags flags,
|
||||
gchar **scheme,
|
||||
gchar **userinfo,
|
||||
gchar **host,
|
||||
gint *port,
|
||||
gchar **path,
|
||||
gchar **query,
|
||||
gchar **fragment,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gboolean g_uri_split_with_user (const gchar *uri_ref,
|
||||
GUriFlags flags,
|
||||
gchar **scheme,
|
||||
gchar **user,
|
||||
gchar **password,
|
||||
gchar **auth_params,
|
||||
gchar **host,
|
||||
gint *port,
|
||||
gchar **path,
|
||||
gchar **query,
|
||||
gchar **fragment,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gboolean g_uri_split_network (const gchar *uri_string,
|
||||
GUriFlags flags,
|
||||
gchar **scheme,
|
||||
gchar **host,
|
||||
gint *port,
|
||||
GError **error);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gboolean g_uri_is_valid (const gchar *uri_string,
|
||||
GUriFlags flags,
|
||||
GError **error);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gchar * g_uri_join (GUriFlags flags,
|
||||
const gchar *scheme,
|
||||
const gchar *userinfo,
|
||||
const gchar *host,
|
||||
gint port,
|
||||
const gchar *path,
|
||||
const gchar *query,
|
||||
const gchar *fragment);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gchar * g_uri_join_with_user (GUriFlags flags,
|
||||
const gchar *scheme,
|
||||
const gchar *user,
|
||||
const gchar *password,
|
||||
const gchar *auth_params,
|
||||
const gchar *host,
|
||||
gint port,
|
||||
const gchar *path,
|
||||
const gchar *query,
|
||||
const gchar *fragment);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GUri * g_uri_parse (const gchar *uri_string,
|
||||
GUriFlags flags,
|
||||
GError **error);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GUri * g_uri_parse_relative (GUri *base_uri,
|
||||
const gchar *uri_ref,
|
||||
GUriFlags flags,
|
||||
GError **error);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gchar * g_uri_resolve_relative (const gchar *base_uri_string,
|
||||
const gchar *uri_ref,
|
||||
GUriFlags flags,
|
||||
GError **error);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GUri * g_uri_build (GUriFlags flags,
|
||||
const gchar *scheme,
|
||||
const gchar *userinfo,
|
||||
const gchar *host,
|
||||
gint port,
|
||||
const gchar *path,
|
||||
const gchar *query,
|
||||
const gchar *fragment);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GUri * g_uri_build_with_user (GUriFlags flags,
|
||||
const gchar *scheme,
|
||||
const gchar *user,
|
||||
const gchar *password,
|
||||
const gchar *auth_params,
|
||||
const gchar *host,
|
||||
gint port,
|
||||
const gchar *path,
|
||||
const gchar *query,
|
||||
const gchar *fragment);
|
||||
|
||||
/**
|
||||
* GUriHideFlags:
|
||||
* @G_URI_HIDE_NONE: No flags set.
|
||||
* @G_URI_HIDE_USERINFO: Hide the userinfo.
|
||||
* @G_URI_HIDE_PASSWORD: Hide the password.
|
||||
* @G_URI_HIDE_AUTH_PARAMS: Hide the auth_params.
|
||||
* @G_URI_HIDE_QUERY: Hide the query.
|
||||
* @G_URI_HIDE_FRAGMENT: Hide the fragment.
|
||||
*
|
||||
* Flags describing what parts of the URI to hide in
|
||||
* g_uri_to_string_partial(). Note that %G_URI_HIDE_PASSWORD and
|
||||
* %G_URI_HIDE_AUTH_PARAMS will only work if the #GUri was parsed with
|
||||
* the corresponding flags.
|
||||
*
|
||||
* Since: 2.66
|
||||
*/
|
||||
GLIB_AVAILABLE_TYPE_IN_2_66
|
||||
typedef enum {
|
||||
G_URI_HIDE_NONE = 0,
|
||||
G_URI_HIDE_USERINFO = 1 << 0,
|
||||
G_URI_HIDE_PASSWORD = 1 << 1,
|
||||
G_URI_HIDE_AUTH_PARAMS = 1 << 2,
|
||||
G_URI_HIDE_QUERY = 1 << 3,
|
||||
G_URI_HIDE_FRAGMENT = 1 << 4,
|
||||
} GUriHideFlags;
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
char * g_uri_to_string (GUri *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
char * g_uri_to_string_partial (GUri *uri,
|
||||
GUriHideFlags flags);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
const gchar *g_uri_get_scheme (GUri *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
const gchar *g_uri_get_userinfo (GUri *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
const gchar *g_uri_get_user (GUri *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
const gchar *g_uri_get_password (GUri *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
const gchar *g_uri_get_auth_params (GUri *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
const gchar *g_uri_get_host (GUri *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gint g_uri_get_port (GUri *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
const gchar *g_uri_get_path (GUri *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
const gchar *g_uri_get_query (GUri *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
const gchar *g_uri_get_fragment (GUri *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GUriFlags g_uri_get_flags (GUri *uri);
|
||||
|
||||
/**
|
||||
* GUriParamsFlags:
|
||||
* @G_URI_PARAMS_NONE: No flags set.
|
||||
* @G_URI_PARAMS_CASE_INSENSITIVE: Parameter names are case insensitive.
|
||||
* @G_URI_PARAMS_WWW_FORM: Replace `+` with space character. Only useful for
|
||||
* URLs on the web, using the `https` or `http` schemas.
|
||||
* @G_URI_PARAMS_PARSE_RELAXED: See %G_URI_FLAGS_PARSE_RELAXED.
|
||||
*
|
||||
* Flags modifying the way parameters are handled by g_uri_parse_params() and
|
||||
* #GUriParamsIter.
|
||||
*
|
||||
* Since: 2.66
|
||||
*/
|
||||
GLIB_AVAILABLE_TYPE_IN_2_66
|
||||
typedef enum {
|
||||
G_URI_PARAMS_NONE = 0,
|
||||
G_URI_PARAMS_CASE_INSENSITIVE = 1 << 0,
|
||||
G_URI_PARAMS_WWW_FORM = 1 << 1,
|
||||
G_URI_PARAMS_PARSE_RELAXED = 1 << 2,
|
||||
} GUriParamsFlags;
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GHashTable *g_uri_parse_params (const gchar *params,
|
||||
gssize length,
|
||||
const gchar *separators,
|
||||
GUriParamsFlags flags,
|
||||
GError **error);
|
||||
|
||||
typedef struct _GUriParamsIter GUriParamsIter;
|
||||
|
||||
struct _GUriParamsIter
|
||||
{
|
||||
/*< private >*/
|
||||
gint dummy0;
|
||||
gpointer dummy1;
|
||||
gpointer dummy2;
|
||||
guint8 dummy3[256];
|
||||
};
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
void g_uri_params_iter_init (GUriParamsIter *iter,
|
||||
const gchar *params,
|
||||
gssize length,
|
||||
const gchar *separators,
|
||||
GUriParamsFlags flags);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gboolean g_uri_params_iter_next (GUriParamsIter *iter,
|
||||
gchar **attribute,
|
||||
gchar **value,
|
||||
GError **error);
|
||||
|
||||
/**
|
||||
* G_URI_ERROR:
|
||||
*
|
||||
* Error domain for URI methods. Errors in this domain will be from
|
||||
* the #GUriError enumeration. See #GError for information on error
|
||||
* domains.
|
||||
*
|
||||
* Since: 2.66
|
||||
*/
|
||||
#define G_URI_ERROR (g_uri_error_quark ()) GLIB_AVAILABLE_MACRO_IN_2_66
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GQuark g_uri_error_quark (void);
|
||||
|
||||
/**
|
||||
* GUriError:
|
||||
* @G_URI_ERROR_FAILED: Generic error if no more specific error is available.
|
||||
* See the error message for details.
|
||||
* @G_URI_ERROR_BAD_SCHEME: The scheme of a URI could not be parsed.
|
||||
* @G_URI_ERROR_BAD_USER: The user/userinfo of a URI could not be parsed.
|
||||
* @G_URI_ERROR_BAD_PASSWORD: The password of a URI could not be parsed.
|
||||
* @G_URI_ERROR_BAD_AUTH_PARAMS: The authentication parameters of a URI could not be parsed.
|
||||
* @G_URI_ERROR_BAD_HOST: The host of a URI could not be parsed.
|
||||
* @G_URI_ERROR_BAD_PORT: The port of a URI could not be parsed.
|
||||
* @G_URI_ERROR_BAD_PATH: The path of a URI could not be parsed.
|
||||
* @G_URI_ERROR_BAD_QUERY: The query of a URI could not be parsed.
|
||||
* @G_URI_ERROR_BAD_FRAGMENT: The fragment of a URI could not be parsed.
|
||||
*
|
||||
* Error codes returned by #GUri methods.
|
||||
*
|
||||
* Since: 2.66
|
||||
*/
|
||||
typedef enum {
|
||||
G_URI_ERROR_FAILED,
|
||||
G_URI_ERROR_BAD_SCHEME,
|
||||
G_URI_ERROR_BAD_USER,
|
||||
G_URI_ERROR_BAD_PASSWORD,
|
||||
G_URI_ERROR_BAD_AUTH_PARAMS,
|
||||
G_URI_ERROR_BAD_HOST,
|
||||
G_URI_ERROR_BAD_PORT,
|
||||
G_URI_ERROR_BAD_PATH,
|
||||
G_URI_ERROR_BAD_QUERY,
|
||||
G_URI_ERROR_BAD_FRAGMENT,
|
||||
} GUriError;
|
||||
|
||||
/**
|
||||
* G_URI_RESERVED_CHARS_GENERIC_DELIMITERS:
|
||||
*
|
||||
* Generic delimiters characters as defined in
|
||||
* [RFC 3986](https://tools.ietf.org/html/rfc3986). Includes `:/?#[]@`.
|
||||
*
|
||||
* Since: 2.16
|
||||
**/
|
||||
#define G_URI_RESERVED_CHARS_GENERIC_DELIMITERS ":/?#[]@"
|
||||
|
||||
/**
|
||||
* G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS:
|
||||
*
|
||||
* Subcomponent delimiter characters as defined in
|
||||
* [RFC 3986](https://tools.ietf.org/html/rfc3986). Includes `!$&'()*+,;=`.
|
||||
*
|
||||
* Since: 2.16
|
||||
**/
|
||||
#define G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS "!$&'()*+,;="
|
||||
|
||||
/**
|
||||
* G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT:
|
||||
*
|
||||
* Allowed characters in path elements. Includes `!$&'()*+,;=:@`.
|
||||
*
|
||||
* Since: 2.16
|
||||
**/
|
||||
#define G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":@"
|
||||
|
||||
/**
|
||||
* G_URI_RESERVED_CHARS_ALLOWED_IN_PATH:
|
||||
*
|
||||
* Allowed characters in a path. Includes `!$&'()*+,;=:@/`.
|
||||
*
|
||||
* Since: 2.16
|
||||
**/
|
||||
#define G_URI_RESERVED_CHARS_ALLOWED_IN_PATH G_URI_RESERVED_CHARS_ALLOWED_IN_PATH_ELEMENT "/"
|
||||
|
||||
/**
|
||||
* G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO:
|
||||
*
|
||||
* Allowed characters in userinfo as defined in
|
||||
* [RFC 3986](https://tools.ietf.org/html/rfc3986). Includes `!$&'()*+,;=:`.
|
||||
*
|
||||
* Since: 2.16
|
||||
**/
|
||||
#define G_URI_RESERVED_CHARS_ALLOWED_IN_USERINFO G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS ":"
|
||||
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
char * g_uri_unescape_string (const char *escaped_string,
|
||||
const char *illegal_characters);
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
char * g_uri_unescape_segment (const char *escaped_string,
|
||||
const char *escaped_string_end,
|
||||
const char *illegal_characters);
|
||||
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
char * g_uri_parse_scheme (const char *uri);
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
const char *g_uri_peek_scheme (const char *uri);
|
||||
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
char * g_uri_escape_string (const char *unescaped,
|
||||
const char *reserved_chars_allowed,
|
||||
gboolean allow_utf8);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GBytes * g_uri_unescape_bytes (const char *escaped_string,
|
||||
gssize length,
|
||||
const char *illegal_characters,
|
||||
GError **error);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
char * g_uri_escape_bytes (const guint8 *unescaped,
|
||||
gsize length,
|
||||
const char *reserved_chars_allowed);
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
G_END_DECLS
|
|
@ -235,6 +235,16 @@
|
|||
*/
|
||||
#define GLIB_VERSION_2_64 (G_ENCODE_VERSION (2, 64))
|
||||
|
||||
/**
|
||||
* GLIB_VERSION_2_66:
|
||||
*
|
||||
* A macro that evaluates to the 2.66 version of GLib, in a format
|
||||
* that can be used by the C pre-processor.
|
||||
*
|
||||
* Since: 2.66
|
||||
*/
|
||||
#define GLIB_VERSION_2_66 (G_ENCODE_VERSION (2, 66))
|
||||
|
||||
/* evaluates to the current stable version; for development cycles,
|
||||
* this means the next stable target
|
||||
*/
|
||||
|
@ -636,11 +646,13 @@
|
|||
|
||||
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_44
|
||||
# define GLIB_AVAILABLE_IN_2_44 GLIB_UNAVAILABLE(2, 44)
|
||||
# define GLIB_AVAILABLE_STATIC_INLINE_IN_2_44 GLIB_UNAVAILABLE_STATIC_INLINE(2, 44)
|
||||
# define GLIB_AVAILABLE_MACRO_IN_2_44 GLIB_UNAVAILABLE_MACRO(2, 44)
|
||||
# define GLIB_AVAILABLE_ENUMERATOR_IN_2_44 GLIB_UNAVAILABLE_ENUMERATOR(2, 44)
|
||||
# define GLIB_AVAILABLE_TYPE_IN_2_44 GLIB_UNAVAILABLE_TYPE(2, 44)
|
||||
#else
|
||||
# define GLIB_AVAILABLE_IN_2_44 _GLIB_EXTERN
|
||||
# define GLIB_AVAILABLE_STATIC_INLINE_IN_2_44
|
||||
# define GLIB_AVAILABLE_MACRO_IN_2_44
|
||||
# define GLIB_AVAILABLE_ENUMERATOR_IN_2_44
|
||||
# define GLIB_AVAILABLE_TYPE_IN_2_44
|
||||
|
@ -888,11 +900,13 @@
|
|||
|
||||
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_60
|
||||
# define GLIB_AVAILABLE_IN_2_60 GLIB_UNAVAILABLE(2, 60)
|
||||
# define GLIB_AVAILABLE_STATIC_INLINE_IN_2_60 GLIB_UNAVAILABLE_STATIC_INLINE(2, 60)
|
||||
# define GLIB_AVAILABLE_MACRO_IN_2_60 GLIB_UNAVAILABLE_MACRO(2, 60)
|
||||
# define GLIB_AVAILABLE_ENUMERATOR_IN_2_60 GLIB_UNAVAILABLE_ENUMERATOR(2, 60)
|
||||
# define GLIB_AVAILABLE_TYPE_IN_2_60 GLIB_UNAVAILABLE_TYPE(2, 60)
|
||||
#else
|
||||
# define GLIB_AVAILABLE_IN_2_60 _GLIB_EXTERN
|
||||
# define GLIB_AVAILABLE_STATIC_INLINE_IN_2_60
|
||||
# define GLIB_AVAILABLE_MACRO_IN_2_60
|
||||
# define GLIB_AVAILABLE_ENUMERATOR_IN_2_60
|
||||
# define GLIB_AVAILABLE_TYPE_IN_2_60
|
||||
|
@ -920,11 +934,13 @@
|
|||
|
||||
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_62
|
||||
# define GLIB_AVAILABLE_IN_2_62 GLIB_UNAVAILABLE(2, 62)
|
||||
# define GLIB_AVAILABLE_STATIC_INLINE_IN_2_62 GLIB_UNAVAILABLE_STATIC_INLINE(2, 62)
|
||||
# define GLIB_AVAILABLE_MACRO_IN_2_62 GLIB_UNAVAILABLE_MACRO(2, 62)
|
||||
# define GLIB_AVAILABLE_ENUMERATOR_IN_2_62 GLIB_UNAVAILABLE_ENUMERATOR(2, 62)
|
||||
# define GLIB_AVAILABLE_TYPE_IN_2_62 GLIB_UNAVAILABLE_TYPE(2, 62)
|
||||
#else
|
||||
# define GLIB_AVAILABLE_IN_2_62 _GLIB_EXTERN
|
||||
# define GLIB_AVAILABLE_STATIC_INLINE_IN_2_62
|
||||
# define GLIB_AVAILABLE_MACRO_IN_2_62
|
||||
# define GLIB_AVAILABLE_ENUMERATOR_IN_2_62
|
||||
# define GLIB_AVAILABLE_TYPE_IN_2_62
|
||||
|
@ -952,14 +968,50 @@
|
|||
|
||||
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_64
|
||||
# define GLIB_AVAILABLE_IN_2_64 GLIB_UNAVAILABLE(2, 64)
|
||||
# define GLIB_AVAILABLE_STATIC_INLINE_IN_2_64 GLIB_UNAVAILABLE_STATIC_INLINE(2, 64)
|
||||
# define GLIB_AVAILABLE_MACRO_IN_2_64 GLIB_UNAVAILABLE_MACRO(2, 64)
|
||||
# define GLIB_AVAILABLE_ENUMERATOR_IN_2_64 GLIB_UNAVAILABLE_ENUMERATOR(2, 64)
|
||||
# define GLIB_AVAILABLE_TYPE_IN_2_64 GLIB_UNAVAILABLE_TYPE(2, 64)
|
||||
#else
|
||||
# define GLIB_AVAILABLE_IN_2_64 _GLIB_EXTERN
|
||||
# define GLIB_AVAILABLE_STATIC_INLINE_IN_2_64
|
||||
# define GLIB_AVAILABLE_MACRO_IN_2_64
|
||||
# define GLIB_AVAILABLE_ENUMERATOR_IN_2_64
|
||||
# define GLIB_AVAILABLE_TYPE_IN_2_64
|
||||
#endif
|
||||
|
||||
#if GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_66
|
||||
# define GLIB_DEPRECATED_IN_2_66 GLIB_DEPRECATED
|
||||
# define GLIB_DEPRECATED_IN_2_66_FOR(f) GLIB_DEPRECATED_FOR(f)
|
||||
# define GLIB_DEPRECATED_MACRO_IN_2_66 GLIB_DEPRECATED_MACRO
|
||||
# define GLIB_DEPRECATED_MACRO_IN_2_66_FOR(f) GLIB_DEPRECATED_MACRO_FOR(f)
|
||||
# define GLIB_DEPRECATED_ENUMERATOR_IN_2_66 GLIB_DEPRECATED_ENUMERATOR
|
||||
# define GLIB_DEPRECATED_ENUMERATOR_IN_2_66_FOR(f) GLIB_DEPRECATED_ENUMERATOR_FOR(f)
|
||||
# define GLIB_DEPRECATED_TYPE_IN_2_66 GLIB_DEPRECATED_TYPE
|
||||
# define GLIB_DEPRECATED_TYPE_IN_2_66_FOR(f) GLIB_DEPRECATED_TYPE_FOR(f)
|
||||
#else
|
||||
# define GLIB_DEPRECATED_IN_2_66 _GLIB_EXTERN
|
||||
# define GLIB_DEPRECATED_IN_2_66_FOR(f) _GLIB_EXTERN
|
||||
# define GLIB_DEPRECATED_MACRO_IN_2_66
|
||||
# define GLIB_DEPRECATED_MACRO_IN_2_66_FOR(f)
|
||||
# define GLIB_DEPRECATED_ENUMERATOR_IN_2_66
|
||||
# define GLIB_DEPRECATED_ENUMERATOR_IN_2_66_FOR(f)
|
||||
# define GLIB_DEPRECATED_TYPE_IN_2_66
|
||||
# define GLIB_DEPRECATED_TYPE_IN_2_66_FOR(f)
|
||||
#endif
|
||||
|
||||
#if GLIB_VERSION_MAX_ALLOWED < GLIB_VERSION_2_66
|
||||
# define GLIB_AVAILABLE_IN_2_66 GLIB_UNAVAILABLE(2, 66)
|
||||
# define GLIB_AVAILABLE_STATIC_INLINE_IN_2_66 GLIB_UNAVAILABLE_STATIC_INLINE(2, 66)
|
||||
# define GLIB_AVAILABLE_MACRO_IN_2_66 GLIB_UNAVAILABLE_MACRO(2, 66)
|
||||
# define GLIB_AVAILABLE_ENUMERATOR_IN_2_66 GLIB_UNAVAILABLE_ENUMERATOR(2, 66)
|
||||
# define GLIB_AVAILABLE_TYPE_IN_2_66 GLIB_UNAVAILABLE_TYPE(2, 66)
|
||||
#else
|
||||
# define GLIB_AVAILABLE_IN_2_66 _GLIB_EXTERN
|
||||
# define GLIB_AVAILABLE_STATIC_INLINE_IN_2_66
|
||||
# define GLIB_AVAILABLE_MACRO_IN_2_66
|
||||
# define GLIB_AVAILABLE_ENUMERATOR_IN_2_66
|
||||
# define GLIB_AVAILABLE_TYPE_IN_2_66
|
||||
#endif
|
||||
|
||||
#endif /* __G_VERSION_MACROS_H__ */
|
|
@ -202,7 +202,7 @@ struct _GClosure
|
|||
|
||||
/* invariants/constraints:
|
||||
* - ->marshal and ->data are _invalid_ as soon as ->is_invalid==TRUE
|
||||
* - invocation of all inotifiers occours prior to fnotifiers
|
||||
* - invocation of all inotifiers occurs prior to fnotifiers
|
||||
* - order of inotifiers is random
|
||||
* inotifiers may _not_ free/invalidate parameter values (e.g. ->data)
|
||||
* - order of fnotifiers is random
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* enumerations from "../gobject/../glib/gunicode.h" */
|
||||
/* enumerations from "../../../../source/glib/glib-2.66.3/gobject/../glib/gunicode.h" */
|
||||
GLIB_AVAILABLE_IN_2_60 GType g_unicode_type_get_type (void) G_GNUC_CONST;
|
||||
#define G_TYPE_UNICODE_TYPE (g_unicode_type_get_type ())
|
||||
GLIB_AVAILABLE_IN_2_60 GType g_unicode_break_type_get_type (void) G_GNUC_CONST;
|
|
@ -297,6 +297,15 @@ typedef gsize GType;
|
|||
*/
|
||||
#define G_TYPE_OPTION_GROUP (g_option_group_get_type ())
|
||||
|
||||
/**
|
||||
* G_TYPE_URI:
|
||||
*
|
||||
* The #GType for a boxed type holding a #GUri.
|
||||
*
|
||||
* Since: 2.66
|
||||
*/
|
||||
#define G_TYPE_URI (g_uri_get_type ())
|
||||
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
GType g_date_get_type (void) G_GNUC_CONST;
|
||||
GLIB_AVAILABLE_IN_ALL
|
||||
|
@ -353,6 +362,8 @@ GLIB_AVAILABLE_IN_2_40
|
|||
GType g_mapped_file_get_type (void) G_GNUC_CONST;
|
||||
GLIB_AVAILABLE_IN_2_44
|
||||
GType g_option_group_get_type (void) G_GNUC_CONST;
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
GType g_uri_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GLIB_DEPRECATED_FOR('G_TYPE_VARIANT')
|
||||
GType g_variant_get_gtype (void) G_GNUC_CONST;
|
|
@ -320,7 +320,7 @@ struct _GObjectClass
|
|||
GSList *construct_properties;
|
||||
|
||||
/*< public >*/
|
||||
/* seldom overidden */
|
||||
/* seldom overridden */
|
||||
GObject* (*constructor) (GType type,
|
||||
guint n_construct_properties,
|
||||
GObjectConstructParam *construct_properties);
|
||||
|
@ -335,7 +335,7 @@ struct _GObjectClass
|
|||
GParamSpec *pspec);
|
||||
void (*dispose) (GObject *object);
|
||||
void (*finalize) (GObject *object);
|
||||
/* seldom overidden */
|
||||
/* seldom overridden */
|
||||
void (*dispatch_properties_changed) (GObject *object,
|
||||
guint n_pspecs,
|
||||
GParamSpec **pspecs);
|
||||
|
@ -838,7 +838,7 @@ static inline void
|
|||
*
|
||||
* Updates a pointer to weakly refer to @new_object. It assigns @new_object
|
||||
* to @weak_pointer_location and ensures that @weak_pointer_location will
|
||||
* automaticaly be set to %NULL if @new_object gets destroyed. The assignment
|
||||
* automatically be set to %NULL if @new_object gets destroyed. The assignment
|
||||
* is not atomic. The weak reference is not thread-safe, see
|
||||
* g_object_add_weak_pointer() for details.
|
||||
*
|
|
@ -395,6 +395,9 @@ GLIB_AVAILABLE_IN_ALL
|
|||
GType g_param_type_register_static (const gchar *name,
|
||||
const GParamSpecTypeInfo *pspec_info);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_66
|
||||
gboolean g_param_spec_is_valid_name (const gchar *name);
|
||||
|
||||
/* For registering builting types */
|
||||
GType _g_param_type_register_static_constant (const gchar *name,
|
||||
const GParamSpecTypeInfo *pspec_info,
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue