Mon 21 Jul 22:43:21 CEST 2025

This commit is contained in:
sbosse 2025-07-21 23:06:13 +02:00
parent a6dfe0ccf9
commit 024f6e1a87

View File

@ -0,0 +1,36 @@
var x11 = require('../../lib');
x11.createClient(function(err, display) {
var maxstd = 0;
var atomName;
for (atomName in display.client.atoms)
{
var id = display.client.atoms[atomName];
console.log(id + '\t' + atomName);
if (id > maxstd)
maxstd = id;
}
(
function getAtoms(atomIdStart, atomIdEnd)
{
var atomId;
var numInBatch = atomIdEnd - atomIdStart;
for (atomId = atomIdStart; atomId < atomIdEnd; atomId++)
{
(function(id) {
display.client.GetAtomName(id, function(err, atom) {
if (err) {
display.client.terminate();
return true;
} else {
console.log(id + '\t' + atom);
numInBatch--;
if (numInBatch === 0) {
getAtoms(atomIdStart + 100, atomIdEnd+ 100);
}
}
});
})(atomId);
}
}
)(maxstd+1, maxstd+100);
});