home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!ucbvax!parc.xerox.com!janssen
- From: janssen@parc.xerox.com (Bill Janssen)
- Newsgroups: comp.soft-sys.andrew
- Subject: Re: More checks on size of ATK applications
- Message-ID: <seaba7UB0KGW82AmJK@holmes.parc.xerox.com>
- Date: 25 Aug 92 18:18:47 GMT
- References: <EeZ=xSq__5g8Ei1nVN@cs.city.ac.uk>
- Sender: daemon@ucbvax.BERKELEY.EDU
- Distribution: world
- Organization: The Internet
- Lines: 76
-
- Excerpts from ext.andrew: 21-Aug-92 More checks on size of ATK .. Nick
- Williams@cs.city.ac (1088+0)
-
- > Hence the 900 odd K of runapp could be cut down fairly massively.
-
- > Am I wrong?
-
- Not at all. Here's my 24K (SunOS 4.1.1, SPARC) version of EZ:
-
- #include <stdio.h>
-
- #include <class.h>
- #include <im.ih>
- #include <buffer.ih>
- #include <frame.ih>
-
- #ifndef _XLIB_H_
- #define Window unsigned long
- #define Display char
- #endif
- #include <xim.ih>
-
- main (ac, av)
- int ac;
- char **av;
- {
- struct xim *xim;
- Window window;
- struct buffer *buffer;
-
- initclass();
-
- im_SetProgramName("edit"); /* if this isn't done,
- im_Create() will core-dump. Dumb. */
-
- window = atoi(av[1]);
- buffer = buffer_GetBufferOnFile (av[2], 0);
- xim = xim_New();
- if (!xim_CreateWindow (xim, "localhost"))
- exit(1);
- xim_SetView (xim, frame_Create(buffer));
- im_KeyboardProcessor();
- exit (0);
- }
-
- static initclass ()
- {
- #if ((sun)&&(sparc))
-
- #include <sys/fcntl.h> /* for O_RDWR */
-
- {
- int fd;
-
- /*
- * XXX - force "/dev/zero" to be open as a file descriptor one
- * greater than the first available one, as a workaround for a
- * 4.1 bug (also present in 4.1.1) in the run-time loader.
- * (Fixed in System V Release 4, allegedly.)
- */
-
- printf ("doing fix for SunOS 4.1...\n");
-
- fd = open("/dev/zero", O_RDWR);
- dup(fd); /* one greater */
- close(fd);
- }
- #endif
-
- class_Init(AndrewDir("/dlib/atk"));
- }
-
-
- Link it with libclass.a and libutil.a...
-
- Bill
-