projects
/
m6w6
/
ext-pq
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
test fix; build fix; meta data
[m6w6/ext-pq]
/
php_pq_type.awk
diff --git
a/php_pq_type.awk
b/php_pq_type.awk
index c9ed34bbd74f5d0bd74d7231355499389fb941fc..15ffd1b975198924334508e074ea31fac7638142 100755
(executable)
--- a/
php_pq_type.awk
+++ b/
php_pq_type.awk
@@
-9,17
+9,24
@@
BEGIN {
END {
printf "#ifndef PHP_PQ_TYPE_IS_ARRAY\n"
printf "# define PHP_PQ_TYPE_IS_ARRAY(oid) (\\\n\t\t0 \\\n"
END {
printf "#ifndef PHP_PQ_TYPE_IS_ARRAY\n"
printf "# define PHP_PQ_TYPE_IS_ARRAY(oid) (\\\n\t\t0 \\\n"
- for (
name
in arrays) {
- printf "\t||\t((oid) == %d) \\\n",
arrays[name]
+ for (
oid
in arrays) {
+ printf "\t||\t((oid) == %d) \\\n",
oid
}
printf ")\n#endif\n"
}
printf ")\n#endif\n"
+ printf "#ifndef PHP_PQ_TYPE_OF_ARRAY\n"
+ printf "# define PHP_PQ_TYPE_OF_ARRAY(oid) ("
+ for (oid in arrays) {
+ printf "\\\n\t(oid) == %d ? %s : ", oid, arrays[oid]
+ }
+ printf "0 \\\n)\n#endif\n"
}
/^DATA/ {
oid = $4
name = toupper($6)
}
/^DATA/ {
oid = $4
name = toupper($6)
+ atypoid = $17
if (sub("^_", "", name)) {
if (sub("^_", "", name)) {
- arrays[
name] =
oid
+ arrays[
oid] = atyp
oid
name = name "ARRAY"
}
printf "#ifndef PHP_PQ_OID_%s\n", name
name = name "ARRAY"
}
printf "#ifndef PHP_PQ_OID_%s\n", name