void psi_context_dump(struct psi_context *C, int fd)
{
- dprintf(fd, "// psi.engine=%s\n",
- (char *) C->ops->query(C, PSI_CONTEXT_QUERY_SELF, NULL));
+ size_t i;
+ struct psi_data *D;
- psi_data_dump(fd, PSI_DATA(C));
+ dprintf(fd, "// psi.engine=%s\n// %lu files\n",
+ (char *) C->ops->query(C, PSI_CONTEXT_QUERY_SELF, NULL),
+ C->count);
+
+ for (i = 0; i < C->count; ++i) {
+ psi_data_dump(fd, &C->data[i]);
+ }
}
}
if (!s->size && !psi_plist_count(s->args)) {
+ /* TODO: return true and check those structs are only used by address */
+ /* suppress needless warning
+ data->error(data, s->token, PSI_WARNING, "Empty struct %s",
+ s->name);
+ */
return false;
}
}
/* nothing changed; bail out */
- if (count_all && (dst->flags & PSI_SILENT) && !(flags & PSI_SILENT)) {
- /* one last error-spitting round, if not explicitly suppressed */
- dst->flags ^= PSI_SILENT;
- check_count = ~0;
+ if (count_all) {
+ src->errors += count_all;
- PSI_DEBUG_PRINT(dst, "PSI: validation bail out with %zu"
- " type checks remaining, errors follow\n", count_all);
- continue;
+ if ((dst->flags & PSI_SILENT) && !(flags & PSI_SILENT)) {
+ /* one last error-spitting round, if not explicitly suppressed */
+ dst->flags ^= PSI_SILENT;
+ check_count = ~0;
+
+ PSI_DEBUG_PRINT(dst, "PSI: validation bail out with %zu"
+ " type checks remaining, errors follow\n", count_all);
+ continue;
+ }
}
- src->errors += count_all;
break;
}
<?php
extension_loaded("psi") or die("skip - need ext/psi");
?>
+--INI--
+psi.directory={PWD}/../../psi.d
--FILE--
===TEST===
<?php
fclose($fd);
var_dump(file_exists($fn));
-var_dump(psi_validate($fn));
+var_dump(psi_validate($fn, 0, $e), $e);
@unlink(__DIR__."/dump001.psi");
?>
===DONE===
---EXPECT--
+--EXPECTF--
===TEST===
bool(true)
bool(true)
+int(%d)
===DONE===
--CLEAN--
<?php