mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2025-03-21 02:10:53 +00:00
Remove all the support stuff
This commit is contained in:
parent
724bca0eec
commit
644a807731
33 changed files with 0 additions and 2622 deletions
|
@ -1,92 +0,0 @@
|
|||
DROPBOX := dropbox_uploader.sh
|
||||
UNAME := $(shell uname -m)
|
||||
DOWNLOAD:= ../doc/html/download.c
|
||||
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
|
||||
ifneq ($(shell uname -m), x86_64)
|
||||
$(error Cannot build packages without an x86_64 capable CPU)
|
||||
endif
|
||||
|
||||
.NOTPARALLEL: base
|
||||
.NOTPARALLEL: upload
|
||||
|
||||
HEADER=\e[5;32;40m
|
||||
RESET=\e[0;37;40m
|
||||
INFO=\e[5;33;40m
|
||||
|
||||
base:
|
||||
@echo -e "\n$(HEADER)Building Debian packages ...$(RESET)"
|
||||
@echo -e " $(INFO)=> building 64-bit package$(RESET)"
|
||||
@$(MAKE) -C deb/ >/dev/null
|
||||
@echo -e " $(INFO)=> building 32-bit package$(RESET)"
|
||||
@$(MAKE) -C deb/ CARCH=i686 OPTIONAL_CFLAGS=-m32 OPTIONAL_LDFLAGS=-m32 >/dev/null
|
||||
|
||||
@echo -e "\n$(HEADER)Building ArchLinux packages ...$(RESET)"
|
||||
@echo -e " $(INFO)=> building 64-bit package$(RESET)"
|
||||
@$(MAKE) -C archlinux/this/ >/dev/null
|
||||
@echo -e " $(INFO)=> building 32-bit package$(RESET)"
|
||||
@$(MAKE) -C archlinux/this/ CARCH=i686 OPTIONAL_CFLAGS=-m32 OPTIONAL_LDFLAGS=-m32 >/dev/null
|
||||
|
||||
@echo -e "\n$(HEADER)Building ArchBSD packages ...$(RESET)"
|
||||
@echo -e " $(INFO)=> building 64-bit package$(RESET)"
|
||||
@$(MAKE) -C archbsd/this/ >/dev/null
|
||||
@echo -e " $(INFO)=> building 32-bit package$(RESET)"
|
||||
@$(MAKE) -C archbsd/this/ CARCH=i686 OPTIONAL_CFLAGS=-m32 OPTIONAL_LDFLAGS=-m32 >/dev/null
|
||||
|
||||
@echo -e "\n$(HEADER)Building Slackware packages ...$(RESET)"
|
||||
@echo -e " $(INFO)=> building 64-bit package$(RESET)"
|
||||
@$(MAKE) -C slackware/this/ >/dev/null
|
||||
@echo -e " $(INFO)=> building 32-bit package$(RESET)"
|
||||
@$(MAKE) -C slackware/this/ CARCH=i686 OPTIONAL_CFLAGS=-m32 OPTIONAL_LDFLAGS=-m32 >/dev/null
|
||||
|
||||
@echo -e "\n$(HEADER)Building Fedora packages ...$(RESET)"
|
||||
@echo -e " $(INFO)=> building 64-bit package$(RESET)"
|
||||
@$(MAKE) -C fedora/this/ >/dev/null
|
||||
|
||||
@echo -e "\n\$(HEADER)Building Windows packages ...$(RESET)"
|
||||
@echo -e " $(INFO)=> building 64-bit package$(RESET)"
|
||||
@$(MAKE) -C win64/ >/dev/null
|
||||
@echo -e " $(INFO)=> building 32-bit package$(RESET)"
|
||||
@$(MAKE) -C win32/ >/dev/null
|
||||
|
||||
@rm -rf pkgs/
|
||||
@mkdir pkgs/
|
||||
@mv deb/*.deb ./pkgs/
|
||||
@mv archlinux/this/*pkg.tar.xz ./pkgs/
|
||||
@mv archbsd/this/*pkg.tar.xz ./pkgs/
|
||||
@mv win32/*.zip ./pkgs/
|
||||
@mv win64/*.zip ./pkgs/
|
||||
@mv slackware/this/*.txz ./pkgs/
|
||||
@mv fedora/this/*.rpm ./pkgs/
|
||||
|
||||
@echo -e "\n\n$(HEADER)Completed:$(RESET)"
|
||||
@find ./pkgs/ -type f -regex ".*/.*\.\(xz\|deb\|zip\|txz\|rpm\)" -exec echo -e " $(INFO)=>$(RESET) {}" \;
|
||||
|
||||
upload:
|
||||
@echo "APPKEY:76vh3q42hnvmzm3" > dropbox_config
|
||||
@echo "APPSECRET:tmeecht2cmh72xa" >> dropbox_config
|
||||
@echo "ACCESS_LEVEL:sandbox" >> dropbox_config
|
||||
@echo "OAUTH_ACCESS_TOKEN:w0bxzf0dft8edfq" >> dropbox_config
|
||||
@echo "OAUTH_ACCESS_TOKEN_SECRET:9vosx7x8gy4kgjk" >> dropbox_config
|
||||
@wget -q "http://raw.github.com/andreafabrizi/Dropbox-Uploader/master/dropbox_uploader.sh"
|
||||
@chmod +x dropbox_uploader.sh
|
||||
@sed -i -e "s/~\/.dropbox_uploader/.\/dropbox_config/g" $$(basename $(DROPBOX))
|
||||
@find ./pkgs -type f -regex ".*/.*\.\(xz\|deb\|zip\|txz\|rpm\)" -exec ./$$(basename $(DROPBOX)) upload {} \;
|
||||
@rm dropbox_config dropbox_uploader.sh
|
||||
|
||||
website:
|
||||
$(CC) $(DOWNLOAD) -o html.gen
|
||||
@./html.gen ../
|
||||
@rm html.gen
|
||||
@git stash
|
||||
@git checkout gh-pages
|
||||
@rm -f ../download.html
|
||||
@mv -f download.html ../download.html
|
||||
@cd ..; git add download.html; git commit -m 'update download page'; git push origin gh-pages;
|
||||
@git checkout $(BRANCH)
|
||||
@git stash apply
|
||||
|
||||
clean:
|
||||
@rm -rf pkgs/
|
||||
@rm -f *.html
|
||||
|
||||
all: base upload
|
|
@ -1,55 +0,0 @@
|
|||
# Contributor: matthiaskrgr <matthiaskrgr _strange_curverd_character_ freedroid D0T org>
|
||||
# Contributor: Wolfgang Bumiller <blub@speed.at>
|
||||
|
||||
pkgname=gmqcc-git
|
||||
pkgver=20131031
|
||||
pkgrel=1
|
||||
pkgdesc="An Improved Quake C Compiler"
|
||||
arch=('i686' 'x86_64')
|
||||
depends=()
|
||||
conflicts=('gmqcc')
|
||||
provides=('gmqcc=0.3.5')
|
||||
makedepends=('git')
|
||||
url="https://github.com/graphitemaster/gmqcc.git"
|
||||
license=('MIT')
|
||||
|
||||
_gitroot="git://github.com/graphitemaster/gmqcc.git"
|
||||
_gitname="gmqcc"
|
||||
|
||||
build() {
|
||||
cd $srcdir
|
||||
msg "Connecting to the GIT server..."
|
||||
if [[ -d $srcdir/$_gitname ]] ; then
|
||||
cd $_gitname
|
||||
msg "Removing build files..."
|
||||
git clean -dfx
|
||||
msg "Updating..."
|
||||
git pull --no-tags
|
||||
msg "The local files are updated."
|
||||
else
|
||||
msg "Cloning..."
|
||||
git clone $_gitroot $_gitname --depth 1
|
||||
msg "Clone done."
|
||||
fi
|
||||
|
||||
msg "Starting compilation..."
|
||||
cd "$srcdir"/"$_gitname"
|
||||
|
||||
msg "Compiling..."
|
||||
gmake
|
||||
}
|
||||
|
||||
check() {
|
||||
cd "$srcdir"/"$_gitname"
|
||||
gmake check
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir"/"$_gitname"
|
||||
msg "Compiling and installing to pkgdir this time..."
|
||||
gmake install DESTDIR=$pkgdir PREFIX=/usr
|
||||
msg "Compiling done."
|
||||
|
||||
install -dm755 ${pkgdir}/usr/share/licenses/gmqcc
|
||||
install -m644 LICENSE ${pkgdir}/usr/share/licenses/gmqcc/LICENSE
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
# Contributor: matthiaskrgr <matthiaskrgr _strange_curverd_character_ freedroid D0T org>
|
||||
# Contributor: Wolfgang Bumiller <blub@speed.at>
|
||||
|
||||
pkgname=gmqcc
|
||||
pkgver=0.3.5
|
||||
pkgrel=1
|
||||
pkgdesc="An Improved Quake C Compiler"
|
||||
arch=('i686' 'x86_64')
|
||||
depends=()
|
||||
url="https://github.com/graphitemaster/gmqcc.git"
|
||||
license=('MIT')
|
||||
source=(gmqcc-$pkgver.zip::https://github.com/graphitemaster/gmqcc/zipball/$pkgver)
|
||||
sha1sums=('69085478f48f04eefbd2a088c1bd8c266b59f952')
|
||||
|
||||
_gitname=graphitemaster-gmqcc-7f2b206/
|
||||
|
||||
build() {
|
||||
msg "Starting compilation..."
|
||||
cd "$srcdir"/"$_gitname"
|
||||
|
||||
msg "Compiling..."
|
||||
gmake
|
||||
}
|
||||
|
||||
check() {
|
||||
cd "$srcdir"/"$_gitname"
|
||||
gmake check
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir"/"$_gitname"
|
||||
msg "Compiling and installing to pkgdir this time..."
|
||||
gmake install DESTDIR=$pkgdir PREFIX=/usr
|
||||
msg "Compiling done."
|
||||
|
||||
install -dm755 ${pkgdir}/usr/share/licenses/gmqcc
|
||||
install -m644 LICENSE ${pkgdir}/usr/share/licenses/gmqcc/LICENSE
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
all:
|
||||
$(MAKE) -f ../../archlinux/this/Makefile \
|
||||
LIBC_DEPEND=libc \
|
||||
DESTDIR=distro/archbsd/this \
|
||||
SUFFIX=archbsd
|
|
@ -1,60 +0,0 @@
|
|||
# Contributor: matthiaskrgr <matthiaskrgr _strange_curverd_character_ freedroid D0T org>
|
||||
|
||||
pkgname=gmqcc-git
|
||||
pkgver=0.3.5
|
||||
pkgver(){
|
||||
cd gmqcc
|
||||
git describe --tags | sed -e 's/^gmqcc\-//' -e 's/-/./g'
|
||||
}
|
||||
pkgrel=1
|
||||
pkgdesc="An Improved Quake C Compiler"
|
||||
arch=('i686' 'x86_64')
|
||||
depends=('glibc')
|
||||
conflicts=('gmqcc')
|
||||
provides=('gmqcc=0.3.5')
|
||||
makedepends=('git')
|
||||
url="https://github.com/graphitemaster/gmqcc.git"
|
||||
license=('MIT')
|
||||
source=('gmqcc::git://github.com/graphitemaster/gmqcc.git')
|
||||
sha1sums=('SKIP')
|
||||
|
||||
|
||||
build() {
|
||||
msg "Starting compilation..."
|
||||
cd "$srcdir"/"gmqcc"
|
||||
|
||||
msg "Compiling..."
|
||||
make
|
||||
}
|
||||
|
||||
check() {
|
||||
cd "$srcdir"/"gmqcc"
|
||||
make check
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir"/"gmqcc"
|
||||
msg "Compiling and installing to pkgdir this time..."
|
||||
make install DESTDIR=$pkgdir PREFIX=/usr
|
||||
msg "Compiling done."
|
||||
|
||||
install -dm755 ${pkgdir}/usr/share/geany
|
||||
install -m644 syntax/geany/filetypes.qc \
|
||||
${pkgdir}/usr/share/geany/filetypes.qc
|
||||
|
||||
install -dm755 ${pkgdir}/usr/share/gtksourceview-3.0/language-specs
|
||||
install -m644 syntax/gtksourceview/qc.lang \
|
||||
${pkgdir}/usr/share/gtksourceview-3.0/language-specs/qc.lang
|
||||
|
||||
install -dm755 ${pkgdir}/usr/share/apps/katepart/syntax
|
||||
install -m644 syntax/kate/qc.xml \
|
||||
${pkgdir}/usr/share/apps/katepart/syntax/qc.xml
|
||||
|
||||
install -dm755 ${pkgdir}/usr/share/nano
|
||||
install -m644 syntax/nano/qc.nanorc \
|
||||
${pkgdir}/usr/share/nano/qc.nanorc
|
||||
|
||||
install -dm755 ${pkgdir}/usr/share/licenses/gmqcc
|
||||
install -m644 LICENSE \
|
||||
${pkgdir}/usr/share/licenses/gmqcc/LICENSE
|
||||
}
|
|
@ -1,38 +0,0 @@
|
|||
# Contributor: matthiaskrgr <matthiaskrgr _strange_curverd_character_ freedroid D0T org>
|
||||
# Contributor: Wolfgang Bumiller <blub@speed.at>
|
||||
|
||||
pkgname=gmqcc
|
||||
pkgver=0.3.5
|
||||
pkgrel=1
|
||||
pkgdesc="An Improved Quake C Compiler"
|
||||
arch=('i686' 'x86_64')
|
||||
depends=('glibc')
|
||||
url="https://github.com/graphitemaster/gmqcc.git"
|
||||
license=('MIT')
|
||||
source=(gmqcc-$pkgver.zip::https://github.com/graphitemaster/gmqcc/zipball/$pkgver)
|
||||
sha1sums=('69085478f48f04eefbd2a088c1bd8c266b59f952')
|
||||
|
||||
_gitname=graphitemaster-gmqcc-7f2b206/
|
||||
|
||||
build() {
|
||||
msg "Starting compilation..."
|
||||
cd "$srcdir"/"$_gitname"
|
||||
|
||||
msg "Compiling..."
|
||||
make
|
||||
}
|
||||
|
||||
check() {
|
||||
cd "$srcdir"/"$_gitname"
|
||||
make check
|
||||
}
|
||||
|
||||
package() {
|
||||
cd "$srcdir"/"$_gitname"
|
||||
msg "Compiling and installing to pkgdir this time..."
|
||||
make install DESTDIR=$pkgdir PREFIX=/usr
|
||||
msg "Compiling done."
|
||||
|
||||
install -dm755 ${pkgdir}/usr/share/licenses/gmqcc
|
||||
install -m644 LICENSE ${pkgdir}/usr/share/licenses/gmqcc/LICENSE
|
||||
}
|
|
@ -1,52 +0,0 @@
|
|||
BASEDIR := ../../../
|
||||
PREFIX := /usr
|
||||
HEADER := $(BASEDIR)/gmqcc.h
|
||||
MAJOR := $(shell sed -n -e '/GMQCC_VERSION_MAJOR/{s/.* .* //;p;q;}' $(HEADER))
|
||||
MINOR := $(shell sed -n -e '/GMQCC_VERSION_MINOR/{s/.* .* //;p;q;}' $(HEADER))
|
||||
PATCH := $(shell sed -n -e '/GMQCC_VERSION_PATCH/{s/.* .* //;p;q;}' $(HEADER))
|
||||
PKGREL := 1
|
||||
SUFFIX ?= archlinux
|
||||
CARCH := $(shell uname -m)
|
||||
PKGDIR := gmqcc-$(MAJOR).$(MINOR).$(PATCH)-$(PKGREL)-$(CARCH)-$(SUFFIX)
|
||||
TARCOMP := -J
|
||||
PKG := $(PKGDIR).pkg.tar.xz
|
||||
PKGINFO := $(PKGDIR)/.PKGINFO
|
||||
DESTDIR := distro/archlinux/this
|
||||
CFLAGS :=
|
||||
|
||||
LIBC_DEPEND := glibc
|
||||
|
||||
base:
|
||||
$(MAKE) -C $(BASEDIR) clean
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
$(MAKE) -C $(BASEDIR) "DESTDIR=$(DESTDIR)/$(PKGDIR)" "PREFIX=$(PREFIX)" strip install
|
||||
@echo "pkgname = gmqcc" > $(PKGINFO)
|
||||
@echo "pkgver = $(MAJOR).$(MINOR).$(PATCH)-$(PKGREL)" >> $(PKGINFO)
|
||||
@echo "pkgdesc = An Improved Quake C Compiler" >> $(PKGINFO)
|
||||
@echo "url = https://github.com/graphitemaster/gmqcc.git" >> $(PKGINFO)
|
||||
@echo "builddate = `date -u \"+%s\"`" >> $(PKGINFO)
|
||||
@echo "packager = Unknown Packager" >> $(PKGINFO)
|
||||
@echo "size = `du -sk $(PKGDIR) | awk '{print $$1 * 1024}'`" >> $(PKGINFO)
|
||||
@echo "arch = $(CARCH)" >> $(PKGINFO)
|
||||
@echo "license = MIT" >> $(PKGINFO)
|
||||
@echo "conflict = gmqcc" >> $(PKGINFO)
|
||||
@echo "depend = $(LIBC_DEPEND)" >> $(PKGINFO)
|
||||
@echo "makepkgopt = strip" >> $(PKGINFO)
|
||||
@echo "makepkgopt = docs" >> $(PKGINFO)
|
||||
@echo "makepkgopt = libtool" >> $(PKGINFO)
|
||||
@echo "makepkgopt = emptydirs" >> $(PKGINFO)
|
||||
@echo "makepkgopt = zipman" >> $(PKGINFO)
|
||||
@echo "makepkgopt = purge" >> $(PKGINFO)
|
||||
@echo "makepkgopt = !upx" >> $(PKGINFO)
|
||||
@bsdtar -C $(PKGDIR) -czf $(PKGDIR)/.MTREE \
|
||||
--format=mtree \
|
||||
--options='!all,use-set,type,uid,gid,mode,time,size,md5,sha256,link' \
|
||||
.PKGINFO usr/ 2>&1 >/dev/null
|
||||
@bsdtar $(TARCOMP) -cvf $(PKG) -C $(PKGDIR)/ .PKGINFO .MTREE usr/ 2>&1 >/dev/null
|
||||
@rm -rf $(PKGDIR)
|
||||
|
||||
clean:
|
||||
$(MAKE) -C $(BASEDIR) clean
|
||||
@rm -f *.pkg.tar.xz
|
||||
|
||||
all: base
|
|
@ -1,45 +0,0 @@
|
|||
BASEDIR := ../..
|
||||
PREFIX := /usr
|
||||
HEADER := $(BASEDIR)/gmqcc.h
|
||||
MAJOR := `sed -n -e '/GMQCC_VERSION_MAJOR/{s/.* .* //;p;q;}' $(HEADER)`
|
||||
MINOR := `sed -n -e '/GMQCC_VERSION_MINOR/{s/.* .* //;p;q;}' $(HEADER)`
|
||||
PATCH := `sed -n -e '/GMQCC_VERSION_PATCH/{s/.* .* //;p;q;}' $(HEADER)`
|
||||
DEBDIR := gmqcc-$(MAJOR).$(MINOR).$(PATCH)
|
||||
CARCH := $(shell uname -m)
|
||||
DEB := $(DEBDIR)-$(CARCH).deb
|
||||
CONTROL := $(DEBDIR)/DEBIAN/control
|
||||
|
||||
ifneq (, $(findstring i686, $(CARCH)))
|
||||
CFLAGS += -m32
|
||||
LDFLAGS += -m32
|
||||
endif
|
||||
|
||||
base:
|
||||
$(MAKE) -C $(BASEDIR) clean
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
$(MAKE) -C $(BASEDIR) DESTDIR=distro/deb/$(DEBDIR) PREFIX=$(PREFIX) strip install
|
||||
@install -d -m755 $(DEBDIR)/DEBIAN
|
||||
@echo "Package: gmqcc" > $(CONTROL)
|
||||
@echo "Version: $(MAJOR).$(MINOR).$(PATCH)" >> $(CONTROL)
|
||||
@echo "Section: user/hidden" >> $(CONTROL)
|
||||
@echo "Priority: optional" >> $(CONTROL)
|
||||
@echo "Architecture: $(CARCH)" >> $(CONTROL)
|
||||
@echo "Installed-Size: `du -ks $($(DEBDIR)/usr) | cut -f 1`" >> $(CONTROL)
|
||||
@echo "Maintainer: Dale Weiler <killfieldengine@gmail.com>" >> $(CONTROL)
|
||||
@echo "Description: An improved Quake C Compiler" >> $(CONTROL)
|
||||
@echo " For an enduring period of time the options for a decent compiler for the Quake C programming language" >> $(CONTROL)
|
||||
@echo " were confined to a specific compiler known as QCC. Attempts were made to extend and improve upon the" >> $(CONTROL)
|
||||
@echo " design of QCC, but many foreseen the consequences of building on a broken foundation. The solution" >> $(CONTROL)
|
||||
@echo " was obvious, a new compiler; one born from the NIH realm of sarcastic wit. We welcome you. You won't" >> $(CONTROL)
|
||||
@echo " find a better Quake C compiler." >> $(CONTROL)
|
||||
@tar czf data.tar.gz -C $(DEBDIR)/ . --exclude=DEBIAN
|
||||
@tar czf control.tar.gz -C $(DEBDIR)/DEBIAN/ .
|
||||
@echo 2.0 > debian-binary
|
||||
@ar r $(DEB) debian-binary control.tar.gz data.tar.gz 2>&1 >/dev/null
|
||||
@rm -rf debian-binary control.tar.gz data.tar.gz $(DEBDIR)
|
||||
|
||||
clean:
|
||||
$(MAKE) -C $(BASEDIR) clean
|
||||
@rm -f *.deb
|
||||
|
||||
all: base
|
|
@ -1,31 +0,0 @@
|
|||
File is constantly updated!
|
||||
|
||||
Since Fedora 19 we have this package in main repos. Please use it!
|
||||
|
||||
For install gmqcc do this:
|
||||
# yum install gmqcc
|
||||
|
||||
For install qcvm do this:
|
||||
# yum install qcvm
|
||||
|
||||
For install gmqpak do this:
|
||||
# yum install gmqpak
|
||||
|
||||
To use the spec files in this fedora directory you need the core
|
||||
development tools , building enviroment for the user, and
|
||||
the directory structure for it. If you don't already have these, issue
|
||||
the following commands.
|
||||
|
||||
# yum groupinstall "Development Tools"
|
||||
# yum install rpmdevtools
|
||||
$ rm -rf ~/rpmbuild
|
||||
$ rpmdev-setuptree
|
||||
|
||||
Prepare and build the RPMs.
|
||||
|
||||
$ cp gmqcc.spec ~/rpmbuild/SPECS/
|
||||
$ wget https://github.com/graphitemaster/gmqcc/archive/0.3.5.tar.gz -o ~/rpmbuild/SOURCES/gmqcc-0.3.5.tar.gz
|
||||
$ rpmbuild -ba ~/rpmbuild/SPECS/gmqcc.spec
|
||||
|
||||
Now we have RPMs in ~/rpmbuild/RPMS/ and you can install it via yum.
|
||||
|
|
@ -1,96 +0,0 @@
|
|||
Name: gmqcc
|
||||
Version: 0.3.6
|
||||
Release: 2%{?dist}
|
||||
Summary: Improved Quake C Compiler
|
||||
License: MIT
|
||||
URL: http://graphitemaster.github.io/gmqcc/
|
||||
Source0: https://github.com/graphitemaster/%{name}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
||||
|
||||
# tests fail on big endians
|
||||
ExclusiveArch: %{ix86} x86_64 %{arm}
|
||||
|
||||
%description
|
||||
Modern written-from-scratch compiler for the QuakeC language with
|
||||
support for many common features found in other QC compilers.
|
||||
|
||||
%package -n qcvm
|
||||
Summary: Standalone QuakeC VM binary executor
|
||||
|
||||
%description -n qcvm
|
||||
Executor for QuakeC VM binary files created using a QC compiler such
|
||||
as gmqcc or fteqcc. It provides a small set of built-in functions, and
|
||||
by default executes the main function if there is one. Some options
|
||||
useful for debugging are available as well.
|
||||
|
||||
%package -n gmqpak
|
||||
Summary: Standalone Quake PAK file utility
|
||||
|
||||
%description -n gmqpak
|
||||
Standalone Quake PAK file utility supporting the extraction of files,
|
||||
directories, or whole PAKs, as well as the opposite (creation of PAK files).
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
echo '#!/bin/sh' > ./configure
|
||||
chmod +x ./configure
|
||||
|
||||
# and for all for all of those switches they increase the runtime of the compile
|
||||
# making compiles of code slower
|
||||
|
||||
# we don't need compile time buffer protection, we test with clang's address
|
||||
# sanatizer and valgrind before releases
|
||||
%global optflags %(echo %{optflags} | sed 's/-D_FORTIFY_SOURCE=2 //')
|
||||
# there is no exceptions in C
|
||||
%global optflags %(echo %{optflags} | sed 's/-fexceptions //')
|
||||
# same with clangs address sanatizer and valgrind testing
|
||||
%global optflags %(echo %{optflags} | sed 's/-fstack-protector-strong //')
|
||||
# buffer overflow protection is unrequired since most (if not all) allocations
|
||||
# happen dynamically and we have our own memory allocator which checks this
|
||||
# (with valgrind integration), also clang's address santatizer cathes it as
|
||||
# for grecord-gcc-switches, that just adds pointless information to the binary
|
||||
# increasing its size
|
||||
%global optflags %(echo %{optflags} | sed 's/--param=ssp-buffer-size=4 //')
|
||||
|
||||
%build
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
|
||||
%install
|
||||
%make_install PREFIX=%{_prefix}
|
||||
|
||||
%check
|
||||
make check
|
||||
|
||||
%files
|
||||
%doc LICENSE README AUTHORS CHANGES TODO
|
||||
%doc gmqcc.ini.example
|
||||
%{_mandir}/man1/gmqcc.1*
|
||||
%{_bindir}/gmqcc
|
||||
|
||||
%files -n qcvm
|
||||
%doc LICENSE README AUTHORS CHANGES TODO
|
||||
%{_mandir}/man1/qcvm.1*
|
||||
%{_bindir}/qcvm
|
||||
|
||||
%files -n gmqpak
|
||||
%doc LICENSE README AUTHORS CHANGES TODO
|
||||
%{_mandir}/man1/gmqpak.1*
|
||||
%{_bindir}/gmqpak
|
||||
|
||||
%changelog
|
||||
* Sat Nov 16 2013 Dan Horák <dan[at]danny.cz> - 0.3.5-2
|
||||
- fix build on big endian arches
|
||||
- use the standard wildcarded filename for man pages
|
||||
- and make it Exclusive for little endians because tests fail on big endians
|
||||
|
||||
* Thu Nov 14 2013 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.3.5-1
|
||||
- 0.3.5 upstream release
|
||||
|
||||
* Thu Sep 26 2013 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.3.0-2
|
||||
- Optimizing compile flags
|
||||
|
||||
* Fri Sep 20 2013 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.3.0-1
|
||||
- Update to 0.3.0 (improved new package: gmqpak)
|
||||
|
||||
* Sat Jul 27 2013 Igor Gnatenko <i.gnatenko.brain@gmail.com> - 0.2.9-1
|
||||
- Initial release
|
|
@ -1,21 +0,0 @@
|
|||
BASEDIR := $(CURDIR)/../../..
|
||||
HEADER := $(BASEDIR)/gmqcc.h
|
||||
MAJOR := `sed -n -e '/GMQCC_VERSION_MAJOR/{s/.* .* //;p;q;}' $(HEADER)`
|
||||
MINOR := `sed -n -e '/GMQCC_VERSION_MINOR/{s/.* .* //;p;q;}' $(HEADER)`
|
||||
PATCH := `sed -n -e '/GMQCC_VERSION_PATCH/{s/.* .* //;p;q;}' $(HEADER)`
|
||||
NAME := gmqcc-$(MAJOR).$(MINOR).$(PATCH)
|
||||
TARFILE := $(NAME).tar.gz
|
||||
|
||||
all:
|
||||
@mkdir -p ~/rpmbuild/SPECS
|
||||
@mkdir -p ~/rpmbuild/SOURCES
|
||||
@cp ../spec/gmqcc.spec ~/rpmbuild/SPECS
|
||||
@mkdir -p /tmp/$(NAME)
|
||||
@cp -R $(BASEDIR) /tmp/$(NAME)/
|
||||
@cd /tmp && tar -zcf ~/rpmbuild/SOURCES/$(TARFILE) $(NAME)/
|
||||
@rm -rf /tmp/$(NAME)
|
||||
@rpmbuild -ba ../spec/gmqcc.spec 2>&1 >/dev/null
|
||||
|
||||
@mv ~/rpmbuild/RPMS/x86_64/gmqcc*.rpm . 2>/dev/null; true
|
||||
@mv ~/rpmbuild/RPMS/x86_64/qcvm*.rpm . 2>/dev/null; true
|
||||
@mv ~/rpmbuild/RPMS/x86_64/gmqpak*.rpm . 2>/dev/null; true
|
|
@ -1,35 +0,0 @@
|
|||
To use the ebuilds provided in this gentoo directory you first must
|
||||
create a directory in your overlay tree.
|
||||
|
||||
If you don't already have your own directory for custom ebuilds, you can
|
||||
create one. If you already have one, and that directory is set in your
|
||||
/etc/make.conf for PORTDIR_OVERLAY, this step can be skiped. Otherwise
|
||||
if you don't already, you can create one as such.
|
||||
|
||||
# mkdir -p /usr/local/portage
|
||||
# vim /etc/make.conf
|
||||
Set PORTDIR_OVERLAY=/usr/local/portage
|
||||
Then save and exit
|
||||
|
||||
Once that is completed, or you skiped that step, you need to create a
|
||||
directory in your overlay tree for gmqcc, this can be done as such:
|
||||
(subsitute [[PORTDIR_OVERLAY]] with the one set in /etc/make.conf)
|
||||
|
||||
# mkdir -p [[PORTDIR_OVERLAY]]/gmqcc
|
||||
|
||||
After the directory is created you need to move the correct version ebuild
|
||||
into that directory depending on which version of GMQCC you want. For
|
||||
instance, if you want gmqcc 0.3.0, you move gmqcc-0.3.0.ebuild into that
|
||||
directory.
|
||||
|
||||
# mv gmqcc-{version}.ebuild [[PORTDIR_OVERLAY]]/gmqcc/
|
||||
|
||||
After the file is moved into your newly created portage overlay tree, you'll
|
||||
need to build a digest for it with ebuild. A digest is simply a Manifest and
|
||||
digital signature for the source files used.
|
||||
|
||||
# ebuild gmqcc-0.3.0.ebuild digest
|
||||
|
||||
After the digest is built, you can emerge gmqcc as usual.
|
||||
|
||||
# emerge gmqcc
|
|
@ -1,20 +0,0 @@
|
|||
EAPI=5
|
||||
|
||||
DESCRIPTION="An Improved Quake C Compiler"
|
||||
HOMEPAGE="http://graphitemaster.github.com/gmqcc/"
|
||||
SRC_URI="https://github.com/graphitemaster/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
|
||||
|
||||
LICENSE="MIT"
|
||||
|
||||
SLOT="0"
|
||||
IUSE=""
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
src_prepare() {
|
||||
sed -i -e "s:-Werror ::" Makefile || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
emake install PREFIX="${D}/usr"
|
||||
dodoc README
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
BASEDIR := ../../../
|
||||
PREFIX := /usr
|
||||
HEADER := $(BASEDIR)/gmqcc.h
|
||||
MAJOR := $(shell sed -n -e '/GMQCC_VERSION_MAJOR/{s/.* .* //;p;q;}' $(HEADER))
|
||||
MINOR := $(shell sed -n -e '/GMQCC_VERSION_MINOR/{s/.* .* //;p;q;}' $(HEADER))
|
||||
PATCH := $(shell sed -n -e '/GMQCC_VERSION_PATCH/{s/.* .* //;p;q;}' $(HEADER))
|
||||
CARCH := $(shell uname -m)
|
||||
PKGDIR := gmqcc-$(MAJOR).$(MINOR).$(PATCH)-$(CARCH)
|
||||
PKG := $(PKGDIR).txz
|
||||
PKGINFO := $(PKGDIR)/.PKGINFO
|
||||
DESTDIR := distro/slackware/this/$(PKGDIR)
|
||||
CFLAGS :=
|
||||
|
||||
|
||||
ifneq (, $(findstring i686, $(CARCH)))
|
||||
CFLAGS += -m32
|
||||
LDFLAGS += -m32
|
||||
endif
|
||||
|
||||
base:
|
||||
$(MAKE) -C $(BASEDIR) clean
|
||||
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \
|
||||
$(MAKE) -C $(BASEDIR) "DESTDIR=$(DESTDIR)" "PREFIX=$(PREFIX)" strip install
|
||||
gzip -9 $(PKGDIR)/usr/share/man/man?/*.?
|
||||
strip -s $(PKGDIR)/usr/bin/*
|
||||
mkdir $(PKGDIR)/install
|
||||
cp slack-desc $(PKGDIR)/install
|
||||
@tar -cJvf $(PKG) -C $(PKGDIR)/ install/ usr/
|
||||
@rm -rf $(PKGDIR)
|
||||
|
||||
clean:
|
||||
$(MAKE) -C $(BASEDIR) clean
|
||||
@rm -f *.txz
|
||||
|
||||
all: base
|
|
@ -1,12 +0,0 @@
|
|||
|-----handy-ruler------------------------------------------------------|
|
||||
gmqcc: gmqcc (Quake C compiler)
|
||||
gmqcc:
|
||||
gmqcc: A modern written-from-scratch compiler for the QuakeC language with
|
||||
gmqcc: support for many common features found in other QC compilers.
|
||||
gmqcc: Additionally contains a standalone QCVM executor, and a tool to deal
|
||||
gmqcc: with .pak archive files.
|
||||
gmqcc:
|
||||
gmqcc:
|
||||
gmqcc: github page:
|
||||
gmqcc: http://github.com/graphitemaster/gmqcc
|
||||
gmqcc:
|
|
@ -1,22 +0,0 @@
|
|||
BASEDIR := ../..
|
||||
HEADER := $(BASEDIR)/gmqcc.h
|
||||
MAJOR := `sed -n -e '/GMQCC_VERSION_MAJOR/{s/.* .* //;p;q;}' $(HEADER)`
|
||||
MINOR := `sed -n -e '/GMQCC_VERSION_MINOR/{s/.* .* //;p;q;}' $(HEADER)`
|
||||
PATCH := `sed -n -e '/GMQCC_VERSION_PATCH/{s/.* .* //;p;q;}' $(HEADER)`
|
||||
BINDIR := gmqcc-$(MAJOR).$(MINOR).$(PATCH)
|
||||
|
||||
base:
|
||||
$(MAKE) CC=i686-w64-mingw32-gcc UNAME=MINGW -C $(BASEDIR) clean
|
||||
$(MAKE) CC=i686-w64-mingw32-gcc UNAME=MINGW -C $(BASEDIR) DESTDIR=distro/win32/$(BINDIR) PREFIX=/ strip install
|
||||
@mkdir -p $(BINDIR)/doc
|
||||
@groff -mandoc $(BINDIR)/man1/gmqpak.1 | ps2pdf - $(BINDIR)/doc/gmqpak.pdf
|
||||
@groff -mandoc $(BINDIR)/man1/qcvm.1 | ps2pdf - $(BINDIR)/doc/qcvm.pdf
|
||||
@groff -mandoc $(BINDIR)/man1/gmqcc.1 | ps2pdf - $(BINDIR)/doc/gmqcc.pdf
|
||||
@rm -rf $(BINDIR)/man1/
|
||||
@zip -r $(BINDIR)-win32.zip $(BINDIR)
|
||||
@rm -rf $(BINDIR)
|
||||
clean:
|
||||
$(MAKE) -C $(BASEDIR) clean
|
||||
@rm -f *.zip
|
||||
|
||||
all: base
|
|
@ -1,22 +0,0 @@
|
|||
BASEDIR := ../..
|
||||
HEADER := $(BASEDIR)/gmqcc.h
|
||||
MAJOR := `sed -n -e '/GMQCC_VERSION_MAJOR/{s/.* .* //;p;q;}' $(HEADER)`
|
||||
MINOR := `sed -n -e '/GMQCC_VERSION_MINOR/{s/.* .* //;p;q;}' $(HEADER)`
|
||||
PATCH := `sed -n -e '/GMQCC_VERSION_PATCH/{s/.* .* //;p;q;}' $(HEADER)`
|
||||
BINDIR := gmqcc-$(MAJOR).$(MINOR).$(PATCH)
|
||||
|
||||
base:
|
||||
$(MAKE) CC=x86_64-w64-mingw32-gcc UNAME=MINGW -C $(BASEDIR) clean
|
||||
$(MAKE) CC=x86_64-w64-mingw32-gcc UNAME=MINGW -C $(BASEDIR) DESTDIR=distro/win64/$(BINDIR) PREFIX=/ strip install
|
||||
@mkdir -p $(BINDIR)/doc
|
||||
@groff -mandoc $(BINDIR)/man1/gmqpak.1 | ps2pdf - $(BINDIR)/doc/gmqpak.pdf
|
||||
@groff -mandoc $(BINDIR)/man1/qcvm.1 | ps2pdf - $(BINDIR)/doc/qcvm.pdf
|
||||
@groff -mandoc $(BINDIR)/man1/gmqcc.1 | ps2pdf - $(BINDIR)/doc/gmqcc.pdf
|
||||
@rm -rf $(BINDIR)/man1/
|
||||
@zip -r $(BINDIR)-win64.zip $(BINDIR)
|
||||
@rm -rf $(BINDIR)
|
||||
clean:
|
||||
$(MAKE) -C $(BASEDIR) clean
|
||||
@rm -f *.zip
|
||||
|
||||
all: base
|
39
doc/gmqpak.1
39
doc/gmqpak.1
|
@ -1,39 +0,0 @@
|
|||
.\" gmqpak mdoc manpage
|
||||
.Dd April 27, 2013
|
||||
.Dt GMQPAK 2 PRM
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm gmqpak
|
||||
.Nd A standalone Quake PAK utility
|
||||
.Sh SYNOPSIS
|
||||
.Nm gmqpak
|
||||
.Op Cm options
|
||||
.Op Cm files
|
||||
.Sh DESCRIPTION
|
||||
.Nm gmqpak
|
||||
Is a standalone Quake PAK file utility supporting the extraction of files,
|
||||
directories, or whole PAKs, as well as the opposite (creation of PAK files).
|
||||
.Sh OPTIONS
|
||||
.Bl -tag -width indent
|
||||
.It Fl -file Ar file
|
||||
Specify the PAK file to create or extract
|
||||
.It Fl -e
|
||||
Used to denote the extraction operation on a PAK file.
|
||||
.It Fl -c
|
||||
Used to denote the creation operation on a PAK file.
|
||||
.El
|
||||
.Sh EXAMPLES
|
||||
Here's some examples of how to use the utility to manipulate PAK files.
|
||||
.Bl -ohang
|
||||
.It Li gmqpak -file id1.pak -e
|
||||
.D1 extracts a PAK to ./
|
||||
.It Li gmqpak -file new.pak -c file1 dir/file2
|
||||
.D1 creates a PAK with the files specified
|
||||
.It Li gmqpak -file new1.pak -c directory.
|
||||
.D1 creates a PAK from files within the directory, including subdirectories and files.
|
||||
.El
|
||||
.Sh AUTHOR
|
||||
See <http://graphitemaster.github.com/gmqcc>.
|
||||
.Sh BUGS
|
||||
Please report bugs on <http://github.com/graphitemaster/gmqcc/issues>,
|
||||
or see <http://graphitemaster.github.com/gmqcc> on how to contact us.
|
|
@ -1,293 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <errno.h>
|
||||
|
||||
/*
|
||||
* protect some information, not that I care, but this is just to stay
|
||||
* safer.
|
||||
*/
|
||||
#define SECURITY_BASE "\
|
||||
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
||||
#define SECURITY_TOKEN "\
|
||||
P29hdXRoX2NvbnN1bWVyX2tleT03NnZoM3E0Mmhudm16bTMmb2F1dGhfdG9rZW49\
|
||||
dzBieHpmMGRmdDhlZGZxJm9hdXRoX3NpZ25hdHVyZV9tZXRob2Q9UExBSU5URVhU\
|
||||
Jm9hdXRoX3NpZ25hdHVyZT10bWVlY2h0MmNtaDcyeGElMjY5dm9zeDd4OGd5NGtn\
|
||||
amsmb2F1dGhfdGltZXN0YW1wPSZvYXV0aF9ub25jZT0xMjE2NQo="
|
||||
|
||||
int isbase64(char c) {
|
||||
return !!(c && strchr(SECURITY_BASE, c) != NULL);
|
||||
}
|
||||
char value(char c) {
|
||||
const char *load = SECURITY_BASE;
|
||||
const char *find = strchr(load, c);
|
||||
|
||||
return (find) ? find - load : 0;
|
||||
}
|
||||
|
||||
int security_decode(unsigned char *dest, const unsigned char *src, int srclen) {
|
||||
unsigned char *p;
|
||||
|
||||
if(!*src)
|
||||
return 0;
|
||||
|
||||
*dest = 0;
|
||||
p = dest;
|
||||
|
||||
do {
|
||||
*p++ = (value(src[0]) << 2) | (value(src[1]) >> 4);
|
||||
*p++ = (value(src[1]) << 4) | (value(src[2]) >> 2);
|
||||
*p++ = (value(src[2]) << 6) | (value(src[3]) >> 0);
|
||||
|
||||
if(!isbase64(src[1])) {
|
||||
p -= 2;
|
||||
break;
|
||||
}
|
||||
else if(!isbase64(src[2])) {
|
||||
p -= 2;
|
||||
break;
|
||||
}
|
||||
else if(!isbase64(src[3])) {
|
||||
p--;
|
||||
break;
|
||||
}
|
||||
src += 4;
|
||||
|
||||
while(*src && (*src == 13 || *src == 10))
|
||||
src++;
|
||||
} while(srclen-= 4);
|
||||
|
||||
*p = 0;
|
||||
return p-dest;
|
||||
}
|
||||
|
||||
#define BASEURL " https://api-content.dropbox.com/1/files/sandbox/"
|
||||
|
||||
/*
|
||||
* If more platforms are supported add the entries between the start
|
||||
* tag here, and the end tag below. Nothing else needs to be done
|
||||
* <tag> (the table needs to match the HTML too)
|
||||
*/
|
||||
#define ARCHLINUX_32_REF "%sgmqcc-%c.%c.%c-1-i686.pkg.tar.xz%s"
|
||||
#define ARCHLINUX_64_REF "%sgmqcc-%c.%c.%c-1-x86_64.pkg.tar.xz%s"
|
||||
#define DEBIAN_32_REF "%sgmqcc-%c.%c.%c-i686.deb%s"
|
||||
#define DEBIAN_64_REF "%sgmqcc-%c.%c.%c-x86_64.deb%s"
|
||||
#define WINDOWS_32_REF "%sgmqcc-%c.%c.%c-win32.zip%s"
|
||||
#define WINDOWS_64_REF "%sgmqcc-%c.%c.%c-win64.zip%s"
|
||||
#define SLACKWARE_32_REF "%sgmqcc-%c.%c.%c-i686.txz%s"
|
||||
#define SLACKWARE_64_REF "%sgmqcc-%c.%c.%c-x86_64.txz%s"
|
||||
|
||||
|
||||
#define HTML "\
|
||||
<!doctype html>\
|
||||
<html>\
|
||||
<head>\
|
||||
<meta charset=\"utf-8\">\
|
||||
<meta http-equiv=\"X-UA-Compatible\" content=\"chrome=1\">\
|
||||
<title>GMQCC</title>\
|
||||
<link rel=\"stylesheet\" href=\"stylesheets/styles.css\">\
|
||||
<link rel=\"stylesheet\" href=\"stylesheets/pygment_trac.css\">\
|
||||
<script src=\"javascripts/scale.fix.js\"></script>\
|
||||
<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, user-scalable=no\">\
|
||||
<!--[if lt IE 9]>\
|
||||
<script src=\"//html5shiv.googlecode.com/svn/trunk/html5.js\"></script>\
|
||||
<![endif]-->\
|
||||
</head>\
|
||||
<body>\
|
||||
<a href=\"https://github.com/graphitemaster/gmqcc\"><div class=\"fork\"></div></a>\
|
||||
<div class=\"wrapper\">\
|
||||
<header>\
|
||||
<h1 class=\"header\">GMQCC</h1>\
|
||||
<p class=\"header\">An Improved Quake C Compiler</p>\
|
||||
<ul>\
|
||||
<li class=\"buttons\"><a href=index.html>Index</a></li>\
|
||||
<li class=\"download\"><a href=\"download.html\">Download</a></li>\
|
||||
<li class=\"buttons\"><a href=\"https://github.com/graphitemaster/gmqcc/issues\">Issues</a></li>\
|
||||
<li class=\"buttons\"><a href=\"doc.html\">Documentation</a></li>\
|
||||
<li class=\"buttons\"><a href=\"https://github.com/graphitemaster/gmqcc\">View On GitHub</a></li>\
|
||||
</ul>\
|
||||
</header>\
|
||||
<section>\
|
||||
<table>\
|
||||
<tr>\
|
||||
<th>Operating System / Distribution</th>\
|
||||
<th>x86 Architecture</th>\
|
||||
<th>x86_64 Architecture</th>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td>Archlinux</td>\
|
||||
<td><a href=\"%s\">Download</a></td>\
|
||||
<td><a href=\"%s\">Download</a></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td>Debian</td>\
|
||||
<td><a href=\"%s\">Download</a></td>\
|
||||
<td><a href=\"%s\">Download</a></td>\
|
||||
</tr>\
|
||||
<tr>\
|
||||
<td>Slackware</td>\
|
||||
<td><a href=\"%s\">Download</a></td>\
|
||||
<td><a href=\"%s\">Download</a></td>\
|
||||
<tr>\
|
||||
<td>Windows</td>\
|
||||
<td><a href=\"%s\">Download</a></td>\
|
||||
<td><a href=\"%s\">Download</a></td>\
|
||||
</tr>\
|
||||
</table>\
|
||||
</section>\
|
||||
<footer>\
|
||||
<script type=\"text/javascript\" src=\"http://www.ohloh.net/p/602517/widgets/project_partner_badge.js\"></script>\
|
||||
</footer>\
|
||||
</div>\
|
||||
<!--[if !IE]><script>fixScale(document);</script><![endif]-->\
|
||||
</body>\
|
||||
</html>\
|
||||
"
|
||||
|
||||
static char build_table[][4096] = {
|
||||
ARCHLINUX_32_REF, ARCHLINUX_64_REF,
|
||||
DEBIAN_32_REF, DEBIAN_64_REF,
|
||||
SLACKWARE_32_REF, SLACKWARE_64_REF,
|
||||
WINDOWS_32_REF, WINDOWS_64_REF
|
||||
};
|
||||
/* </tag> */
|
||||
|
||||
#define ISXDIGIT(c) ((c >= 48 && c <= 57) || ((c & ~0x20) >= 65 && (c & ~0x20) <= 70))
|
||||
typedef struct {
|
||||
char *data;
|
||||
unsigned int len;
|
||||
unsigned int size;
|
||||
} url_t;
|
||||
void escape(url_t *str) {
|
||||
char *p, *ptr;
|
||||
char hexstr[3];
|
||||
unsigned int i=0;
|
||||
unsigned long l=0;
|
||||
|
||||
p = str->data;
|
||||
for(i=0; i < str->len; i++) {
|
||||
if((p - str->data) >= str->len)
|
||||
break;
|
||||
if(*p == '%' &&
|
||||
((p - str->data)+2) < str->len &&
|
||||
ISXDIGIT(*(p+1)) &&
|
||||
ISXDIGIT(*(p+2))
|
||||
) {
|
||||
p++;
|
||||
hexstr[0] = *p++;
|
||||
hexstr[1] = *p++;
|
||||
hexstr[2] = 0;
|
||||
l = strtoul(hexstr, &ptr, 16);
|
||||
str->data[i] = (char)(l & 0x7f);
|
||||
continue;
|
||||
}
|
||||
if(*p == '+') {
|
||||
*p = ' ';
|
||||
}
|
||||
str->data[i] = *p++;
|
||||
}
|
||||
str->data[i] = 0;
|
||||
str->len = i;
|
||||
}
|
||||
|
||||
void version(const char *directory, char *major, char *minor, char *patch) {
|
||||
FILE *handle;
|
||||
char file[4096];
|
||||
size_t size = 0;
|
||||
char *data = NULL;
|
||||
snprintf(file, sizeof(file), "%s/gmqcc.h", directory);
|
||||
|
||||
handle = fopen(file, "r");
|
||||
if (!handle) {
|
||||
fprintf(stderr, "failed to open %s for reading version (%s)\n",
|
||||
file, strerror(errno)
|
||||
);
|
||||
abort();
|
||||
}
|
||||
|
||||
while (getline(&data, &size, handle) != EOF) {
|
||||
|
||||
#define TEST(TYPE, STORE) \
|
||||
if (strstr(data, "#define GMQCC_VERSION_" TYPE )) { \
|
||||
char *get = data; \
|
||||
while (!isdigit(*get)) \
|
||||
get++; \
|
||||
*STORE = *get; \
|
||||
}
|
||||
|
||||
TEST("MAJOR", major)
|
||||
TEST("MINOR", minor)
|
||||
TEST("PATCH", patch)
|
||||
|
||||
#undef TEST
|
||||
}
|
||||
|
||||
free(data);
|
||||
}
|
||||
|
||||
void genhtml() {
|
||||
FILE *fp = fopen("download.html", "w");
|
||||
if (!fp) {
|
||||
fprintf(stderr, "failed to generate HTML: %s\n", strerror(errno));
|
||||
abort();
|
||||
}
|
||||
|
||||
fprintf(fp, HTML,
|
||||
build_table[0], build_table[1],
|
||||
build_table[2], build_table[3],
|
||||
build_table[4], build_table[5],
|
||||
build_table[6], build_table[7]
|
||||
);
|
||||
fclose (fp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Builds a list of download links with the right version and handles the
|
||||
* rest of the magic.
|
||||
*/
|
||||
void build(const char *directory) {
|
||||
/* Figure out version number */
|
||||
char find[3];
|
||||
char decode[4096];
|
||||
size_t size;
|
||||
version(directory, &find[0], &find[1], &find[2]);
|
||||
|
||||
/*
|
||||
* decode the secuity stuff for preparing the URLs which will be used
|
||||
* as links.
|
||||
*/
|
||||
memset(decode, 0, sizeof(decode));
|
||||
security_decode(decode, SECURITY_TOKEN, strlen(SECURITY_TOKEN));
|
||||
|
||||
for (size = 0; size < sizeof(build_table) / sizeof(*build_table); size++) {
|
||||
char *load = strdup(build_table[size]);
|
||||
url_t esc = { NULL, 0 };
|
||||
|
||||
snprintf(build_table[size], 4096, load, BASEURL, find[0], find[1], find[2], decode);
|
||||
esc.data = strdup(build_table[size]);
|
||||
esc.size = strlen(build_table[size]);
|
||||
esc.len = esc.size;
|
||||
|
||||
/* Yes we also need to escape URLs just incase */
|
||||
escape(&esc);
|
||||
free(load);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now generate the HTML file for those download links by asking tinyurl to
|
||||
*/
|
||||
genhtml();
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
size_t itr;
|
||||
|
||||
argc--;
|
||||
argv++;
|
||||
if (!argc) {
|
||||
printf("usage: %s [gmqcc.h location]\n", argv[-1]);
|
||||
return 0;
|
||||
}
|
||||
|
||||
build(*argv);
|
||||
}
|
Binary file not shown.
Before Width: | Height: | Size: 2.3 KiB |
|
@ -1,92 +0,0 @@
|
|||
html, body, div, span, applet, object, iframe,
|
||||
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
|
||||
a, abbr, acronym, address, big, cite, code,
|
||||
del, dfn, em, img, ins, kbd, q, s, samp,
|
||||
small, strike, strong, sub, sup, tt, var,
|
||||
b, u, i, center,
|
||||
dl, dt, dd, ol, ul, li,
|
||||
fieldset, form, label, legend,
|
||||
table, caption, tbody, tfoot, thead, tr, th, td,
|
||||
article, aside, canvas, details, embed,
|
||||
figure, figcaption, footer, header, hgroup,
|
||||
menu, nav, output, ruby, section, summary,
|
||||
time, mark, audio, video {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
font: inherit;
|
||||
vertical-align: baseline;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
|
||||
margin: 0;
|
||||
line-height: 1.8em;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
background: #CDC9C9;
|
||||
}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {
|
||||
color:#232323;
|
||||
margin:36px 0 10px;
|
||||
}
|
||||
|
||||
.head-ltitle, .head-rtitle, .head-vol {
|
||||
font: bold 0.8em Arial, Helvectia, sans-serif;
|
||||
}
|
||||
|
||||
.head-vol {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.name {
|
||||
font: bold 0.8em Monospace, serif;
|
||||
}
|
||||
|
||||
.ftype {
|
||||
font: normal 1em Monospace, serif;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #c30000;
|
||||
margin-top: 0.3em;
|
||||
margin-bottom: 0.3em;
|
||||
line-height: 1.3;
|
||||
font: normal 1.4em Arvo, Monaco, sans-serif;
|
||||
/*font: bold 1.4em Arial, Helvetica, sans-serif*/
|
||||
}
|
||||
|
||||
.section {
|
||||
margin-bottom: 1em;
|
||||
margin-top: 1em;
|
||||
padding-left: 1em;
|
||||
border-top: 1px #cccccc solid;
|
||||
font: normal 0.9em Arial, Helvetica, sans-serif;
|
||||
text-align: justify;
|
||||
border: 0;
|
||||
padding-bottom: 1em;
|
||||
border-bottom: 1px solid #f0e0e0;
|
||||
}
|
||||
|
||||
.list-tag {
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
pre {
|
||||
border: 1px dashed #ffffff;
|
||||
background: #ddd8d8;
|
||||
}
|
||||
|
||||
.flag {
|
||||
font: normal 1em Monospace, serif;
|
||||
}
|
||||
|
||||
a {
|
||||
color:#C30000;
|
||||
font-weight:200;
|
||||
text-decoration:none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
|
@ -1,759 +0,0 @@
|
|||
\documentclass{article}
|
||||
|
||||
%%% PACKAGES
|
||||
\usepackage{geometry}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[parfill]{parskip}
|
||||
\usepackage{subfig}
|
||||
\usepackage{listings}
|
||||
\usepackage{color}
|
||||
\usepackage{sectsty}
|
||||
|
||||
%%% GEOMETRY FOR DOCUMENT
|
||||
\geometry{a4paper}
|
||||
|
||||
%%% HEADERS/FOOTERS APPEARANCE
|
||||
\usepackage{fancyhdr} % This should be set AFTER setting up the page geometry
|
||||
\pagestyle{fancy} % options: empty , plain , fancy
|
||||
\renewcommand{\headrulewidth}{0pt} % customise the layout...
|
||||
\lhead{}\chead{}\rhead{}
|
||||
\lfoot{}\cfoot{\thepage}\rfoot{}
|
||||
|
||||
%%% SECTION TITLE APPEARANCE
|
||||
\allsectionsfont{\sffamily\mdseries\upshape} % (See the fntguide.pdf for font help)
|
||||
|
||||
%%% ToC APPEARANCE
|
||||
\usepackage[nottoc,notlof,notlot]{tocbibind} % Put the bibliography in the ToC
|
||||
\usepackage[titles,subfigure]{tocloft} % Alter the style of the Table of Contents
|
||||
\renewcommand{\cftsecfont}{\rmfamily\mdseries\upshape}
|
||||
\renewcommand{\cftsecpagefont}{\rmfamily\mdseries\upshape} % No bold!
|
||||
|
||||
%%% listing language definitions
|
||||
%%% BNF for now, QuakeC will be later
|
||||
\definecolor{keyword1}{RGB}{0,102,153}
|
||||
\definecolor{keyword2}{RGB}{0,153,102}
|
||||
\definecolor{keyword3}{RGB}{0,153,255}
|
||||
\definecolor{comment}{RGB}{204,0,0}
|
||||
\definecolor{function}{RGB}{153,102,255}
|
||||
\definecolor{digit}{RGB}{255,0,0}
|
||||
\definecolor{string}{RGB}{255,0,204}
|
||||
\definecolor{rule}{RGB}{192,192,192}
|
||||
\definecolor{back}{RGB}{250,250,250}
|
||||
|
||||
\lstdefinelanguage{bnf}{
|
||||
keywordstyle={\color{keyword2}\bfseries},
|
||||
keywords={},
|
||||
otherkeywords={::=,|},
|
||||
morecomment=[s][\color{comment}]{(*}{*)},
|
||||
stringstyle=\color{string},
|
||||
showstringspaces=false,
|
||||
frame=none,
|
||||
rulecolor=\color{rule},
|
||||
backgroundcolor=\color{back}
|
||||
}
|
||||
|
||||
%% Title Information %%
|
||||
\title{The GMQCC QuakeC Programming Language}
|
||||
\author{Dale Weiler}
|
||||
\date{\today}
|
||||
|
||||
\begin{document}
|
||||
|
||||
%% Title Page %%
|
||||
\maketitle
|
||||
\thispagestyle{empty}
|
||||
\raggedright
|
||||
\abstract
|
||||
This document specifies the form and establishes the interpretation of programs written in
|
||||
the GMQCC QuakeC programming language variant (refereed simply as QuakeC throughout this
|
||||
document). It specifies:
|
||||
\begin{itemize}
|
||||
\item the representation of QuakeC programs;
|
||||
\item the syntax and constraints of the QuakeC language;
|
||||
\item the semantic rules for interpreting QuakeC programs;
|
||||
\item the representation of input data to be processed by QuakeC programs;
|
||||
\item the representation of output data produced by QuakeC programs;
|
||||
\item the restrictions and limits imposed by a conforming implementation of QuakeC.
|
||||
\end{itemize}
|
||||
This document does not specify
|
||||
\begin{itemize}
|
||||
\item the mechanism by which QuakeC programs are transformed for use by a data-
|
||||
processing system;
|
||||
\item the mechanism by which QuakeC programs are invoked for use by a data-processing
|
||||
system;
|
||||
\item the mechanism by which input data are transformed for use by a QuakeC program;
|
||||
\item the size or complexity of a program and its data that will exceed the capacity
|
||||
of any specific data-processing system or the capacity of a particular
|
||||
execution environment;
|
||||
\item all minimal requirements of a data-processing system that is capable of
|
||||
supporting a conforming implementation.
|
||||
\end{itemize}
|
||||
|
||||
%% Table Of Contents %%
|
||||
\newpage
|
||||
\thispagestyle{empty}
|
||||
\tableofcontents
|
||||
\newpage
|
||||
|
||||
%% Begin Contents %%
|
||||
\raggedright % No weird TEX spacing on lines to fill page
|
||||
|
||||
%% -> Terms, definitions, and symbols %%
|
||||
\section{Terms, definitions, and symbols}
|
||||
\subsection*{argument}
|
||||
Expression in the comma-separated list bounded by the parentheses in a function call
|
||||
expression, or a sequence of preprocessing tokens in the comma-separated list bounded
|
||||
by the parentheses in a function-like macro invocation.
|
||||
|
||||
\subsection*{behavior}
|
||||
External appearance or action
|
||||
|
||||
\subsection*{implementation-defined behavior}
|
||||
Unspecified behavior where each implementation documents how the choice is made.
|
||||
|
||||
\subsection*{undefined behavior}
|
||||
Behavior, upon use of a non-portable or erroneous program construct or of erroneous data,
|
||||
for which this document imposes no actual requirements.
|
||||
|
||||
\subsection*{unspecified behavior}
|
||||
Use of an unspecified value, or other behavior where this document provides two or more
|
||||
possibilities and imposes no further requirements on which is chosen in any instance.
|
||||
|
||||
\subsection*{constraint}
|
||||
Restriction, either syntactic or semantic, by which the exposition of language elements
|
||||
is to be interpreted.
|
||||
|
||||
\subsection*{diagnostic message}
|
||||
Message belonging to an implementation-defined subset of the implementation's message
|
||||
output.
|
||||
|
||||
\subsection*{object}
|
||||
Region of data storage in the execution environment, the contents of which can represent
|
||||
values.
|
||||
|
||||
\subsection*{parameter}
|
||||
Object declared as part of a function declaration or definition that acquires a value on
|
||||
entry to the function, or an identifier from the comma-separated list bounded by the
|
||||
parentheses immediately following the macro name in a function-like macro definition.
|
||||
|
||||
\subsection*{recommended practice}
|
||||
Specification that is strongly recommended as being in keeping with the intent of this
|
||||
document, but that may be impractical for some implementations.
|
||||
|
||||
\subsection*{value}
|
||||
Precise meaning of the contents of an object when interpreted as having a specific type.
|
||||
|
||||
\subsection*{implementation}
|
||||
Particular set of software, running in a particular translation environment under
|
||||
particular control options, that performs translation of programs for, and supports
|
||||
execution of functions in, a particular execution environment.
|
||||
|
||||
\subsection*{implementation-defined value}
|
||||
Unspecified value where each implementation documents how the choice is made.
|
||||
|
||||
\subsection*{unspecified value}
|
||||
Valid value of the relevant type where this document imposes no requirements on which
|
||||
value is chosen in any instance.
|
||||
|
||||
%% -> Conformance %%
|
||||
\section{Conformance}
|
||||
In this document, "shall" is to be interpreted as a requirement on an implementation
|
||||
or on a program; conversely, "shall not" is to be interpreted as a prohibition. \\
|
||||
If a "shall" or "shall not" requirement that appears outside of a constraint is violated,
|
||||
the behavior is undefined. Undefined behavior is otherwise indicated in this document by
|
||||
the words "undefined behavior" or by the omission of any explicit definition of behavior.
|
||||
There is no difference in emphasis among these three; they all describe "behavior that is
|
||||
undefined".
|
||||
|
||||
%% -> Enviroment %%
|
||||
\section{Environment}
|
||||
An implementation that translates QuakeC source files and executes QuakeC programs in two
|
||||
data processing-system environments, which will be called the translation environment and
|
||||
the execution environment in this document. Their characteristics define and constrain the
|
||||
results of executing QuakeC programs constructed according to the syntactic and semantic
|
||||
rules for conforming implementations.
|
||||
\subsection{Conceptual models}
|
||||
\subsubsection{Translation environment}
|
||||
\paragraph*{Translation steps}
|
||||
The precedence among the syntax rules of translation is specified by the following steps
|
||||
\begin{enumerate}
|
||||
\item Physical source file characters are mapped, in an implementation-defined manner,
|
||||
to the source character set (introducing new-line characters for end-of-line
|
||||
indicators) if necessary. Trigraph and digraph sequences are replaced by their
|
||||
corresponding single-character internal representations.
|
||||
\item The source file is decomposed into preprocessing tokens and sequences of white-
|
||||
space characters (including comments). A source file shall not end in a partial
|
||||
preprocessing token or in a partial comment. Each comment is replaced by one
|
||||
space character. New-line characters are retained. Whether each nonempty
|
||||
sequences of white-space characters other than new-line is retained or replaced
|
||||
by one space character is implementation-defined.
|
||||
\item Preprocessing directives are executed, macro invocations are expanded
|
||||
recursively. A \#include preprocessing directive causes the named header or
|
||||
source file to be processed from step one through step three, recursively. All
|
||||
preprocessing directives are then deleted.
|
||||
\item Each source character set member and escape sequence in character constants and
|
||||
string literals is converted to the corresponding member of the execution
|
||||
character set; if there is no corresponding member, it is converted to an
|
||||
implementation-defined member other than the null character.
|
||||
\item Adjacent string literal tokens are concatenated.
|
||||
\item White-space characters seperating tokens are no longer significant. Each
|
||||
preprocessing token is converted into a token. The resulting tokens are then
|
||||
syntactically and semantically analyzed and translated.
|
||||
\end{enumerate}
|
||||
\subparagraph*{Footnotes}
|
||||
Implementations shall behave as if these steps occur separately, even though many are likely
|
||||
to be folded together in practice. Source files need not be stored as file, nor need there
|
||||
be any one-to-one correspondence between these items and any external representation. The
|
||||
description is conceptual only, and does not specify any particular implementation.
|
||||
|
||||
\paragraph*{Diagnostics}
|
||||
A conforming implementation shall produce at least on diagnostic message(identified in an
|
||||
implementation-defined manner) if a source file contains a violation of any syntax rule or
|
||||
constraint, even if the behavior is also explicitly specified as undefined or
|
||||
implementation-defined. Diagnostic messages need not be produced in other circumstances.
|
||||
|
||||
%% ->-> Execution environments %%
|
||||
\subsubsection{Execution environment}
|
||||
A conforming execution environment shall provide at minimal the following 15 definitions
|
||||
for built in functions, with an accompanying header or source file that defines them.
|
||||
\begin{enumerate}
|
||||
\item entity () spawn
|
||||
\item void (entity) remove
|
||||
|
||||
\item string (float) ftos
|
||||
\item string (vector) vtos
|
||||
\item string (entity) etos
|
||||
\item float (string) stof
|
||||
|
||||
\item void (string, ...) dprint
|
||||
\item void (entity) eprint
|
||||
|
||||
\item float (float) rint
|
||||
\item float (float) floor
|
||||
\item float (float) ceil
|
||||
\item float (float) fabs
|
||||
\item float (float) sin
|
||||
\item float (float) cos
|
||||
\item float (float) sqrt
|
||||
\end{enumerate}
|
||||
The numbers of which these built-ins are assigned is implementation-defined;
|
||||
an implementation is allowed to use these built-ins however it sees fit.
|
||||
|
||||
\pagebreak
|
||||
%% -> Language %%
|
||||
\section{Language}
|
||||
\subsection{Notation}
|
||||
The syntax notation used in this document is that of a BNF specification. A set of
|
||||
derivation rules, often written as:
|
||||
\begin{lstlisting}[language=bnf]
|
||||
symbol ::= expression
|
||||
\end{lstlisting}
|
||||
Where symbol is a nonterminal, and the expression consists of one or more sequences of
|
||||
symbols; more sequences are separated by a vertical bar \textbar, indicating a choice,
|
||||
the whole being a possible substitution for the symbol on the left. Symbols that never
|
||||
appear on the left side are terminals.
|
||||
\linebreak
|
||||
|
||||
This document defines language syntax throughout it's way at defining language
|
||||
constructs If you're interested in a summary of the language syntax, one is given in
|
||||
annex A.
|
||||
|
||||
%% -> Concepts %%
|
||||
\subsection{Concepts}
|
||||
%% ->-> Scopes of identifiers %%
|
||||
\subsubsection{Scopes of identifiers}
|
||||
An identifier can denote an object; a function, or enumeration; a label name; a macro
|
||||
name; or a macro parameter. The same identifier can denote different items at different
|
||||
points in the program. A member of an enumeration is called an enumeration constant.
|
||||
Macro names and macro parameters are not considered further here, because prior to the
|
||||
semantic phase of program translation any occurrences of macro names in the source file
|
||||
are replaced by the preprocessing token sequences that constitute their macro definitions.
|
||||
\linebreak
|
||||
|
||||
For each different item that an identifier designates, the identifier is visible (i.e,
|
||||
can be used) only within a region of program text called its scope. Different items
|
||||
designated by the same identifier either have different scopes, or are in different name
|
||||
spaces. There are four kinds of scopes: function, file, block and function prototype.
|
||||
(A function prototype is a declaration of a function that declares the types of its
|
||||
parameters.)
|
||||
\linebreak
|
||||
|
||||
A label name is the only kind of identifier that has function scope. It can be used (in
|
||||
a goto statement) anywhere in the function in which it appears, and is declared
|
||||
implicitly by its syntactic appearance (prefixed by a colon :, and suffixed with a
|
||||
statement).
|
||||
\linebreak
|
||||
|
||||
Every other identifier has scope determined by the placement of its declaration (in a
|
||||
declarator or type specifier). If the declarator or type specifier that declares the
|
||||
identifier appears outside any block or list of parameters, the identifier has file
|
||||
scope, which terminates at the end of the file. If the declartor or type specifier that
|
||||
declares the identifier appears inside a block or within the list of parameter
|
||||
declarations in a function definition, the identifier has block scope, which terminates
|
||||
at the end of the associated block. If the declarator or type specifier that declares
|
||||
the identifier appears within the list of parameter declarations in a function prototype
|
||||
(not part of a function definition), the identifier has function prototype scope, which
|
||||
terminates at the end of the function declarator. If an identifier designates two
|
||||
different items in the same name space, the scopes might overlap. If so, the scope of
|
||||
one item (the inner scope) will be a strict subset of the scope of the other item (the
|
||||
outer scope). Within the inner scope, the identifier designates the item declared in the
|
||||
inner scope; the item declared in the outer scope is hidden (and not visible) within
|
||||
the inner scope.
|
||||
\linebreak
|
||||
|
||||
Unless explicitly stated otherwise, where this document uses the term "identifier" to
|
||||
refer to some item (as opposed to the syntactic construct), it refers to the item in the
|
||||
relevant name space whose declaration is visible at the point the identifier occurs.
|
||||
\linebreak
|
||||
|
||||
Two identifiers have the same scope if and only if their scopes terminate at the same
|
||||
point.
|
||||
\linebreak
|
||||
|
||||
Each enumeration constant has scope that begins just after the appearance of its defining
|
||||
enumerator in an enumerator list. Any other identifier has scope that begins just after
|
||||
the completion of its declarator.
|
||||
|
||||
%% ->-> Name spaces of identifiers %%
|
||||
\subsubsection{Name spaces of identifiers}
|
||||
If more than one declaration of a particular identifier is visible at any point in a
|
||||
source file, the syntactic context disambiguates uses that refer to different items.
|
||||
Thus, there are separate name spaces for various categories of identifiers, as follows:
|
||||
\linebreak
|
||||
\begin{itemize}
|
||||
\item Label names (disambiguated by the syntax of the label declaration and use);
|
||||
\item Enumerations (disambiguated by following the keyword enum);
|
||||
\item All other identifiers, called ordinary identifiers (declared in ordinary
|
||||
declarators or as enumeration constants).
|
||||
\end{itemize}
|
||||
|
||||
%% ->-> Types %%
|
||||
\subsubsection{Types}
|
||||
The meaning of a value stored in an object returned by a function is determined by the
|
||||
type of the expression used to access it. (An identifier declared to be an object is the simplest
|
||||
such expression; the type is specified in the declaration of the identifier.) Types are
|
||||
partitioned into object types (types that fully describe objects), function types(types
|
||||
that describe functions), and incomplete types(types that describe objects but lack
|
||||
information).
|
||||
\linebreak
|
||||
|
||||
An object declared type bool is large enough to store the values 0 and 1.
|
||||
\linebreak
|
||||
|
||||
An object declared type float is a real type; An object declared type vector is a
|
||||
comprised set of three floats that respectively represent the \underline{x,y,z}
|
||||
components of a three-dimensional vector.
|
||||
\linebreak
|
||||
|
||||
An enumeration comprises a set of named integer constant values. Each distinct
|
||||
enumeration constitutes a different enumerated type.
|
||||
\linebreak
|
||||
|
||||
Enumeration types and float are collectively called arithmetic types. Each arithmetic
|
||||
type belongs to one type domain.
|
||||
\linebreak
|
||||
|
||||
The void type comprises an empty set of values; it is an incomplete type that cannot be
|
||||
completed.
|
||||
\linebreak
|
||||
|
||||
A number of derived types can be constructed from the object, function and incomplete
|
||||
types, as follows:
|
||||
\linebreak
|
||||
|
||||
\begin{itemize}
|
||||
\item An array type describes a contiguously allocated nonempty set of objects with a
|
||||
particular object type, called the element type. Array types are characterized
|
||||
by their element type and by the number of elements in the array. An array type
|
||||
is said to be derived from its element type, and if its element is type T, the
|
||||
array type is sometimes called "array of T". The construction of an array type
|
||||
from an element type is called "array type derivation".
|
||||
\item A function type describes a function with a specified return type. A function
|
||||
type is characterized by its return type and the number and types of its
|
||||
parameters. A function type is said to be derived from its return type, and if
|
||||
its return type is T, the function type is sometimes called "function returning
|
||||
T". The construction of a function type from a return type is called "function
|
||||
type derivation".
|
||||
\end{itemize}
|
||||
|
||||
Arithmetic types are collectively called scalar types. Arrays and vectors are
|
||||
collectively called aggregate types.
|
||||
\linebreak
|
||||
|
||||
An array of unknown size is an incomplete type. It is completed, for an identifier of
|
||||
that type, by specifying the size in a later declaration. Arrays are required to have
|
||||
known constant size.
|
||||
\linebreak
|
||||
|
||||
A type is characterized by its type category, which is either the outermost derivation
|
||||
of a derived type (as noted above in the construction of derived types), or the type
|
||||
itself if the type consists of no derived types.
|
||||
\linebreak
|
||||
|
||||
Any type so far mentioned is an unqualified type. Each unqualified type has several
|
||||
qualified versions of its type, corresponding to the combinations of one, two, or all
|
||||
two of const and volatile qualifiers. The qualified or unqualified versions of a type
|
||||
are distinct types that belong to the same type category and have the same representation.
|
||||
A derived type is not qualified by the qualifiers (if any) of the type from which it
|
||||
is derived.
|
||||
\linebreak
|
||||
|
||||
%% ->-> Compatible types and composite type %%
|
||||
\subsubsection{Compatible types and composite type}
|
||||
Two types have compatible type if their types are the same.
|
||||
\linebreak
|
||||
|
||||
All declarations that refer to the same object or function shall have compatible type;
|
||||
otherwise the behavior is undefined.
|
||||
\linebreak
|
||||
|
||||
A composite type can be constructed from two types that are compatible; it is a type that
|
||||
is compatible with both of the two types and satisfies the following conditions:
|
||||
\begin{itemize}
|
||||
\item If one type is an array, the composite type is an array of that size.
|
||||
\item If only one type is a function type with a parameter type list(a function
|
||||
prototype), the composite type is a function prototype with the parameter type
|
||||
list.
|
||||
\item If both types are function types with parameter type lists, the type of each
|
||||
parameter in the composite parameter type list is the composite type of the
|
||||
corresponding parameters.
|
||||
\end{itemize}
|
||||
These rules apply recursively to types from which the two types are derived.
|
||||
\linebreak
|
||||
|
||||
%% ->Conversions %%
|
||||
\subsection{Conversions}
|
||||
Several operators convert operand values from one type to another automatically. This
|
||||
sub-clause specifies the result required from such an implicit conversion.
|
||||
\linebreak
|
||||
|
||||
Conversion from an operand value to a compatible type causes no change to the value or
|
||||
the representation.
|
||||
\linebreak
|
||||
|
||||
TODO: Specify all implicit conversions.
|
||||
|
||||
%% ->->Aritmetic operands %%
|
||||
\subsubsection{Arithmetic operands}
|
||||
\paragraph*{Boolean type}
|
||||
When any scalar value is converted to bool, the result is 0 if the value compares equal
|
||||
to 0; otherwise the result is 1.
|
||||
|
||||
%% ->->Other operands %%
|
||||
\subsubsection{Other operands}
|
||||
\paragraph{Lvalues, arrays and function designators}
|
||||
An lvalue is an expression with an object type or an incomplete type other than void;
|
||||
if an lvalue does not designate an object when it is evaluated, the behavior is undefined.
|
||||
When an object is said to have a particular type, the type is specified by the lvalue
|
||||
used to designate the object. A modifiable lvalue is an lvalue that does not have an
|
||||
array type, does not have an incomplete type, and does not have a const-qualified type.
|
||||
\linebreak
|
||||
|
||||
Except when it is the operand of the unary \& operator, the ++ operator, the -- operator,
|
||||
or the left operand of the . operator or an assignment operator, an lvalue that does not
|
||||
have array type is converted to the value stored in the designated object (and is no
|
||||
longer an lvalue). If the lvalue has qualified type, the value has the unqualified
|
||||
version of the type of the lvalue; otherwise, the value has the type of the lvalue. If
|
||||
the lvalue has an incomplete type and does not have array type, the behavior is undefined.
|
||||
\linebreak
|
||||
|
||||
A function designator is an expression that has function type.
|
||||
|
||||
\paragraph*{void}
|
||||
The (nonexistent) value of a void expression (an expression that has type void) shall not
|
||||
be used in any way, and implicit conversions (except to void) shall not be applied to
|
||||
such an expression. If an expression of any other type is evaluated as a void expression,
|
||||
its value or designator is discarded. (A void expression is only evaluated for its
|
||||
side effects.)
|
||||
\pagebreak
|
||||
|
||||
\subsection{Lexical elements}
|
||||
\paragraph*{Syntax}
|
||||
\begin{lstlisting}[language=bnf]
|
||||
token ::= keyword
|
||||
| identifier
|
||||
| constant
|
||||
| string-literal
|
||||
| punctuator
|
||||
preprocessing-token ::= header-name
|
||||
| identifier
|
||||
| pp-number
|
||||
| string-literal
|
||||
| punctuator
|
||||
\end{lstlisting}
|
||||
\paragraph*{Constraints}
|
||||
Each preprocessing token that is converted to a token shall have the lexical form of a
|
||||
keyword, an identifier, a constant, a string literal, or a punctuator.
|
||||
|
||||
\paragraph*{Semantics}
|
||||
A token is the minimal lexical element of the language in translation steps six and seven.
|
||||
The categories of tokens are: keywords, identifiers, constants, string literals, and
|
||||
punctuators. A preprocessing token is the minimal lexical element of the language in
|
||||
translation steps three through five. The categories of preprocessing tokens are: header
|
||||
names, identifiers, preprocessing numbers, string literals, punctuators and other single
|
||||
non-white-space characters that do not lexically match the other preprocessing token
|
||||
categories. If a ' or a " character matches the last category, the behavior is undefined.
|
||||
Preprocessing tokens can be separated by white space; this consists of comments (described
|
||||
later), or white-space characters (space, horizontal tab, new-line, vertical tab, and form
|
||||
-feed), or both. In certain circumstances during translation step four, white space (or
|
||||
the absence thereof) serves as more than preprocessing token separation. White space may
|
||||
appear within a preprocessing token only as part of a header name or between the quotation
|
||||
characters in a string literal.
|
||||
\linebreak
|
||||
|
||||
If the input stream has been parsed into preprocessing tokens up to a given character, the
|
||||
next preprocessing token is the longest sequence of characters that could constitute a
|
||||
preprocessing token. There is one exception to this rule: header name preprocessing tokens
|
||||
are recognized only within \#include preprocessing directives and in implementation-defined
|
||||
locations within \#pragma directives. In such contexts, a sequence of characters that
|
||||
could be either a header name or string literal is recognized as the former.
|
||||
|
||||
%% ->-> Keywords %%
|
||||
\subsubsection{Keywords}
|
||||
\paragraph*{Syntax}
|
||||
\begin{lstlisting}[language=bnf]
|
||||
keyword ::= enum | break | return | void
|
||||
| case | float | volatile | for
|
||||
| while | const | goto | bool
|
||||
| continue | if | static | default
|
||||
| inline | do | switch | else
|
||||
| vector | entity
|
||||
\end{lstlisting}
|
||||
\paragraph*{Semantics}
|
||||
The above tokens (case sensitive) are reserved (in translation step seven and eight) for
|
||||
use as keywords, and shall not be used otherwise.
|
||||
|
||||
%% ->->Identifiers %%
|
||||
\subsubsection{Identifiers}
|
||||
\begin{lstlisting}[language=bnf]
|
||||
identifier ::= nondigit
|
||||
| identifier nondigit
|
||||
| identifier digit
|
||||
|
||||
nondigit ::= _ | a | b | c | d | e | f | g | h | i
|
||||
| j | k | l | m | n | o | p | q | r | s
|
||||
| t | u | v | w | x | y | z | A | B | C
|
||||
| D | E | F | G | H | I | J | K | L | M
|
||||
| N | P | Q | R | S | T | U | V | W | X
|
||||
| Y | Z
|
||||
|
||||
digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
|
||||
\end{lstlisting}
|
||||
\paragraph*{Semantics}
|
||||
An identifier is a sequence of nondigit characters (including the underscore \_, the lower
|
||||
case and upper case Latin letters, and other characters) and digits, which designates one
|
||||
or more items. Lowercase and uppercase letters are distinct. There is a specific limit of
|
||||
65535 characters for an identifier.
|
||||
\linebreak
|
||||
|
||||
When preprocessing tokens are converted to tokens during translation step six, if a
|
||||
preprocessing token could not be converted to either a keyword or an identifier, it is
|
||||
converted to a keyword.
|
||||
|
||||
\paragraph*{Predefined identifiers}
|
||||
Any identifiers that begin with the prefix \_\_builtin, or are within the reserved name
|
||||
space are reserved by the implementation.
|
||||
|
||||
%% ->->Constants %%
|
||||
\subsubsection{Constants}
|
||||
\begin{lstlisting}[language=bnf]
|
||||
constant ::= integer-constant
|
||||
| floating-constant
|
||||
| enumeration-constant
|
||||
| character-constant
|
||||
| vector-constant
|
||||
|
||||
integer-constant ::= decimal-constant
|
||||
| octal-constant
|
||||
| hexadecimal-constant
|
||||
|
||||
decimal-constant ::= nonzero-digit
|
||||
| decimal-constant digit
|
||||
|
||||
octal-constant ::= 0
|
||||
| octal-constant octal-digit
|
||||
|
||||
hexadecimal-constant ::= hexdecimal-prefix
|
||||
hexadecimal-digit
|
||||
| hexadecimal-digit
|
||||
hexadecimal-constant
|
||||
|
||||
hexadecimal-prefix: ::= 0x | 0X
|
||||
|
||||
nonzero-digit ::= 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8
|
||||
| 9
|
||||
|
||||
octal-digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
|
||||
|
||||
hexadecimal-digit ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
|
||||
| 8 | 9 | a | b | c | d | e | f
|
||||
| A | B | C | D | E | F
|
||||
\end{lstlisting}
|
||||
|
||||
%% ->-> String literals %%
|
||||
\subsubsection{String literals}
|
||||
\begin{lstlisting}[language=bnf]
|
||||
string-literal := " s-char-sequence "
|
||||
|
||||
s-char-sequence := s-char
|
||||
| s-char-sequence s-char
|
||||
|
||||
s-char := ` | ! | @ | # | $ | % | ^ | & | *
|
||||
| ( | ) | _ | - | + | = | { | } | [
|
||||
| ] | | | : | ; | ' | < | , | > | .
|
||||
| ? | / | 1 | 2 | 3 | 4 | 5 | 6 | 7
|
||||
| 8 | 9 | 0 | q | w | e | r | t | y
|
||||
| u | i | o | p | a | s | d | f | g
|
||||
| h | j | k | l | z | x | c | v | b
|
||||
| n | m | Q | W | E | R | T | Y | U
|
||||
| I | O | P | A | S | D | F | G | |
|
||||
| H | J | K | L | Z | X | C | V | B
|
||||
| N | M
|
||||
\end{lstlisting}
|
||||
\paragraph*{Description}
|
||||
A character string literal is a sequence of zero or more characters enclosed in
|
||||
double-quotes, as in "xyz".
|
||||
\linebreak
|
||||
|
||||
The same considerations apply to each element of the sequence in a character string
|
||||
literal as if it where an integer character constant, except that the single-quote
|
||||
' is representable either by itself or by the escape sequence \textbackslash', but
|
||||
the double-quote " shall be represented by the escape sequence \textbackslash".
|
||||
|
||||
\paragraph*{Semantics}
|
||||
In translation stage six, the character sequences specified by any sequence of adjacent
|
||||
character string literal tokens are concatenated into a single character sequence.
|
||||
|
||||
%% ->-> Punctuators %%
|
||||
\subsubsection{Punctuators}
|
||||
TODO: BNF
|
||||
|
||||
A punctuator is a symbol that has independent syntactic and semantic significance.
|
||||
Depending on context, it may specify an operation to be performed (which in turn
|
||||
may yield a value or a function designator, produce a side effect, or some combination
|
||||
thereof) in which case it is known as an operator (other forms of operator also exist
|
||||
in some contexts). An operand is an item on which an operator acts.
|
||||
\linebreak
|
||||
|
||||
TODO: Trigraphs \& Digraphs
|
||||
|
||||
\subsubsection{Header names}
|
||||
TODO
|
||||
\subsubsection{Preprocessing numbers}
|
||||
TODO
|
||||
\subsubsection{Comments}
|
||||
Except within a character constant, a string literal, or a comment, the characters /*
|
||||
introduce a comment. The contents of such a comment are examined only to identify
|
||||
characters and to find the characters */ that terminate it.
|
||||
\linebreak
|
||||
|
||||
Except within a character constant, a string literal, or a comment, the characters //
|
||||
introduce a comment that includes all characters up to, but not including, the next
|
||||
new-line character. The contents of such a comment are examined only to identify
|
||||
characters and to find the terminating new-line character.
|
||||
\linebreak
|
||||
|
||||
%% -> Expressions %%
|
||||
\subsection{Expressions}
|
||||
An expression is a sequence of operators and operands that specifies computation of a
|
||||
value, or that designates an object or function, or that generates side effects, or that
|
||||
performs a combination thereof.
|
||||
\linebreak
|
||||
|
||||
Between the previous and next sequence point an object shall have its stored value
|
||||
modified at most once by the evaluation of an expression. Furthermore, the prior value
|
||||
shall be read only to determine the value to be stored.
|
||||
\linebreak
|
||||
|
||||
The grouping of operators and operands is indicated by the syntax. Except as specified
|
||||
later (for the function call (), \&\&, \textbar\textbar ?:, and comma operators), the
|
||||
order of evaluation of sub-expressions and the order in which side effects take place
|
||||
are both unspecified.
|
||||
\linebreak
|
||||
|
||||
Some operators (the unary \textasciitilde operator, and the binary operators \textless
|
||||
\textless, \textgreater\textgreater, \&, \^, and \textbar, collectively describe bitwise
|
||||
operators) are required to have operands that are either integer, or floating point with
|
||||
zero points of decimal precision.
|
||||
\linebreak
|
||||
|
||||
If an exceptional condition occurs during the evaluation of an expression (that is, if
|
||||
the result is not mathematically defined or not in the range or representable values for
|
||||
its type), the behavior is undefined.
|
||||
|
||||
%% ->-> Primary expressions %%
|
||||
\subsubsection{Primary expressions}
|
||||
\paragraph*{Syntax}
|
||||
\begin{lstlisting}[language=bnf]
|
||||
primary-expression ::= identifier
|
||||
| constant
|
||||
| string-literal
|
||||
( expression )
|
||||
\end{lstlisting}
|
||||
\paragraph*{Semantics}
|
||||
An identifier is a primary expression, provided it has been declared as designating an
|
||||
object(in which case it is an lvalue) or a function(in which case it is a function
|
||||
designator).
|
||||
\linebreak
|
||||
|
||||
A constant is a primary expression. Its type depends on its form and value.
|
||||
\linebreak
|
||||
|
||||
A string literal is a primary expression. It is an lvalue.
|
||||
\linebreak
|
||||
|
||||
A parenthesized expression is a primary expression. Its type and value identical to
|
||||
those of the unparenthesized expression. It is an lvalue, a function designator, or a
|
||||
void expression if the unparenthesized expression is, respectively, an lvalue, a
|
||||
function designator, or a void expression.
|
||||
|
||||
%% ->-> Constant expressions %%
|
||||
\subsubsection{Constant expressions}
|
||||
\paragraph*{Syntax}
|
||||
\begin{lstlisting}[language=bnf]
|
||||
constant-expression ::= conditional-expression
|
||||
\end{lstlisting}
|
||||
\paragraph*{Description}
|
||||
A constant expression can be evaluated during translation rather than runtime, and
|
||||
accordingly may be used in any place that a constant may be.
|
||||
\paragraph*{Constraints}
|
||||
\begin{itemize}
|
||||
\item Constant expressions shall not contain assignment, increment, decrement,
|
||||
function-call, or comma operators, except when contained within a subexpression
|
||||
that is not evaluated.
|
||||
\item Each constant expression shall evaluate to a constant that is in range of
|
||||
representable values for its type.
|
||||
\end{itemize}
|
||||
\paragraph*{Semantics}
|
||||
An expression that evaluates to a constant is required in several contexts. If a floating
|
||||
point expression is evaluated in the translation environment, the arithmetic precision range
|
||||
shall be as great is if the expression were being evaluated in the execution environment.
|
||||
\linebreak
|
||||
|
||||
An integer constant expression shall have integer type and shall only have operands that
|
||||
are integer constants, enumeration constants, character constants, and floating constants
|
||||
that are the immediate operand of casts. Cast operators in an integer constant expression
|
||||
shall only convert arithmetic types to integer types.
|
||||
\linebreak
|
||||
|
||||
More latitude is permitted for constant expressions in initializers. Such a constant expression
|
||||
shall be, or evaluate to an arithmetic constant expression.
|
||||
\linebreak
|
||||
|
||||
An arithmetic constant expression shall have arithmetic type and shall only have operands that
|
||||
are integer constants, floating constants, enumeration constants, and character constants. Cast
|
||||
operators in an arithmetic constant expression shall only convert arithmetic types to arithmetic
|
||||
types.
|
||||
\linebreak
|
||||
|
||||
An implementation may accept other forms of constant expressions.
|
||||
\linebreak
|
||||
|
||||
The semantic rules for the evaluation of a constant expression are the same as for nonconstant
|
||||
expressions.
|
||||
|
||||
|
||||
\bibliographystyle{abbrv}
|
||||
\bibliography{main}
|
||||
|
||||
\end{document}
|
|
@ -1,24 +0,0 @@
|
|||
Here exists some syntax highlighting configuration files for various
|
||||
text editors. Inside each directory exists some documentaiton on how
|
||||
you can install the configuration file correctly.
|
||||
|
||||
Currently the supported text editors:
|
||||
geany
|
||||
kate
|
||||
kwrite - uses kate syntax highlighting
|
||||
kdevelop - uses kate syntax highlighting
|
||||
QtCreator - supports kate syntax highlighting
|
||||
gtksourceview - main source viewer in GNOME
|
||||
gedit - uses gtksourceview
|
||||
sandy - uses gtksourceview
|
||||
nano
|
||||
jedit
|
||||
|
||||
|
||||
Other text editors we plan to provide syntax highlighting configuration
|
||||
files for (but never got around to figuring out)
|
||||
vim
|
||||
emacs
|
||||
|
||||
If your text editor is not supported and you'd like to create syntax
|
||||
highlighting support for it, don't hesitate to share it with us.
|
|
@ -1,8 +0,0 @@
|
|||
To use the geany syntax highlighting install filetypes.qc to the syntax
|
||||
directory for geany.
|
||||
|
||||
# Can be installed globally to
|
||||
/usr/share/geany/
|
||||
|
||||
# Can be installed locally to
|
||||
~/.config/geany/filedefs/
|
|
@ -1,55 +0,0 @@
|
|||
[styling]
|
||||
default=default
|
||||
comment=comment
|
||||
commentline=comment_line
|
||||
commentdoc=comment_doc
|
||||
preprocessorcomment=comment
|
||||
number=number_1
|
||||
word=keyword_1
|
||||
word2=keyword_2
|
||||
string=string_1
|
||||
stringraw=string_2
|
||||
character=character
|
||||
uuid=other
|
||||
preprocessor=preprocessor
|
||||
operator=operator
|
||||
identifier=identifier_1
|
||||
stringeol=string_eol
|
||||
verbatim=string_2
|
||||
regex=regex
|
||||
commentlinedoc=comment_line_doc
|
||||
commentdockeyword=comment_doc_keyword
|
||||
commentdockeyworderror=comment_doc_keyword_error
|
||||
globalclass=class
|
||||
tripleverbatim=string_2
|
||||
hashquotedstring=string_2
|
||||
|
||||
[keywords]
|
||||
primary=break case const continue string default do else enum float for goto if return switch typedef void while false nil true
|
||||
secondary=
|
||||
docComment=
|
||||
|
||||
[lexer_properties]
|
||||
styling.within.preprocessor=1
|
||||
lexer.cpp.track.preprocessor=0
|
||||
preprocessor.symbol.$(file.patterns.cpp)=#
|
||||
preprocessor.start.$(file.patterns.cpp)=if ifdef ifndef
|
||||
preprocessor.middle.$(file.patterns.cpp)=else elif
|
||||
preprocessor.end.$(file.patterns.cpp)=endif
|
||||
|
||||
[settings]
|
||||
extension=qc
|
||||
comment_single=//
|
||||
comment_open=/*
|
||||
comment_close=*/
|
||||
comment_use_indent=true
|
||||
context_action_cmd=
|
||||
|
||||
[indentation]
|
||||
width=4
|
||||
type=0
|
||||
|
||||
[build_settings]
|
||||
compiler=gmqcc -Wall "%f" -o "%e"
|
||||
linker=
|
||||
run_cmd=qcvm "./%e"
|
|
@ -1,5 +0,0 @@
|
|||
To use the gtksourceview syntax highlighting install qc.lang to the syntax
|
||||
directory for gtksourceview
|
||||
|
||||
# Can be installed globally to
|
||||
/usr/share/gtksourceview-[version]/language-specs/
|
|
@ -1,173 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<language id="qc" _name="QuakeC" version="1.0" _section="Sources">
|
||||
<metadata>
|
||||
<property name="globs">*.qc</property>
|
||||
<property name="line-comment-start">//</property>
|
||||
<property name="block-comment-start">/*</property>
|
||||
<property name="block-comment-end">*/</property>
|
||||
</metadata>
|
||||
|
||||
<styles>
|
||||
<style id="comment" _name="Comment" map-to="def:comment"/>
|
||||
<style id="string" _name="String" map-to="def:string"/>
|
||||
<style id="preprocessor" _name="Preprocessor" map-to="def:preprocessor"/>
|
||||
<style id="common-defines" _name="Common Defines" map-to="def:special-constant"/>
|
||||
<style id="included-file" _name="Included File" map-to="def:string"/>
|
||||
<style id="keyword" _name="Keyword" map-to="def:keyword"/>
|
||||
<style id="type" _name="Data Type" map-to="def:type"/>
|
||||
<style id="escaped-character" _name="Escaped Character" map-to="def:special-char"/>
|
||||
<style id="floating-point" _name="Floating point number" map-to="def:floating-point"/>
|
||||
<style id="decimal" _name="Decimal number" map-to="def:decimal"/>
|
||||
<style id="hexadecimal" _name="Hexadecimal number" map-to="def:base-n-integer"/>
|
||||
<style id="boolean" _name="Boolean value" map-to="def:boolean"/>
|
||||
</styles>
|
||||
|
||||
<definitions>
|
||||
|
||||
<!--regexs-->
|
||||
<define-regex id="preproc-start">^\s*#\s*</define-regex>
|
||||
<define-regex id="escaped-character" extended="true">
|
||||
\\( # leading backslash
|
||||
[\\\"\'nrbtfav\?] | # escaped character
|
||||
[0-7]{1,3} | # one, two, or three octal digits
|
||||
x[0-9A-Fa-f]+ # 'x' followed by hex digits
|
||||
)
|
||||
</define-regex>
|
||||
|
||||
<!-- Preprocessor -->
|
||||
<context id="if0-comment" style-ref="comment">
|
||||
<start>\%{preproc-start}if\b\s*0\b</start>
|
||||
<end>\%{preproc-start}(endif|else|elif)\b</end>
|
||||
<include>
|
||||
<context id="if-in-if0">
|
||||
<start>\%{preproc-start}if(n?def)?\b</start>
|
||||
<end>\%{preproc-start}endif\b</end>
|
||||
<include>
|
||||
<context ref="if-in-if0"/>
|
||||
<context ref="def:in-comment"/>
|
||||
</include>
|
||||
</context>
|
||||
<context ref="def:in-comment"/>
|
||||
</include>
|
||||
</context>
|
||||
<context id="include" style-ref="preprocessor">
|
||||
<match extended="true">
|
||||
\%{preproc-start}
|
||||
(include|import)\s*
|
||||
(".*?"|<.*>)
|
||||
</match>
|
||||
<include>
|
||||
<context id="included-file" sub-pattern="2" style-ref="included-file"/>
|
||||
</include>
|
||||
</context>
|
||||
<context id="preprocessor" style-ref="preprocessor" end-at-line-end="true">
|
||||
<start extended="true">
|
||||
\%{preproc-start}
|
||||
(define|undef|error|pragma|ident|if(n?def)?|else|elif|endif|line|warning)
|
||||
\b
|
||||
</start>
|
||||
<include>
|
||||
<context ref="def:line-continue" ignore-style="true"/>
|
||||
<context ref="string" ignore-style="true"/>
|
||||
<context ref="def:qc-like-comment"/>
|
||||
<context ref="def:qc-like-comment-multiline"/>
|
||||
</include>
|
||||
</context>
|
||||
|
||||
<context id="float" style-ref="floating-point">
|
||||
<match extended="true">
|
||||
(?<![\w\.])
|
||||
((\.[0-9]+ | [0-9]+\.[0-9]*) ([Ee][+-]?[0-9]*)? |
|
||||
([0-9]+[Ee][+-]?[0-9]*))
|
||||
[fFlL]?
|
||||
(?![\w\.])
|
||||
</match>
|
||||
</context>
|
||||
|
||||
<context id="hexadecimal" style-ref="hexadecimal">
|
||||
<match extended="true">
|
||||
(?<![\w\.])
|
||||
0[xX][a-fA-F0-9]+[uUlL]*
|
||||
(?![\w\.])
|
||||
</match>
|
||||
</context>
|
||||
|
||||
<context id="invalid-hexadecimal" style-ref="error">
|
||||
<match extended="true">
|
||||
(?<![\w\.])
|
||||
0[xX][a-fA-F0-9]*[g-zG-Z][a-zA-Z0-9]*[uUlL]*
|
||||
(?![\w\.])
|
||||
</match>
|
||||
</context>
|
||||
|
||||
<context id="decimal" style-ref="decimal">
|
||||
<match extended="true">
|
||||
(?<![\w\.])
|
||||
(0|[1-9][0-9]*)[uUlL]*
|
||||
(?![\w\.])
|
||||
</match>
|
||||
</context>
|
||||
|
||||
<context id="keywords" style-ref="keyword">
|
||||
<keyword>break</keyword>
|
||||
<keyword>case</keyword>
|
||||
<keyword>continue</keyword>
|
||||
<keyword>default</keyword>
|
||||
<keyword>do</keyword>
|
||||
<keyword>else</keyword>
|
||||
<keyword>enum</keyword>
|
||||
<keyword>for</keyword>
|
||||
<keyword>goto</keyword>
|
||||
<keyword>if</keyword>
|
||||
<keyword>return</keyword>
|
||||
<keyword>switch</keyword>
|
||||
<keyword>typedef</keyword>
|
||||
<keyword>while</keyword>
|
||||
<keyword>nil</keyword>
|
||||
</context>
|
||||
|
||||
<context id="types" style-ref="type">
|
||||
<keyword>bool</keyword>
|
||||
<keyword>string</keyword>
|
||||
<keyword>vector</keyword>
|
||||
<keyword>float</keyword>
|
||||
<keyword>void</keyword>
|
||||
</context>
|
||||
|
||||
<context id="boolean" style-ref="boolean">
|
||||
<keyword>true</keyword>
|
||||
<keyword>false</keyword>
|
||||
</context>
|
||||
|
||||
<context id="common-defines" style-ref="common-defines">
|
||||
<keyword>__LINE__</keyword>
|
||||
<keyword>__FILE__</keyword>
|
||||
<keyword>__TIME__</keyword>
|
||||
<keyword>__RANDOM__</keyword>
|
||||
<keyword>__RANDOM_LAST__</keyword>
|
||||
<keyword>__COUNTER__</keyword>
|
||||
<keyword>__COUNTER_LAST__</keyword>
|
||||
<keyword>__DATE__</keyword>
|
||||
</context>
|
||||
|
||||
<context id="qc" class="no-spell-check">
|
||||
<include>
|
||||
<context ref="def:qc-like-comment"/>
|
||||
<context ref="def:qc-like-comment-multiline"/>
|
||||
<context ref="def:qc-like-close-comment-outside-comment"/>
|
||||
<context ref="if0-comment"/>
|
||||
<context ref="include"/>
|
||||
<context ref="preprocessor"/>
|
||||
<context ref="string"/>
|
||||
<context ref="float"/>
|
||||
<context ref="hexadecimal"/>
|
||||
<context ref="invalid-hexadecimal"/>
|
||||
<context ref="decimal"/>
|
||||
<context ref="keywords"/>
|
||||
<context ref="types"/>
|
||||
<context ref="boolean"/>
|
||||
<context ref="common-defines"/>
|
||||
</include>
|
||||
</context>
|
||||
</definitions>
|
||||
</language>
|
|
@ -1,26 +0,0 @@
|
|||
To use the jedit syntax highlighting install qc.xml to the syntax
|
||||
directory for jedit
|
||||
|
||||
# For Windows Users that directory is
|
||||
C:\Users\username\.jedit\modes
|
||||
|
||||
# For Linux users that directory is
|
||||
/home/username/.jedit/modes
|
||||
|
||||
# For Mac users that directory is
|
||||
/Users/username/Library/jEdit/modes
|
||||
|
||||
After the file is installed, a mode line needs to be added to
|
||||
a file caled catalog in that same directory.
|
||||
|
||||
Add the following line:
|
||||
<MODE NAME="QuakeC Code" FILE="qc.xml" FILE_NAME_GLOB="*.qc" />
|
||||
|
||||
inside the <MODES> block before the end tag </MODES>. If the file
|
||||
does not exist, you can simply make one and use the following:
|
||||
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE MODES SYSTEM "catalog.dtd">
|
||||
<MODES>
|
||||
<MODE NAME="QuakeC Code" FILE="qc.xml" FILE_NAME_GLOB="*.qc" />
|
||||
</MODES>
|
|
@ -1,271 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!DOCTYPE MODE SYSTEM "xmode.dtd">
|
||||
|
||||
<MODE>
|
||||
<PROPS>
|
||||
<PROPERTY NAME="commentStart" VALUE="/*" />
|
||||
<PROPERTY NAME="commentEnd" VALUE="*/" />
|
||||
<PROPERTY NAME="lineComment" VALUE="//" />
|
||||
<PROPERTY NAME="wordBreakChars" VALUE=",+-=<>/?^&*" />
|
||||
|
||||
<!-- Auto indent -->
|
||||
<PROPERTY NAME="indentOpenBrackets" VALUE="{" />
|
||||
<PROPERTY NAME="indentCloseBrackets" VALUE="}" />
|
||||
<PROPERTY NAME="unalignedOpenBrackets" VALUE="(" />
|
||||
<PROPERTY NAME="unalignedCloseBrackets" VALUE=")" />
|
||||
<PROPERTY NAME="indentNextLine"
|
||||
VALUE="(?!^\s*(#|//)).*(\b(if|while|for)\s*\(.*\)|\b(else|do)\b)[^{;]*$" />
|
||||
<PROPERTY NAME="unindentThisLine"
|
||||
VALUE="^\s*((case\b.*|[\p{Alpha}_][\p{Alnum}_]*)\s*:(?!:)).*$" />
|
||||
<PROPERTY NAME="electricKeys" VALUE=":" />
|
||||
</PROPS>
|
||||
|
||||
<RULES
|
||||
IGNORE_CASE="FALSE"
|
||||
HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[0-9][0-9a-zA-Z]*">
|
||||
<EOL_SPAN TYPE="KEYWORD2" AT_WHITESPACE_END="TRUE" DELEGATE="CPP">#</EOL_SPAN>
|
||||
|
||||
<IMPORT DELEGATE="LEX"/>
|
||||
<IMPORT DELEGATE="CORE"/>
|
||||
</RULES>
|
||||
|
||||
<RULES SET="LEX" IGNORE_CASE="FALSE">
|
||||
<IMPORT DELEGATE="COMMENTS" />
|
||||
<IMPORT DELEGATE="C_LEXER" />
|
||||
</RULES>
|
||||
|
||||
<!-- Comments, Trigraph, Alternate-Tokens -->
|
||||
<RULES SET="C_LEXER"
|
||||
IGNORE_CASE="FALSE"
|
||||
HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[0-9][0-9a-zA-Z]*">
|
||||
|
||||
<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\">
|
||||
<BEGIN>L"</BEGIN>
|
||||
<END>"</END>
|
||||
</SPAN>
|
||||
<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\">
|
||||
<BEGIN>"</BEGIN>
|
||||
<END>"</END>
|
||||
</SPAN>
|
||||
<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\">
|
||||
<BEGIN>L'</BEGIN>
|
||||
<END>'</END>
|
||||
</SPAN>
|
||||
<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE" ESCAPE="\">
|
||||
<BEGIN>'</BEGIN>
|
||||
<END>'</END>
|
||||
</SPAN>
|
||||
|
||||
<!-- Trigraphs -->
|
||||
<SEQ TYPE="LITERAL4">??(</SEQ>
|
||||
<SEQ TYPE="LITERAL4">??/</SEQ>
|
||||
<SEQ TYPE="LITERAL4">??)</SEQ>
|
||||
<SEQ TYPE="LITERAL4">??'</SEQ>
|
||||
<SEQ TYPE="LITERAL4">??<</SEQ>
|
||||
<SEQ TYPE="LITERAL4">??!</SEQ>
|
||||
<SEQ TYPE="LITERAL4">??></SEQ>
|
||||
<SEQ TYPE="LITERAL4">??-</SEQ>
|
||||
<SEQ TYPE="LITERAL4">??=</SEQ>
|
||||
|
||||
<!-- Alternate tokens -->
|
||||
<SEQ TYPE="LITERAL4"><:</SEQ>
|
||||
<SEQ TYPE="LITERAL4">:></SEQ>
|
||||
<SEQ TYPE="LITERAL4"><%</SEQ>
|
||||
<SEQ TYPE="LITERAL4">%></SEQ>
|
||||
<SEQ TYPE="LITERAL4">%:</SEQ>
|
||||
|
||||
<!-- Labels.
|
||||
This is a part of core language syntax, but must be here
|
||||
because it can't work after SEQ for ':'. -->
|
||||
<MARK_PREVIOUS AT_WHITESPACE_END="TRUE"
|
||||
MATCH_TYPE="OPERATOR"
|
||||
TYPE="LABEL">:</MARK_PREVIOUS>
|
||||
|
||||
<!-- Function-like macro or function calls.
|
||||
This can't work after SEQ for '('. -->
|
||||
<MARK_PREVIOUS
|
||||
TYPE="FUNCTION"
|
||||
MATCH_TYPE="OPERATOR">(</MARK_PREVIOUS>
|
||||
|
||||
<SEQ TYPE="OPERATOR">=</SEQ>
|
||||
<SEQ TYPE="OPERATOR">!</SEQ>
|
||||
<SEQ TYPE="OPERATOR">+</SEQ>
|
||||
<SEQ TYPE="OPERATOR">-</SEQ>
|
||||
<SEQ TYPE="OPERATOR">/</SEQ>
|
||||
<SEQ TYPE="OPERATOR">*</SEQ>
|
||||
<SEQ TYPE="OPERATOR">></SEQ>
|
||||
<SEQ TYPE="OPERATOR"><</SEQ>
|
||||
<SEQ TYPE="OPERATOR">%</SEQ>
|
||||
<SEQ TYPE="OPERATOR">&</SEQ>
|
||||
<SEQ TYPE="OPERATOR">|</SEQ>
|
||||
<SEQ TYPE="OPERATOR">^</SEQ>
|
||||
<SEQ TYPE="OPERATOR">~</SEQ>
|
||||
<SEQ TYPE="OPERATOR">?</SEQ>
|
||||
<SEQ TYPE="OPERATOR">:</SEQ>
|
||||
<SEQ TYPE="OPERATOR">.</SEQ>
|
||||
<SEQ TYPE="OPERATOR">,</SEQ>
|
||||
<SEQ TYPE="OPERATOR">[</SEQ>
|
||||
<SEQ TYPE="OPERATOR">]</SEQ>
|
||||
<SEQ TYPE="OPERATOR">)</SEQ>
|
||||
<SEQ TYPE="OPERATOR">}</SEQ>
|
||||
<SEQ TYPE="OPERATOR">{</SEQ>
|
||||
<SEQ TYPE="OPERATOR">;</SEQ>
|
||||
|
||||
<KEYWORDS>
|
||||
<LITERAL2>__FILE__</LITERAL2>
|
||||
<LITERAL2>__LINE__</LITERAL2>
|
||||
<LITERAL2>__DATE__</LITERAL2>
|
||||
<LITERAL2>__RANDOM__</LITERAL2>
|
||||
<LITERAL2>__RANDOM_LAST</LITERAL2>
|
||||
<LITERAL2>__COUNT__</LITERAL2>
|
||||
<LITERAL2>__COUNT_LAST</LITERAL2>
|
||||
</KEYWORDS>
|
||||
</RULES>
|
||||
|
||||
<!-- Core language -->
|
||||
<RULES SET="CORE"
|
||||
IGNORE_CASE="FALSE"
|
||||
HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[0-9][0-9a-zA-Z]*">
|
||||
<KEYWORDS>
|
||||
<!-- Types -->
|
||||
<KEYWORD3>float</KEYWORD3>
|
||||
<KEYWORD3>vector</KEYWORD3>
|
||||
<KEYWORD3>string</KEYWORD3>
|
||||
<KEYWORD3>entity</KEYWORD3>
|
||||
<KEYWORD3>enum</KEYWORD3>
|
||||
<KEYWORD3>.float</KEYWORD3>
|
||||
<KEYWORD3>.int</KEYWORD3>
|
||||
<KEYWORD3>.vector</KEYWORD3>
|
||||
<KEYWORD3>.string</KEYWORD3>
|
||||
<KEYWORD3>.entity</KEYWORD3>
|
||||
<KEYWORD3>.void</KEYWORD3>
|
||||
<KEYWORD3>typedef</KEYWORD3>
|
||||
|
||||
<KEYWORD1>break</KEYWORD1>
|
||||
<KEYWORD1>case</KEYWORD1>
|
||||
<KEYWORD1>continue</KEYWORD1>
|
||||
<KEYWORD1>default</KEYWORD1>
|
||||
<KEYWORD1>do</KEYWORD1>
|
||||
<KEYWORD1>else</KEYWORD1>
|
||||
<KEYWORD1>for</KEYWORD1>
|
||||
<KEYWORD1>goto</KEYWORD1>
|
||||
<KEYWORD1>if</KEYWORD1>
|
||||
<KEYWORD1>return</KEYWORD1>
|
||||
<KEYWORD1>switch</KEYWORD1>
|
||||
<KEYWORD1>void</KEYWORD1>
|
||||
<KEYWORD1>while</KEYWORD1>
|
||||
<KEYWORD1>nil</KEYWORD1>
|
||||
|
||||
<LITERAL2>FALSE</LITERAL2>
|
||||
<LITERAL2>TRUE</LITERAL2>
|
||||
<LITERAL2>...</LITERAL2>
|
||||
</KEYWORDS>
|
||||
</RULES>
|
||||
|
||||
<!-- Different comment styles. -->
|
||||
<RULES SET="COMMENTS">
|
||||
<!-- Doxygen comment, Javadoc style -->
|
||||
<SEQ TYPE="COMMENT1">/**/</SEQ>
|
||||
<SPAN TYPE="COMMENT3" DELEGATE="doxygen::DOXYGEN">
|
||||
<BEGIN>/**<</BEGIN>
|
||||
<END>*/</END>
|
||||
</SPAN>
|
||||
<SPAN TYPE="COMMENT3" DELEGATE="doxygen::DOXYGEN">
|
||||
<BEGIN>/**</BEGIN>
|
||||
<END>*/</END>
|
||||
</SPAN>
|
||||
<EOL_SPAN TYPE="COMMENT3" DELEGATE="doxygen::DOXYGEN">///<</EOL_SPAN>
|
||||
<EOL_SPAN TYPE="COMMENT3" DELEGATE="doxygen::DOXYGEN">///</EOL_SPAN>
|
||||
|
||||
<!-- Doxygen comment, Qt style -->
|
||||
<SPAN TYPE="COMMENT3" DELEGATE="doxygen::DOXYGEN">
|
||||
<BEGIN>/*!<</BEGIN>
|
||||
<END>*/</END>
|
||||
</SPAN>
|
||||
<SPAN TYPE="COMMENT3" DELEGATE="doxygen::DOXYGEN">
|
||||
<BEGIN>/*!</BEGIN>
|
||||
<END>*/</END>
|
||||
</SPAN>
|
||||
<EOL_SPAN TYPE="COMMENT3" DELEGATE="doxygen::DOXYGEN">//!<</EOL_SPAN>
|
||||
<EOL_SPAN TYPE="COMMENT3" DELEGATE="doxygen::DOXYGEN">//!</EOL_SPAN>
|
||||
|
||||
<!-- C style comment -->
|
||||
<SPAN TYPE="COMMENT1">
|
||||
<BEGIN>/*</BEGIN>
|
||||
<END>*/</END>
|
||||
</SPAN>
|
||||
<EOL_SPAN TYPE="COMMENT1">//</EOL_SPAN>
|
||||
</RULES>
|
||||
|
||||
<!-- Preprocessor specific rules -->
|
||||
<RULES SET="CPP"
|
||||
IGNORE_CASE="FALSE"
|
||||
HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[0-9][0-9a-zA-Z]*">
|
||||
|
||||
<EOL_SPAN_REGEXP HASH_CHAR="include" TYPE="MARKUP" DELEGATE="INCLUDE">include\b</EOL_SPAN_REGEXP>
|
||||
<EOL_SPAN_REGEXP HASH_CHAR="define" TYPE="MARKUP" DELEGATE="DEFINE">define\b</EOL_SPAN_REGEXP>
|
||||
<EOL_SPAN_REGEXP HASH_CHAR="endif" TYPE="MARKUP" DELEGATE="LEX">endif\b</EOL_SPAN_REGEXP>
|
||||
<EOL_SPAN_REGEXP HASH_CHAR="elif" TYPE="MARKUP" DELEGATE="CONDITION">elif\b</EOL_SPAN_REGEXP>
|
||||
<EOL_SPAN_REGEXP HASH_CHAR="if" TYPE="MARKUP" DELEGATE="CONDITION">if\b</EOL_SPAN_REGEXP>
|
||||
|
||||
<IMPORT DELEGATE="LEX"/>
|
||||
|
||||
<!-- Directives -->
|
||||
<KEYWORDS>
|
||||
<MARKUP>undef</MARKUP>
|
||||
<MARKUP>ifdef</MARKUP>
|
||||
<MARKUP>ifndef</MARKUP>
|
||||
<MARKUP>else</MARKUP>
|
||||
<MARKUP>error</MARKUP>
|
||||
<MARKUP>warning</MARKUP>
|
||||
<MARKUP>pragma</MARKUP>
|
||||
<MARKUP>$frame</MARKUP>
|
||||
<MARKUP>$model</MARKUP>
|
||||
</KEYWORDS>
|
||||
</RULES>
|
||||
|
||||
<!-- After #include directive -->
|
||||
<!-- "\"s are not escaped. -->
|
||||
<RULES SET="INCLUDE"
|
||||
IGNORE_CASE="FALSE"
|
||||
HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[0-9][0-9a-zA-Z]*">
|
||||
<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE">
|
||||
<BEGIN><</BEGIN>
|
||||
<END>></END>
|
||||
</SPAN>
|
||||
<SPAN TYPE="LITERAL1" NO_LINE_BREAK="TRUE">
|
||||
<BEGIN>"</BEGIN>
|
||||
<END>"</END>
|
||||
</SPAN>
|
||||
<IMPORT DELEGATE="LEX"/>
|
||||
</RULES>
|
||||
|
||||
<!-- After #define directive -->
|
||||
<!-- Almost same as the normal code,
|
||||
except two additional operators # and ##. -->
|
||||
<RULES SET="DEFINE"
|
||||
IGNORE_CASE="FALSE"
|
||||
HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[0-9][0-9a-zA-Z]*">
|
||||
<SEQ TYPE="OPERATOR">#</SEQ>
|
||||
<IMPORT DELEGATE="LEX"/>
|
||||
<IMPORT DELEGATE="CORE"/>
|
||||
</RULES>
|
||||
|
||||
<!-- After #if or #elif directive -->
|
||||
<!-- All constant expressions and a special operator
|
||||
'defined' is available. But the core language elements
|
||||
(such as operator 'sizeof', type casting, etc...) are not. -->
|
||||
<RULES SET="CONDITION"
|
||||
IGNORE_CASE="FALSE"
|
||||
HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[0-9][0-9a-zA-Z]*">
|
||||
<IMPORT DELEGATE="LEX"/>
|
||||
<KEYWORDS>
|
||||
<KEYWORD2>defined</KEYWORD2>
|
||||
<KEYWORD2>TRUE</KEYWORD2>
|
||||
<KEYWORD2>FALSE</KEYWORD2>
|
||||
<KEYWORD2>true</KEYWORD2>
|
||||
<KEYWORD2>false</KEYWORD2>
|
||||
</KEYWORDS>
|
||||
</RULES>
|
||||
</MODE>
|
|
@ -1,9 +0,0 @@
|
|||
To use the Kate syntax highlighting install qc.xml to the syntax
|
||||
directory for kate.
|
||||
|
||||
# Can be installed globally to
|
||||
$KDEDIR/share/apps/katepart/syntax
|
||||
|
||||
if $KDEDIR is unset you can lookup the folder directory with
|
||||
kde4-config --prefix if that doesn't work chances are KDEDIR is
|
||||
/usr
|
|
@ -1,155 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE language SYSTEM "language.dtd">
|
||||
<language name="QuakeC" section="Sources"
|
||||
version="1.00" kateversion="2.4"
|
||||
indenter="cstyle"
|
||||
extensions="*.qc;*.QC;*.qh"
|
||||
mimetype=""
|
||||
priority="5"
|
||||
author="Dale Weiler">
|
||||
<highlighting>
|
||||
<list name="keywords">
|
||||
<item> break </item>
|
||||
<item> case </item>
|
||||
<item> continue </item>
|
||||
<item> default </item>
|
||||
<item> do </item>
|
||||
<item> else </item>
|
||||
<item> enum </item>
|
||||
<item> for </item>
|
||||
<item> goto </item>
|
||||
<item> if </item>
|
||||
<item> return </item>
|
||||
<item> switch </item>
|
||||
<item> typedef </item>
|
||||
<item> while </item>
|
||||
<item> nil </item>
|
||||
</list>
|
||||
<list name="types">
|
||||
<item> const </item>
|
||||
<item> vector </item>
|
||||
<item> float </item>
|
||||
<item> void </item>
|
||||
<item> string </item>
|
||||
</list>
|
||||
<contexts>
|
||||
<context attribute="Normal Text" lineEndContext="#stay" name="Normal">
|
||||
<DetectSpaces />
|
||||
<RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0\s*$" beginRegion="PP" firstNonSpace="true" />
|
||||
<DetectChar context="AfterHash" char="#" firstNonSpace="true" lookAhead="true" />
|
||||
<StringDetect attribute="Region Marker" context="Region Marker" String="//BEGIN" beginRegion="Region1" firstNonSpace="true" />
|
||||
<StringDetect attribute="Region Marker" context="Region Marker" String="//END" endRegion="Region1" firstNonSpace="true" />
|
||||
<keyword attribute="Keyword" context="#stay" String="keywords"/>
|
||||
<keyword attribute="Data Type" context="#stay" String="types"/>
|
||||
<DetectIdentifier />
|
||||
<DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" />
|
||||
<DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" />
|
||||
<Float attribute="Float" context="#stay">
|
||||
<AnyChar String="fF" attribute="Float" context="#stay"/>
|
||||
</Float>
|
||||
<HlCHex attribute="Hex" context="#stay"/>
|
||||
<Int attribute="Decimal" context="#stay" >
|
||||
<StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/>
|
||||
<StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/>
|
||||
<StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/>
|
||||
<StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/>
|
||||
<StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/>
|
||||
<StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/>
|
||||
<StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/>
|
||||
<StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/>
|
||||
</Int>
|
||||
<HlCChar attribute="Char" context="#stay"/>
|
||||
<DetectChar attribute="String" context="String" char="""/>
|
||||
<Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
|
||||
<Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
|
||||
<AnyChar attribute="Symbol" context="#stay" String=":!%&()+,-/.*<=>?[]|~^;"/>
|
||||
</context>
|
||||
|
||||
<context attribute="String" lineEndContext="#pop" name="String">
|
||||
<LineContinue attribute="String" context="#stay"/>
|
||||
<HlCStringChar attribute="String Char" context="#stay"/>
|
||||
<DetectChar attribute="String" context="#pop" char="""/>
|
||||
</context>
|
||||
|
||||
<context attribute="Region Marker" lineEndContext="#pop" name="Region Marker">
|
||||
</context>
|
||||
|
||||
<context attribute="Comment" lineEndContext="#pop" name="Commentar 1">
|
||||
<LineContinue attribute="Comment" context="#stay"/>
|
||||
<IncludeRules context="##Alerts" />
|
||||
</context>
|
||||
|
||||
<context attribute="Comment" lineEndContext="#stay" name="Commentar 2">
|
||||
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/>
|
||||
<IncludeRules context="##Alerts" />
|
||||
</context>
|
||||
|
||||
<context attribute="Error" lineEndContext="#pop" name="AfterHash">
|
||||
<!-- define, elif, else, endif, error, if, ifdef, ifndef, include, include_next, line, pragma, undef, warning -->
|
||||
<RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*if(?:def|ndef)?(?=\s+\S)" insensitive="true" beginRegion="PP" firstNonSpace="true" />
|
||||
<RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*endif" insensitive="true" endRegion="PP" firstNonSpace="true" />
|
||||
<RegExpr attribute="Preprocessor" context="Define" String="#\s*define.*((?=\\))" insensitive="true" firstNonSpace="true" />
|
||||
<RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*(?:el(?:se|if)|include(?:_next)?|define|undef|line|error|warning|pragma)" insensitive="true" firstNonSpace="true" />
|
||||
<RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s+[0-9]+" insensitive="true" firstNonSpace="true" />
|
||||
</context>
|
||||
|
||||
<context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor">
|
||||
<LineContinue attribute="Preprocessor" context="#stay"/>
|
||||
<RangeDetect attribute="Prep. Lib" context="#stay" char=""" char1="""/>
|
||||
<RangeDetect attribute="Prep. Lib" context="#stay" char="<" char1=">"/>
|
||||
<IncludeRules context="##Doxygen" />
|
||||
<Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*" beginRegion="Comment2" />
|
||||
<Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/" />
|
||||
</context>
|
||||
|
||||
<context attribute="Preprocessor" lineEndContext="#pop" name="Define">
|
||||
<LineContinue attribute="Preprocessor" context="#stay"/>
|
||||
</context>
|
||||
|
||||
<context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor">
|
||||
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment2" />
|
||||
</context>
|
||||
|
||||
<context attribute="Comment" lineEndContext="#stay" name="Outscoped" >
|
||||
<DetectSpaces />
|
||||
<DetectIdentifier />
|
||||
<DetectChar attribute="String" context="String" char="""/>
|
||||
<Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
|
||||
<Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
|
||||
<RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="PP" firstNonSpace="true" />
|
||||
<RegExpr attribute="Preprocessor" context="#pop" String="#\s*el(?:se|if)" firstNonSpace="true" />
|
||||
<RegExpr attribute="Preprocessor" context="#pop" String="#\s*endif" endRegion="PP" firstNonSpace="true" />
|
||||
</context>
|
||||
|
||||
<context attribute="Comment" lineEndContext="#stay" name="Outscoped intern">
|
||||
<DetectSpaces />
|
||||
<DetectIdentifier />
|
||||
<DetectChar attribute="String" context="String" char="""/>
|
||||
<Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/>
|
||||
<Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/>
|
||||
<RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="PP" firstNonSpace="true" />
|
||||
<RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="PP" firstNonSpace="true" />
|
||||
</context>
|
||||
</contexts>
|
||||
<itemDatas>
|
||||
<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
|
||||
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
|
||||
<itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/>
|
||||
<itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/>
|
||||
<itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/>
|
||||
<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/>
|
||||
<itemData name="String" defStyleNum="dsString"/>
|
||||
<itemData name="String Char" defStyleNum="dsChar"/>
|
||||
<itemData name="Comment" defStyleNum="dsComment"/>
|
||||
<itemData name="Symbol" defStyleNum="dsNormal" spellChecking="false"/>
|
||||
<itemData name="Preprocessor" defStyleNum="dsOthers" spellChecking="false"/>
|
||||
</itemDatas>
|
||||
</highlighting>
|
||||
<general>
|
||||
<comments>
|
||||
<comment name="singleLine" start="//" />
|
||||
<comment name="multiLine" start="/*" end="*/" />
|
||||
</comments>
|
||||
<keywords casesensitive="1" additionalDeliminator="'"" />
|
||||
</general>
|
||||
</language>
|
|
@ -1,12 +0,0 @@
|
|||
To use the nano syntax highlighting install qc.nanorc somewhere and
|
||||
add:
|
||||
|
||||
include /directory/qc.nanorc
|
||||
|
||||
to your nanorc file located at ~/.nanorc. If the file doesn't exist
|
||||
create it.
|
||||
|
||||
Optionally you can install it globally by installing qc.nanorc to
|
||||
/usr/share/nano
|
||||
|
||||
However you still need to provide the include to your ~/.nanorc
|
|
@ -1,22 +0,0 @@
|
|||
# Language: QuakeC
|
||||
# Maintainer: Dale Weiler
|
||||
|
||||
syntax "qc" "\.(qc|QC)$" "\.(qh|QH)$"
|
||||
color brightred "\<[A-Z_][0-9A-Z_]+\>"
|
||||
color green "\<(float|string|enum|void|const|typedef|nil)\>"
|
||||
color brightyellow "\<(for|if|while|do|else|case|default|switch)\>"
|
||||
color magenta "\<(goto|continue|break|return)\>"
|
||||
color brightcyan "^[[:space:]]*#[[:space:]]*(define|include|(un|ifn?)def|endif|el(if|se)|if|warning|error|pragma)"
|
||||
color brightmagenta "'([^'\]|(\\["'abfnrtv\\]))'" "'\\(([0-3]?[0-7]{1,2}))'" "'\\x[0-9A-Fa-f]{1,2}'"
|
||||
|
||||
color brightyellow "<[^= ]*>" ""(\\.|[^"])*""
|
||||
|
||||
## This string is VERY resource intensive!
|
||||
color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
|
||||
|
||||
## Comment highlighting
|
||||
color brightblue "//.*"
|
||||
color brightblue start="/\*" end="\*/"
|
||||
|
||||
## Trailing whitespace
|
||||
color ,green "[[:space:]]+$"
|
Loading…
Reference in a new issue