projects
/
m6w6
/
ext-pq
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
release 2.1.0
[m6w6/ext-pq]
/
php_pq_type.awk
diff --git
a/php_pq_type.awk
b/php_pq_type.awk
index 15ffd1b975198924334508e074ea31fac7638142..b5d07b4d53c1a6e5707a5265610ef82bbbc4b9ae 100755
(executable)
--- a/
php_pq_type.awk
+++ b/
php_pq_type.awk
@@
-13,22
+13,32
@@
END {
printf "\t||\t((oid) == %d) \\\n", oid
}
printf ")\n#endif\n"
printf "\t||\t((oid) == %d) \\\n", oid
}
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"
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"
+
+ printf "#ifndef PHP_PQ_DELIM_OF_ARRAY\n"
+ printf "# define PHP_PQ_DELIM_OF_ARRAY(oid) ("
+ for (oid in delims) {
+ printf "\\\n\t(oid) == %d ? '%s' : ", oid, delims[oid]
+ }
+ printf "0 \\\n)\n#endif\n"
}
/^DATA/ {
oid = $4
name = toupper($6)
}
/^DATA/ {
oid = $4
name = toupper($6)
+ adelim = $15
atypoid = $17
if (sub("^_", "", name)) {
arrays[oid] = atypoid
name = name "ARRAY"
}
atypoid = $17
if (sub("^_", "", name)) {
arrays[oid] = atypoid
name = name "ARRAY"
}
+ delims[oid] = adelim
printf "#ifndef PHP_PQ_OID_%s\n", name
printf "# define PHP_PQ_OID_%s %d\n", name, oid
printf "#endif\n"
printf "#ifndef PHP_PQ_OID_%s\n", name
printf "# define PHP_PQ_OID_%s %d\n", name, oid
printf "#endif\n"