Skip to Main Content
Volume 7A: XView Programming Manual
book

Volume 7A: XView Programming Manual

by Dan Heller
October 1994
Intermediate to advanced content levelIntermediate to advanced
770 pages
22h 58m
English
O'Reilly Media, Inc.
Content preview from Volume 7A: XView Programming Manual
Example 18-15. Selection reply procedure (continued)
do {
Atom *targets = (Atom *)value;
char *target_name;
if (targets[--length]) {
target_name = (char *)xv_get(server, SERVER_ATOM_NAME,
targets[length]);
textsw_insert(textsw, "\t", 1);
textsw_insert(textsw, target_name, strlen(target_name));
textsw_insert(textsw, "\n", 1);
}
} while(length);
}
else
if (target == ATOM(server, "TIMESTAMP")) {
char buf[10];
textsw_insert(textsw, "TIMESTAMP of acquisition: ", 26);
sprintf(buf, "%U\n", *(unsigned long *)value);
textsw_insert(textsw, buf, strlen(buf));
}
else
if (target == ATOM(server, "LENGTH")) {
char buf[10];
textsw_insert(textsw, "Length of selection: ", 21);
sprintf(buf, "%d\n", *(int *)value);
textsw_insert(textsw, buf, strlen(buf));
}
else
if (target == ATOM(server, "STRING")) {
static int incr = False;
if (type == ATOM(server, "INCR")) {
textsw_insert(textsw, "Contents of the selection:\n", 27);
incr = True;
}
else
if (length) {
if (!incr)
textsw_insert(textsw, "Contents of the selection:\n", 27);
textsw_insert(textsw, (char *)value, length);
textsw_insert(textsw, "\n", 1);
}
else
incr = False;
}
else
if (target == ATOM(server, "DELETE")) {
textsw_insert(textsw, "The Selection has been deleted\n", 31);
}
textsw_insert(textsw, LINE, strlen(LINE));
}
428 XView Programming Manual
18.9.0.2 Sample error procedure
The error procedure ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 6A: Motif Programming Manual

Volume 6A: Motif Programming Manual

David Brennan, Dan Heller, Paula Ferguson
Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Alejandro Terrazas, John Ostuni, Michael Barlow

Publisher Resources

ISBN: 9780937175873