diff options
author | Russ Cox <rsc@swtch.com> | 2008-06-30 19:41:08 -0400 |
---|---|---|
committer | Russ Cox <rsc@swtch.com> | 2008-06-30 19:41:08 -0400 |
commit | 9142d36228acc954b289705244ce2477187091e9 (patch) | |
tree | 0c8a33bbb8ecf5426ecd2fc59e11162080d19ff1 /src/cmd/devdraw/x11-init.c | |
parent | 1e77a39450cf1542089114becb66a9974db50768 (diff) | |
download | plan9port-9142d36228acc954b289705244ce2477187091e9.tar.gz plan9port-9142d36228acc954b289705244ce2477187091e9.tar.bz2 plan9port-9142d36228acc954b289705244ce2477187091e9.zip |
devdraw: OS X native version
Diffstat (limited to 'src/cmd/devdraw/x11-init.c')
-rw-r--r-- | src/cmd/devdraw/x11-init.c | 74 |
1 files changed, 1 insertions, 73 deletions
diff --git a/src/cmd/devdraw/x11-init.c b/src/cmd/devdraw/x11-init.c index 7e795906..0fd27d72 100644 --- a/src/cmd/devdraw/x11-init.c +++ b/src/cmd/devdraw/x11-init.c @@ -10,8 +10,7 @@ #include <mouse.h> #include <cursor.h> #include "x11-memdraw.h" - -static int parsewinsize(char*, Rectangle*, int*); +#include "devdraw.h" static void plan9cmap(void); static int setupcmap(XWindow); @@ -729,74 +728,3 @@ _xreplacescreenimage(void) _drawreplacescreenimage(m); return 1; } - -static int -parsewinsize(char *s, Rectangle *r, int *havemin) -{ - char c, *os; - int i, j, k, l; - - os = s; - *havemin = 0; - *r = Rect(0,0,0,0); - if(!isdigit((uchar)*s)) - goto oops; - i = strtol(s, &s, 0); - if(*s == 'x'){ - s++; - if(!isdigit((uchar)*s)) - goto oops; - j = strtol(s, &s, 0); - r->max.x = i; - r->max.y = j; - if(*s == 0) - return 0; - if(*s != '@') - goto oops; - - s++; - if(!isdigit((uchar)*s)) - goto oops; - i = strtol(s, &s, 0); - if(*s != ',' && *s != ' ') - goto oops; - s++; - if(!isdigit((uchar)*s)) - goto oops; - j = strtol(s, &s, 0); - if(*s != 0) - goto oops; - *r = rectaddpt(*r, Pt(i,j)); - *havemin = 1; - return 0; - } - - c = *s; - if(c != ' ' && c != ',') - goto oops; - s++; - if(!isdigit((uchar)*s)) - goto oops; - j = strtol(s, &s, 0); - if(*s != c) - goto oops; - s++; - if(!isdigit((uchar)*s)) - goto oops; - k = strtol(s, &s, 0); - if(*s != c) - goto oops; - s++; - if(!isdigit((uchar)*s)) - goto oops; - l = strtol(s, &s, 0); - if(*s != 0) - goto oops; - *r = Rect(i,j,k,l); - *havemin = 1; - return 0; - -oops: - werrstr("bad syntax in window size '%s'", os); - return -1; -} |