| 24 | |
| 25 | |
| 26 | static unsigned short DisplayNumber(Display *dpy) |
| 27 | { |
| 28 | int dpynum = 0; char *ptr = NULL; |
| 29 | |
| 30 | if((ptr = strchr(DisplayString(dpy), ':')) != NULL) |
| 31 | { |
| 32 | if(strlen(ptr) > 1) dpynum = atoi(ptr + 1); |
| 33 | if(dpynum < 0 || dpynum > 65535) dpynum = 0; |
| 34 | } |
| 35 | return (unsigned short)dpynum; |
| 36 | } |
| 37 | |
| 38 | |
| 39 | #define ENDIANIZE(h) \ |