*** atk/console/stats/pmax_3/getstats.c Fri Jul 27 16:01:36 1990 --- atk/console/stats/pmax_3/getstats.c.NEW Thu Jul 12 12:58:39 1990 *************** *** 2,23 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/console/stats/pmax_3/RCS/getstats.c,v 1.1 89/09/29 13:02:51 cfe Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/console/stats/pmax_3/RCS/getstats.c,v $ */ #ifndef lint ! static char *getstats_c_id = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/console/stats/pmax_3/RCS/getstats.c,v 1.1 89/09/29 13:02:51 cfe Exp $"; #endif /* lint */ /* ********************************************************************** - * **************** - * STUB LIBRARY FILE---NOT YET IMPLEMENTED FOR THIS SYSTEM - * THIS CODE SHOULD BE REPLACED BY AN IMPLEMENTATION OF - * THE RELEVANT ROUTINES FOR YOUR MACHINE TYPE. - * Please contribute your implementations to info-andrew-bugs@andrew.cmu.edu. - * You may use any of the other ..//getstats.c files as templates. - * **************** - * * This code is designed to read what might be priveledged (setuid) * information regarding both Disk Statistics (% full) and a host of * stats from /dev/kmem (including but not limited to, CPU, I/O, and VM) --- 2,15 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/pmax_3/RCS/getstats.c,v 1.2 90/06/29 10:08:23 rr2b Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/pmax_3/RCS/getstats.c,v $ */ #ifndef lint ! static char *getstats_c_id = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/pmax_3/RCS/getstats.c,v 1.2 90/06/29 10:08:23 rr2b Exp $"; #endif /* lint */ /* ********************************************************************** * This code is designed to read what might be priveledged (setuid) * information regarding both Disk Statistics (% full) and a host of * stats from /dev/kmem (including but not limited to, CPU, I/O, and VM) *************** *** 59,76 **** --- 51,453 ---- ********************************************************************** */ #include + /* The following include defines sys_vax_20 for Vax release 2.0 op sys, */ + /* since that particular OS needs some special treatment. We would have */ + /* used -Dsys_vax_20 except we want to use the same Makefile for each cpu... */ + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include /* search namelist in vmunix */ + + #include + + #include + #include + #include + + #include + #include + #include + + #ifndef MAXUPRC /* This is a constant in BSD, but */ + long maxuprc = 0; /* we have to nlist in Ultrix */ + #else /* MAXUPRC */ + long maxuprc = MAXUPRC; + #endif /* MAXUPRC */ + + #define VMMON_DODECL + #include + extern struct nlist RawStatistics[]; + + + struct mtab mtab[NMOUNT]; + int fi; + daddr_t alloc(); + char *strcpy(); + + char root[32]; + + int TotalTime; + int deficit; + int MemoryFile /* file descriptor for unix memory */ ; + int nproc; + int SwapMapAddress; + int nSwapMapEntries; + int SwapMapSize; + int nSwapBlks; + int CurrentSwapUsed; + int dmmax; + off_t procp; + struct mapent *SwapMap; + struct proc proc[8];/* 8 = a few, for fewer syscalls */ + struct proc *mproc; + extern char *malloc(); + + + struct{ + long time[CPUSTATES]; + long xfer[DK_NDRIVE]; + struct vmmeter Rate; + struct vmtotal Total; + long dk_xfer[DK_NDRIVE]; + }s, s1; + + union { + struct fs iu_fs; + char dummy[SBSIZE]; + } sb; + + #define rate s.Rate + #define total s.Total + #define sblock sb.iu_fs + #define sendval(text) {printf text ;fflush(stdout);} + + + + GetGVMStats(UsersID) int UsersID; { + register int i; + long t; + struct mapent *sp; + lseek(MemoryFile,(long) RawStatistics[X_CPTIME].n_value, 0); + read(MemoryFile, s.time, sizeof(s.time)); + + if (RawStatistics[X_NDSTAT].n_value == 0){ + lseek(MemoryFile,(long) RawStatistics[X_DKXFER].n_value, 0); + read(MemoryFile, s.dk_xfer, sizeof(s.dk_xfer)); + } + lseek(MemoryFile,(long) RawStatistics[X_RATE].n_value, 0); + read(MemoryFile, &rate, sizeof(rate)); + sp = SwapMap; + lseek(MemoryFile, SwapMapAddress, 0); + read(MemoryFile, sp, SwapMapSize); + for (CurrentSwapUsed = nSwapBlks;sp->m_size;sp++){ + CurrentSwapUsed -= sp->m_size; + } + lseek(MemoryFile,(long) RawStatistics[X_TOTAL].n_value, 0); + read(MemoryFile, &total, sizeof(total)); + lseek(MemoryFile,(long) RawStatistics[X_DEFICIT].n_value, 0); + read(MemoryFile, &deficit, sizeof(deficit)); + for (i = 0; i < CPUSTATES; i++) { + t = s.time[i]; + s.time[i] -= s1.time[i]; + s1.time[i] = t; + } + s.time[1] += s.time[0]; + TotalTime = 0; + for (i = 1; i < CPUSTATES; i++) + TotalTime += s.time[i]; + if (TotalTime == 0) + TotalTime = 1; + sendval(("%d:%d\n", LOADCPU, (s.time[1] + s.time[2]) * 100 / TotalTime)); + { + int myval = 0; + { + register int i; + for (i = 1; i < DK_NDRIVE - 1; i++) + s.dk_xfer[0] += s.dk_xfer[i]; + } + if (s1.dk_xfer[0] == 0){ + s1.dk_xfer[0] = s.dk_xfer[0]; + } + myval = s.dk_xfer[0] - s1.dk_xfer[0]; + if (myval > 100) myval = 100; + sendval(("%d:%d\n", LOADIO, myval)); + s1.dk_xfer[0] = s.dk_xfer[0]; + } + sendval(("%d:%d\n", LOADUSER, s.time[1] * 100 / TotalTime)); + sendval(("%d:%d\n", LOADSYS, s.time[2] * 100 / TotalTime)); + sendval(("%d:%d\n", LOADIDLE, s.time[3] * 100 / TotalTime)); + sendval(("%d:%d\n", VM, nSwapBlks ? CurrentSwapUsed * 100 / nSwapBlks : -1)); + sendval(("%d:%d\n", PAGEIN, rate.v_pgpgin / 2)); + sendval(("%d:%d\n", PAGEOUT, rate.v_pgpgout / 2)); + sendval(("%d:%d\n", PAGEREPLACABLE, rate.v_scan)); + sendval(("%d:%d\n", PAGEDEFICIT, deficit)); + sendval(("%d:%d\n", MEMACTIVE, total.t_avm / 2)); + sendval(("%d:%d\n", MEMFREE, total.t_free / 2)); + sendval(("%d:%d\n", QUEUERUN, total.t_rq)); + sendval(("%d:%d\n", QUEUEBLOCK, total.t_dw + total.t_pw)); + sendval(("%d:%d\n", QUEUEMEM, total.t_sw)); + sendval(("%d:%d\n", INTSIO, rate.v_intr)); + sendval(("%d:%d\n", INTSSYS, rate.v_syscall)); + sendval(("%d:%d\n", INTSSWAP, rate.v_swtch)); + if (1) {/* DoPROCESSES */ + int i, j, userprocesses, totalprocesses, otherprocs; + off_t tmpprocp; + + userprocesses = 0; + totalprocesses = 1; + otherprocs = 0; + tmpprocp = procp; + + for (i = 0; i < nproc; i += 8) { + lseek(MemoryFile, (long) tmpprocp, 0); + j = nproc - i; + if (j > 8) + j = 8; + j *= sizeof(struct proc); + if (read(MemoryFile, (char *) proc, j) != j) { + sendval(("%d:%d\n", GVM_ERR_1, 0)); + exit(-1); + } + tmpprocp += j; + for (j = j / sizeof(struct proc) - 1; j >= 0; j--) { + mproc = &proc[j]; + if (mproc->p_pid != 0) { + totalprocesses++; + if (UsersID == mproc->p_uid) { + userprocesses ++; + } else if (mproc->p_uid) { + otherprocs++; + } + } + } + } + sendval(("%d:%d\n", PROCSUSER, maxuprc ? (userprocesses * 100) / maxuprc : -1)); + sendval(("%d:%d\n", PROCSTOTAL, nproc ? totalprocesses * 100 / nproc : -1)); + sendval(("%d:%d\n", PROCSOTHER, otherprocs)); + } } + + + + InitGVMStats() { + time_t bootime; + int code = 0; + + /* + set up Unix interface: scan name list for current system + addresses and then open a file which is the memory image + of the system. + */ + code = nlist(_SITE_VMUNIX, RawStatistics); + if (code == -1){ + sendval(("%d:%d\n", GVM_ERR_2, 0)); + exit(-1); + } + else{ + if (RawStatistics[0].n_type == 0){ + sendval(("%d:%d\n", GVM_ERR_3, 0)); + exit(-1); + } + } + MemoryFile = open(_SITE_DEV_KMEM, 0); + if (MemoryFile < 0){ + sendval(("%d:%d\n", GVM_ERR_4, 0)); + exit(-1); + } + lseek(MemoryFile,(long) RawStatistics[X_BOOTIME].n_value, 0); + read(MemoryFile, &bootime, sizeof(bootime)); + lseek(MemoryFile, (long) RawStatistics[X_PROC].n_value, 0); + read(MemoryFile,(char *) &procp, sizeof(procp)); + lseek(MemoryFile, (long) RawStatistics[X_NPROC].n_value, 0); + read(MemoryFile,(char *) &nproc, sizeof(nproc)); + #ifndef MAXUPRC + lseek(MemoryFile, (long) RawStatistics[X_MAXUPRC].n_value, 0); + read(MemoryFile,(char *) &maxuprc, sizeof(maxuprc)); + #endif /* MAXUPRC */ + lseek(MemoryFile,(long) RawStatistics[X_SWAPMAP].n_value, 0); + read(MemoryFile, &SwapMapAddress, sizeof(SwapMapAddress)); + SwapMapAddress += sizeof(struct map); + lseek(MemoryFile,(long) RawStatistics[X_NSWAPMAP].n_value, 0); + read(MemoryFile, &nSwapMapEntries, sizeof(nSwapMapEntries)); + SwapMapSize = (--nSwapMapEntries)*sizeof(struct mapent); + lseek(MemoryFile,(long) RawStatistics[X_NSWAPBLKS].n_value, 0); + read(MemoryFile, &nSwapBlks, sizeof(nSwapBlks)); + lseek(MemoryFile,(long) RawStatistics[X_DMMAX].n_value, 0); + read(MemoryFile, &dmmax, sizeof(dmmax)); + nSwapBlks -= dmmax/2; /* See vm_sw.c--initialization of swap space */ + SwapMap = (struct mapent *) malloc(SwapMapSize); } + + /* the DeviceTable keeps a list of all the devices (and their mounted directory file name) that we should watch */ + + extern int getmnt(); + GetDiskStats(Init) int Init; { + int i = 0; + struct fstab *fsp; + + + i = open(_SITE_MTAB, 0); + if (i >= 0) { + (void) read(i, (char *)mtab, sizeof (mtab)); + (void) close(i); + } + sync(); + if (setfsent() == 0){ + sendval(("%d:%d\n", DISK_ERR_5, 0)); + exit(1); + } + i = DISK1 - 1; /* figuratively 0 */ + while ((fsp = getfsent()) && i < MAXGETSTATSCOUNTERS) { + i++; + if (strcmp(fsp->fs_type, FSTAB_RW) && + strcmp(fsp->fs_type, FSTAB_RO) && + strcmp(fsp->fs_type, FSTAB_RQ)) + continue; + if (root[0] == 0){ + (void) strcpy(root, fsp->fs_spec); + } + dfree1(i, fsp->fs_spec, 1, Init); + } + endfsent(); } + + int bread(fi, bno, buf, cnt) + int fi; + daddr_t bno; + char *buf; + int cnt; + { + extern int errno; + + (void) lseek(fi, (long)(bno * DEV_BSIZE), 0); + if (read(fi, buf, cnt) != cnt) + { + /* probably a dismounted disk if errno == EIO */ + if (errno != EIO) { + sendval(("%d:%d\n", DISK_ERR_5, 0)); + } + return (0); + } + return (1); + } + + /* + * Given a name like /dev/rrp0h, returns the mounted path, like /usr. + */ + char *mpath(file) + char *file; + { + register struct mtab *mp; + + + if (eq(file, root)){ + return ("/"); + } + for (mp = mtab; mp < mtab + NMOUNT; mp++){ + if (eq(file, mp->m_dname)){ + return (mp->m_path); + } + } + return ""; + } + + eq(f1, f2) + char *f1, *f2; + { + if (strncmp(f1, "/dev/", 5) == 0) + f1 += 5; + if (strncmp(f2, "/dev/", 5) == 0) + f2 += 5; + if (!strcmp(f1, f2)) + return (1); + if (*f1 == 'r' && !strcmp(f1+1, f2)) + return (1); + if (*f2 == 'r' && !strcmp(f1, f2+1)) + return (1); + if (*f1 == 'r' && *f2 == 'r' && strcmp(f1+1, f2+1) == 0) + return (1); + return (0); + } + + int round(num) + double num; + { + int inum = (int) num; + return(((num - inum) >= 0.5) ? (inum + 1) : inum); + } + + dfree1(id, file, infsent, Init) + int id; + char *file; + int infsent; + int Init; + { + long totalblks, availblks, free, used; + int fi; + struct stat stbuf; + struct fstab *fsp; + + if (stat(file, &stbuf) == 0 && + (stbuf.st_mode&S_IFMT) != S_IFCHR && + (stbuf.st_mode&S_IFMT) != S_IFBLK) { + if (infsent) { + sendval(("%d:%d\n", DISK_ERR_3, 0)); + return; + } + setfsent(); + while (fsp = getfsent()) { + struct stat stb; + + if (stat(fsp->fs_spec, &stb) == 0 && + stb.st_rdev == stbuf.st_dev) { + file = fsp->fs_spec; + endfsent(); + goto found; + } + } + endfsent(); + sendval(("%d:%d\n", DISK_ERR_4, 0)); + return; + } + found: + fi = open(file, 0); + if (fi < 0){ + return; + } + if (bread(fi, SBLOCK, (char *)&sblock, SBSIZE) == 0) { + (void) close(fi); + return; + } + totalblks = sblock.fs_dsize; + free = sblock.fs_cstotal.cs_nbfree * sblock.fs_frag + + sblock.fs_cstotal.cs_nffree; + used = totalblks - free; + availblks = totalblks * (100 - sblock.fs_minfree) / 100; + if(Init){ + sendval(("%d:%d:%s\n", id, 0, mpath(file))); + } + else{ + sendval(("%d:%d\n", id, availblks == 0 ? 0 : round((double) used / (double) availblks * 100.0))); + } + (void) close(fi); + } + *** atk/console/stats/rs_aix31/Imakefile Fri Jul 27 13:40:16 1990 --- atk/console/stats/rs_aix31/Imakefile.NEW Wed Jun 13 16:55:22 1990 *************** *** 0 **** --- 1,14 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + LOCALINCLUDES = -I../../lib + OBJS = getstats.o + + DependTarget() + NormalObjectRule() + + ProgramTarget(getstats, getstats.o, ,) + + InstallFile(getstats, $(INSTPROGFLAGS), $(DESTDIR)/bin) + *** atk/console/stats/rs_aix31/getstats.c Fri Jul 27 13:40:29 1990 --- atk/console/stats/rs_aix31/getstats.c.NEW Wed Jun 13 16:55:26 1990 *************** *** 0 **** --- 1,314 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/rs_aix31/RCS/getstats.c,v 1.1 90/06/11 18:27:48 gk5g Exp $ */ + /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/rs_aix31/RCS/getstats.c,v $ */ + + #ifndef lint + static char *getstats_c_id = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/rs_aix31/RCS/getstats.c,v 1.1 90/06/11 18:27:48 gk5g Exp $"; + #endif /* lint */ + + /* ********************************************************************** + * This code is designed to read what might be priveledged (setuid) + * information regarding both Disk Statistics (% full) and a host of + * stats from /dev/kmem (including but not limited to, CPU, I/O, and VM) + * + * When retriving the data - this program will print out to stdout + * a string in the form of either "%d:%d\n" or "%d:%d:%s\n" + * The latter case is for passing the name of where a disk is mounted + * back to the parent program. + * + * The parent program (Console, or any other program which wishes to get + * at this information) is responsible for setting up a pipe, binding the + * child's (this program) stdout to one end of a pipe, and parsing the + * strings which are passed back. + * + * The basic string format is an ID (int), a colon, a value (int), and + * optionally another colon followed by a string. The ID is coded from + * the included file "getstats.h" - ID values 50 and over represent + * ERRORS as documented in the above mentioned inclued file. When an + * ERROR or the optional string is passed, the value (second parameter) + * can be safely ignored, and is usually set to 0. + * + * The arguments to be passed to this program are the effective UID from + * the parent program, a polling frequency (# of seconds) for checking + * /dev/kmem (usually between 1 and 5, must be > 0), and a polling + * frequency for checking how full the local disks are (generally higher + * than the value for /dev/kmem, but could vary greatly). Thus the call + * is: + * + * execvp("getstats", argv) + * + * with argv as: + * + * argv[0]="getstats"; + * argv[1]=~ ("%d", UID); + * argv[2]=~ ("%d", kmempollfrequency); + * argv[3]=~ ("%d", diskpollfrequency); + * argv[4]=NULL; + * + ********************************************************************** */ + + /* + * Additional information about the RT/PC AIX implementation. + * Paul G. Crumley, pgc@andrew.cmu.edu + * + * Most of the numbers returned by previous implementations of + * getstats are pretty meaningless. There are no conventions + * for determining the full-scale values for items that are + * reported by value rather than as a ratio. In addition, the + * exact datastream is no well specified as in whether file + * system names may be sent as often as desired or can only be + * sent once, when the program is initialized. Finally, the + * previous implentations of getstats have to run SUID root or + * the device /dev/kmem must be set to allow any process read + * access. + * + * In this implementation I have decided to report only those + * statistics that are ratios, report file system names often + * (since such mappings can change with time) and have used + * available facilities so that getstats needs no special + * protections and system security is not compromised. + * + * The command line is slightly different for the AIX implementation. + * The command arguments are: + * + * getstats UID kernel_reporting_rate filesystem_reporting_rate + * + * getstats uses the arguments as follows: + * + * argv[0]="getstats" + * argv[1]= IGNORED + * argv[2]= reporting rate in seconds + * argv[3]=IGNORED + * + * + * In order to allow getstats to run with out special protections + * I have chosen to use the SAR facilities to collect kernel + * statistics and the "df" command to get information about + * the filesystems. These are known system specific commands + * and facilities. Just thought you should know.... + */ + + + + #include + + #include + #include + #include + #include + #include + + + /* + * The following information is from manual + * "Managing the AIX Operating System" SC23-2008. + */ + struct paginginfo { + unsigned int freeslots; + unsigned int cycles; + unsigned int faults; + unsigned int otherdiskios; + }; + + struct sa { + struct sysinfo si; + struct paginginfo pi; + int szinode; + int szfile; + int sztext; + int szproc; + int mszinode; + int mszfile; + int msztext; + int mszproc; + long inodeovf; + long fileofv; + long textofv; + long procofv; + time_t ts; + }; + + /* + * The above structure (sa) is what is emitted by + * the sadc command. When sadc is first invoked + * two words (32 bits) of zeroes are emmitted to + * mark the beginning of a new set of data. + */ + + + + #define SADC_COMMAND "/usr/lib/sa/sadc" + #define DF_COMMAND "/bin/df" + + #define SAMPLES 10000000 /* run SADC 10,000,000 times (forever) */ + + + /* + * Used to emit values for console. + */ + #define sendval(text) {printf text ;fflush(stdout);} + + + + /* + * global data + */ + + FILE *sadc_pipe; /* pipe kernel stat info is read from */ + FILE *df_pipe; /* pipe filesystem info is read from */ + struct sa last_sainfo; /* last snapshot of various system counters */ + struct sa this_sainfo; /* latest snapshot of various system counters */ + + + /* + * Parse command line and start up the data collection command. + */ + static void + Initialize(argc, argv) + int argc; + char *argv[]; + + { + int interval; + int rc; + char sadc_command[1000]; + + /* + * check and parse command line + */ + if (argc != 4){ + sendval(("%d:%d\n", PARSE_ERR_1, 0)); /* make sure we have the right # args */ + exit(-1); + } + if ((interval = atoi(argv[2])) < 1){ /* get the collection interval */ + sendval(("%d:%d\n", PARSE_ERR_2, 0)); + exit(-1); + } + + /* + * start up the data collection process + */ + (void) sprintf(sadc_command, "%s %d %d", SADC_COMMAND, interval, (SAMPLES+1)); /* one extra for baseline */ + sadc_pipe = popen(sadc_command, "r"); + if (sadc_pipe == NULL) { + fprintf(stderr, "error starting sadc command\n"); + exit(-1); + } + + rc = fread(&last_sainfo, sizeof(time_t), 2, sadc_pipe); /* special flag at beginning of data */ + if (rc != 2) { + fprintf(stderr, "error reading flag\n"); + exit(-1); + } + + rc = fread(&last_sainfo, sizeof(last_sainfo), 1, sadc_pipe); /* get initial counters */ + if (rc != 1) { + fprintf(stderr, "error reading sadc output\n"); + exit(-1); + } + } + + + /* + * Get a new set of kernel info, see what has happened since the last + * time we looked, and report what changed. + */ + static void + EmitKernelStats() + { + long total_time_ticks; + long idle_time_ticks; + long usr_time_ticks; + long kernel_time_ticks; + long wait_time_ticks; + + + /* + * get the newest info + */ + if (1 != fread(&this_sainfo, sizeof(this_sainfo), 1, sadc_pipe)) { /* get initial counters */ + fprintf(stderr, "error reading sadc output\n"); + exit(-1); + } + + /* + * calculate stats + */ + idle_time_ticks = this_sainfo.si.cpu[CPU_IDLE] - last_sainfo.si.cpu[CPU_IDLE]; + usr_time_ticks = this_sainfo.si.cpu[CPU_USER] - last_sainfo.si.cpu[CPU_USER]; + kernel_time_ticks = this_sainfo.si.cpu[CPU_KERNEL] - last_sainfo.si.cpu[CPU_KERNEL]; + wait_time_ticks = this_sainfo.si.cpu[CPU_WAIT] - last_sainfo.si.cpu[CPU_WAIT]; + total_time_ticks = idle_time_ticks + usr_time_ticks + kernel_time_ticks + wait_time_ticks; + + /* + * emit results + */ + sendval(("%d:%d\n", LOADUSER, 100 * usr_time_ticks / total_time_ticks)); + sendval(("%d:%d\n", LOADSYS, 100 * kernel_time_ticks / total_time_ticks)); + sendval(("%d:%d\n", LOADIO, 100 * wait_time_ticks / total_time_ticks)); + sendval(("%d:%d\n", LOADIDLE, 100 * idle_time_ticks / total_time_ticks)); + sendval(("%d:%d\n", LOADCPU, 100 - (100 * idle_time_ticks / total_time_ticks))); /* ??? */ + + sendval(("%d:%d\n", PROCSTOTAL, this_sainfo.szproc)); + + /* + * save current info for next time + */ + (void) bcopy(&this_sainfo, &last_sainfo, sizeof(this_sainfo)); + } + + + /* + * Invoke the df command to get the current stats on the mounted filesystems. + */ + static void + EmitFilesystemStats() + { + int id; /* each filesystem has a number in the datastream */ + int i; /* % of filesystem that is used */ + char name[1000]; /* name of filesystem mount point */ + + df_pipe = popen(DF_COMMAND, "r"); + if (df_pipe == NULL) { + sendval(("%d:%d\n", DISK_ERR_3, 0)); /* some generic, non-fatal error */ + return; + } + + if (EOF == fscanf(df_pipe, "%*[^\n]\n")) { /* toss heading */ + (void) pclose(df_pipe); + sendval(("%d:%d\n", DISK_ERR_3, 0)); /* some generic, non-fatal error */ + return; + } + + id = DISK1; + while (EOF != fscanf(df_pipe, "%*s %s %*d %*d %d%*[^\n]\n", name, &i) && i < MAXGETSTATSCOUNTERS) { + sendval(("%d:%d:%s\n", id, 0, name)); + sendval(("%d:%d\n", id, i)); + id++; + } + + (void) pclose(df_pipe); /* close this to recover resources */ + } + + /* + * + */ + int + main(argc, argv) + int argc; + char *argv[]; + { + int count; + + Initialize(argc, argv); + + for (count = 0; count < SAMPLES; count++) { + EmitKernelStats(); + EmitFilesystemStats(); + } + exit(0); + } + *** atk/console/stats/rt_r3/getstats.c Wed Jan 17 16:37:21 1990 --- atk/console/stats/rt_r3/getstats.c.NEW Mon May 14 11:42:30 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/console/stats/rt_r3/RCS/getstats.c,v 1.4 89/11/21 08:17:50 ghoti Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/console/stats/rt_r3/RCS/getstats.c,v $ */ #ifndef lint ! static char *getstats_c_id = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/console/stats/rt_r3/RCS/getstats.c,v 1.4 89/11/21 08:17:50 ghoti Exp $"; #endif /* lint */ /* ********************************************************************** --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/rt_r3/RCS/getstats.c,v 1.6 90/05/14 11:36:42 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/rt_r3/RCS/getstats.c,v $ */ #ifndef lint ! static char *getstats_c_id = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/rt_r3/RCS/getstats.c,v 1.6 90/05/14 11:36:42 gk5g Exp $"; #endif /* lint */ /* ********************************************************************** *************** *** 50,61 **** * ********************************************************************** */ #include - - /* The following include defines sys_vax_20 for Vax release 2.0 op sys, */ - /* since that particular OS needs some special treatment. We would have */ - /* used -Dsys_vax_20 except we want to use the same Makefile for each cpu... */ - - #include #include #include --- 50,55 ---- *** atk/console/stats/i386_mach/Imakefile Fri Jul 27 13:40:51 1990 --- atk/console/stats/i386_mach/Imakefile.NEW Thu May 10 16:25:58 1990 *************** *** 0 **** --- 1,11 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + LOCALINCLUDES = -I../../lib + + DependTarget() + NormalObjectRule() + + LibraryTarget(libgs.a, getstats.o) + *** atk/console/stats/i386_mach/getstats.c Fri Jul 27 13:41:04 1990 --- atk/console/stats/i386_mach/getstats.c.NEW Thu May 10 16:26:00 1990 *************** *** 0 **** --- 1,76 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.1 90/05/09 16:26:10 gk5g Exp $ */ + /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v $ */ + + #ifndef lint + static char *getstats_c_id = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/console/stats/i386_mach/RCS/getstats.c,v 1.1 90/05/09 16:26:10 gk5g Exp $"; + #endif /* lint */ + + /* ********************************************************************** + * **************** + * STUB LIBRARY FILE---NOT YET IMPLEMENTED FOR THIS SYSTEM + * THIS CODE SHOULD BE REPLACED BY AN IMPLEMENTATION OF + * THE RELEVANT ROUTINES FOR YOUR MACHINE TYPE. + * Please contribute your implementations to info-andrew-bugs@andrew.cmu.edu. + * You may use any of the other ..//getstats.c files as templates. + * **************** + * + * This code is designed to read what might be priveledged (setuid) + * information regarding both Disk Statistics (% full) and a host of + * stats from /dev/kmem (including but not limited to, CPU, I/O, and VM) + * + * When retriving the data - this program will print out to stdout + * a string in the form of either "%d:%d\n" or "%d:%d:%s\n" + * The latter case is for passing the name of where a disk is mounted + * back to the parent program. + * + * The parent program (Console, or any other program which wishes to get + * at this information) is responsible for setting up a pipe, binding the + * child's (this program) stdout to one end of a pipe, and parsing the + * strings which are passed back. + * + * The basic string format is an ID (int), a colon, a value (int), and + * optionally another colon followed by a string. The ID is coded from + * the included file "getstats.h" - ID values 50 and over represent + * ERRORS as documented in the above mentioned inclued file. When an + * ERROR or the optional string is passed, the value (second parameter) + * can be safely ignored, and is usually set to 0. + * + * The arguments to be passed to this program are the effective UID from + * the parent program, a polling frequency (# of seconds) for checking + * /dev/kmem (usually between 1 and 5, must be > 0), and a polling + * frequency for checking how full the local disks are (generally higher + * than the value for /dev/kmem, but could vary greatly). Thus the call + * is: + * + * execvp("getstats", argv) + * + * with argv as: + * + * argv[0]="getstats"; + * argv[1]=~ ("%d", UID); + * argv[2]=~ ("%d", kmempollfrequency); + * argv[3]=~ ("%d", diskpollfrequency); + * argv[4]=NULL; + * + ********************************************************************** */ + #include + + #include + + GetGVMStats(UsersID) + int UsersID; + { + } + + InitGVMStats() + { + } + + GetDiskStats(Init) + int Init; + { + } *** atk/datacat/datacat.help Wed Nov 22 12:01:22 1989 --- atk/datacat/datacat.help.NEW Fri Jul 20 11:24:48 1990 *************** *** 1,4 **** ! \begindata{text,268770020} \textdsversion{12} \template{help} \chapter{Datacat: Concatenate ATK Datastream Files --- 1,4 ---- ! \begindata{text,268849460} \textdsversion{12} \template{help} \chapter{Datacat: Concatenate ATK Datastream Files *************** *** 9,21 **** }\leftindent{ Datacat is a non-interactive application, similar to the Unix \italic{cat} program, specially designed to concatenate ATK datastream files. \italic{cat ! }cannot be used to concatenate ATK files; you must use datacat. } \section{How Datacat works ! }\leftindent{Datacat takes a list of two or more files and concatenates them by creating a text object and then inserting the contents of the named files into it. If the named files are text, then their contents are simply concatenated, and if the files contain insets/objects other than text, then --- 9,24 ---- }\leftindent{ Datacat is a non-interactive application, similar to the Unix \italic{cat} program, specially designed to concatenate ATK datastream files. \italic{cat ! }cannot be used to concatenate ATK files; you must use datacat.\leftindent{A ! new feature of datacat is the ability to make use of master files }that ! include the names of other files to be included in datacat's output. + } \section{How Datacat works ! }\leftindent{Datacat takes a list of one or more files and concatenates them by creating a text object and then inserting the contents of the named files into it. If the named files are text, then their contents are simply concatenated, and if the files contain insets/objects other than text, then *************** *** 55,63 **** --- 58,83 ---- that call datacat. There is also a \bold{-v} (verbose) flag that causes datacat to report on the files as it concatenates them. + + When given the \bold{-i} flag, datacat will search through the files it is + passed for lines of the form + + + @include(filename) + + + }\leftindent{Datacat \bold{-i} will interpret all of the instances of this and + include the named files in its output. + + + The \bold{-I} flag does the same as the \bold{-i} flag, except that it will + also look for @include lines in the included files themselves. + + } + \section{Program Author} \leftindent{ *************** *** 81,84 **** }For more information on ATK datastream, see the ATK Programmer's Manual chapter on the class\italic{ dataobject.} ! }\enddata{text,268770020} --- 101,104 ---- }For more information on ATK datastream, see the ATK Programmer's Manual chapter on the class\italic{ dataobject.} ! }\enddata{text,268849460} *** atk/datacat/datacata.c Wed Nov 22 12:01:19 1989 --- atk/datacat/datacata.c.NEW Fri Jul 20 11:24:49 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/datacat/RCS/datacata.c,v 2.12 89/10/27 11:07:04 tpn Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/datacat/RCS/datacata.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/datacat/RCS/datacata.c,v 2.12 89/10/27 11:07:04 tpn Exp $"; #endif /* lint */ #include /* For MAXPATHLEN. */ --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/datacat/RCS/datacata.c,v 2.13 90/07/17 16:52:27 tpn Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/datacat/RCS/datacata.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/datacat/RCS/datacata.c,v 2.13 90/07/17 16:52:27 tpn Exp $"; #endif /* lint */ #include /* For MAXPATHLEN. */ *************** *** 24,29 **** --- 24,30 ---- #include #include #include + #include /* output options */ *************** *** 30,42 **** extern int errno; char *progname; ! #define checkandprint(A) if(A) {datacatapp_PrintVersionNumber(self);A = FALSE;} void datacatapp__ReadInitFile(self) struct datacatapp *self; { } boolean datacatapp__ParseArgs (self,argc, argv) struct datacatapp *self; int argc; --- 31,113 ---- extern int errno; char *progname; ! #define checkandprint(A) if(A) {datacatapp_PrintVersionNumber(self);A = FALSE;}; ! boolean verbose; void datacatapp__ReadInitFile(self) struct datacatapp *self; { } + doinsert(text,size,followlinks) + struct text * text; + long size; + boolean followlinks; + { + long i,j,len; + char name[1026],cname[1026],*c,*cn; + FILE *f; + boolean foundopen ; + int charflag ; + while((i = text_Index(text,size,'@',(len = text_GetLength(text)) - size)) >= 0){ + if((i == size || (text_GetChar(text,i - 1) == '\n')) && text_Strncmp(text,i,"@include",8) == 0 && i + 10 < len){ + foundopen = FALSE; + charflag = 0; + cn = cname; + j = i + 8; + if(len > j + 1024) len = j + 1024; + for(c = name; j < len; j++){ + *c = text_GetChar(text,j); + *cn++ = *c; + if(*c == ')' || *c == '\n') break; + if(*c == '(' ){ + foundopen = TRUE; + continue; + } + if(*c == ' ' || *c == '\t'){ + if(charflag == 1 ) charflag = 2; + continue; + } + if(charflag > 1){ + /* found space in name */ + charflag = 3; + break; + } + else charflag = 1; + c++; + } + if(charflag > 0 && charflag < 3 && foundopen && *c == ')'){ + *c = '\0'; + filetype_CanonicalizeFilename(cname, name, 1024); + if(verbose) { + fprintf(stderr,"Including %s\n",cname); + fflush(stderr); + } + if((f = fopen(cname,"r") ) == NULL){ + fprintf(stderr,"Can't open include file %s\n",cname); + } + else { + text_DeleteCharacters(text,i,j + 1 - i); + len = text_InsertFile(text,f,name, i); + fclose(f); + if(followlinks) size = i; + else size = i + len; + continue; + } + } + else { + *cn-- = '\0'; + if(*cn == '\n'){ + *cn = '\0'; + fprintf(stderr,"badly formed include line '@include%s'\n",cname); + } + else + fprintf(stderr,"badly formed include line '@include%s...'\n",cname); + } + } + size = i + 1; + } + } boolean datacatapp__ParseArgs (self,argc, argv) struct datacatapp *self; int argc; *************** *** 49,60 **** FILE *ofile,*f,*fopen(); struct text *tx; boolean pv = TRUE; ! boolean verbose = FALSE; #ifdef LOCKANDDELETE int LockAndDelete = 0; #endif /* LOCKANDDELETE */ /* initialize as if ez */ ((struct application * )self)->name = "ez"; super_ReadInitFile(self); ((struct application * )self)->name = "datacat"; DocumentName = NULL; --- 120,134 ---- FILE *ofile,*f,*fopen(); struct text *tx; boolean pv = TRUE; ! boolean ipros = FALSE; ! long oldlength; ! boolean followlinks = FALSE; #ifdef LOCKANDDELETE int LockAndDelete = 0; #endif /* LOCKANDDELETE */ /* initialize as if ez */ ((struct application * )self)->name = "ez"; + verbose = FALSE; super_ReadInitFile(self); ((struct application * )self)->name = "datacat"; DocumentName = NULL; *************** *** 64,69 **** --- 138,150 ---- for (i=1;i --- 4,15 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/ez/RCS/eza.c,v 2.10 90/07/09 14:59:34 gk5g Exp $ */ /* $ACIS:eza.c 1.5$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/ez/RCS/eza.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/ez/RCS/eza.c,v 2.10 90/07/09 14:59:34 gk5g Exp $"; #endif /* lint */ #include *************** *** 236,242 **** message_DisplayString(frame, 0, "You must specify a file. Press any key to continue. "); break; default: ! message_DisplayString(frame, 0, "File not found; could not create. Press any key to continue."); } if(count++ > 10) /* the user probably quit */ exit(0); } while ((cc = im_GetCharacter(view_GetIM((struct view *) frame))) == EOF); --- 236,242 ---- message_DisplayString(frame, 0, "You must specify a file. Press any key to continue. "); break; default: ! message_DisplayString(frame, 0, "File could not be created. Press any key to continue."); } if(count++ > 10) /* the user probably quit */ exit(0); } while ((cc = im_GetCharacter(view_GetIM((struct view *) frame))) == EOF); *************** *** 403,409 **** } else { char errorMessage[200]; ! sprintf(errorMessage, "File %s does not exist and could not be created.", fileEntry->filename); StartupError(errtext,errorMessage); } next = fileEntry->next; --- 403,433 ---- } else { char errorMessage[200]; ! switch (errno) { ! case 0: ! sprintf(errorMessage,"Could not create correct data object for file '%s'.", fileEntry->filename ); ! break; ! case EACCES: ! sprintf(errorMessage,"File '%s' not found; could not create. Permission denied.", fileEntry->filename ); ! break; ! #ifdef ETIMEDOUT ! case ETIMEDOUT: ! sprintf(errorMessage,"File '%s' not found; could not create. A file server is down.", fileEntry->filename ); ! break; ! #endif /* ETIMEDOUT */ ! #ifdef EIO ! case EIO: ! sprintf(errorMessage,"File '%s' not found; could not create. An I/O error occurred on the disk.", fileEntry->filename ); ! break; ! #endif /* EIO */ ! /* This next case is somewhat based on internal knowledge of the buffer package... */ ! case EISDIR: ! sprintf(errorMessage,"Attempt to visit directory without trailing slash."); ! break; ! default: ! sprintf(errorMessage, "File '%s' not found; could not create. %s.", fileEntry->filename, UnixError(errno)); ! break; ! } StartupError(errtext,errorMessage); } next = fileEntry->next; *** atk/extensions/Imakefile Wed Nov 22 12:12:06 1989 --- atk/extensions/Imakefile.NEW Tue Jun 19 12:50:19 1990 *************** *** 7,12 **** --- 7,13 ---- dsearch.do \ ezdiff.do \ filter.do \ + gsearch.do \ isearch.do \ spell.do \ tags.do \ *************** *** 16,21 **** --- 17,23 ---- dsearch.ih \ ezdiff.ih \ filter.ih \ + gsearch.ih \ isearch.ih \ spell.ih \ tags.ih \ *************** *** 36,42 **** DependTarget() NormalHelpRule() ! InstallDocs(tags.help ezdiff.help compile.help search.help ezdproc.help comproc.help desproc.help dsrproc.help isrproc.help ftrproc.help splproc.help tgsproc.help, ${DESTDIR}/help) InstallHelpAlias(ftrproc, filterproc filterprocs) InstallHelpAlias(splproc, spellproc spellprocs) InstallHelpAlias(tgsproc, tagsproc tagsprocs) --- 38,44 ---- DependTarget() NormalHelpRule() ! InstallDocs(tags.help ezdiff.help compile.help search.help ezdproc.help comproc.help desproc.help dsrproc.help gsrproc.help isrproc.help ftrproc.help splproc.help tgsproc.help, ${DESTDIR}/help) InstallHelpAlias(ftrproc, filterproc filterprocs) InstallHelpAlias(splproc, spellproc spellprocs) InstallHelpAlias(tgsproc, tagsproc tagsprocs) *************** *** 44,49 **** --- 46,52 ---- InstallHelpAlias(comproc, compileproc compileprocs) InstallHelpAlias(desproc, deskey deskeyproc deskeyprocs) InstallHelpAlias(dsrproc, dsearch dsearchproc dsearchprocs) + InstallHelpAlias(gsrproc, gsearch gsearchproc gsearchprocs) InstallHelpAlias(isrproc, isearch isearchproc isearchprocs) InstallHelpAlias(ezdiff, ez-diff) InstallHelpAlias(search, searching) *** atk/extensions/ezdiff.c Wed Nov 22 12:11:55 1989 --- atk/extensions/ezdiff.c.NEW Wed Jun 13 16:58:30 1990 *************** *** 2,23 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/extensions/RCS/ezdiff.c,v 2.10 89/10/27 15:07:35 tpn Exp $ */ /* $ACIS:ezdiff.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/extensions/RCS/ezdiff.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/extensions/RCS/ezdiff.c,v 2.10 89/10/27 15:07:35 tpn Exp $"; #endif /* lint */ #include #include /* sys/file.h */ ! #ifndef hp9000s300 #include ! #endif /* hp9000s300 */ ! #ifdef AIX #include ! #endif /* AIX */ #include #include #include --- 2,23 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/extensions/RCS/ezdiff.c,v 2.11 90/06/06 13:56:19 ajp Exp $ */ /* $ACIS:ezdiff.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/extensions/RCS/ezdiff.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/extensions/RCS/ezdiff.c,v 2.11 90/06/06 13:56:19 ajp Exp $"; #endif /* lint */ #include #include /* sys/file.h */ ! #if (! defined(hpux)) || HP_OS < 70 #include ! #endif /* hpux */ ! #if defined(AIX) || defined(hpux) #include ! #endif /* AIX || hpux*/ #include #include #include *************** *** 177,187 **** struct ezdiff *self; char name1[256],name2[256],fnm[512]; char *argv[6],**av; ! #ifdef hp9000s300 int status; ! #else /* hp9000s300 */ union wait status; ! #endif /* hp9000s300 */ sprintf(name1,"/tmp/%s-1",buffer_GetName(buf1)); sprintf(name2,"/tmp/%s-2",buffer_GetName(buf2)); sprintf(fnm,"/tmp/wmdiff.%s.%s",buffer_GetName(buf1),buffer_GetName(buf2)); --- 177,187 ---- struct ezdiff *self; char name1[256],name2[256],fnm[512]; char *argv[6],**av; ! #ifdef hpux int status; ! #else /* hpux */ union wait status; ! #endif /* hpux */ sprintf(name1,"/tmp/%s-1",buffer_GetName(buf1)); sprintf(name2,"/tmp/%s-2",buffer_GetName(buf2)); sprintf(fnm,"/tmp/wmdiff.%s.%s",buffer_GetName(buf1),buffer_GetName(buf2)); *************** *** 196,204 **** *av = NULL; self = NULL; if(WaitCursor) im_SetProcessCursor(WaitCursor); ! #ifdef AIX signal(SIGCLD, SIG_DFL); ! #endif /* AIX */ if(osi_vfork() == 0) { close(1); if((open(fnm,O_RDWR | O_CREAT | O_TRUNC,0600)) == -1){ --- 196,204 ---- *av = NULL; self = NULL; if(WaitCursor) im_SetProcessCursor(WaitCursor); ! #if defined(AIX) || defined(hpux) signal(SIGCLD, SIG_DFL); ! #endif /* AIX || hpux */ if(osi_vfork() == 0) { close(1); if((open(fnm,O_RDWR | O_CREAT | O_TRUNC,0600)) == -1){ *************** *** 208,219 **** _exit(4); } wait(&status); ! #ifdef hp9000s300 ! switch((status & 0xff00) >> 8){ ! #else /* hp9000s300 */ switch(status.w_T.w_Retcode){ ! #endif /* hp9000s300 */ case 0: /* No Differences */ message_DisplayString(NULL,0,"Files are identical"); break; --- 208,219 ---- _exit(4); } wait(&status); ! #ifdef hpux ! switch((((int)status >>8)&0377)){ ! #else /* hpux */ switch(status.w_T.w_Retcode){ ! #endif /* hpux */ case 0: /* No Differences */ message_DisplayString(NULL,0,"Files are identical"); break; *** atk/extensions/spell.c Wed Jan 17 16:37:32 1990 --- atk/extensions/spell.c.NEW Thu Jul 12 13:00:38 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/extensions/RCS/spell.c,v 2.9 89/12/12 15:00:29 ghoti Exp $ */ /* $ACIS:spell.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/extensions/RCS/spell.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/extensions/RCS/spell.c,v 2.9 89/12/12 15:00:29 ghoti Exp $"; #endif /* lint */ /* xspell.c --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/extensions/RCS/spell.c,v 2.10 90/07/11 12:35:27 rr2b Exp $ */ /* $ACIS:spell.c 1.2$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/extensions/RCS/spell.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/extensions/RCS/spell.c,v 2.10 90/07/11 12:35:27 rr2b Exp $"; #endif /* lint */ /* xspell.c *************** *** 172,184 **** struct mark *tempMark; struct process *speller; char testBuf[100]; ! /* Post a wait cursor. */ message_DisplayString(self, 0, "Starting spell check."); im_ForceUpdate(); text = Text(self); tempMark = text_CreateMark(text, 0, 0); ! /* Start up process and free process structure. */ if ((speller = StartProcess("ispell -a", &inFile, &outFile)) != NULL) free(speller); /* Not used for now. */ --- 172,185 ---- struct mark *tempMark; struct process *speller; char testBuf[100]; ! long textlen; ! /* Post a wait cursor. */ message_DisplayString(self, 0, "Starting spell check."); im_ForceUpdate(); text = Text(self); tempMark = text_CreateMark(text, 0, 0); ! /* Start up process and free process structure. */ if ((speller = StartProcess("ispell -a", &inFile, &outFile)) != NULL) free(speller); /* Not used for now. */ *************** *** 190,208 **** return; } ! while (text_GetChar(text, pos) != EOF) { int c; ! while (!isalpha(c = text_GetChar(text, pos)) && c != EOF) /* Skip to "word" */ ! pos++; - if (text_GetChar(text, pos) != EOF) { - int c, startpos = pos; char buffer[4096], thisWord[100], *temp = thisWord; /* Lots of space... */ ! for (c = text_GetChar(text, pos); isalpha(c); c = text_GetChar(text, ++pos)) { putc(c, outFile); *temp++ = c; } --- 191,208 ---- return; } ! while (pos<(textlen=text_GetLength(text))) { int c; + while (pos + + #include + + #include + #include + #include + #include + #include + #include + #include + + #include + + enum gsearchdir { + gsdir_forward, + gsdir_backward + }; + + #define MAXPATLEN (512) + + #define CTRL_G (7) + #define CTRL_H (8) + #define CTRL_R (18) + #define CTRL_S (19) + #define ESC (27) + #define DEL (127) + + static char rcsid[] = "$Revision: 1.2 $"; + + static char LastPattern[MAXPATLEN]; + + static void dosearch(tv, txt, startpos, dir) + struct textview *tv; + struct text *txt; + struct mark *startpos; + enum gsearchdir dir; + { + int patternlen = 0, success = 1, c, lastsuccesslen = 0; + int okpattern, juststarted = 1; + char pattern[MAXPATLEN], *compiled = NULL; + char prompt[100 + MAXPATLEN], *compileerr = NULL; + char defaultpattern[5 + MAXPATLEN]; + struct mark *lastmatch = startpos; + long loc; + + *pattern = '\0'; + if (*LastPattern) + sprintf(defaultpattern, " [%s]", LastPattern); + while (1) { + sprintf(prompt, "%sI-Search %s%s: %s", + success ? "" : "Failing ", + (dir == gsdir_forward) ? "forward" : "backward", + ((juststarted && (*LastPattern)) + ? defaultpattern + : ""), + pattern); + if (compileerr) { + strcat(prompt, " {"); + strcat(prompt, compileerr); + strcat(prompt, "}"); + } + message_DisplayString(tv, 0, prompt); + im_ForceUpdate(); + c = im_GetCharacter(textview_GetIM(tv)); + switch (c) { + case CTRL_G: + if (success) { + textview_SetDotPosition(tv, mark_GetPos(startpos)); + textview_SetDotLength(tv, mark_GetLength(startpos)); + textview_FrameDot(tv, mark_GetPos(startpos)); + text_RemoveMark(txt, startpos); + mark_Destroy(startpos); + if (lastmatch != startpos) { + text_RemoveMark(txt, lastmatch); + mark_Destroy(lastmatch); + } + message_DisplayString(tv, 0, "Aborted."); + im_ForceUpdate(); + return; + } + /* We're currently in a failing search. */ + juststarted = 0; + success = 1; + mark_SetPos(tv->atMarker, mark_GetPos(lastmatch)); + mark_SetLength(tv->atMarker, + mark_GetLength(lastmatch)); + textview_FrameDot(tv, mark_GetPos(lastmatch)); + pattern[patternlen = lastsuccesslen] = '\0'; + compiled = NULL; + if (patternlen > 0) { + okpattern = ((compileerr = search_CompilePattern(pattern, &compiled)) == NULL); + } + break; + case ESC: + mark_SetPos(tv->atMarker, mark_GetPos(startpos)); + mark_SetLength(tv->atMarker, + mark_GetLength(startpos)); + text_RemoveMark(txt, startpos); + mark_Destroy(startpos); + if (lastmatch != startpos) { + text_RemoveMark(txt, lastmatch); + mark_Destroy(lastmatch); + } + message_DisplayString(tv, 0, "Mark set."); + strcpy(LastPattern, pattern); + im_ForceUpdate(); + return; + case CTRL_S: + if (juststarted) { + juststarted = 0; + strcpy(pattern, LastPattern); + patternlen = strlen(LastPattern); + compiled = NULL; + if (okpattern = ((compileerr = search_CompilePattern(pattern, &compiled)) == NULL)) { + dir = gsdir_backward; /* To fool the following + * code into thinking it's + * reversing directions; + * that way, the search + * will start from the + * current position + * instead of pos + 1 */ + } + } + if ((compiled != NULL) + && okpattern) { + if ((loc = search_MatchPattern(txt, textview_GetDotPosition(tv) + ((dir == gsdir_backward) ? 0 : 1), compiled)) + >= 0) { + /* Found it (again) */ + if (lastmatch != startpos) { + text_RemoveMark(txt, lastmatch); + mark_Destroy(lastmatch); + } + lastmatch = text_CreateMark(txt, loc, search_GetMatchLength()); + textview_SetDotPosition(tv, loc); + textview_SetDotLength(tv, search_GetMatchLength()); + textview_FrameDot(tv, loc); + lastsuccesslen = patternlen; + success = 1; + } + else { + success = 0; + } + } + dir = gsdir_forward; + break; + case CTRL_R: + if (juststarted) { + juststarted = 0; + strcpy(pattern, LastPattern); + patternlen = strlen(LastPattern); + compiled = NULL; + if (okpattern = ((compileerr = search_CompilePattern(pattern, &compiled)) == NULL)) { + dir = gsdir_forward; /* To fool the following + * code into thinking it's + * reversing directions; + * that way, the search + * will start from the + * current position + * instead of pos - 1 */ + } + } + if ((compiled != NULL) + && okpattern) { + if ((loc = search_MatchPatternReverse(txt, textview_GetDotPosition(tv) - ((dir == gsdir_forward) ? 0 : 1), compiled)) + >= 0) { + /* Found it (again) */ + if (lastmatch != startpos) { + text_RemoveMark(txt, lastmatch); + mark_Destroy(lastmatch); + } + lastmatch = text_CreateMark(txt, loc, search_GetMatchLength()); + textview_SetDotPosition(tv, loc); + textview_SetDotLength(tv, search_GetMatchLength()); + textview_FrameDot(tv, loc); + lastsuccesslen = patternlen; + success = 1; + } + else { + success = 0; + } + } + dir = gsdir_backward; + break; + case CTRL_H: + case DEL: + if (patternlen > 0) { + if (okpattern) { + if (dir == gsdir_forward) + loc = search_MatchPatternReverse(txt, textview_GetDotPosition(tv) - 1, compiled); + else + loc = search_MatchPattern(txt, textview_GetDotPosition(tv) + 1, compiled); + if (loc >= 0) { + if (lastmatch != startpos) { + text_RemoveMark(txt, lastmatch); + mark_Destroy(lastmatch); + } + lastmatch = text_CreateMark(txt, loc, search_GetMatchLength()); + textview_SetDotPosition(tv, loc); + textview_SetDotLength(tv, search_GetMatchLength()); + textview_FrameDot(tv, loc); + lastsuccesslen = patternlen; + success = 1; + break; + } + } + pattern[--patternlen] = '\0'; + compiled = NULL; + if (patternlen > 0) { + if (okpattern = ((compileerr = search_CompilePattern(pattern, &compiled)) == NULL)) { + if (dir == gsdir_forward) + loc = search_MatchPatternReverse(txt, textview_GetDotPosition(tv), compiled); + else + loc = search_MatchPattern(txt, textview_GetDotPosition(tv), compiled); + if (loc >= 0) { + if (lastmatch != startpos) { + text_RemoveMark(txt, lastmatch); + mark_Destroy(lastmatch); + } + lastmatch = text_CreateMark(txt, loc, search_GetMatchLength()); + textview_SetDotPosition(tv, loc); + textview_SetDotLength(tv, search_GetMatchLength()); + textview_FrameDot(tv, loc); + lastsuccesslen = patternlen; + success = 1; + } + else { /* OK pattern, but not found */ + success = 0; + } + } + } + else { /* empty pattern, go back to square + * 1 */ + if (lastmatch != startpos) { + text_RemoveMark(txt, lastmatch); + mark_Destroy(lastmatch); + } + lastmatch = text_CreateMark(txt, textview_GetDotPosition(tv), 0); + textview_SetDotLength(tv, 0); + textview_FrameDot(tv, mark_GetPos(lastmatch)); + lastsuccesslen = patternlen; /* i.e., 0 */ + success = 1; + } + } + break; + default: + if (isascii(c) && (isprint(c) || isspace(c))) { /* Extend the search + * pattern */ + juststarted = 0; + pattern[patternlen++] = c; + pattern[patternlen] = '\0'; + compiled = NULL; + if (okpattern = ((compileerr = search_CompilePattern(pattern, &compiled)) == NULL)) { + if (dir == gsdir_forward) + loc = search_MatchPattern(txt, textview_GetDotPosition(tv), compiled); + else + loc = search_MatchPatternReverse(txt, textview_GetDotPosition(tv), compiled); + if (loc >= 0) { + if (lastmatch != startpos) { + text_RemoveMark(txt, lastmatch); + mark_Destroy(lastmatch); + } + lastmatch = text_CreateMark(txt, loc, search_GetMatchLength()); + textview_SetDotPosition(tv, loc); + textview_SetDotLength(tv, search_GetMatchLength()); + textview_FrameDot(tv, loc); + lastsuccesslen = patternlen; + success = 1; + } + else { + success = 0; + } + } + } + else { /* Search is over */ + mark_SetPos(tv->atMarker, mark_GetPos(startpos)); + mark_SetLength(tv->atMarker, + mark_GetLength(startpos)); + text_RemoveMark(txt, startpos); + mark_Destroy(startpos); + if (lastmatch != startpos) { + text_RemoveMark(txt, lastmatch); + mark_Destroy(lastmatch); + } + message_DisplayString(tv, 0, "Mark set."); + strcpy(LastPattern, pattern); + im_ForceUpdate(); + im_DoKey(textview_GetIM(tv), c); + return; + } + break; + } + } + } + + static void fsearch(tv, key) + struct textview *tv; + long key; + { + struct text *txt = (struct text *) (tv->header.view.dataobject); + struct mark *mark = text_CreateMark(txt, textview_GetDotPosition(tv), textview_GetDotLength(tv)); + + dosearch(tv, txt, mark, gsdir_forward); + } + + static void rsearch(tv, key) + struct textview *tv; + long key; + { + struct text *txt = (struct text *) (tv->header.view.dataobject); + struct mark *mark = text_CreateMark(txt, textview_GetDotPosition(tv), textview_GetDotLength(tv)); + + dosearch(tv, txt, mark, gsdir_backward); + } + + boolean gsearch__InitializeClass() + { + static struct bind_Description fns[] = { + {"gsearch-forward", NULL, 0, NULL, 0, 0, fsearch, + "Search forward incrementally.", "gsearch"}, + {"gsearch-backward", NULL, 0, NULL, 0, 0, rsearch, "Search backward incrementally.", "gsearch"}, + {NULL}, + }; + struct classinfo *textviewClassinfo; + + *LastPattern = '\0'; + textviewClassinfo = class_Load("textview"); + if (textviewClassinfo != NULL) { + bind_BindList(fns, NULL, NULL, textviewClassinfo); + return TRUE; + } + else + return FALSE; + } *** atk/extensions/gsearch.ch Fri Jul 27 13:42:44 1990 --- atk/extensions/gsearch.ch.NEW Tue Jun 19 12:50:23 1990 *************** *** 0 **** --- 1,9 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + package gsearch { + classprocedures: + InitializeClass() returns boolean; + }; *** atk/extensions/gsrproc.help Fri Jul 27 13:42:53 1990 --- atk/extensions/gsrproc.help.NEW Tue Jun 19 12:50:24 1990 *************** *** 0 **** --- 1,13 ---- + \begindata{text,268700816} + \textdsversion{12} + \template{help} + \center{\bold{\bigger{\bigger{Proclist for Gsearch + + + }}}} + gsearch-forward: Incremental GNU-Emacs style search forward + + + gsearch-backward: Incremental GNU-Emacs style search backward + + \enddata{text,268700816} *** atk/fad/fadv.c Wed Nov 22 12:12:59 1989 --- atk/fad/fadv.c.NEW Thu May 10 16:27:34 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/fad/RCS/fadv.c,v 2.9 89/11/03 11:10:38 tpn Exp $ */ /* $ACIS:fadv.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/fad/RCS/fadv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/fad/RCS/fadv.c,v 2.9 89/11/03 11:10:38 tpn Exp $"; #endif /* lint */ #include /* sys/time.h sys/types.h */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/fad/RCS/fadv.c,v 2.10 90/05/08 16:12:43 gk5g Exp $ */ /* $ACIS:fadv.c 1.6$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/fad/RCS/fadv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/fad/RCS/fadv.c,v 2.10 90/05/08 16:12:43 gk5g Exp $"; #endif /* lint */ #include /* sys/time.h sys/types.h */ *************** *** 498,503 **** --- 498,511 ---- fadview_DrawRectSize(self,0,0,fadview_GetLogicalWidth(self)-1,fadview_GetLogicalHeight(self)-1); } } + + void fadview__FinalizeObject(classID, self) + struct classheader *classID; + struct fadview *self; + { + if(self->menulist) menulist_Destroy(self->menulist); + } + boolean fadview__InitializeObject(classID, self) struct classheader *classID; struct fadview *self; *** atk/fad/fadv.ch Wed Nov 22 12:12:55 1989 --- atk/fad/fadv.ch.NEW Thu May 10 16:27:38 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/fad/RCS/fadv.ch,v 2.5 89/02/20 12:49:22 ghoti Exp $ */ /* $ACIS:fadv.ch 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/fad/RCS/fadv.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidfadview_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/fad/RCS/fadv.ch,v 2.5 89/02/20 12:49:22 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/fad/RCS/fadv.ch,v 2.6 90/05/08 16:13:20 gk5g Exp $ */ /* $ACIS:fadv.ch 1.5$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/fad/RCS/fadv.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidfadview_H = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/fad/RCS/fadv.ch,v 2.6 90/05/08 16:13:20 gk5g Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #include *************** *** 32,37 **** --- 32,38 ---- classprocedures: InitializeObject(struct fadview *self) returns boolean; + FinalizeObject(struct fadview *self); InitializeClass() returns boolean; data: int HasFocus; *** atk/frame/frame.c Wed Apr 11 14:19:08 1990 --- atk/frame/frame.c.NEW Thu May 10 16:27:47 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.c,v 2.15 90/03/12 19:27:42 gk5g Exp $ */ /* $ACIS:frame.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.c,v 2.15 90/03/12 19:27:42 gk5g Exp $"; #endif /* lint */ /* frame.c --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.c,v 2.16 90/05/08 12:13:35 gk5g Exp $ */ /* $ACIS:frame.c 1.6$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/frame.c,v 2.16 90/05/08 12:13:35 gk5g Exp $"; #endif /* lint */ /* frame.c *************** *** 164,175 **** #else frame_SetBuffer(self, NULL, FALSE); #endif ! frame_SetNth(self, 1, NULL); /* Remove the view from the lpair */ framemessage_Destroy(self->messageLine); framemessage_Destroy(self->dialogLine); cursor_Destroy(self->octcursor); cursor_Destroy(self->arrowcursor); ! if (self->title != NULL) free(self->title); --- 164,175 ---- #else frame_SetBuffer(self, NULL, FALSE); #endif ! frame_SetNth(self, 1, NULL); /* Remove the view from the lpair */ framemessage_Destroy(self->messageLine); framemessage_Destroy(self->dialogLine); cursor_Destroy(self->octcursor); cursor_Destroy(self->arrowcursor); ! if(self->menulist) menulist_Destroy(self->menulist); if (self->title != NULL) free(self->title); *************** *** 279,284 **** --- 279,288 ---- struct view *inputFocus, *targetView; + if(buffer == NULL && self->buffer == NULL && self->childView != NULL){ + frame_SetNth(self, 0, NULL); /* Remove the view from the lpair so it can be + destroyed by whoever created it */ + } if (buffer != self->buffer) { if (self->buffer != NULL) { if (self->childView != NULL) { *************** *** 326,331 **** --- 330,339 ---- self->object = NULL; self->buffer = NULL; } + else if(view == NULL && self->childView != NULL){ + frame_SetNth(self, 0, NULL); /* Remove the view from the lpair so it can be + destroyed by whoever created it */ + } self->childView = self->targetView = view; if (view != NULL) { frame_VFixed(self, self->childView, self->messageView, self->lineHeight, TRUE); *************** *** 757,763 **** } else frame_FillRect(self,&self->AnswerBox, frame_WhitePattern(self)); - if(self->DialogBuffer) { drawshadow(self,&self->bufferrec); frame_DrawRect(self,&self->bufferrec); --- 765,770 ---- *** atk/frame/framecmd.c Wed Apr 11 14:19:20 1990 --- atk/frame/framecmd.c.NEW Wed Jun 13 16:58:49 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framecmd.c,v 2.37 90/03/23 15:35:33 gk5g Exp $ */ /* $ACIS:framecmd.c 1.3$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framecmd.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framecmd.c,v 2.37 90/03/23 15:35:33 gk5g Exp $"; #endif /* lint */ /* framecmd.c --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framecmd.c,v 2.38 90/05/09 14:03:55 gk5g Exp Locker: wjh $ */ /* $ACIS:framecmd.c 1.3$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framecmd.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framecmd.c,v 2.38 90/05/09 14:03:55 gk5g Exp Locker: wjh $"; #endif /* lint */ /* framecmd.c *************** *** 630,637 **** frame_Enumerate(countFrames, &count); if (count > 1) { ! struct im *im = frame_GetIM( self); ! frame_UnlinkTree(self); frame_Destroy(self); im_Destroy(im); } --- 630,638 ---- frame_Enumerate(countFrames, &count); if (count > 1) { ! struct im *im = frame_GetIM(self); ! frame_SetView(self,NULL); ! im_SetView(im,NULL); frame_Destroy(self); im_Destroy(im); } *************** *** 670,676 **** frame_Enumerate(countFrames, &count); if (count > 1) { /* if more than one window, don't quit */ struct im *im = frame_GetIM(self); ! frame_UnlinkTree(self); frame_Destroy(self); im_Destroy(im); return; --- 671,678 ---- frame_Enumerate(countFrames, &count); if (count > 1) { /* if more than one window, don't quit */ struct im *im = frame_GetIM(self); ! frame_SetView(self,NULL); ! im_SetView(im,NULL); frame_Destroy(self); im_Destroy(im); return; *** atk/frame/framev.c Wed Apr 11 14:19:25 1990 --- atk/frame/framev.c.NEW Thu May 10 16:27:56 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framev.c,v 2.14 90/04/02 14:40:21 tpn Exp $ */ /* $ACIS:framev.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framev.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framev.c,v 2.14 90/04/02 14:40:21 tpn Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framev.c,v 2.15 90/05/07 15:11:27 gk5g Exp $ */ /* $ACIS:framev.c 1.4$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framev.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/frame/RCS/framev.c,v 2.15 90/05/07 15:11:27 gk5g Exp $"; #endif /* lint */ #include *************** *** 50,56 **** self->transientMark = NULL; self->amLosingInputFocus = FALSE; frameview_SetBorder(self, 2, 2); ! /* This next piece of code depends on textview allocating a new style for every textview's default style. That way we can change the meaning of this style for our textview only with out opying the style. If the textview behavior changes, this will have to change as well. */ if ((defaultStyle = frameview_GetDefaultStyle(self)) != NULL) { style_SetJustification(defaultStyle, style_LeftJustified); --- 50,56 ---- self->transientMark = NULL; self->amLosingInputFocus = FALSE; frameview_SetBorder(self, 2, 2); ! /* This next piece of code depends on textview allocating a new style for every textview's default style. That way we can change the meaning of this style for our textview only without copying the style. If the textview behavior changes, this will have to change as well. */ if ((defaultStyle = frameview_GetDefaultStyle(self)) != NULL) { style_SetJustification(defaultStyle, style_LeftJustified); *************** *** 64,69 **** --- 64,70 ---- { keystate_Destroy(self->keystate); + if(self->menulist) menulist_Destroy(self->menulist); if (self->transientMark != NULL) { text_RemoveMark(self->messageLine->messageText, self->transientMark); mark_Destroy(self->transientMark); *** atk/glist/glist.c Wed Nov 22 12:14:01 1989 --- atk/glist/glist.c.NEW Fri Jul 27 12:50:37 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/glist/RCS/glist.c,v 2.3 89/02/17 16:15:05 ghoti Exp $ */ /* $ACIS:glist.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/glist/RCS/glist.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/glist/RCS/glist.c,v 2.3 89/02/17 16:15:05 ghoti Exp $"; #endif /* lint */ /* List object --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/glist/RCS/glist.c,v 2.4 90/07/23 16:47:04 gk5g Exp $ */ /* $ACIS:glist.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/glist/RCS/glist.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/glist/RCS/glist.c,v 2.4 90/07/23 16:47:04 gk5g Exp $"; #endif /* lint */ /* List object *************** *** 360,363 **** --- 360,375 ---- item = item->next; } return FALSE; + } + + void glist__Enumerate(self, proc, rock) + struct glist *self; + void (*proc)(); + unsigned long rock; + { + struct glistelt *elt; + + if(proc == NULL) return; + for(elt = self->head; elt != NULL; elt = elt->next) + (*proc)(elt->this,rock); } *** atk/glist/glist.ch Wed Nov 22 12:13:58 1989 --- atk/glist/glist.ch.NEW Fri Jul 27 12:50:39 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/glist/RCS/glist.ch,v 2.5 89/09/08 16:30:38 ghoti Exp $ */ /* $ACIS:glist.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/glist/RCS/glist.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidglist_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/glist/RCS/glist.ch,v 2.5 89/09/08 16:30:38 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* List object --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/glist/RCS/glist.ch,v 2.6 90/07/23 16:47:50 gk5g Exp $ */ /* $ACIS:glist.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/glist/RCS/glist.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidglist_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/glist/RCS/glist.ch,v 2.6 90/07/23 16:47:50 gk5g Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* List object *************** *** 35,40 **** --- 35,41 ---- InsertUnique(char * element) returns boolean; Delete(char * element, boolean destroy) returns boolean; Find(procedure filter, char * rock) returns char *; /* filter is called: filter(char * element) */ + Enumerate(void (*proc)(), unsigned long rock); Contains(char * element) returns boolean; Clear(boolean destroy); macromethods: *** atk/glist/glist.doc Wed Nov 22 12:14:02 1989 --- atk/glist/glist.doc.NEW Fri Jul 27 12:50:41 1990 *************** *** 1,4 **** ! \begindata{text,269242860} \textdsversion{12} \template{default} \define{bold --- 1,4 ---- ! \begindata{text,268715264} \textdsversion{12} \template{default} \define{bold *************** *** 56,61 **** --- 56,64 ---- \fixedtext{boolean \bold{glist_}Delete }\fixedindent{(struct glist *\paramname{glist}, char *\paramname{element}, boolean \paramname{destroy});} + \fixedtext{void \bold{glist}_Enumerate (struct glist *\italic{self}, procedure + \italic{proc}, unsigned long \italic{rock});} + \fixedtext{void \bold{glist_}FinalizeObject }\fixedindent{(struct glist *\paramname{self});} *************** *** 66,71 **** --- 69,76 ---- + + \fixedtext{boolean \bold{glist_}InitializeObject }\fixedindent{(struct glist *\paramname{self});} *************** *** 74,79 **** --- 79,86 ---- + + \fixedtext{boolean \bold{glist_}InsertUnique }\fixedindent{(struct glist *\paramname{glist}, char *\paramname{element});} *************** *** 84,89 **** --- 91,98 ---- + + \fixedtext{char *\bold{glist_}Pop }\fixedindent{(struct glist *\paramname{glist});} *************** *** 94,101 **** \fixedtext{boolean \bold{glist_}Sort }\fixedindent{(struct glist *\paramname{glist}, procedure \paramname{greater});} ! \enddata{text,269242860} --- 103,112 ---- + + \fixedtext{boolean \bold{glist_}Sort }\fixedindent{(struct glist *\paramname{glist}, procedure \paramname{greater});} ! \enddata{text,268715264} *** atk/gob/gobv.c Wed Nov 22 12:14:20 1989 --- atk/gob/gobv.c.NEW Thu May 10 16:28:03 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/gob/RCS/gobv.c,v 1.6 89/02/24 10:39:24 ghoti Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/gob/RCS/gobv.c,v $ */ #ifndef lint ! char *gobview_rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/gob/RCS/gobv.c,v 1.6 89/02/24 10:39:24 ghoti Exp $"; #endif /* lint */ /* gobv.c --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/gob/RCS/gobv.c,v 1.7 90/05/08 16:25:03 gk5g Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/gob/RCS/gobv.c,v $ */ #ifndef lint ! char *gobview_rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/gob/RCS/gobv.c,v 1.7 90/05/08 16:25:03 gk5g Exp $"; #endif /* lint */ /* gobv.c *************** *** 486,491 **** --- 486,492 ---- register struct gobview *self; { self->Menus = menulist_DuplicateML(EmbeddedMenus, self); + self->AppMenus = NULL; /* ApplicationMenus are added in GetApplicationLayer */ self->Keystate = keystate_Create(self, EmbeddedKeymap); *************** *** 505,511 **** struct classhdr *ClassID; register struct gobview *self; { ! menulist_Destroy(self->Menus); keystate_Destroy(self->Keystate); /* $$$ is variables in the data: of gobv.ch have been assigned --- 506,513 ---- struct classhdr *ClassID; register struct gobview *self; { ! if(self->Menus) menulist_Destroy(self->Menus); ! if(self->AppMenus) menulist_Destroy(self->AppMenus); keystate_Destroy(self->Keystate); /* $$$ is variables in the data: of gobv.ch have been assigned *************** *** 536,543 **** register struct gobview *self; { self->embedded = FALSE; ! menulist_ChainBeforeML(self->Menus, ! menulist_DuplicateML(ApplicationMenus, self), NULL); keystate_AddBefore(keystate_Create(self, ApplicationKeymap), self->Keystate); return self; } --- 538,544 ---- register struct gobview *self; { self->embedded = FALSE; ! menulist_ChainBeforeML(self->Menus, self->AppMenus = menulist_DuplicateML(ApplicationMenus, self), NULL); keystate_AddBefore(keystate_Create(self, ApplicationKeymap), self->Keystate); return self; } *** atk/gob/gobv.ch Wed Nov 22 12:14:09 1989 --- atk/gob/gobv.ch.NEW Thu May 10 16:28:06 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/gob/RCS/gobv.ch,v 1.5 89/02/20 12:50:49 ghoti Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/gob/RCS/gobv.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/gob/RCS/gobv.ch,v 1.5 89/02/20 12:50:49 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/gob/RCS/gobv.ch,v 1.6 90/05/08 16:25:46 gk5g Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/gob/RCS/gobv.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/gob/RCS/gobv.ch,v 1.6 90/05/08 16:25:46 gk5g Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* *************** *** 22,27 **** --- 22,30 ---- */ /* * $Log: gobv.ch,v $ + Revision 1.6 90/05/08 16:25:46 gk5g + Added instance variable to hold the AppMenus so we can destroy them in FinalizeObject. + Revision 1.5 89/02/20 12:50:49 ghoti class syntax changes *************** *** 82,87 **** --- 85,91 ---- data: struct menulist *Menus; + struct menulist *AppMenus; struct keystate *Keystate; struct graphic *BlackPattern; /* these might differ between instances . . . */ *** atk/help/src/config.h Wed Nov 22 12:14:49 1989 --- atk/help/src/config.h.NEW Thu Jul 19 14:01:43 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/help/src/RCS/config.h,v 1.8 89/10/06 10:27:18 cfe Exp $ */ /* $ACIS$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/help/src/RCS/config.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/help/src/RCS/config.h,v 1.8 89/10/06 10:27:18 cfe Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/config.h,v 1.9 90/07/19 13:40:43 gk5g Exp $ */ /* $ACIS$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/config.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/config.h,v 1.9 90/07/19 13:40:43 gk5g Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ *************** *** 25,31 **** * Entry in AndrewSetup indicating where the help index is to be found. * If that doesn't work, use the DEFAULT_ directory, relative to ANDREWDIR */ ! #define SETUP_INDEXDIR "HelpIndex" #define DEFAULT_INDEXDIR "/lib/help.index" /* --- 25,31 ---- * Entry in AndrewSetup indicating where the help index is to be found. * If that doesn't work, use the DEFAULT_ directory, relative to ANDREWDIR */ ! #define SETUP_INDEXDIR "HelpIndexDir" #define DEFAULT_INDEXDIR "/lib/help.index" /* *************** *** 57,78 **** #define DEFAULT_TUTORIALDIR "/help" /* ! * location of the alias file, relative to the Help HELPDIR */ #define ALIASFILE "/help.aliases" /* ! * location of the default overviews list file, relative to the Help LIBDIR */ #define OVERVIEWFILE "/help.overviews" /* ! * the location of the default help topics list file, relative to the Help LIBDIR */ #define PROGRAMFILE "/help.programs" /* ! * where to store the "missing file x" notices, relative to the Help HELPDIR */ #define MISSINGDIR "/HelpFlaws" --- 57,99 ---- #define DEFAULT_TUTORIALDIR "/help" /* ! * Entry in AndrewSetup indicating where to look for "alias files". ! * If that doesn't work, use the DEFAULT_ directory, relative to ANDREWDIR */ + #define SETUP_ALIASDIR "HelpAliasDir" + #define DEFAULT_ALIASDIR "/help" + + /* + * Entry in AndrewSetup indicating where to look for "panels files". + * If that doesn't work, use the DEFAULT_ directory, relative to LIBDIR (above) + */ + #define SETUP_PANELSDIR "HelpPanelsDir" + #define DEFAULT_PANELSDIR "/help" + + /* + * Entry in AndrewSetup indicating where to store "missing files". + * If that doesn't work, use the DEFAULT_ directory, relative to ANDREWDIR + */ + #define SETUP_MISSINGDIR "HelpMissingDir" + #define DEFAULT_MISSINGDIR "/help" + + /* + * location of the alias file, relative to the Help ALIASDIR + */ #define ALIASFILE "/help.aliases" /* ! * location of the default overviews list file, relative to the Help PANELSDIR */ #define OVERVIEWFILE "/help.overviews" /* ! * the location of the default help topics list file, relative to the Help PANELSDIR */ #define PROGRAMFILE "/help.programs" /* ! * where to store the "missing file x" notices, relative to the Help MISSINGDIR */ #define MISSINGDIR "/HelpFlaws" *************** *** 192,197 **** --- 213,223 ---- * maximum length of a help topic */ #define HNSIZE 100 + + /* + * Maximum number of tutorial dirs allowed + */ + #define MAX_TUTORIAL_DIRS 25 /* * how many items in the history panel *** atk/help/src/help.c Mon Mar 12 13:16:03 1990 --- atk/help/src/help.c.NEW Thu Jul 19 14:01:47 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/help/src/RCS/help.c,v 2.70 90/02/26 16:20:12 gk5g Exp $ */ /* $ACIS$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/help/src/RCS/help.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/help/src/RCS/help.c,v 2.70 90/02/26 16:20:12 gk5g Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/help.c,v 2.72 90/07/19 13:59:22 gk5g Exp $ */ /* $ACIS$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/help.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/help.c,v 2.72 90/07/19 13:59:22 gk5g Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ *************** *** 32,41 **** #include #include /* sys/types.h in AIX PS2 defines "struct label", causing a type name clash. Avoid this by temporarily redefining "label" to be something else in the preprocessor. */ - #define label gezornenplatz #include /* sys/types.h sys/file.h */ #undef label --- 32,41 ---- #include + #define label gezornenplatz #include /* sys/types.h in AIX PS2 defines "struct label", causing a type name clash. Avoid this by temporarily redefining "label" to be something else in the preprocessor. */ #include /* sys/types.h sys/file.h */ #undef label *************** *** 72,78 **** #include #include #include - #include #include #include /* use the reg expression routines in overhead */ --- 72,77 ---- *************** *** 92,98 **** static struct menulist *Help_Menus; /* statics representing information cache */ ! static char tutorialDir[MAXPATHLEN]; static char changesDir[MAXPATHLEN]; /* a list of instances of help */ --- 91,97 ---- static struct menulist *Help_Menus; /* statics representing information cache */ ! static char *tutorialDirs[MAX_TUTORIAL_DIRS]; static char changesDir[MAXPATHLEN]; /* a list of instances of help */ *************** *** 101,107 **** static struct cursor *waitCursor; /* the watch cursor */ static char **panelList = NULL; /* used for enumerating across the help index */ ! static int panelIndex = 0; /* hooks to textview and frame procs */ static void (*textSearch)() = (void (*)())NULL; --- 100,106 ---- static struct cursor *waitCursor; /* the watch cursor */ static char **panelList = NULL; /* used for enumerating across the help index */ ! static int panelIndex = 0, panelListSize = help_MAXPANEL; /* hooks to textview and frame procs */ static void (*textSearch)() = (void (*)())NULL; *************** *** 460,466 **** scroll_SetView(c->scroll, c->view); /* does a linktree */ textview_SetEmbeddedBorder((struct textview *) c->view, 20, 5); dataobject_NotifyObservers(c->data, (long)0); - scroll_WantUpdate(c->scroll, c->scroll); /* get rid of the old view and dataobject*/ DEBUG(("destroying... %d ",(int)oldview)); --- 459,464 ---- *************** *** 477,483 **** lastmore = amoreFlag; im_SetTitle(view_GetIM((struct view *)c->view), tbuffer); ! super_WantInputFocus(c->view, c->view); fclose(fd); --- 475,481 ---- lastmore = amoreFlag; im_SetTitle(view_GetIM((struct view *)c->view), tbuffer); ! super_WantInputFocus(self, c->view); fclose(fd); *************** *** 486,492 **** --- 484,522 ---- /* phew! */ } + /* + FindEntryInDirs( dirs, entry, extension ) + char *dirs[]; A list of directories to be searched for a given entry. + char *entry; The entry to be searched for in dirs sans extension. + char *extension; The extension that will be concatenated to entry for searching purposes. + Purpose: This routine is used to find a specified file within an ordered list of possible directories that are specified via that AndrewSetup file (see config.h for possible AndrewSetup entries). The dirs[] are a NULL-terminated list of pointers to character strings. Entry is a pointer to a character string that is a file-name w/o the extension. Extension is the extension that will be placed at the end of entry. The first match that is found is returned in a static memory area. DON'T FREE THE VALUE THAT IS RETURNED... COPY IT TO SOME WORKING AREA OR USE IT BEFORE MAKING ANOTHER CALL TO THIS ROUTINE. + + Used in: HistoryHelp(), ShowTutorial(), GetHelpOn(). NOTE: this routine is currently only used to find tutorial files because it is useful to be able to place tutorials in various places ( /usr/local/help, /usr/andrew/help, ...). In the future other files (like .help files) may have various homes and this routine should be used to access them. + */ + + static char * + FindEntryInDirs( dirs, entry , extension ) + char *dirs[]; + char *entry, *extension; + { + static char fullPath[MAXPATHLEN]; + char *returnPath = NULL; + int i = 0; + + *fullPath = '\0'; + if(entry && dirs && *dirs) { + for(i = 0; dirs[i] && *dirs[i] ; i++) { + sprintf(fullPath,"%s/%s%s",dirs[i],entry,extension); + if(access(fullPath, 0) == 0) break; + else *fullPath = '\0'; + } + } + if(*fullPath != '\0') + returnPath = fullPath; + return(returnPath); + } + /* * Main function for getting help on a string * *************** *** 558,567 **** c->flags &= ~(MENU_SwitchChangesMenu | MENU_SwitchTutorialMenu | MENU_SwitchMoreMenu); /* should we display "show tutorial" or "show changes" menus? */ ! sprintf(tbuffer, "%s/%s%s", tutorialDir, c->name, TUTORIAL_EXT); ! if (access(tbuffer, 0) == 0 && !(c->flags & MENU_SwitchTutorialMenu)) ! c->flags |= MENU_SwitchTutorialMenu; ! sprintf(tbuffer, "%s/%s%s", changesDir, c->name, CHANGE_EXT); if (access(tbuffer, 0) == 0 && !(c->flags & MENU_SwitchChangesMenu)) c->flags |= MENU_SwitchChangesMenu; --- 588,597 ---- c->flags &= ~(MENU_SwitchChangesMenu | MENU_SwitchTutorialMenu | MENU_SwitchMoreMenu); /* should we display "show tutorial" or "show changes" menus? */ ! if(FindEntryInDirs(tutorialDirs, c->name, TUTORIAL_EXT)) { ! if (!(c->flags & MENU_SwitchTutorialMenu)) ! c->flags |= MENU_SwitchTutorialMenu; ! } sprintf(tbuffer, "%s/%s%s", changesDir, c->name, CHANGE_EXT); if (access(tbuffer, 0) == 0 && !(c->flags & MENU_SwitchChangesMenu)) c->flags |= MENU_SwitchChangesMenu; *************** *** 597,604 **** DEBUG(("ERROR\n")); sprintf(helpBuffer, (errmsg == NULL) ? err_generic : errmsg); ERRORBOX(c->view, helpBuffer); - DEBUG(("want focus\n")); - super_WantInputFocus(c->view, c->view); } else { /* no error, advance to next file on list */ c->cur = c->cur->next; } --- 627,632 ---- *************** *** 797,806 **** register struct help *self; { static char tbuffer[MAXPATHLEN]; ! sprintf(tbuffer, "%s/%s%s", tutorialDir, self->info->name, TUTORIAL_EXT); ! self->info->flags &= ~MENU_SwitchTutorialMenu; /* turn off menu item */ ! SetupMenus(self->info); ShowFile(self, tbuffer, help_USE_OLD_TITLE, help_HIST_TAIL); } --- 825,837 ---- register struct help *self; { static char tbuffer[MAXPATHLEN]; + char *tmp = NULL; ! if(tmp = FindEntryInDirs(tutorialDirs,self->info->name,TUTORIAL_EXT)) { ! strcpy(tbuffer,tmp); ! self->info->flags &= ~MENU_SwitchTutorialMenu; /* turn off menu item */ ! SetupMenus(self->info); ! } ShowFile(self, tbuffer, help_USE_OLD_TITLE, help_HIST_TAIL); } *************** *** 892,898 **** { char buf[HNSIZE + HELP_MAX_ERR_LENGTH]; char fnbuf[MAXPATHLEN]; ! char *tmp, *dir; int code; int file = FALSE; --- 923,929 ---- { char buf[HNSIZE + HELP_MAX_ERR_LENGTH]; char fnbuf[MAXPATHLEN]; ! char *tmp = NULL, *dir = NULL; int code; int file = FALSE; *************** *** 910,921 **** } if (!strcmp(tmp, TUTORIAL_EXT)) { file = TRUE; ! dir = tutorialDir; } } if (file) { ! strcpy(fnbuf, dir); strcat(fnbuf, "/"); strcat(fnbuf, ent->fname); DEBUG(("history file: %s\n",fnbuf)); --- 941,953 ---- } if (!strcmp(tmp, TUTORIAL_EXT)) { file = TRUE; ! *tmp = '\0'; ! dir = FindEntryInDirs( tutorialDirs, ent->fname , TUTORIAL_EXT ); } } if (file) { ! strcpy(fnbuf, dir ); strcat(fnbuf, "/"); strcat(fnbuf, ent->fname); DEBUG(("history file: %s\n",fnbuf)); *************** *** 1076,1086 **** } } - /*---------------------------------------------------------------------------*/ /* PANEL FUNCTIONS */ /*---------------------------------------------------------------------------*/ /* * setup panels and default entries. This function had an ifdef to map it between cmu and non-cmu. --- 1108,1149 ---- } } /*---------------------------------------------------------------------------*/ /* PANEL FUNCTIONS */ /*---------------------------------------------------------------------------*/ + static boolean + EnsurePanelListSize() + { + if(panelList || (panelList = (char**)calloc(panelListSize,sizeof(char*)))) + if(panelIndex >= (panelListSize-1)) { + panelListSize *= 2; + if(panelList = (char**) realloc(panelList,sizeof(char*) * panelListSize)) { + int i; + + for(i = panelIndex; i < panelListSize; i++) + panelList[i] = NULL; + } + } + return(panelList ? TRUE : FALSE); + } + + static void + FreePanelListData() + { + if(panelList && (panelIndex > 0)) { + int i; + + for(i = 0; i <= panelIndex; i++) + /* Don't free the panelList strings because these strings are passed in as the client data (tag) for the panel object items and panel_FreeAllTags() will release these.*/ + if(panelList[i]) panelList[i] = NULL; + free(panelList); + panelList = NULL; + panelListSize = help_MAXPANEL; + panelIndex = 0; + } + } + /* * setup panels and default entries. This function had an ifdef to map it between cmu and non-cmu. *************** *** 1139,1173 **** else if ((helpdir = opendir(fname)) == (DIR *)NULL) ERRORBOX(panel, err_openhelpdir); else { ! if (!panelList) ! panelList = (char **)malloc(sizeof(char *) * help_MAXPANEL); ! panelIndex = 0; ! ! strcpy(tf, fname); /* make a base for filenames dir/dir/ */ ! tfp = tf + strlen(tf); ! *tfp++ = '/'; /* tfp points just after the last '/' */ ! while((ent = readdir(helpdir)) != (struct direct *)NULL) { ! strcpy(tfp, ent->d_name); /* finish the filename */ ! defptr = def; ! tmp = rindex(ent->d_name, '.'); ! if (tmp != NULL) { ! while (defptr && *defptr != (char *) NULL) { ! if (strcmp(tmp, *defptr++) == 0) { ! *tmp = '\0'; /* chop off extension */ ! /* found a good candidate filename */ ! AddToPanelList(ent->d_name); ! *tmp = '.'; /* replace period */ ! entriesadded++; ! } ! } } } ! closedir(helpdir); ! /* now make the list */ ! SortAndMakePanel(panel); } return entriesadded; } --- 1202,1237 ---- else if ((helpdir = opendir(fname)) == (DIR *)NULL) ERRORBOX(panel, err_openhelpdir); else { ! FreePanelListData(); ! if(!EnsurePanelListSize()) { ! fprintf(stderr,"Couldn't allocate enough memory!\n"); ! return(0); ! } ! strcpy(tf, fname); /* make a base for filenames dir/dir/ */ ! tfp = tf + strlen(tf); ! *tfp++ = '/'; /* tfp points just after the last '/' */ ! while((ent = readdir(helpdir)) != (struct direct *)NULL) { ! strcpy(tfp, ent->d_name); /* finish the filename */ ! defptr = def; ! tmp = rindex(ent->d_name, '.'); ! if (tmp != NULL) { ! while (defptr && *defptr != (char *) NULL) { ! if (strcmp(tmp, *defptr++) == 0) { ! *tmp = '\0'; /* chop off extension */ ! /* found a good candidate filename */ ! AddToPanelList(ent->d_name); ! *tmp = '.'; /* replace period */ ! entriesadded++; } + } } ! } ! closedir(helpdir); ! /* now make the list */ ! SortAndMakePanel(panel); } return entriesadded; } *************** *** 1440,1458 **** static void SortAndMakePanel(p) struct panel *p; { ! char **ts; DEBUG(("sort and make...")); - panelList[panelIndex] = NULL; DEBUG(("sort...")); ! if(panelIndex > 1) qsort(panelList, panelIndex, sizeof(char *), panelCompare); DEBUG(("removing...")); if(panelIndex > 0){ panel_FreeAllTags(p); panel_RemoveAll(p); DEBUG(("adding...")); ! for (ts=panelList; *ts; ts++) { ! panel_Add(p, *ts, *ts, FALSE); } } DEBUG(("done\n")); --- 1504,1522 ---- static void SortAndMakePanel(p) struct panel *p; { ! int i; DEBUG(("sort and make...")); DEBUG(("sort...")); ! if(panelIndex > 1) ! qsort(panelList, panelIndex, sizeof(char *), panelCompare); DEBUG(("removing...")); if(panelIndex > 0){ panel_FreeAllTags(p); panel_RemoveAll(p); DEBUG(("adding...")); ! for (i = 0; i < panelIndex; i++) { ! panel_Add(p, panelList[i], panelList[i], FALSE); } } DEBUG(("done\n")); *************** *** 1465,1480 **** static char *AddToPanelList(s) char *s; { ! if(!panelList) ! panelList = (char **)malloc(sizeof(char *) * help_MAXPANEL); ! if(!panelList) ! return((char *) NULL); ! panelList[panelIndex] = (char *)malloc(strlen(s) + 1); ! if (!panelList[panelIndex]) ! return NULL; ! strcpy(panelList[panelIndex], s); ! panelIndex++; ! return panelList[(panelIndex - 1)]; } --- 1529,1547 ---- static char *AddToPanelList(s) char *s; { ! if(EnsurePanelListSize()) { ! if(!(panelList[panelIndex] = (char*)malloc(strlen(s) + 1))) { ! fprintf(stderr,"Couldn't allocate enough memory!\n"); ! return(NULL); ! } ! strcpy(panelList[panelIndex], s); ! panelIndex++; ! return panelList[(panelIndex - 1)]; ! } ! else { ! fprintf(stderr,"Couldn't allocate enough memory!\n"); ! return(NULL); ! } } *************** *** 1519,1530 **** self->expandedList = 0; panel_FreeAllTags(self->listPanel); ! panel_RemoveAll(self->listPanel); /* this frees all the strings in panelList */ /* add only the small list of entries to listPanel */ ! tmp = environ_GetConfiguration(SETUP_LIBDIR); if (tmp == NULL) ! tmp = environ_AndrewDir(DEFAULT_LIBDIR); sprintf(pathName, "%s%s", tmp, PROGRAMFILE); if (0 == SetupPanel(TRUE, pathName, self->listPanel, NULL)) { --- 1586,1597 ---- self->expandedList = 0; panel_FreeAllTags(self->listPanel); ! panel_RemoveAll(self->listPanel); /* this frees all the strings in panelLits */ /* add only the small list of entries to listPanel */ ! tmp = environ_GetConfiguration(SETUP_PANELSDIR); if (tmp == NULL) ! tmp = environ_AndrewDir(DEFAULT_PANELSDIR); sprintf(pathName, "%s%s", tmp, PROGRAMFILE); if (0 == SetupPanel(TRUE, pathName, self->listPanel, NULL)) { *************** *** 1541,1551 **** DEBUG(("expanding ")); ! if (!panelList) ! panelList = (char **)malloc(sizeof(char *) * help_MAXPANEL); - panelIndex = 0; - if (!helpdb_CheckIndex(self)) return; message_DisplayString(self, 0, msg_expanding); --- 1608,1619 ---- DEBUG(("expanding ")); ! FreePanelListData(); ! if(EnsurePanelListSize() == FALSE) { ! fprintf(stderr,"Couldn't allocate enough memory!\n"); ! return; ! } if (!helpdb_CheckIndex(self)) return; message_DisplayString(self, 0, msg_expanding); *************** *** 1648,1654 **** if ((code < 0) || (buf[0] == '\0')) return; ! panelIndex = 0; if (rock == help_FILTER_FILTER) list = self->listPanel->panelList; --- 1716,1722 ---- if ((code < 0) || (buf[0] == '\0')) return; ! FreePanelListData(); if (rock == help_FILTER_FILTER) list = self->listPanel->panelList; *************** *** 1750,1760 **** struct classheader *classID; register struct help *self; { ! char pathName[MAXPATHLEN], *tmp; struct proctable_Entry *pe; struct self_help *id; struct view *v; DEBUG(("IN init obj\n")); waitCursor = cursor_Create(0); cursor_SetStandard(waitCursor, Cursor_Wait); --- 1818,1830 ---- struct classheader *classID; register struct help *self; { ! char pathName[MAXPATHLEN], *tmp = NULL, *colon = NULL; struct proctable_Entry *pe; struct self_help *id; struct view *v; + int i = 0; + DEBUG(("IN init obj\n")); waitCursor = cursor_Create(0); cursor_SetStandard(waitCursor, Cursor_Wait); *************** *** 1766,1776 **** } strcpy(changesDir, tmp); ! tmp = environ_GetConfiguration(SETUP_TUTORIALDIR); ! if (tmp == NULL) { tmp = environ_AndrewDir(DEFAULT_TUTORIALDIR); } - strcpy(tutorialDir, tmp); im_SetProcessCursor((struct cursor *) NULL); --- 1836,1868 ---- } strcpy(changesDir, tmp); ! for(i = 0; i < MAX_TUTORIAL_DIRS; i++) ! tutorialDirs[i] = NULL; ! i = 0; ! if(tmp = environ_GetConfiguration(SETUP_TUTORIALDIR)) { ! if((colon = rindex(tmp,':')) == NULL) { ! tutorialDirs[i] = (char*) malloc(strlen(tmp) + 1); ! strcpy(tutorialDirs[i],tmp); ! } ! else { ! while(colon && (colon != '\0')) { ! *colon = '\0'; ! tutorialDirs[i] = (char*) malloc(strlen(tmp) + 1); ! strcpy(tutorialDirs[i],tmp); ! *colon = ':'; ! tmp = colon + 1; ! colon = rindex(tmp,':'); ! i++; ! } ! tutorialDirs[i] = (char*) malloc(strlen(tmp) + 1); ! strcpy(tutorialDirs[i],tmp); ! } ! } ! else { tmp = environ_AndrewDir(DEFAULT_TUTORIALDIR); + tutorialDirs[i] = (char*) malloc(strlen(tmp) + 1); + strcpy(tutorialDirs[i],tmp); } im_SetProcessCursor((struct cursor *) NULL); *************** *** 1900,1908 **** scroll_LinkTree(self->info->scroll, self); /* add minimum set of entries to listPanel */ ! tmp = environ_GetConfiguration(SETUP_LIBDIR); ! if (tmp == NULL) ! tmp = environ_AndrewDir(DEFAULT_LIBDIR); sprintf(pathName, "%s%s", tmp, PROGRAMFILE); if (0 == SetupPanel(TRUE, pathName, self->listPanel, NULL)) { --- 1992,2002 ---- scroll_LinkTree(self->info->scroll, self); /* add minimum set of entries to listPanel */ ! if((tmp = environ_GetConfiguration(SETUP_PANELSDIR)) == NULL) { ! tmp = environ_GetConfiguration(SETUP_LIBDIR); ! if (tmp == NULL) ! tmp = environ_AndrewDir(DEFAULT_LIBDIR); ! } sprintf(pathName, "%s%s", tmp, PROGRAMFILE); if (0 == SetupPanel(TRUE, pathName, self->listPanel, NULL)) { *************** *** 1921,1929 **** ToggleProgramListSize(self, help_EXPAND); /* get overviews entries */ ! tmp = environ_GetConfiguration(SETUP_LIBDIR); ! if (tmp == NULL) ! tmp = environ_AndrewDir(DEFAULT_LIBDIR); sprintf(pathName, "%s%s", tmp, OVERVIEWFILE); if (0 == SetupPanel(TRUE, pathName, self->overviewPanel, NULL)) { tmp = environ_GetConfiguration(SETUP_HELPDIR); --- 2015,2025 ---- ToggleProgramListSize(self, help_EXPAND); /* get overviews entries */ ! if((tmp = environ_GetConfiguration(SETUP_PANELSDIR)) == NULL) { ! tmp = environ_GetConfiguration(SETUP_LIBDIR); ! if (tmp == NULL) ! tmp = environ_AndrewDir(DEFAULT_LIBDIR); ! } sprintf(pathName, "%s%s", tmp, OVERVIEWFILE); if (0 == SetupPanel(TRUE, pathName, self->overviewPanel, NULL)) { tmp = environ_GetConfiguration(SETUP_HELPDIR); *************** *** 1989,1998 **** can't post menus */ free(self->info); self->info = NULL; ! if(panelList!=NULL){ ! free(panelList); ! panelList=NULL; ! } im_Destroy(view_GetIM((struct view *)self)); DEBUG(("info\n")); DEBUG(("OUT finalize\n")); --- 2085,2091 ---- can't post menus */ free(self->info); self->info = NULL; ! if(panelList) FreePanelListData(); im_Destroy(view_GetIM((struct view *)self)); DEBUG(("info\n")); DEBUG(("OUT finalize\n")); *************** *** 2232,2238 **** pager = DEFAULTPAGER; if (!helpdb_CheckIndex(NULL)) { ! fprintf(stderr, *err_index, pathName); return; } --- 2325,2331 ---- pager = DEFAULTPAGER; if (!helpdb_CheckIndex(NULL)) { ! fprintf(stderr, err_index, pathName); return; } *************** *** 2370,2372 **** --- 2463,2466 ---- } } } + *** atk/help/src/help.ch Wed Nov 22 12:14:31 1989 --- atk/help/src/help.ch.NEW Thu Jul 19 14:01:49 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/help/src/RCS/help.ch,v 2.18 89/05/02 13:36:47 mp1w Exp $ */ /* $ACIS$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/help/src/RCS/help.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/help/src/RCS/help.ch,v 2.18 89/05/02 13:36:47 mp1w Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/help.ch,v 2.18 89/05/02 13:36:47 mp1w Exp $ */ /* $ACIS$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/help.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/help.ch,v 2.18 89/05/02 13:36:47 mp1w Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ *** atk/help/src/helpa.c Wed Nov 22 12:14:34 1989 --- atk/help/src/helpa.c.NEW Thu Jul 19 14:01:51 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/help/src/RCS/helpa.c,v 2.28 89/10/17 15:58:01 ajp Exp $ */ /* $ACIS$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/help/src/RCS/helpa.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/help/src/RCS/helpa.c,v 2.28 89/10/17 15:58:01 ajp Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /*---------------------------------------------------------------------------*/ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/helpa.c,v 2.30 90/07/19 14:00:03 gk5g Exp $ */ /* $ACIS$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/helpa.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/helpa.c,v 2.30 90/07/19 14:00:03 gk5g Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /*---------------------------------------------------------------------------*/ *************** *** 32,39 **** --- 32,41 ---- #include + #define label gezornenplatz #include #include /* sys/types.h sys/time.h strings.h */ + #undef label #include #include *************** *** 135,147 **** { register int ns; struct sockaddr_in helpaddr; ! long addrlen = 0; char buf[MAXPATHLEN+1]; char errbuf[HNSIZE + 50]; long len; addrlen = sizeof(helpaddr); ! ns = accept(helpSocket, &helpaddr, &addrlen); if (ns >= 0) { while(1) { addrlen = read(ns, &len, sizeof(long)); --- 137,149 ---- { register int ns; struct sockaddr_in helpaddr; ! int addrlen; char buf[MAXPATHLEN+1]; char errbuf[HNSIZE + 50]; long len; addrlen = sizeof(helpaddr); ! ns = accept(helpSocket, (struct sockaddr *)&helpaddr, &addrlen); if (ns >= 0) { while(1) { addrlen = read(ns, &len, sizeof(long)); *************** *** 512,518 **** sprintf(tbuffer, error, WMDEFAULTFILE); help_HelpappGetHelpOn(WMDEFAULTFILE, help_NEW, help_HIST_NOADD, tbuffer); } - help_WantInputFocus(helpobj, helpobj); super_Run(self); DEBUG(("ha: OUT run\n")); --- 514,519 ---- *** atk/help/src/helpdb.c Fri Feb 2 12:25:03 1990 --- atk/help/src/helpdb.c.NEW Thu Jul 19 14:01:52 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/help/src/RCS/helpdb.c,v 1.11 90/01/26 13:04:09 susan Exp $ */ /* $ACIS$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/help/src/RCS/helpdb.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/help/src/RCS/helpdb.c,v 1.11 90/01/26 13:04:09 susan Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #ifdef CCH --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/helpdb.c,v 1.12 90/07/19 14:00:15 gk5g Exp $ */ /* $ACIS$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/helpdb.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/help/src/RCS/helpdb.c,v 1.12 90/07/19 14:00:15 gk5g Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #ifdef CCH *************** *** 124,132 **** waitCursor = cursor_Create(0); cursor_SetStandard(waitCursor, Cursor_Wait); ! tmp = environ_GetConfiguration(SETUP_HELPDIR); if (tmp == NULL) { ! tmp = environ_AndrewDir(DEFAULT_HELPDIR); } sprintf(pathName, "%s%s", tmp, ALIASFILE); helpdb_ReadAliasesFile(pathName); --- 124,132 ---- waitCursor = cursor_Create(0); cursor_SetStandard(waitCursor, Cursor_Wait); ! tmp = environ_GetConfiguration(SETUP_ALIASDIR); if (tmp == NULL) { ! tmp = environ_AndrewDir(DEFAULT_ALIASDIR); } sprintf(pathName, "%s%s", tmp, ALIASFILE); helpdb_ReadAliasesFile(pathName); *************** *** 266,271 **** --- 266,273 ---- { struct helpDir *thd; + for(thd = firstHelpDirs; thd; thd = thd->next) + if(!strcmp(dirName,thd->dirName)) return; thd = (struct helpDir *) malloc(sizeof(struct helpDir)); thd->next = firstHelpDirs; firstHelpDirs = thd; *************** *** 615,623 **** DIR *dd; struct direct *ent; ! helpDir = environ_GetConfiguration(SETUP_HELPDIR); if (helpDir == NULL) ! helpDir = environ_AndrewDir(DEFAULT_HELPDIR); sprintf(tname, "%s%s/Missing.%s", helpDir, missing_dir, aname); DEBUG(("db: missing name: %s\n",tname)); bname = rindex(tname,'/'); --- 617,625 ---- DIR *dd; struct direct *ent; ! helpDir = environ_GetConfiguration(SETUP_MISSINGDIR); if (helpDir == NULL) ! helpDir = environ_AndrewDir(DEFAULT_MISSINGDIR); sprintf(tname, "%s%s/Missing.%s", helpDir, missing_dir, aname); DEBUG(("db: missing name: %s\n",tname)); bname = rindex(tname,'/'); *************** *** 764,770 **** tmplist = (struct helpFile *)NULL; ts = index_GetAnySet(openIndex, baseName); - for(i=0;icount;i++) { code = index_GetData(openIndex, &ts->data[i], pathName, sizeof(pathName)); --- 766,771 ---- *************** *** 789,796 **** *ef = t; } /* now add the auxiliary help units */ ! for(thd = firstHelpDirs; thd; thd = thd->next) { char *tmp; char *subdir = MANSUBS; --- 790,798 ---- *ef = t; } + #if 0 /* now add the auxiliary help units */ ! for(thd = firstHelpDirs; thd; thd = thd->next) { char *tmp; char *subdir = MANSUBS; *************** *** 797,802 **** --- 799,805 ---- char dir[MAXPATHLEN]; tmp = rindex(thd->dirName, '/'); + DEBUG(("thd->dirName: %s\n", thd->dirName)); if (tmp) tmp = tmp+1; else *************** *** 813,818 **** --- 816,822 ---- } else tmplist = AddFilesFromDir(thd->dirName, aname, tmplist); } + #endif /* 0 */ #ifdef DEBUGGING DEBUG(("db: For topic %s:\n", aname)); *** atk/lset/cel.c Wed Nov 22 12:16:24 1989 --- atk/lset/cel.c.NEW Wed Jun 6 15:08:26 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/cel.c,v 2.12 89/08/05 15:26:53 tpn Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/cel.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/cel.c,v 2.12 89/08/05 15:26:53 tpn Exp $ "; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/cel.c,v 2.13 90/06/06 14:23:11 rr2b Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/cel.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/cel.c,v 2.13 90/06/06 14:23:11 rr2b Exp $ "; #endif /* lint */ #include *************** *** 19,27 **** --- 19,62 ---- #include #include #include + + + #include + #define VALUE 10 static long viewID = 0; + + void cel__ObservedChanged(self, changed, value) + struct cel *self; + struct observable *changed; + long value; + { + if(changed==(struct observable *)self->dataObject) { + cel_NotifyObservers(self,value); + } + } + + short cel__Get(self,property, type, rock) + struct cel *self; + struct atom *property; + struct atom **type; + long *rock; + { + short result=super_Get(self,property,type,rock); + if(self->dataObject && !result) + return dataobject_Get(self->dataObject, property, type, rock); + else return result; + } + + void cel__FinalizeObject(classID,self) + struct classheader *classID; + struct cel *self; + { + if(self->dataObject) dataobject_RemoveObserver(self->dataObject,self); + cel_NotifyObservers(self,observable_OBJECTDESTROYED); + } + static SetVisible(self) struct cel *self; { *************** *** 67,72 **** --- 102,110 ---- if ((newvr->viewatm = atom_Intern(viewType))!= NULL) { newvr->viewType = atom_Name(newvr->viewatm); newvr->dataObject = dataObject; + + dataobject_AddObserver(dataObject,newvr); + return newvr; } } *************** *** 128,133 **** --- 166,176 ---- /* Register the object with the dictionary */ dictionary_Insert(NULL,(char *)newobject->id,(char *) newobject); self->dataObject = newobject; + + + dataobject_AddObserver(newobject,self); + + cel_SetObjectName(self,class_GetTypeName(newobject)); if(self->usedefaultview) cel_SetViewName(self,NULL,TRUE); *************** *** 232,237 **** --- 275,284 ---- /* Register the object with the dictionary */ dictionary_Insert(NULL,(char *)newobject->id,(char *) newobject); self->dataObject = newobject; + + + dataobject_AddObserver(newobject,self); + } *************** *** 411,417 **** printf("<%s>\n",cbuf); printf("['%s' '%s' '%s' %ld]\n",self->dataType,self->viewType,self->refname,did); fflush(stdout); #endif /* DEBUG */ ! if(did) self->dataObject = (struct dataobject *)dictionary_LookUp(NULL,(char *) did); else if((self->linkname == NULL || *(self->linkname) == '\0') && self->dataType != NULL){ if(self->viewType == NULL || *(self->viewType) == '\0') self->usedefaultview = TRUE; --- 458,468 ---- printf("<%s>\n",cbuf); printf("['%s' '%s' '%s' %ld]\n",self->dataType,self->viewType,self->refname,did); fflush(stdout); #endif /* DEBUG */ ! ! if(did) { ! self->dataObject = (struct dataobject *) dictionary_LookUp(NULL,(char *) did); ! dataobject_AddObserver(self->dataObject,self); ! } else if((self->linkname == NULL || *(self->linkname) == '\0') && self->dataType != NULL){ if(self->viewType == NULL || *(self->viewType) == '\0') self->usedefaultview = TRUE; *** atk/lset/arbcon.c Wed Jan 17 16:37:56 1990 --- atk/lset/arbcon.c.NEW Wed Jun 13 16:59:50 1990 *************** *** 3,11 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/lset/RCS/arbcon.c,v 2.32 89/12/12 15:01:46 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/lset/RCS/arbcon.c,v $ */ /* user code ends here for HeaderInfo */ #include #include --- 3,11 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/arbcon.c,v 2.34 90/06/11 21:42:04 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/arbcon.c,v $ */ /* user code ends here for HeaderInfo */ #include #include *************** *** 40,46 **** #include #include #include ! char *malloc(); void ArbCopyCelCallBack(); void ArbCutCelCallBack(); static struct arbcon *Gself; --- 40,48 ---- #include #include #include ! #ifndef _IBMR2 ! extern char *malloc(); ! #endif /* _IBMR2 */ void ArbCopyCelCallBack(); void ArbCutCelCallBack(); static struct arbcon *Gself; *************** *** 1033,1039 **** #ifdef INFOFILE FILE *f,*fopen(); #endif /* INFOFILE */ ! char *p,*m,*malloc(); struct classinfo *viewtype = class_Load("view"); Gself = self; controlV_SetAutoInit(FALSE); --- 1035,1041 ---- #ifdef INFOFILE FILE *f,*fopen(); #endif /* INFOFILE */ ! char *p,*m; struct classinfo *viewtype = class_Load("view"); Gself = self; controlV_SetAutoInit(FALSE); *** atk/lset/arbiterv.c Wed Nov 22 12:16:18 1989 --- atk/lset/arbiterv.c.NEW Wed Jun 13 16:59:53 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/arbiterv.c,v 2.16 89/09/08 16:38:10 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/arbiterv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/arbiterv.c,v 2.16 89/09/08 16:38:10 ghoti Exp $ "; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/arbiterv.c,v 2.17 90/06/06 14:44:05 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/arbiterv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/arbiterv.c,v 2.17 90/06/06 14:44:05 gk5g Exp $ "; #endif /* lint */ #include *************** *** 314,320 **** struct classheader *classID; struct arbiterview *self; { ! char *malloc(); if(lastlink != NULL) lastlink->next = self; self->next = NULL; lastlink = self; --- 314,322 ---- struct classheader *classID; struct arbiterview *self; { ! #ifndef _IBMR2 ! extern char *malloc(); ! #endif /* _IBMR2 */ if(lastlink != NULL) lastlink->next = self; self->next = NULL; lastlink = self; *** atk/lset/cel.ch Wed Nov 22 12:16:20 1989 --- atk/lset/cel.ch.NEW Wed Jun 13 16:59:55 1990 *************** *** 2,15 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/cel.ch,v 2.9 89/05/05 12:51:29 tpn Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/cel.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_cel_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/lset/RCS/cel.ch,v 2.9 89/05/05 12:51:29 tpn Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #define cel_VERSION 1 #define cel_VISIBLE 0 #define cel_INVISIBLE 1 --- 2,18 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/cel.ch,v 2.10 90/06/06 14:24:08 rr2b Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/cel.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_cel_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/cel.ch,v 2.10 90/06/06 14:24:08 rr2b Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ + #include + #include + #define cel_VERSION 1 #define cel_VISIBLE 0 #define cel_INVISIBLE 1 *************** *** 19,27 **** --- 22,34 ---- #define cel_NOTSET -1 #define cel_VALUE 10 #define cel_NeedsRepost 4242 + #define cel_UNDEFINEDVALUE -47474747 class cel: dataobject[dataobj] { overrides: + ObservedChanged (struct observable *changed, long value); + Get( struct atom * property, struct atom ** type, long * rock ) + returns short; Read (FILE *file, long id) returns long; Write (FILE *file, long writeid, int level) returns long; GetModified() returns long; *************** *** 29,35 **** Create(char *viewtype, struct dataobject *dataobject) returns struct cel *; InitializeClass()returns boolean; InitializeObject() returns boolean; ! FinializeObject(); methods: SetChildObject(struct dataobject *newobject,char *viewName) returns boolean; SetObjectByName(char *dataname) returns boolean; --- 36,42 ---- Create(char *viewtype, struct dataobject *dataobject) returns struct cel *; InitializeClass()returns boolean; InitializeObject() returns boolean; ! FinalizeObject(struct cel *self); methods: SetChildObject(struct dataobject *newobject,char *viewName) returns boolean; SetObjectByName(char *dataname) returns boolean; *** atk/lset/celv.c Wed Apr 11 14:19:35 1990 --- atk/lset/celv.c.NEW Thu May 10 16:28:37 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/celv.c,v 2.23 90/04/03 11:20:36 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/celv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/celv.c,v 2.23 90/04/03 11:20:36 gk5g Exp $ "; #endif /* lint */ #define UNSET 0 --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/celv.c,v 2.24 90/05/08 15:59:14 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/celv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/celv.c,v 2.24 90/05/08 15:59:14 gk5g Exp $ "; #endif /* lint */ #define UNSET 0 *************** *** 1263,1268 **** --- 1263,1269 ---- view_RemoveObserver(child,self); view_Destroy(child); } + if(self->menus) menulist_Destroy(self->menus); } void celview__InitChildren(self) struct celview *self; *** atk/lset/lsetv.c Wed Apr 11 14:19:40 1990 --- atk/lset/lsetv.c.NEW Thu Jul 12 13:01:07 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/lsetv.c,v 2.8 90/03/23 17:16:21 tpn Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/lsetv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/lsetv.c,v 2.8 90/03/23 17:16:21 tpn Exp $ "; #endif /* lint */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/lsetv.c,v 2.10 90/06/29 09:59:38 rr2b Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/lsetv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/lset/RCS/lsetv.c,v 2.10 90/06/29 09:59:38 rr2b Exp $ "; #endif /* lint */ *************** *** 693,700 **** tempProc = proctable_DefineProc(cmdString = "lsetview-Insert-Object", lsetview_PlaceView,&lsetview_classinfo,NULL, "Set the object of a child view"); /* keymap_BindToKey(newKeymap,cmdString,NULL,"\033\t"); */ /* menulist_AddToML(newMenus,"lset,Set Object~31",tempProc,NULL,0); */ ! tempProc = proctable_DefineProc(cmdString = "lsetview-Destroy-Object", lsetview_DestroyView,&lsetview_classinfo,NULL, "Destroy the child view"); ! keymap_BindToKey(newKeymap,cmdString,tempProc,"\033d"); tempProc = proctable_DefineProc(cmdString = "lsetview-Insert-value", lsetview_PlaceValue,&lsetview_classinfo,NULL, "Set the value of a child view"); --- 693,700 ---- tempProc = proctable_DefineProc(cmdString = "lsetview-Insert-Object", lsetview_PlaceView,&lsetview_classinfo,NULL, "Set the object of a child view"); /* keymap_BindToKey(newKeymap,cmdString,NULL,"\033\t"); */ /* menulist_AddToML(newMenus,"lset,Set Object~31",tempProc,NULL,0); */ ! tempProc = proctable_DefineProc("lsetview-Destroy-Object", lsetview_DestroyView,&lsetview_classinfo,NULL, "Destroy the child view"); ! keymap_BindToKey(newKeymap,"\033d",tempProc,0); tempProc = proctable_DefineProc(cmdString = "lsetview-Insert-value", lsetview_PlaceValue,&lsetview_classinfo,NULL, "Set the value of a child view"); *************** *** 762,767 **** --- 762,768 ---- struct classheader *classID; struct lsetview *self; { + if(self->menulist) menulist_Destroy(self->menulist); if(self->app){ struct view *child = self->child; view_UnlinkTree(child); *** atk/ness/type/type.c Wed Nov 22 12:20:10 1989 --- atk/ness/type/type.c.NEW Thu Jul 12 13:01:25 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/type/RCS/type.c,v 1.5 89/09/27 15:41:30 wjh Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/type/RCS/type.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! char *type_rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/type/RCS/type.c,v 1.5 89/09/27 15:41:30 wjh Exp $"; #endif /* type.c --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/ness/type/RCS/type.c,v 1.7 90/07/11 15:40:54 rr2b Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/ness/type/RCS/type.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! char *type_rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/ness/type/RCS/type.c,v 1.7 90/07/11 15:40:54 rr2b Exp $"; #endif /* type.c *************** *** 16,21 **** --- 16,27 ---- */ /* * $Log: type.c,v $ + * Revision 1.7 90/07/11 15:40:54 rr2b + * fixed more null dereferences + * + * Revision 1.6 90/04/11 15:00:14 gk5g + * Apply fix submitted wrt bugID 1214. + * * Revision 1.5 89/09/27 15:41:30 wjh * utilize variable 'touch' to avoid compiler warning * *************** *** 565,571 **** { char *classpath = environ_Get("CLASSPATH"); ! if (*classpath == '\0') classpath = environ_AndrewDir("/dlib/atk"); return classpath; --- 571,577 ---- { char *classpath = environ_Get("CLASSPATH"); ! if (classpath==NULL) classpath = environ_AndrewDir("/dlib/atk"); return classpath; *************** *** 756,765 **** struct text *text_cpp = text_New(); char nameBuf[40], filenameBuf[40], *err; ! strcpy(pathBuf, environ_GetProfile("includepath")); path = pathBuf; - if (*path == '\0') - sprintf(pathBuf, ".:/usr/include:%s:%s/atk", environ_AndrewDir("/include"), environ_AndrewDir("/include")); /* create /tmp/type.class */ file = fopen("/tmp/type.class", "w"); --- 762,772 ---- struct text *text_cpp = text_New(); char nameBuf[40], filenameBuf[40], *err; ! if ((path = environ_GetProfile("includepath")) == NULL) ! sprintf(pathBuf, ".:/usr/include:%s:%s/atk", environ_AndrewDir("/include"), environ_AndrewDir("/include")); ! else ! strcpy(pathBuf, path); path = pathBuf; /* create /tmp/type.class */ file = fopen("/tmp/type.class", "w"); *************** *** 914,924 **** return buf; } ! strcpy(pathBuf, environ_GetProfile("includepath")); ! path = pathBuf; ! if (*path == '\0') ! sprintf(pathBuf, ".:/usr/include:%s:%s/atk", environ_AndrewDir("/include"), environ_AndrewDir("/include")); pos = buf; *pos = '\0'; while (TRUE) --- 921,932 ---- return buf; } ! path=environ_GetProfile("includepath"); ! if(path!=NULL) strcpy(pathBuf, path); ! else sprintf(pathBuf, ".:/usr/include:%s:%s/atk", environ_AndrewDir("/include"), environ_AndrewDir("/include")); + path = pathBuf; + pos = buf; *pos = '\0'; while (TRUE) *** atk/ness/objects/Imakefile Wed Nov 22 12:21:09 1989 --- atk/ness/objects/Imakefile.NEW Fri Jul 20 11:26:42 1990 *************** *** 10,19 **** INTERPOBJS = interp.o gen.o dump.o search.o error.o nevent.o call.o real.o NESSOBJS = ness.o nesscomp.o ${INTERPOBJS} ! DOBJS = ness.do nessv.do nessmark.do nesssym.do IHFILES = ness.ih nessv.ih nessmark.ih nesssym.ih OBJS = ${NESSOBJS} nessv.o nessmark.o ATKLIBS= ${BASEDIR}/lib/atk/libframe.a \ ${BASEDIR}/lib/atk/libtext.a \ ${BASEDIR}/lib/atk/libsupport.a \ --- 10,25 ---- INTERPOBJS = interp.o gen.o dump.o search.o error.o nevent.o call.o real.o NESSOBJS = ness.o nesscomp.o ${INTERPOBJS} ! DOBJS = ness.do nessv.do nessmark.do nesssym.do nessruna.do IHFILES = ness.ih nessv.ih nessmark.ih nesssym.ih OBJS = ${NESSOBJS} nessv.o nessmark.o + + #ifdef WM_ENV + WMLIB = ${BASEDIR}/lib/libwm.a + #endif /* WM_ENV */ + + ATKLIBS= ${BASEDIR}/lib/atk/libframe.a \ ${BASEDIR}/lib/atk/libtext.a \ ${BASEDIR}/lib/atk/libsupport.a \ *************** *** 23,29 **** ${BASEDIR}/lib/libclass.a \ ${MALLOCLIB} \ ${BASEDIR}/lib/liberrors.a \ ! ${UTILLIB} all:: init --- 29,36 ---- ${BASEDIR}/lib/libclass.a \ ${MALLOCLIB} \ ${BASEDIR}/lib/liberrors.a \ ! ${UTILLIB} \ ! ${WMLIB} all:: init *************** *** 66,85 **** TestProgramTarget(nesst, nesst.o, ${LIBS} /usr/lib/libm.a,) TestProgramTarget(goodness, goodness.o ${NESSOBJS} nessmark.o nesssym.o , ../tokens/libtokens.a ${LIBS}, -lm) ! ProgramTarget(nessrun, nessrun.o ${NESSOBJS} nessmark.o nesssym.o , ../tokens/libtokens.a ${LIBS}, -lm) ! InstallProgram(nessrun, ${DESTDIR}/bin) InstallLink(runapp, ${DESTDIR}/bin/ness) InstallFile(nesswarn.d, ${INSTMANFLAGS}, ${DESTDIR}/lib/ness) DependTarget(init) ! checkin: Imakefile nesscomp.gra nodeclss.n *.ch *.hn \ ! call.c dump.c error.c gen.c goodness.c interp.c interpt.c \ ! ness.c nessmark.c nessrun.c nesssym.c nessv.c nevent.c \ ! real.c search.c yypshpop.c \ ! call.h compdefs.h envt.h error.h gen.h interp.h nesscomp.h \ ! nessrun.ci nevent.h nodeclss.h nessmrkt.c nesswarn.d nesst.c notes.d ci -l $? touch checkin --- 73,93 ---- TestProgramTarget(nesst, nesst.o, ${LIBS} /usr/lib/libm.a,) TestProgramTarget(goodness, goodness.o ${NESSOBJS} nessmark.o nesssym.o , ../tokens/libtokens.a ${LIBS}, -lm) ! TestProgramTarget(nessrun, nessrun.o ${NESSOBJS} nessmark.o nesssym.o , ../tokens/libtokens.a ${LIBS}, -lm) ! /* InstallProgram(nessrun, ${DESTDIR}/bin) */ InstallLink(runapp, ${DESTDIR}/bin/ness) + InstallLink(runapp, ${DESTDIR}/bin/nessrun) InstallFile(nesswarn.d, ${INSTMANFLAGS}, ${DESTDIR}/lib/ness) DependTarget(init) ! checkin: Imakefile nesscomp.gra nodeclss.n *.ch *.hn \ ! call.c dump.c error.c gen.c goodness.c interp.c interpt.c \ ! ness.c nessmark.c nessrun.c nessruna.c nesssym.c nessv.c ! nevent.c real.c search.c yypshpop.c \ ! envt.h error.h interp.h nesscomp.h \ ! nessrun.ci nodeclss.h nessmrkt.c nesswarn.d nesst.c notes.d ci -l $? touch checkin *** atk/ness/objects/call.c Wed Jan 17 16:38:05 1990 --- atk/ness/objects/call.c.NEW Fri Jul 27 12:51:22 1990 *************** *** 1,12 **** /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/ness/objects/RCS/call.c,v 1.34 89/12/12 15:04:47 ghoti Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/ness/objects/RCS/call.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/ness/objects/RCS/call.c,v 1.34 89/12/12 15:04:47 ghoti Exp $"; #endif /* --- 1,12 ---- /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/call.c,v 1.35 90/07/15 15:23:37 wjh Exp Locker: wjh $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/call.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/call.c,v 1.35 90/07/15 15:23:37 wjh Exp Locker: wjh $"; #endif /* *************** *** 108,113 **** --- 108,114 ---- {"toend", "mpx", {Tstr, Tstr, Tend}, ness_codeOrange}, {"copy", "qzr", {Tstr, Tstr, Tend}, ness_codeOrange}, + /* F* search.c */ /* SearchOp's with two marker args */ {"search", "Fa", {Tstr, Tstr, Tstr, Tend}, ness_codeOrange}, {"match", "Fb", {Tstr, Tstr, Tstr, Tend}, ness_codeOrange}, *************** *** 123,128 **** --- 124,130 ---- {"nextstylegroup", "Fs", {Tstr, Tstr, Tend}, ness_codeOrange}, {"enclosingstylegroup", "Ft", {Tstr, Tstr, Tend}, ness_codeOrange}, {"clearstyles", "Fu", {Tstr, Tstr, Tend}, ness_codeOrange}, + {"nextstylesegment", "Fv", {Tstr, Tstr, Tend}, ness_codeOrange}, /* SearchOp with no arg */ {"whereitwas", "Fw", {Tstr, Tend}, ness_codeOrange}, /* SearchOp with three args */ *************** *** 129,134 **** --- 131,137 ---- {"replacewithobject", "Fx", {Tstr, Tstr, Tptr, Tstr, Tend}, ness_codeYellow}, + /* interp.c */ {"textimage", "L", {Tstr, Tunk, Tend}, ness_codeOrange}, {"readfile", "i", {Tstr, Tstr, Tend}, ness_codeOrange}, {"writefile", "zW", {Tstr, Tstr, Tstr, Tend}, ness_codeGreen}, *************** *** 147,152 **** --- 150,156 ---- {"dokeys", "Kk", {Tvoid, Tstr, Tptr, Tend}, ness_codeGreen}, {"domenu", "Km", {Tvoid, Tstr, Tptr, Tend}, ness_codeGreen}, + /* U* nevent.c */ {"value_getvalue", "Un", {Tlong, Tptr, Tend}, ness_codeOrange}, {"value_getarraysize", "Uo", {Tlong, Tptr, Tend}, ness_codeOrange}, {"value_getstring", "Up", {Tstr, Tptr, Tend}, ness_codeOrange}, *************** *** 157,167 **** --- 161,173 ---- {"value_setarrayelt", "Uu", {Tvoid, Tstr, Tlong, Tptr, Tend}, ness_codeYellow}, {"value_setnotify", "Uv", {Tvoid, Tbool, Tptr, Tend}, ness_codeYellow}, + /* J* call.c */ {"im_forceupdate", "Jq", {Tvoid, Tend}, ness_codeOrange}, {"inset", "Jr", {Tptr, Tstr, Tend}, ness_codeOrange}, {"new", "Js", {Tptr, Tptr, Tend}, ness_codeOrange}, {"class", "Jt", {Tptr, Tunk, Tend}, ness_codeOrange}, + /* H* real.c */ /* unary real operators */ {"acos", "Ha", {Tdbl, Tdbl, Tend}, ness_codeOrange}, {"asin", "Hc", {Tdbl, Tdbl, Tend}, ness_codeOrange}, *************** *** 198,203 **** --- 204,210 ---- {"log1p", "Hw", {Tdbl, Tdbl, Tend}, ness_codeOrange}, #endif /* (!SYSV && !AIX) */ + /* M* real.c */ /* binary and other real operators */ {"atan2", "Ma", {Tdbl, Tdbl, Tdbl, Tend}, ness_codeOrange}, {"hypot", "Mb", {Tdbl, Tdbl, Tdbl, Tend}, ness_codeOrange}, *************** *** 1403,1408 **** --- 1410,1416 ---- sprintf(msg, "*could not find class \"%s\"", s); RunError(freeze(msg), iar); } + free(s); } else if (NSP->p.hdr == ptrHdr && NSP->p.v != NULL) cip = class_GetType(NSP->p.v); *************** *** 1414,1419 **** --- 1422,1428 ---- NSP->p.hdr = ptrHdr; NSP->p.v = (struct basicobject *)cip; } break; + } /* end switch(op) */ return NSP; } *** atk/ness/objects/gen.c Wed Nov 22 12:21:12 1989 --- atk/ness/objects/gen.c.NEW Fri Jul 20 11:26:49 1990 *************** *** 1,12 **** /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/gen.c,v 1.18 89/11/06 15:01:40 cfe Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/gen.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/gen.c,v 1.18 89/11/06 15:01:40 cfe Exp $"; #endif /* --- 1,12 ---- /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/gen.c,v 1.19 90/07/15 15:23:55 wjh Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/gen.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/gen.c,v 1.19 90/07/15 15:23:55 wjh Exp $"; #endif /* *************** *** 15,20 **** --- 15,42 ---- */ /* * $Log: gen.c,v $ + * Revision 1.19 90/07/15 15:23:55 wjh + * call.c: fix a coreleak in class() + * ness.ch: defined CURRENTMODIFICATIONLEVEL + * nessruna.c: set version number as + * CURRENTSYNTAXLEVEL.CURRENTMODIFICATIONLEVEL + * nessruna.c: add -f switch to cause a fork after compile and before exec + * Imakefile: switch to using nessrunapp instead of nessrun.ci + * nessfunc.d: document the new proctable entries in framecmd.c + * nessauth.d: describe usage of the framecmd stuff. + * nesssauth.d: describe --$syntaxlevel + * nessauth.d: give example of a long string + * + * search.c: redo nextstylegroup + * search.c: addstyles will now complain if the argument is a constant + * gen.c: fix so it will not crash after allocating all the initial sysmarks + * that is: it won't crash after a few compiles + * search.c: revise HasStyles to check for name equality as well as style location equality + * search.c: add nextstylesegment() which gives the segment from end of subject to next style change + * search.c: fix enclosingstyle, nextstylegroup, and nextstylesegment to know about + * the bogus length values used in the outermost environment + * + * * Revision 1.18 89/11/06 15:01:40 cfe * typo: disasterous is a misspelling. * *************** *** 437,444 **** SysMarkSize += 1000; if (SysMarkSize > 65535) SysMarkSize = 65535; SysMarkLowEnd = (struct nessmark *) ! realloc(SysMarkSize * sizeof(struct nessmark)); ! bzero(SysMarkLowEnd+oldsize, (SysMarkSize - oldsize) * sizeof(struct nessmark)); SysMarkHiEnd = SysMarkLowEnd + SysMarkSize; for (i = oldsize; i < SysMarkSize; i++) --- 459,466 ---- SysMarkSize += 1000; if (SysMarkSize > 65535) SysMarkSize = 65535; SysMarkLowEnd = (struct nessmark *) ! realloc(SysMarkLowEnd, SysMarkSize * sizeof(struct nessmark)); ! bzero(SysMarkLowEnd+oldsize * sizeof(struct nessmark), (SysMarkSize - oldsize) * sizeof(struct nessmark)); SysMarkHiEnd = SysMarkLowEnd + SysMarkSize; for (i = oldsize; i < SysMarkSize; i++) *** atk/ness/objects/interp.c Wed Apr 11 14:19:45 1990 --- atk/ness/objects/interp.c.NEW Fri Jul 20 11:26:53 1990 *************** *** 1,12 **** /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/interp.c,v 1.29 90/03/22 11:08:27 wjh Exp $ */ /* $ACIS:$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/interp.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/interp.c,v 1.29 90/03/22 11:08:27 wjh Exp $"; #endif /* interp.c --- 1,12 ---- /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/interp.c,v 1.30 90/07/16 15:41:54 gk5g Exp $ */ /* $ACIS:$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/interp.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/interp.c,v 1.30 90/07/16 15:41:54 gk5g Exp $"; #endif /* interp.c *************** *** 21,26 **** --- 21,29 ---- /* * $Log: interp.c,v $ + * Revision 1.30 90/07/16 15:41:54 gk5g + * The second argument to longjmp was being casted to (char*) when it should have been casted to (int). + * * Revision 1.29 90/03/22 11:08:27 wjh * Fix "Disasterous Ness error" introduced by earlier fix of core leak. (nessmarks were being deleted as part of returning a nessmark value if another marker to the same text was in the variables of the function returning the value.) * *************** *** 278,284 **** unsigned char *iar; { errIAR = iar; ! longjmp (ExecutionExit, msg); return TRUE; /* more stuff to fool compiler */ } --- 281,287 ---- unsigned char *iar; { errIAR = iar; ! longjmp (ExecutionExit, (int)msg); return TRUE; /* more stuff to fool compiler */ } *************** *** 1342,1348 **** } if (iar == 0) { NSPstore = NSP; ! longjmp(ExecutionExit, (char *)-1); } } break; case 'R': { /* operations on real numbers */ --- 1345,1351 ---- } if (iar == 0) { NSPstore = NSP; ! longjmp(ExecutionExit, (int)-1); } } break; case 'R': { /* operations on real numbers */ *** atk/ness/objects/ness.ch Wed Nov 22 12:22:22 1989 --- atk/ness/objects/ness.ch.NEW Fri Jul 20 11:26:55 1990 *************** *** 1,12 **** /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/ness.ch,v 1.12 89/11/04 17:26:06 wjh Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/ness.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/ness.ch,v 1.12 89/11/04 17:26:06 wjh Exp $"; #endif /* --- 1,12 ---- /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/ness.ch,v 1.13 90/07/15 15:24:09 wjh Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/ness.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/ness.ch,v 1.13 90/07/15 15:24:09 wjh Exp $"; #endif /* *************** *** 20,25 **** --- 20,47 ---- */ /* * $Log: ness.ch,v $ + Revision 1.13 90/07/15 15:24:09 wjh + call.c: fix a coreleak in class() + ness.ch: defined CURRENTMODIFICATIONLEVEL + nessruna.c: set version number as + CURRENTSYNTAXLEVEL.CURRENTMODIFICATIONLEVEL + nessruna.c: add -f switch to cause a fork after compile and before exec + Imakefile: switch to using nessrunapp instead of nessrun.ci + nessfunc.d: document the new proctable entries in framecmd.c + nessauth.d: describe usage of the framecmd stuff. + nesssauth.d: describe --$syntaxlevel + nessauth.d: give example of a long string + + search.c: redo nextstylegroup + search.c: addstyles will now complain if the argument is a constant + gen.c: fix so it will not crash after allocating all the initial sysmarks + that is: it won't crash after a few compiles + search.c: revise HasStyles to check for name equality as well as style location equality + search.c: add nextstylesegment() which gives the segment from end of subject to next style change + search.c: fix enclosingstyle, nextstylegroup, and nextstylesegment to know about + the bogus length values used in the outermost environment + + Revision 1.12 89/11/04 17:26:06 wjh patch from Guy Harris to ness.c: Do initializeEnvt() in ness_EstablishViews() to be sure the pointers are initialized. This avoids "!!! Disasterous error..." *************** *** 89,101 **** #include "error.h" #include "nesssym.ih" ! #define CURRENTSYNTAXLEVEL 1 ! #define UNSPECIFIEDSYNTAXLEVEL -1 /* Will get compile error if syntax level of program exceeds CURRENTSYNTAXLEVEL because that means we have a new program and an old compiler. */ #define ness_NEWERROR 2 /* to notify the nessview */ #define ness_WARNINGTEXTCHANGED 3 /* to notify the nessview */ --- 111,133 ---- #include "error.h" #include "nesssym.ih" ! #define CURRENTSYNTAXLEVEL 1 /* Will get compile error if syntax level of program exceeds CURRENTSYNTAXLEVEL because that means we have a new program and an old compiler. */ + #define CURRENTMODIFICATIONLEVEL 3 + /* nessrun generates the VERSION NUMBER as + * + * . + * + */ + + #define UNSPECIFIEDSYNTAXLEVEL -1 + /* this value is assumed if the syntax level is otherwise unspecified */ + + /* values for NotifyObservers */ #define ness_NEWERROR 2 /* to notify the nessview */ #define ness_WARNINGTEXTCHANGED 3 /* to notify the nessview */ *** atk/ness/objects/nessrun.ci Wed Nov 22 12:21:16 1989 --- atk/ness/objects/nessrun.ci.NEW Fri Jul 20 11:26:57 1990 *************** *** 1,12 **** /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/nessrun.ci,v 1.12 89/10/08 08:38:22 wjh Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/nessrun.ci,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/nessrun.ci,v 1.12 89/10/08 08:38:22 wjh Exp $"; #endif /* nessrun.c --- 1,12 ---- /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/nessrun.ci,v 1.13 90/07/15 15:24:16 wjh Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/nessrun.ci,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/nessrun.ci,v 1.13 90/07/15 15:24:16 wjh Exp $"; #endif /* nessrun.c *************** *** 21,26 **** --- 21,48 ---- /* * $Log: nessrun.ci,v $ + * Revision 1.13 90/07/15 15:24:16 wjh + * call.c: fix a coreleak in class() + * ness.ch: defined CURRENTMODIFICATIONLEVEL + * nessruna.c: set version number as + * CURRENTSYNTAXLEVEL.CURRENTMODIFICATIONLEVEL + * nessruna.c: add -f switch to cause a fork after compile and before exec + * Imakefile: switch to using nessrunapp instead of nessrun.ci + * nessfunc.d: document the new proctable entries in framecmd.c + * nessauth.d: describe usage of the framecmd stuff. + * nesssauth.d: describe --$syntaxlevel + * nessauth.d: give example of a long string + * + * search.c: redo nextstylegroup + * search.c: addstyles will now complain if the argument is a constant + * gen.c: fix so it will not crash after allocating all the initial sysmarks + * that is: it won't crash after a few compiles + * search.c: revise HasStyles to check for name equality as well as style location equality + * search.c: add nextstylesegment() which gives the segment from end of subject to next style change + * search.c: fix enclosingstyle, nextstylegroup, and nextstylesegment to know about + * the bogus length values used in the outermost environment + * + * * Revision 1.12 89/10/08 08:38:22 wjh * fixed to return an exit value: zero for success * *************** *** 130,135 **** --- 152,158 ---- #include + #include #include #include #include *************** *** 171,177 **** # include # include # include ! #ifdef WM # include # include # include --- 194,218 ---- # include # include # include ! ! # include ! # include ! # include ! # include ! # include ! # include ! # include ! # include ! ! /* there is no library for the following */ ! /* ! # include ! # include ! # include ! # include ! */ ! ! #ifdef WM_ENV # include # include # include *************** *** 178,200 **** # include # include # include ! #endif WM /* if one were really trying to get arbiterview, too, one would need also all of the following * at present, goodnessrun gets a non-fatal error when it calls * arbiterview_GetNamedView() * if the version is out-of-date - * #include * #include - * #include - * #include - * #include - * #include * #include * #include * #include * #include - * #include * #include * #include * #include --- 219,235 ---- # include # include # include ! #endif WM_ENV /* if one were really trying to get arbiterview, too, one would need also all of the following * at present, goodnessrun gets a non-fatal error when it calls * arbiterview_GetNamedView() * if the version is out-of-date * #include * #include * #include * #include * #include * #include * #include * #include *************** *** 272,278 **** namespace_StaticEntry; mark_StaticEntry; view_StaticEntry; ! #ifdef WM wmws_StaticEntry; mrl_StaticEntry; wmcursor_StaticEntry; --- 307,330 ---- namespace_StaticEntry; mark_StaticEntry; view_StaticEntry; ! ! graphic_StaticEntry; ! fontdesc_StaticEntry; ! keystate_StaticEntry; ! style_StaticEntry; ! lpair_StaticEntry; ! scroll_StaticEntry; ! matte_StaticEntry; ! atomlist_StaticEntry; ! /* ! cel_StaticEntry; ! arbiterview_StaticEntry; ! celview_StaticEntry; ! valueview_StaticEntry; ! */ ! ! ! #ifdef WM_ENV wmws_StaticEntry; mrl_StaticEntry; wmcursor_StaticEntry; *************** *** 279,285 **** wmgraphic_StaticEntry; wmfontdesc_StaticEntry; wmim_StaticEntry; ! #endif WM #endif GOODNESSRUN fnm = NULL; --- 331,337 ---- wmgraphic_StaticEntry; wmfontdesc_StaticEntry; wmim_StaticEntry; ! #endif WM_ENV #endif GOODNESSRUN fnm = NULL; *** atk/ness/objects/search.c Wed Nov 22 12:22:05 1989 --- atk/ness/objects/search.c.NEW Tue Jul 24 16:47:01 1990 *************** *** 1,12 **** /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/search.c,v 1.16 89/09/20 23:50:43 wjh Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/search.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/ness/objects/RCS/search.c,v 1.16 89/09/20 23:50:43 wjh Exp $"; #endif /* --- 1,12 ---- /* ********************************************************************** *\ * Copyright IBM Corporation 1988,1989 - All Rights Reserved * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/search.c,v 1.17 90/07/15 15:24:24 wjh Exp Locker: wjh $ */ /* $ACIS:$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/search.c,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/search.c,v 1.17 90/07/15 15:24:24 wjh Exp Locker: wjh $"; #endif /* *************** *** 18,23 **** --- 18,45 ---- */ /* * $Log: search.c,v $ + * Revision 1.17 90/07/15 15:24:24 wjh + * call.c: fix a coreleak in class() + * ness.ch: defined CURRENTMODIFICATIONLEVEL + * nessruna.c: set version number as + * CURRENTSYNTAXLEVEL.CURRENTMODIFICATIONLEVEL + * nessruna.c: add -f switch to cause a fork after compile and before exec + * Imakefile: switch to using nessrunapp instead of nessrun.ci + * nessfunc.d: document the new proctable entries in framecmd.c + * nessauth.d: describe usage of the framecmd stuff. + * nesssauth.d: describe --$syntaxlevel + * nessauth.d: give example of a long string + * + * search.c: redo nextstylegroup + * search.c: addstyles will now complain if the argument is a constant + * gen.c: fix so it will not crash after allocating all the initial sysmarks + * that is: it won't crash after a few compiles + * search.c: revise HasStyles to check for name equality as well as style location equality + * search.c: add nextstylesegment() which gives the segment from end of subject to next style change + * search.c: fix enclosingstyle, nextstylegroup, and nextstylesegment to know about + * the bogus length values used in the outermost environment + * + * * Revision 1.16 89/09/20 23:50:43 wjh * fix firstobject for happybday.d * *************** *** 387,393 **** --- 409,449 ---- } + /* HasStyle(env, penv) + checks to see if env or any of its parents has the style penv + Returns TRUE if so and FALSE if not + */ + static boolean + HasStyle(env, penv) + struct environment *env, *penv; + { + char *pname, *name; + enum nametype {None, Name, Menu} nt = None; + pname = style_GetName(penv->data.style); + if (pname != NULL) nt = Name; + else { + pname = style_GetMenuName(penv->data.style); + if (pname != NULL) nt = Menu; + } + for ( ; env != NULL; env = environment_GetParent(env)) { + if (env->type != environment_Style || env->data.style == NULL) + continue; + if (env->data.style == penv->data.style) + return TRUE; + switch (nt) { + case None: name = NULL; break; + case Name: name = style_GetName(env->data.style); break; + case Menu: name = style_GetMenuName(env->data.style); break; + } + if (name != NULL && strcmp(name, pname) == 0) + return TRUE; + /* XXX could go on to test style attributes YUCHH */ + } + return FALSE; /* not found */ + } + + #define PTSTOMARK(arg,iar) ((TType)((struct nessmark *)arg)->header.nessmark_methods \ == nessmarkHdr) ? TRUE : \ RunError(":not a pointer to a mark (uninitialized variable?)", iar); *************** *** 419,426 **** struct viewref *vr; static boolean Inited = FALSE; long success; ! long envpos; ! struct environment *env, *patenv, *tenv; if (! Inited) { Inited = TRUE; --- 475,482 ---- struct viewref *vr; static boolean Inited = FALSE; long success; ! long envpos, envlen; ! struct environment *env, *penv, *tenv; if (! Inited) { Inited = TRUE; *************** *** 446,460 **** switch (op) { case 'a': search(subject, pat); NSP = popValue(NSP); break; case 'c': anyof(subject, pat); NSP = popValue(NSP); break; - case 'e': token(subject, pat); NSP = popValue(NSP); break; case 'd': span(subject, pat); NSP = popValue(NSP); break; ! case 'b': match(subject, pat); NSP = popValue(NSP); break; /* {"addstyles", "Fj", {Tstr, Tstr, Tstr, Tvoid}, ness_codeYellow} */ case 'j': /* revise subject to have style of pat */ text = (struct text *)nessmark_GetText(subject); pattext = (struct text *)nessmark_GetText(pat); if (class_IsType(text, textClass) && class_IsType(pattext, textClass)) --- 502,518 ---- switch (op) { case 'a': search(subject, pat); NSP = popValue(NSP); break; + case 'b': match(subject, pat); NSP = popValue(NSP); break; case 'c': anyof(subject, pat); NSP = popValue(NSP); break; case 'd': span(subject, pat); NSP = popValue(NSP); break; ! case 'e': token(subject, pat); NSP = popValue(NSP); break; /* {"addstyles", "Fj", {Tstr, Tstr, Tstr, Tvoid}, ness_codeYellow} */ case 'j': /* revise subject to have style of pat */ text = (struct text *)nessmark_GetText(subject); + if (text_GetReadOnly(text)) + RunError(":Tried to change styles on a constant", opiar); pattext = (struct text *)nessmark_GetText(pat); if (class_IsType(text, textClass) && class_IsType(pattext, textClass)) *************** *** 474,483 **** if ( ! class_IsType(pattext, textClass)) goto gotval; /* no styles: trivially TRUE */ pos = nessmark_GetPos(pat); ! patenv = environment_GetInnerMost(pattext->rootEnvironment, pos); ! while (patenv != NULL && patenv->type != environment_Style) ! patenv = environment_GetParent(patenv); ! if (patenv == NULL) goto gotval; /* pat has no styles: trivially TRUE */ /* now we know pat has at least one style */ --- 532,541 ---- if ( ! class_IsType(pattext, textClass)) goto gotval; /* no styles: trivially TRUE */ pos = nessmark_GetPos(pat); ! penv = environment_GetInnerMost(pattext->rootEnvironment, pos); ! while (penv != NULL && penv->type != environment_Style) ! penv = environment_GetParent(penv); ! if (penv == NULL) goto gotval; /* pat has no styles: trivially TRUE */ /* now we know pat has at least one style */ *************** *** 498,516 **** /* now we know text and pattext both have at least one style return TRUE unless we find a style on pat that is not on text */ ! for ( ; patenv != NULL; patenv = environment_GetParent(patenv)) { ! if (patenv->type == environment_Style) { ! for (tenv = env; tenv != NULL; ! tenv = environment_GetParent(tenv)) ! if (tenv->type == environment_Style ! && tenv->data.style == patenv->data.style) ! break; /* tenv != NULL */ ! if (tenv == NULL) { boolval = FALSE; ! goto gotval; /* could not find a pat style: FALSE */ ! } } ! } /* found all styles of pat, return the TRUE set far above */ gotval: --- 556,569 ---- /* now we know text and pattext both have at least one style return TRUE unless we find a style on pat that is not on text */ ! for ( ; penv != NULL; penv = environment_GetParent(penv)) ! if (penv->type == environment_Style ! && ! HasStyle(env, penv)) { ! /* could not find a pat style: FALSE */ boolval = FALSE; ! break; } ! /* found all styles of pat, return the TRUE set far above */ gotval: *************** *** 605,612 **** or return start of arg if subject is at start of style and a larger group starts at same place return the smallest enclosing style; ! otherwise return the next succeeding style group ! A program can find all styles by successive application of NextStyleGroup(). */ text = (struct text *)nessmark_GetText(subject); if ( ! class_IsType(text, textClass)) { --- 658,666 ---- or return start of arg if subject is at start of style and a larger group starts at same place return the smallest enclosing style; ! otherwise find the next place after start of subject where a style starts ! and return the smallest style group starting there ! A Ness program can find all styles by successive application of NextStyleGroup(). */ text = (struct text *)nessmark_GetText(subject); if ( ! class_IsType(text, textClass)) { *************** *** 615,678 **** } pos = nessmark_GetPos(subject); len = nessmark_GetLength(subject); - env = environment_GetInnerMost(text->rootEnvironment, pos); - while (env != NULL && env->type != environment_Style) - env = environment_GetParent(env); ! /* env is the current style environment. look first for a superior at pos */ tenv = env; ! while (tenv != NULL ! && pos == (envpos=environment_Eval(tenv)) ! && (tenv->type != environment_Style ! || len >= tenv->header.nestedmark.length)) { tenv = environment_GetParent(tenv); } - while (tenv != NULL && tenv->type != environment_Style) { - tenv = environment_GetParent(tenv); - if (tenv != NULL) - envpos = environment_Eval(tenv); - } - /* see if there is a larger group at current position */ - if (tenv != NULL && pos == envpos - && len < tenv->header.nestedmark.length) { - /* this is it ! */ - nessmark_SetLength(subject, - tenv->header.nestedmark.length); - break; - } ! /* at this point there is no superior style at pos ! we must advance to the next style start ! Loop till we have a next environment or NULL */ envpos = pos; do { envpos += environment_GetNextChange(text->rootEnvironment, envpos); ! if (envpos < text_GetLength(text)) ! tenv = environment_GetInnerMost(text->rootEnvironment, ! envpos); ! else tenv = NULL; while (tenv != NULL && tenv->type != environment_Style) tenv = environment_GetParent(tenv); ! /* The "next change" may be an end or start of an environment ! It is an end if tenv is a parent of old env */ ! while (env != NULL && env != tenv) ! env = environment_GetParent(env); ! } while (env != NULL && tenv != NULL) ; ! /* if env == NULL and tenv does not, we have gone up tree from env ! and not found tenv. Therefore, tenv is the next style group */ - /* at this point, tenv is NULL - or points to the environment for the next group, - which starts at envpos */ - if (tenv != NULL) { - /* got it! */ - nessmark_SetPos(subject, envpos); - nessmark_SetLength(subject, - tenv->header.nestedmark.length); - } - else - nessmark_Start(subject); break; /* {"enclosingstylegroup","Ft", {Tstr, Tstr, Tvoid}, ness_codeOrange} */ --- 669,745 ---- } pos = nessmark_GetPos(subject); len = nessmark_GetLength(subject); ! /* Part I. If one or more style groups start where subject does, ! find the smallest that is longer than subject. */ ! ! env = environment_GetInnerMost(text->rootEnvironment, pos); tenv = env; ! while (tenv != NULL && ! (tenv->type != environment_Style ! || tenv->header.nestedmark.length <= len)) tenv = environment_GetParent(tenv); + if (tenv != NULL && environment_Eval(tenv) == pos) { + /* tenv satisfies: + a) is a style + b) is an ancestor of subject's style + c) starts same place as subject + d) is longer than subject + so set length of subject to the length of tenv + BUT. the environment may have length 99999999, + so we need to check condition (d) again + */ + envlen = tenv->header.nestedmark.length; + if (pos + envlen > text_GetLength(text)) + envlen = text_GetLength(text) - pos; + if (envlen > len) { + nessmark_SetLength(subject, envlen); + break; /* exit from nextstylegroup */ + } } ! /* Part II. There is no larger style group that starts where subject does. ! Find the next place where a style starts and take the ! smallest group starting there. ! To do this we check each place where the style changes ! and find the innermost there. If that innermost is a parent ! of subject, we have a style end and not a style start. */ ! envpos = pos; do { envpos += environment_GetNextChange(text->rootEnvironment, envpos); ! if (envpos >= text_GetLength(text)) { ! /* we've reached the end of text */ ! nessmark_Start(subject); ! break; ! } ! tenv = environment_GetInnerMost(text->rootEnvironment, ! envpos); while (tenv != NULL && tenv->type != environment_Style) tenv = environment_GetParent(tenv); ! if (tenv == NULL) ! /* tenv is root envt ! and thus must be a parent of env */ ! continue; ! penv = env; ! while (penv != NULL && penv != tenv) ! penv = environment_GetParent(penv); ! /* if tenv == penv, the style at tenv is a parent of subject's style, ! so it has already been processed */ ! if (tenv != penv) { ! /* at this point, tenv points to the environment for the ! next group, and that group starts at envpos */ ! nessmark_SetPos(subject, envpos); ! envlen = tenv->header.nestedmark.length; ! len = text_GetLength(text); ! if (pos + envlen > len) ! envlen = len - pos; ! nessmark_SetLength(subject, envlen); ! break; ! } ! } while (TRUE); break; /* {"enclosingstylegroup","Ft", {Tstr, Tstr, Tvoid}, ness_codeOrange} */ *************** *** 709,715 **** /* now set the mark to the enclosing range */ if (env != NULL) { nessmark_SetPos(subject, environment_Eval(env)); ! nessmark_SetLength(subject, env->header.nestedmark.length); } else /* no enclosing style */ nessmark_Start(subject); --- 776,787 ---- /* now set the mark to the enclosing range */ if (env != NULL) { nessmark_SetPos(subject, environment_Eval(env)); ! pos = nessmark_GetPos(subject); ! envlen = env->header.nestedmark.length; ! len = text_GetLength(text); ! if (pos + envlen > len) ! envlen = len - pos; ! nessmark_SetLength(subject, envlen); } else /* no enclosing style */ nessmark_Start(subject); *************** *** 749,754 **** --- 821,841 ---- text_NotifyObservers(text, 0); #endif } + break; + + /* {"nextstylesegment", "Fv", {Tstr, Tstr, Tvoid}, ness_codeOrange} */ + case 'v': + /* advance subject to the segment extending + from its former finish to the next style change. + If at finish(base()), return finish(base()).*/ + text = (struct text *)nessmark_GetText(subject); + pos = nessmark_GetPos(subject) + nessmark_GetLength(subject); + nessmark_SetPos(subject, pos); + envlen = environment_GetNextChange(text->rootEnvironment, pos); + len = text_GetLength(text); + if (pos + envlen > len) + envlen = len - pos; + nessmark_SetLength(subject, envlen); break; /* {"whereitwas", "Fw", {Tstr, Tvoid}, ness_codeOrange} */ *** atk/ness/objects/nessruna.c Fri Jul 27 13:50:10 1990 --- atk/ness/objects/nessruna.c.NEW Wed Jul 25 16:36:45 1990 *************** *** 0 **** --- 1,230 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/nessruna.c,v 1.2 90/07/25 16:35:22 wjh Exp $ */ + /* $ACIS: $ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/nessruna.c,v $ */ + + #ifndef lint + char *nessrunapp_rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/nessruna.c,v 1.2 90/07/25 16:35:22 wjh Exp $ "; + #endif /* lint */ + + /* + * app for ness + * + * Program to execute a Ness file. + * + * nessrun [-d] programfilename args + * + * programfilename is the name of a file containing the ness program + * it must have a function main(), which will be called + * to initiate execution + * remaining args are concatenated and passed as a single marker parameter to main() + * + * The -d switch causes the compiler to dump the generated code. + */ + + /* + * $Log: nessruna.c,v $ + * Revision 1.2 90/07/25 16:35:22 wjh + * fix core dump on Sun3 + * + * Revision 1.1 90/07/15 15:24:35 wjh + * Initial revision + * + * 11 May 1990 WJH converted from old standalone nessrun program. + */ + #include + #include + #include + + #include + #include + #include + #include + #include + #include + #include + #include + #include + + struct ness *program; + + + boolean + nessrunapp__InitializeObject(classID,self) + struct classheader *classID; + struct nessrunapp *self; + { + self->inputfile = NULL; + self->dump = FALSE; + self->theNess = ness_New(); + nessrunapp_SetMajorVersion(self, CURRENTSYNTAXLEVEL); + nessrunapp_SetMinorVersion(self, CURRENTMODIFICATIONLEVEL); + nessrunapp_SetFork(self, FALSE); + return TRUE; + } + + void + nessrunapp__FinalizeObject(classID,self) + struct classheader *classID; + struct nessrunapp *self; + { + ness_Destroy(self->theNess); + /* do not free self->inputfile because it is in argv */ + } + + + /* + * usage statement + */ + static void + show_usage(self) + struct nessrunapp *self; + { + fprintf(stderr, + "Usage: %s [-d] programfilename arguments\n", + nessrunapp_GetName(self)); + fprintf(stderr, + "\ + -d: display generated code\n\ + programfilename: execute program in this files\n\ + args: all further text is passed as the arg to main() in the program\n\ + "); + } + + void + dumpall() + { + struct ness *n; + unsigned char *name; + for (n = ness_GetList(); n != NULL; n = ness_GetNext(n)) { + name = ness_GetName(n); + printf("\nObject code for %s\n", + (name != NULL) ? name : (unsigned char *)"unknown"); + ness_dumpattrs(n, stdout); + } + } + + + boolean + nessrunapp__ParseArgs(self, argc, argv) + struct nessrunapp *self; + int argc; + char **argv; + { + struct nessmark *arg, *args, *blank; + + if(!super_ParseArgs(self, argc, argv)) + return FALSE; + + /* super_ParseArgs() passes across the "runapp" and its switches, + leaving "nessrun" as the first arg. */ + + while(*++argv != NULL && **argv == '-') { + switch((*argv)[1]){ + case 'd': + self->dump = TRUE; + break; + case 'f': + nessrunapp_SetFork(self, TRUE); + break; + default: + fprintf(stderr,"%s: unrecognized switch: %s\n", + nessrunapp_GetName(self), *argv); + show_usage(self); + return FALSE; + } + } + + /* are there any arguments to the ness program? */ + + if (*argv != NULL) { + self->inputfile = *argv; + + /* concatenate args to pass to theNess */ + + blank = nessmark_New(); + nessmark_MakeConst(blank, " "); + arg = nessmark_New(); + args = nessmark_New(); + nessmark_SetText(args, simpletext_New()); + while (*argv != NULL) { + nessmark_MakeConst(arg, *argv); + nessmark_Next(args); + nessmark_Replace(args, arg); + nessmark_Next(args); + nessmark_Replace(args, blank); + argv++; + } + nessmark_Base(args); + ness_SupplyMarkerArg(self->theNess, args); + } + else { + fprintf(stderr,"%s: no programfilename specified\n", + nessrunapp_GetName(self)); + show_usage(self); + return FALSE; + } + return TRUE; + } + + boolean + nessrunapp__Start(self) + struct nessrunapp *self; + { + if (ness_ReadNamedFile(self->theNess, self->inputfile) + != dataobject_NOREADERROR) { + fprintf(stderr, "Input file is neither plain text not ATK format: %s\n", + self->inputfile); + return FALSE; + } + return TRUE; + } + + + int + nessrunapp__Run(self) + struct nessrunapp *self; + { + struct errornode *result; + long t0, t1; + struct text *text; + struct textview *textview; + boolean forkit; + + text = text_New(); + textview = textview_New(); + textview_SetDataObject(textview, text); + ness_SetDefaultText(self->theNess, textview); + + ness_SetName(self->theNess, self->inputfile); + ness_SetAccessLevel(self->theNess, ness_codeUV); + + t0 = event_TUtoMSEC(event_Now()); + result = ness_Compile(self->theNess); + t1 = event_TUtoMSEC(event_Now()); + + if (self->dump) + dumpall(); + + if (ness_PrintAllErrors("Compile") != 0) + return(1); + else printf ("Compile okay. Elapsed time is %d msec.\n", t1-t0); + + forkit = nessrunapp_GetFork(self); + if(!nessrunapp_Fork(self)) + return -1; + + t0 = event_TUtoMSEC(event_Now()); + result = ness_Execute(self->theNess, "main"); + t1 = event_TUtoMSEC(event_Now()); + + if (result != NULL) + ness_PrintAllErrors("Execution"); + else if ( ! forkit) + printf ("Execution okay. Elapsed time is %d msec.\n", t1-t0); + + return ((result == NULL) ? 0 : 1); + } *** atk/ness/objects/nessruna.ch Fri Jul 27 13:50:28 1990 --- atk/ness/objects/nessruna.ch.NEW Fri Jul 20 11:27:05 1990 *************** *** 0 **** --- 1,30 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/nessruna.ch,v 1.1 90/07/15 15:24:56 wjh Exp $ */ + /* $ACIS: $ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/nessruna.ch,v $ */ + + #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) + char *rcsid_rofftextapp_ch = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/objects/RCS/nessruna.ch,v 1.1 90/07/15 15:24:56 wjh Exp $ "; + #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ + + /* toandrew application */ + + class nessrunapp[nessruna] : application[app] { + + overrides: + ParseArgs(argc, argv) returns boolean; + Start() returns boolean; + Run() returns int; + + classprocedures: + InitializeObject(self) returns boolean; + FinalizeObject(self); + + data: + char *inputfile; + struct ness *theNess; + boolean dump; + }; *** atk/ness/nesslib/Imakefile Wed Nov 22 12:22:31 1989 --- atk/ness/nesslib/Imakefile.NEW Fri Jul 20 11:27:10 1990 *************** *** 3,9 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! NFILES = ctype.n enum.n format.n funchdr.n sort.n swap.n tokens.n unscribe.n vp2scribe.n wc.n xwipe.n MkdirTarget($(DESTDIR)/lib/ness) --- 3,9 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! NFILES = ctype.n enum.n format.n funchdr.n sort.n swap.n tokens.n unscribe.n vp2scribe.n wc.n xwipe.n date.n MkdirTarget($(DESTDIR)/lib/ness) *** atk/ness/nesslib/enum.n Wed Nov 22 12:22:32 1989 --- atk/ness/nesslib/enum.n.NEW Wed Jun 13 17:00:38 1990 *************** *** 17,48 **** -- because there are no arrays, the set of enumeration units is kept -- as a string in 'CurrSeq', which always has the most recently used value ! marker CurrSeq; function incr(seq) ! marker dig; ! marker before; ! marker after; ! dig := last(seq); ! before := previous(seq); ! after := next(seq); while TRUE do if "0" <= dig and dig < "9" then ! replace(dig, next(search("0123456789", dig))); ! return extent(next(before), start(after)); elif dig = "." then ! replace(finish(dig), "1"); ! return extent(next(before), start(after)); ! return extent(replace(dig, "1"), start(after)); elif dig = "9" then -- replace with "0" and continue to the left ! dig := previous(replace(dig, "0")); else -- reached front of seq ! return extent(replace(finish(dig), "1"), start(after)); ! end if; ! end while; ! end function; ! -- end incr; -- spanseq(t) -- t is the first character of a potential sequence number --- 17,48 ---- -- because there are no arrays, the set of enumeration units is kept -- as a string in 'CurrSeq', which always has the most recently used value ! marker CurrSeq function incr(seq) ! marker dig ! marker before ! marker after ! dig := last(seq) ! before := previous(seq) ! after := next(seq) while TRUE do if "0" <= dig and dig < "9" then ! replace(dig, next(search("0123456789", dig))) ! return extent(next(before), start(after)) elif dig = "." then ! replace(finish(dig), "1") ! return extent(next(before), start(after)) ! return extent(replace(dig, "1"), start(after)) elif dig = "9" then -- replace with "0" and continue to the left ! dig := previous(replace(dig, "0")) else -- reached front of seq ! return extent(replace(finish(dig), "1"), start(after)) ! end if ! end while ! end function ! -- end incr -- spanseq(t) -- t is the first character of a potential sequence number *************** *** 50,71 **** -- if invalid, return the empty string at start(t) -- function spanseq(t) ! marker orig; ! orig := t; while True do -- t is the first character of what may be an enumeration unit -- stay in loop if we find an enum unit; otherwise return ! if t /= "-" then t := span(t, "0123456789"); end if; if t /= "" and next(t) = "." then -- found an enumeration unit ! t := next(next(t)); else -- reached the end of the enumeration ! return extent(orig, start(t)); ! end if; ! end while; ! end function; ! -- end spanseq; -- upseq(seq) --- 50,70 ---- -- if invalid, return the empty string at start(t) -- function spanseq(t) ! marker orig ! orig := t while True do -- t is the first character of what may be an enumeration unit -- stay in loop if we find an enum unit; otherwise return ! if t /= "-" then t := span(start(t), "0123456789") end if if t /= "" and next(t) = "." then -- found an enumeration unit ! t := next(next(t)) else -- reached the end of the enumeration ! return extent(orig, start(t)) ! end if ! end while ! end function -- upseq(seq) *************** *** 78,145 **** -- Save a marker to the new value in CurrSeq. -- function upseq(seq) ! marker sequnit; -- front unit from seq ! marker CurrUnit; -- front unit from CurrSeq ! marker lastunit; -- previous unit in seq ! marker before; -- character before seq ! before := previous(seq); while True do ! -- get first units from seq and CurrSeq; ! if first(seq) = "-" then sequnit := first(seq); ! else sequnit := span(seq, "0123456789"); ! end if; if sequnit = "" then -- reached the end of the enumeration value -- increment last unit in seq and reset CurrSeq ! sequnit := incr(lastunit); ! CurrSeq := extent(second(before), sequnit); ! return; ! end if; ! CurrUnit := span(CurrSeq, "0123456789"); if CurrUnit = "" then ! -- use "0." for sequence; if last, it will be incr'ed above ! sequnit := replace(sequnit, "0"); else -- both exist, update seq ! sequnit := replace(sequnit, CurrUnit); ! end if; -- advance to next units ! lastunit := sequnit; ! seq := extent(next(next(sequnit)), seq); ! CurrSeq := extent(next(next(CurrUnit)), CurrSeq); ! end while; ! end function; ! -- end upseq; -- enumdigits(text) -- scan the text and replace all enumerations with corrected values -- function enumdigits(text) ! marker original; ! marker seq; -- enumeration value ! original := text; ! text := first(text); -- begin check with first selected char while TRUE do -- at this point, text is the first character to check for an enumeration ! seq := spanseq(text); if seq /= "" and (next(seq) = " " or next(seq) = "\t" or next(seq) = "\n") then -- we have an enumeration: update it ! -- printline(seq); ! upseq(seq); ! end if; -- move to next potential enumeration ! text := search(text, "\n"); if text = "" or extent(text, original) = "" then -- off the original end ! return original; ! end if; ! text := next(text); ! end while; ! end function; ! -- end enumdigits; -- enum_Digits() --- 77,142 ---- -- Save a marker to the new value in CurrSeq. -- function upseq(seq) ! marker sequnit -- front unit from seq ! marker CurrUnit -- front unit from CurrSeq ! marker lastunit -- previous unit in seq ! marker before -- character before seq ! before := previous(seq) while True do ! -- get first units from seq and CurrSeq ! if first(seq) = "-" then sequnit := first(seq) ! else sequnit := span(start(seq), "0123456789") ! end if if sequnit = "" then -- reached the end of the enumeration value -- increment last unit in seq and reset CurrSeq ! sequnit := incr(lastunit) ! CurrSeq := extent(second(before), sequnit) ! exit function ! end if ! CurrUnit := span(start(CurrSeq), "0123456789") if CurrUnit = "" then ! -- use "0." for sequence if last, it will be incr'ed above ! sequnit := replace(sequnit, "0") else -- both exist, update seq ! sequnit := replace(sequnit, CurrUnit) ! end if -- advance to next units ! lastunit := sequnit ! seq := extent(next(next(sequnit)), seq) ! CurrSeq := extent(next(next(CurrUnit)), CurrSeq) ! end while ! end function -- enumdigits(text) -- scan the text and replace all enumerations with corrected values -- function enumdigits(text) ! marker original ! marker seq -- enumeration value ! original := text ! text := first(text) -- begin check with first selected char while TRUE do -- at this point, text is the first character to check for an enumeration ! seq := spanseq(text) if seq /= "" and (next(seq) = " " or next(seq) = "\t" or next(seq) = "\n") then -- we have an enumeration: update it ! -- printline(seq) ! upseq(seq) ! end if -- move to next potential enumeration ! text := search(start(text), "\n") if text = "" or extent(text, original) = "" then -- off the original end ! return original ! end if ! text := next(text) ! end while ! end function -- enum_Digits() *************** *** 146,155 **** -- Entry point from command line call -- function enum_Digits() ! CurrSeq := ""; ! enumdigits(currentselection()); ! end function; ! -- end enum_Digits; -- main -- Entry point when using this package via nessrun --- 143,151 ---- -- Entry point from command line call -- function enum_Digits() ! CurrSeq := "" ! enumdigits(currentselection()) ! end function -- main -- Entry point when using this package via nessrun *************** *** 157,176 **** -- It will be replaced, and the old version will be in filename.BAK -- function main (args) ! marker filename; ! marker text; ! CurrSeq := ""; filename := token(args, "qwertyuiopasdfghjklzxcvbnm" ~ "QWERTYUIOPASDFGHJKLZXCVBNM" ! ~ "./0123456789"); ! print("Processing file \"" ~ filename ~ "\"\n"); ! text := readfile(filename); ! system("mv " ~ filename ~ " " ~ filename ~ ".BAK"); ! writefile(filename, enumdigits(text)); ! end function; ! -- end main; --- 153,171 ---- -- It will be replaced, and the old version will be in filename.BAK -- function main (args) ! marker filename ! marker text ! CurrSeq := "" filename := token(args, "qwertyuiopasdfghjklzxcvbnm" ~ "QWERTYUIOPASDFGHJKLZXCVBNM" ! ~ "./0123456789") ! print("Processing file \"" ~ filename ~ "\"\n") ! text := readfile(filename) ! system("mv " ~ filename ~ " " ~ filename ~ ".BAK") ! writefile(filename, enumdigits(text)) ! end function *** atk/ness/nesslib/date.n Fri Jul 27 13:50:57 1990 --- atk/ness/nesslib/date.n.NEW Fri Jul 20 11:27:12 1990 *************** *** 0 **** --- 1,485 ---- + + -- date module + + -- styles accepted: + -- separator styles: + -- slashes: 7/17/1989 + -- dashes: 7-17-1989 + -- periods: 1989.198 + -- month styles: + -- digits: 7 + -- abbr: Jul (must have legal first 3 letters) + -- full: July + -- year styles: + -- digits: 89 + -- abbr: '89 (a number with an apostrophe in front) + -- full: 1989 (a number > 1900) + -- value styles: + -- 3 values: 7/17/1989 (month, day, year) + -- 2 values: 1989.198 (year, number days from 1/1) + -- 1 value: 32340 (number of days from 1/1/1901) + -- position styles: + -- month day year: July 17, 1989 + -- day month year: 17-July-1989 (month must be abbr or full) + -- year day: 1989.198 (year must be abbr or full) + -- extraneous text: + -- ignores extraneous text before and after date + -- takes leftmost combination of characters to form date + -- text between the parts of the date can not contain numbers except a time + -- times must have parts separated by colons (no spaces in time allowed) + -- + -- date limits: + -- this module only handles dates from 1/1/1901 - 12/31/2000. + + -- external routines + -- int function date_canonical(marker m): + -- returns canonical integer representation for the date in the marker m. + -- this canonical integer is the number of days from 1/1/1901. + -- marker function date_text(int n): + -- returns a text representation (eg: July 17, 1989) for the canonical + -- date given in the integer parameter n. + -- marker function date_slashed(int n): + -- returns a slashed representation (eg: 7/17/1989) for the canonical date + -- given in the integer parameter n. + -- marker function date_dashed(int n): + -- returns a dashed representation (eg: 7-17-1989) for the canonical date + -- given in the integer parameter n. + -- marker function date_julian(int n): + -- returns a two-value representation (eg: 1989.198) for the canonical date + -- given in the integer parameter n (note: format is year.day). + + + -- useful constants + + integer base := 1901 -- base year for the canonical date representation + integer ndays_4yrs := 1461 -- number days from 1/1/1901 to 12/31/1904 + integer ndays_limit := 36265 -- number days from 1/1/1901 to 12/31/1999 + + marker ndays_UpToMonth -- total number of days up to a certain month + := "31 59 90 120 151 181 212 243 273 304 334" + + marker month_text -- text name of the months + := "January February March April May June July August September October November December " + + marker month_abbr -- abbreviated text name of the months + := "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec " + + + -- global variables + + marker where_int_was -- used to keep track where an integer was found + + + -- returns the marker for where the last integer found by SearchInt() was. + + marker function WhereIntWas() + + return (where_int_was) + + end function + + + -- searches for and returns the the first integer found in the given text + -- ignore times (integers with colons before or after them) + + integer function FirstInt(marker text) + + integer number + + where_int_was := token( text, "0123456789" ) + while previous(where_int_was) = ":" or next(where_int_was) = ":" do + where_int_was := token( toend( finish(where_int_was)), "0123456789" ) + end while + + if where_int_was = "" then + + number := 0 + else + number := parseint( copy(where_int_was) ) + end if + + return (number) + + end function + + + -- searches for and returns the next integer after the last integer found by FirstInt() or NextInt() + + integer function NextInt() + + integer number + + if WhereIntWas() = "" then + number := 0 + else + number := FirstInt( toend( finish( WhereIntWas() ) ) ) + end if + + return (number) + + end function + + + -- returns a marker consisting of the year, month, and day + -- based on the given canonical date representation. + -- there are three formats for dates returned: + -- 3 values: year, month, day. + -- 2 values: year, number of days from 1/1. + -- 1 value: number of days from 1/1/1901. + -- any errors will result in the return value of "0 0 0", + -- so that the year, month, and day values are all zero. + + marker function IntToDate(integer n, integer n_values) + + marker date -- text of date to be returned + integer year + integer month + integer day + integer temp + integer x, y + + if n_values = 1 then + + date := textimage(n) + + elif n_values > 3 or n_values < 1 or n > ndays_limit then + + -- date error + date := "0 0 0" + + else + + -- count years at 4 yrs at a time + temp :=n / ndays_4yrs + year := base + 4* temp + n := n - temp * ndays_4yrs + + -- count number years left + temp := n / 365 + year := year + temp + n := n - temp * 365 + + if n_values = 2 then + + -- number of days from 1/1 + day := n + + -- make date string + date := textimage(year) ~ " " ~ textimage(day) + + elif n_values = 3 then + + -- count number of months + month := 1 + y := 0 + x := parseint(ndays_UpToMonth) + while ( n > x) do + month := month + 1 + y := x + x := parseint( next( next ( WhereItWas() ) ) ) + end while + + -- count number of days + day := n - y + + -- make date string + date := textimage(year) ~ " " ~ textimage(month) + ~ " " ~ textimage(day) + + end if + + end if + + return (date) + + end function + + + -- returns an integer representation for the given year, month, and day. + -- there are three ways to specify the year, month, and day: + -- if month = 0, then the day field contains number of days from 1/1. + -- if year & month both = 0, then the day field is the number of days from 1/1/1901. + -- if none of the fields = 0, then it is the standard year, month, day format. + + integer function DateToInt(integer year, integer month, integer day) + + integer n -- integer representation for date + integer temp + integer m + integer x, y + + if year > 0 then + + -- count days for the years from base + temp := year - base + n := temp * 365 + + -- add in leap year days + n := n + temp / 4 + + else + + -- no year is specified + n := 0 + + end if + + -- add in days for the month + -- note: if month = 0, then y = 0 also. + m := month + x := parseint(ndays_UpToMonth) + y := 0 + while ( m > 1) do + y := x + x := parseint( next( next ( WhereItWas() ) ) ) + m := m - 1 + end while + n := n + y + + -- add in days remaining + n := n + day + + -- return integer + return (n) + + end function + + + -- returns the full text of the given month + + marker function monthtext(integer month) + + integer m + marker x, y, z + + m := month + x := start(month_text) + while (m > 0) do + z := search(finish(x), " ") + y := extent(finish(x), start(z)) + x := z + m := m - 1 + end while + + return (y) + + end function + + + -- returns the abbreviated text of the given month + + marker function monthabbr(integer month) + + integer m + marker x, y, z + + m := month + x := start(month_abbr) + while (m > 0) do + z := search(finish(x), " ") + y := extent(finish(x), start(z)) + x := z + m := m - 1 + end while + + return (y) + + end function + + + -- returns the slashed date for the canonical integer n + + marker function date_slashed(integer n) + + integer year, month, day + marker date + marker slashed + + date := IntToDate(n,3) + + year := parseint(date) + month := parseint( next( next( WhereItWas() ) ) ) + day := parseint( next( next( WhereItWas() ) ) ) + + slashed := textimage(month) ~ "/" ~ textimage(day) ~ "/" ~ textimage(year) + + return (slashed) + + end function + + + -- returns the dashed date for the canonical integer n + + marker function date_dashed(integer n) + + integer year, month, day + marker date + marker dashed + + date := IntToDate(n,3) + + year := parseint(date) + month := parseint( next( next( WhereItWas() ) ) ) + day := parseint( next( next( WhereItWas() ) ) ) + + dashed := textimage(month) ~ "-" ~ textimage(day) ~ "-" ~ textimage(year) + + return (dashed) + + end function + + + -- returns the text date for the canonical integer n + + marker function date_text(integer n) + + integer year, month, day + marker date + marker text + + date := IntToDate(n,3) + + year := parseint(date) + month := parseint( next( next( WhereItWas() ) ) ) + day := parseint( next( next( WhereItWas() ) ) ) + + text := monthtext(month) ~ " " ~ textimage(day) ~ ", " ~ textimage(year) + + return (text) + + end function + + + -- returns the text date for the canonical integer n + + marker function date_julian(integer n) + + integer year, day + marker date + marker text + + date := IntToDate(n,2) + + year := parseint(date) + day := parseint( next( next( WhereItWas() ) ) ) + + text := textimage(year) ~ "." ~ textimage(day) + + return (text) + + end function + + + -- returns the integer value for a month found in the given text, or 0 if none is found. + -- looks for the abbreviated month text as key + + integer function SearchMonth(marker text) + + integer month + + month := 12 + while ( month > 0 ) do + if search(text,monthabbr(month)) = "" then + month := month - 1 + else + exit while + end if + end while + + return (month) + + end function + + + -- returns the canonical integer representation for the date represented by the given marker text + + integer function date_canonical(marker date) + + integer temp1, temp2, temp3 + integer month, day, year + marker new_start + + -- get first number in date + temp1 := FirstInt(date) + if WhereIntWas() = "" then + -- invalid: no numbers found + return (0) + end if + + -- look for month text in front of the first number + temp2 := SearchMonth( extent( date, WhereIntWas() ) ) + if temp2 = 0 then + -- month not found before first number + new_start := finish( WhereIntWas() ); + -- get next number + temp2 := NextInt() + if WhereIntWas() = "" then + -- valid: days only (no month or year given) + month := 0 + day := temp1 + year := 0 + else + -- look for month text between 1st two numbers + temp3 := SearchMonth( extent( new_start, WhereIntWas() ) ) + if temp3 = 0 then + -- no month text found: get 3rd number + temp3 := NextInt() + if WhereIntWas() = "" then + -- valid: year and day only (no month) + month := 0 + day := temp2 + year := temp1 + else + -- valid: month, day, and year + month := temp1 + day := temp2 + year := temp3 + end if + else + -- valid: day, month, and year (month in middle) + month := temp3 + day := temp1 + year := temp2 + end if + end if + else + -- month found before 1st number: look for next number + temp3 := NextInt() + if WhereIntWas() = "" then + -- invalid: month, day, but no year + return (0) + else + -- valid: month, day, and year + month := temp2 + day := temp1 + year := temp3 + end if + end if + + -- convert year to to full, if necessary + if year > 0 and year < 100 then + year := year + 1900 + end if + + -- return canonical integer representation + return DateToInt(year, month, day) + + end function + + + function main() + + printline( "result = " ~ textimage( date_canonical("July 17, 1989") ) ) + printline( "result = " ~ textimage( date_canonical("17 Jul 1989") ) ) + printline( "result = " ~ textimage( date_canonical("7-17-89") ) ) + printline( "result = " ~ textimage( date_canonical("7/17 '89") ) ) + printline( "result = " ~ textimage( date_canonical("Mon, 17 Jul 89 14:03:19 -0500 (EST)") ) ) + printline( "result = " ~ textimage( date_canonical("Tue Jul 17 17:34:09 EST 1989") ) ) + printline( "result = " ~ textimage( date_canonical("1989.198") ) ) + printline( "result = " ~ textimage( date_canonical("89.198") ) ) + printline( "result = " ~ textimage( date_canonical("'89.198") ) ) + printline( "result = " ~ textimage( date_canonical("32340") ) ) + printline( "result = " ~ textimage( date_canonical("July 17") ) ) + + + end function *** atk/ness/demos/happybday.d Wed Nov 22 12:23:07 1989 --- atk/ness/demos/happybday.d.NEW Fri Jul 20 11:27:17 1990 *************** *** 1,4 **** ! \begindata{text,269207760} \textdsversion{12} \template{default} \define{sans --- 1,4 ---- ! \begindata{text,270171368} \textdsversion{12} \template{default} \define{sans *************** *** 9,25 **** \center{\bigger{\bigger{\italic{\bigger{\bigger{\bigger{Happy Birthday}}}}}}} ! \begindata{cel,269235776} \V 2 ! \begindata{lset,269220812} \V 1 ! \begindata{lset,269223560} \V 1 ! \begindata{cel,269220612} \V 2 ! \begindata{raster,269220476} 2 0 68266 68266 0 0 112 109 ! bits 269220476 112 109 t | t | t | --- 9,25 ---- \center{\bigger{\bigger{\italic{\bigger{\bigger{\bigger{Happy Birthday}}}}}}} ! \begindata{cel,270091164} \V 2 ! \begindata{lset,270088972} \V 1 ! \begindata{lset,270241040} \V 1 ! \begindata{cel,270091048} \V 2 ! \begindata{raster,270088888} 2 0 68266 68266 0 0 112 109 ! bits 270088888 112 109 t | t | t | *************** *** 129,179 **** t | t | t | ! \enddata{raster, 269220476} ! 0 269220476 0 0 0 0 >OBJ< raster >VIEW< rasterview >REF< visible cake >LINK< 4ÿÀÄ ! \enddata{cel,269220612} ! 0 0 0 269220612 0 0 0 >OBJ< cel >VIEW< celview >REF< ! \enddata{lset,269223560} ! \begindata{lset,269221040} \V 1 ! \begindata{cel,269261840} \V 2 ! \begindata{text,269245412} \textdsversion{12} \template{default} ! \italic{\bigger{\bigger{\bigger{ ! }}}}\enddata{text,269245412} ! 0 269245412 0 0 0 0 >OBJ< text >VIEW< textview >REF< song text >LINK< cake_1 ! \enddata{cel,269261840} ! 0 0 0 269261840 0 0 0 >OBJ< cel >VIEW< celview >REF< ! \enddata{lset,269221040} ! 1 66 0 0 269223560 269221040 0 >OBJ< >VIEW< >REF< ! \enddata{lset,269220812} ! 0 269220812 0 0 0 0 >OBJ< lset >VIEW< lsetview >REF< lset >LINK< ! \enddata{cel,269235776} ! \view{celview,269235776,0,455,160} \italic{Empower the Ness (below) and click on the cake for Birthday greetings. --- 129,184 ---- t | t | t | ! \enddata{raster, 270088888} ! 0 270088888 0 0 0 0 >OBJ< raster >VIEW< rasterview >REF< visible cake >LINK< 4ÿÀÄ ! \enddata{cel,270091048} ! 0 0 0 270091048 0 0 0 >OBJ< cel >VIEW< celview >REF< ! \enddata{lset,270241040} ! \begindata{lset,270240652} \V 1 ! \begindata{cel,270089248} \V 2 ! \begindata{text,270240540} \textdsversion{12} \template{default} ! \define{greeting ! menu:[Font~1,Greeting] ! attr:[FontFamily AndySans Int 0] ! attr:[FontSize ConstantFontSize Point 18]} ! \greeting{ ! \ ! }\enddata{text,270240540} ! 0 270240540 0 0 0 0 >OBJ< text >VIEW< textview >REF< song text >LINK< cake_1 ! \enddata{cel,270089248} ! 0 0 0 270089248 0 0 0 >OBJ< cel >VIEW< celview >REF< ! \enddata{lset,270240652} ! 1 66 0 0 270241040 270240652 0 >OBJ< >VIEW< >REF< ! \enddata{lset,270088972} ! 0 270088972 0 0 0 0 >OBJ< lset >VIEW< lsetview >REF< lset >LINK< ! \enddata{cel,270091164} ! \view{celview,270091164,12,455,160} \italic{Empower the Ness (below) and click on the cake for Birthday greetings. *************** *** 182,191 **** For best results, use an IBM RT/PC workstation.} ! \begindata{cel,269299000} \V 2 ! \begindata{ness,269298656} ! \origin{00\13 Oct 1989 at 10:01:56 EDT\wjh: Fred Hansen\00} \template{default} \define{fullwidth menu:[Justify,Full Width] --- 187,196 ---- For best results, use an IBM RT/PC workstation.} ! \begindata{cel,270271572} \V 2 ! \begindata{ness,270271312} ! \origin{00\\5 Jan 1990 at 16:09:23 EST\\wjh: Fred Hansen\\00} \template{default} \define{fullwidth menu:[Justify,Full Width] *************** *** 194,199 **** --- 199,208 ---- \define{sans menu:[Font,Sans] attr:[FontFamily AndySans Int 0]} + \define{greeting + menu:[Font~1,Greeting] + attr:[FontFamily AndySans Int 0] + attr:[FontSize ConstantFontSize Point 18]} -- \bigger{\italic{Happy Birthday to Ness}} ! *************** *** 219,227 **** marker Cakes := "\ ! \begindata{raster,269298496} 2 0 68266 68266 0 0 112 109 ! bits 269298496 112 109 t | t | t | --- 228,236 ---- marker Cakes := "\ ! \begindata{raster,270261204} 2 0 68266 68266 0 0 112 109 ! bits 270261204 112 109 t | t | t | *************** *** 331,342 **** t | t | t | ! \enddata{raster, 269298496} ! \view{rasterview,269298496,1,0,0} \ ! \begindata{raster,269286484} 2 0 68266 68266 0 0 112 109 ! bits 269286484 112 109 t | t | t | --- 340,351 ---- t | t | t | ! \enddata{raster, 270261204} ! \view{rasterview,270261204,13,0,0} \ ! \begindata{raster,270299732} 2 0 68266 68266 0 0 112 109 ! bits 270299732 112 109 t | t | t | *************** *** 446,453 **** t | t | t | ! \enddata{raster, 269286484} ! \view{rasterview,269286484,2,0,0} " --- 455,462 ---- t | t | t | ! \enddata{raster, 270299732} ! \view{rasterview,270299732,14,0,0} " *************** *** 467,474 **** showcake(FirstObject(Cakes)) ! replace(base(currentselection(inset("song text"))), " \\n") end if end if --- 476,485 ---- showcake(FirstObject(Cakes)) ! replace(base(currentselection(inset("song text"))), + "\greeting{ \\n }") + end if end if *************** *** 478,517 **** function sing() ! marker m ! m := last(base(currentselection(inset("song text")))) - m := last(replace(m, "\\nHappy birthday to you\\n")) - im_ForceUpdate() play_notes("L7 CC L4 DCF E P4") ! m := last(replace(m, "\\nHappy birthday to you\\n")) play_notes("L7 CC L4 DCG F P4") im_ForceUpdate() ! m := last(replace(m, "\\nHappy birthday,\\n\\tDear Nessie\\n")) play_notes("L7 CC L4 >C OBJ< ness >VIEW< nessview >REF< ness >LINK< ! \enddata{cel,269299000} ! \view{celview,269299000,3,528,193} ! \enddata{text,269207760} --- 489,528 ---- function sing() ! marker m := second(base(currentselection(inset("song text")))) ! m := last(replace(m, "\\n\\n \greeting{Happy birthday to you}\\n")) im_ForceUpdate() play_notes("L7 CC L4 DCF E P4") ! m := last(replace(m, "\\n \greeting{Happy birthday to you}\\n")) play_notes("L7 CC L4 DCG F P4") im_ForceUpdate() ! m := last(replace(m, "\\n \greeting{Happy birthday,}\\n\\t" + ~ "\greeting{Dear Nessie}\\n")) + play_notes("L7 CC L4 >C OBJ< ness >VIEW< nessview >REF< ness >LINK< ! \enddata{cel,270271572} ! \view{celview,270271572,15,528,211} ! \enddata{text,270171368} *** atk/ness/doc/nessauth.d Wed Jan 17 16:38:27 1990 --- atk/ness/doc/nessauth.d.NEW Fri Jul 20 11:27:23 1990 *************** *** 1,4 **** ! \begindata{text,2065904} \textdsversion{12} \template{default} \define{concat --- 1,4 ---- ! \begindata{text,269830216} \textdsversion{12} \template{default} \define{concat *************** *** 9,15 **** attr:[Flags OverBar Int Set] attr:[FontSize PreviousFontSize Point -2]} ! \flushright{7 December 1989} --- 9,15 ---- attr:[Flags OverBar Int Set] attr:[FontSize PreviousFontSize Point -2]} ! \flushright{14 June 1990} *************** *** 97,113 **** /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/ness/doc/RCS/nessauth.d,v $ */ /* $Log: nessauth.d,v $ ! Revision 1.2 89/12/12 15:02:07 ghoti ! sync with MIT tape ! Revision 1.2 89/12/07 12:15:04 xguest ! added author's name ! Revision 1.1 89/12/07 11:50:02 xguest Initial ! revision Revision 1.1 89/10/11 09:27:04 wjh Initial revision */ }\formatnote{.bp} --- 97,118 ---- /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/doc/RCS/nessauth.d,v $ */ /* $Log: nessauth.d,v $ ! Revision 1.3 90/07/15 15:39:10 wjh ! nessfunc.d: document the new proctable entries in framecmd.c ! nessauth.d: describe usage of the framecmd stuff. ! nesssauth.d: describe --$ness ! nessauth.d: give example of a long string ! nessfunc.d: illustrate neststylegroup and nextstylesegment ! Revision 1.2 89/12/12 15:02:07 ghoti sync with MIT ! tape + Revision 1.2 89/12/07 12:15:04 xguest added author's name Revision 1.1 + 89/12/07 11:50:02 xguest Initial revision + Revision 1.1 89/10/11 09:27:04 wjh Initial revision */ }\formatnote{.bp} *************** *** 141,153 **** Although the Ness compiler pays very little attention to program formatting ! and typography, you should always remember that the purpose of writing a ! program is to explain it to another human because humans have much lower ! tolerance for confusing programs than computers. In the Ness security scheme, ! users are encouraged to read Ness programs and to ignore any they do not ! understand. Not all users will avail themselves of this opportunity, but ! enough will that it well behooves you as author to take some care to produce a ! readable document. Ness programs may contain typography, all of which is ignored except that --- 146,158 ---- Although the Ness compiler pays very little attention to program formatting ! and typography, you should keep in mind that the purpose of writing a program ! is to explain it to another human because humans have much lower tolerance for ! confusing programs than computers. In the Ness security scheme, users are ! encouraged to read Ness programs and to ignore any they do not understand. ! Not all users will avail themselves of this opportunity, but enough will that ! it well behooves you as author to take some care to produce a readable ! document. Ness programs may contain typography, all of which is ignored except that *************** *** 206,212 **** --- 211,239 ---- rather than by the end of the base. + \subsection{1.2 Ness version number} + + The Ness system may evolve from time to time. This raises the possibility + that a program may expect one language and the system may implement some + other. As far as possible changes will be made in an upward compatible manner + so old programs will continue to run with newer compilers. To prevent trying + to run newer programs with older compilers, each program has associated with + it a \italic{Ness version number}. + + + In a Ness object, the Ness version number is automatically recorded when the + object is saved. In a Ness program created with an editor the version number + is recorded with a line of the form + + + --$ness 1 + + + (or what ever version number is appropriate). If the compiler is at a lower + version number than the program it will refuse to compile it. + + \subsection{1.2 Errors} *************** *** 325,330 **** --- 352,364 ---- function 'main', which is where execution begins. + When executed with nessrun, a program may be non-interactive, or it can open a + window and interact with the user. + + + \subsection{2.1 Example non-interactive program} + + The next two pages give a sample program which reads a file, "processes" it line-by-line, and writes the revised file. In this case the processing is simply to make a copy of the contents of the line and create an identical line *************** *** 336,344 **** but then it would not illustrate how to find the lines of the file. ! \begindata{bp,2017584} ! \enddata{bp,2017584} ! \view{bpv,2017584,3,0,0} -- process.n -- Read a file, process each line, and write the result to filename.doc --- 370,381 ---- but then it would not illustrate how to find the lines of the file. ! Discussion continues after the program text. ! ! ! \begindata{bp,269835316} ! \enddata{bp,269835316} ! \view{bpv,269835316,4,0,0} -- process.n -- Read a file, process each line, and write the result to filename.doc *************** *** 348,353 **** --- 385,393 ---- -- Usage: nessrun process.n filename + $ness 1 + + marker destext := "doc" -- extension for destination file marker letters := "qwertyuiopasdfghjklzxcvbnm" *************** *** 422,430 **** end function ! \begindata{bp,2063280} ! \enddata{bp,2063280} ! \view{bpv,2063280,4,0,0} function main(args) \leftindent{marker filename, outname, t --- 462,470 ---- end function ! \begindata{bp,269830140} ! \enddata{bp,269830140} ! \view{bpv,269830140,5,0,0} function main(args) \leftindent{marker filename, outname, t *************** *** 486,505 **** The main function first extracts the input filename from the arguments. Note that as written it only recognizes names consisting of letters, digits, ! underline, dot, and slash. Next it uses a while loop to find the last dot, ! checks the extension, and generates the name for the output file. After then ! printing a message it reads the old file, processes it, moves the old output ! file, and writes the new output file. ! The function Process advances through the text one line at a time, setting the ! variable 'line' to have the contents of each successive line, without a ! newline at either end. The "processed" text is accumulated in 'new' by ! appending to its end. The loop is carefully written to process only the 'text' value passed in, even if it is a substring of some longer string. ! It is instructive to see why the loop leaves 'line'referring to everything after the last newline. The essential cause is that when search() fails to find what it is looking for it returns finish() of its first argument. In this case because the first argument ends at the end of the text, that --- 526,545 ---- The main function first extracts the input filename from the arguments. Note that as written it only recognizes names consisting of letters, digits, ! underline, dot, and slash. Next it uses a \bold{while} loop to find the last ! dot, checks the extension, and generates the name for the output file. After ! then printing a message it reads the old file, processes it, moves the old ! output file, and writes the new output file. ! The function \bold{Process} advances through the text one line at a time, ! setting the variable 'line' to have the contents of each successive line, ! without a newline at either end. The "processed" text is accumulated in 'new' ! by appending to its end. The loop is carefully written to process only the 'text' value passed in, even if it is a substring of some longer string. ! It is instructive to see why the loop leaves 'line' referring to everything after the last newline. The essential cause is that when search() fails to find what it is looking for it returns finish() of its first argument. In this case because the first argument ends at the end of the text, that *************** *** 508,516 **** ! Nessrun does have one switch of its own which, if used, is inserted in the ! command line just after 'nessrun' and before the filename. The switch is -d ! and its effect is to force a dump of the code generated for the program. (In most circumstances this is of little value to you as a Ness programmer.) The code generated is that of a stack machine: operands are fetched to the stack with Load instructions, operators apply to the top elements of the stack, and --- 548,561 ---- ! \subsection{2.2 Nessrun amenities} ! ! ! Nessrun implements two switches which, if used, are inserted in the command ! line just after 'nessrun' and before the filename. ! ! ! \description{-d forces a dump of the code generated for the program. (In most circumstances this is of little value to you as a Ness programmer.) The code generated is that of a stack machine: operands are fetched to the stack with Load instructions, operators apply to the top elements of the stack, and *************** *** 519,524 **** --- 564,574 ---- source code of module atk/ness/objects/dump.c in the Ness source code. + -f causes the nessrun program to fork, thus freeing the typescript for + further command initiation. This switch is particularly of use when the + application opens an interactive window.} + + When writing a standalone program, you may wish to utilize the textview_ proctable functions. To allow this, nessrun provides a value for 'defaulttext'; the value is an empty text, so to use it you first copy the *************** *** 541,550 **** written with "\\begindata\{text", so editing them will not use the nessview inset. Note also that the second time you edit a .n file with the ness inset, you will find the warning message wrapped around it. You can click on the ! Author Mode button near the end of the file. You can remove the warning from ! all your Nesses by adding to your preferences the line *.NessUseDialogBoxInsteadOfWarning: on --- 591,603 ---- written with "\\begindata\{text", so editing them will not use the nessview inset. Note also that the second time you edit a .n file with the ness inset, you will find the warning message wrapped around it. You can click on the ! Author Mode button near the end of the file. + You can remove the warning from all your Nesses by adding to your preferences + the line + + *.NessUseDialogBoxInsteadOfWarning: on *************** *** 598,603 **** --- 651,674 ---- + \{\{Future: 2.3 Interactive Nessrun applications + + + Although ATK applications can be written as documents with embedded Ness + scripts, this has two disadvantages: the embedded Ness occupies screen space + and the user must empower the embedded Ness each time the application is + started. These problems can be avoided by writing the application as a + standalone Ness program which opens a window and interacts with the user. See + the functions fileInteract, markerInteract, and openInteract in nessfunc.d; + note that these functions do not return until the user exits from the + application. In order to intercept events to an object named in the file or + marker, the program may "extend" those objects. To initialize them there can + be an event handler for "view named". + + \}\} + + + \section{3. Extending objects in embedded scripts} *************** *** 936,940 **** ! xxx list all error messages\ ! \enddata{text,2065904} --- 1007,1011 ---- ! \{\{Future: list of all error messages\}\}\ ! \enddata{text,269830216} *** atk/ness/doc/nessfunc.d Wed Jan 17 16:38:36 1990 --- atk/ness/doc/nessfunc.d.NEW Fri Jul 20 11:27:27 1990 *************** *** 1,4 **** ! \begindata{text,2126136} \textdsversion{12} \template{default} \define{index --- 1,4 ---- ! \begindata{text,269765016} \textdsversion{12} \template{default} \define{index *************** *** 8,14 **** attr:[Flags Hidden Int Set]} \define{concat } ! \flushright{7 December 1989} --- 8,14 ---- attr:[Flags Hidden Int Set]} \define{concat } ! \flushright{14 June 1990} *************** *** 74,82 **** document. }}\bold{ ! \begindata{bp,2271720} ! \enddata{bp,2271720} ! \view{bpv,2271720,8,0,0}} Copyright IBM Corporation 1988, 1989 - All Rights Reserved --- 74,82 ---- document. }}\bold{ ! \begindata{bp,269718912} ! \enddata{bp,269718912} ! \view{bpv,269718912,2,0,0}} Copyright IBM Corporation 1988, 1989 - All Rights Reserved *************** *** 102,124 **** /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/ness/doc/RCS/nessfunc.d,v $ */ /* $Log: nessfunc.d,v $ ! Revision 1.3 89/12/12 15:03:27 ghoti ! sync with MIT tape ! Revision 1.2 89/12/07 12:15:23 xguest ! added author's name ! Revision 1.1 89/12/07 11:50:19 xguest Initial ! revision Revision 1.2 89/10/12 13:37:58 wjh changed to use ATK indices instead of the Ness hack Revision 1.1 89/10/11 09:27:48 wjh Initial revision */ ! \begindata{bp,2323912} ! \enddata{bp,2323912} ! \view{bpv,2323912,9,0,0}} Ness provides a variety of functions and access to functions defined outside --- 102,129 ---- /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/ness/doc/RCS/nessfunc.d,v $ */ /* $Log: nessfunc.d,v $ ! Revision 1.4 90/07/15 15:37:34 wjh ! nessfunc.d: document the new proctable entries in framecmd.c ! nessauth.d: describe usage of the framecmd stuff. ! nesssauth.d: describe --$ness ! nessauth.d: give example of a long string ! nessfunc.d: illustrate neststylegroup and nextstylesegment ! Revision 1.3 89/12/12 15:03:27 ghoti sync with MIT ! tape + Revision 1.2 89/12/07 12:15:23 xguest added author's name Revision 1.1 + 89/12/07 11:50:19 xguest Initial revision + Revision 1.2 89/10/12 13:37:58 wjh changed to use ATK indices instead of the Ness hack Revision 1.1 89/10/11 09:27:48 wjh Initial revision */ ! \begindata{bp,269763292} ! \enddata{bp,269763292} ! \view{bpv,269763292,3,0,0}} Ness provides a variety of functions and access to functions defined outside *************** *** 519,527 **** a marker for the next style group - either one that starts where m does and exceeds it in length or one that starts further along in the string. If there is no succeeding style group, the function returns start(m). A program can ! find all styles by successive application of NextStyleGroup(). \indexi{enclosingstylegroup()}\italic{enclosingstylegroup}(m) - Marker m must be either an empty substring or a marker for an entire substring that has a style. The returned value is a marker for the next larger style group that --- 524,539 ---- a marker for the next style group - either one that starts where m does and exceeds it in length or one that starts further along in the string. If there is no succeeding style group, the function returns start(m). A program can ! find all styles by successive application of NextStyleGroup(). See below. + \indexi{nextstylegroup()}\italic{nextstylesegment}(m) - The returned value + is a marker for the segment of base(m) which extends from finish(m) to the + next point where the text style changes. If finish(m) is at finish(base(m), + the function returns start(m). A program can find all style segments by + successive application of NextStyleGroup(). See below. + + \indexi{enclosingstylegroup()}\italic{enclosingstylegroup}(m) - Marker m must be either an empty substring or a marker for an entire substring that has a style. The returned value is a marker for the next larger style group that *************** *** 546,552 **** --- 558,618 ---- into m. (Is this the right order for the arguments?)\}\}} + If the subject text is + + \leftindent{Th\bold{is \italic{is a}\underline{ t}e}st + \typewriter{w\bold{\italic{it}h vari}\underline{ous ne}sting} of styles.} + + + Then a loop cycling through the text with nextstylegroup will find + successively: + + \leftindent{ + is is a te + + is a + + t + + with various nesting + + it + + ith vari + + ous ne + + } + and a loop utilizing nextstylesegment will find: + + + \leftindent{Th + + is + + is a + + t + + e + + st + + w + + it + + h vari + + ous ne + + sting + + of styles. + + } + \section{2. \index{Other Data Types}} *************** *** 1127,1148 **** ! \subsection{5.2 \index{Window control} - } - The following functions have been added to the proctable entries supplied by - the "frame", which is the portion of the system which displays th emessage - line and provides the interface for requesting to edit other files. - To open a new window displaying a file, a program need only execute: ! frame_visit_file_new_window(currentwindow, fnm) - where fnm is a marker value giving the name of the file. (CurrentWindow is a - predefined identifier. See section 3.1.) \description{\indexi{frame_change_directory()}\italic{frame_change_directory}(c\ urrentwindow, new-directory) - Changes the working directory for the current process to be that named by the second argument. --- 1193,1220 ---- ! \subsection{5.2 \index{Window control}} + The functions in this section permit a Ness script to cause windows to appear + and perform other functions. They are in fact proctable entries supplied by + the "frame" or "framecmds" objects. These objects are responsible for the + outer organization of the window, including the message line. There are two + sets of functions depending on whether the ness script has started with + nessrun or not. ! A) Interactive - not nessrun. + These functions apply if there is at least one window already open for the + process. + + Note: An appropriate value for the \italic{currentwindow} arguments below is + \bold{CurrentWindow}, a predefined identifier described in section 3.1. + + \description{\indexi{frame_change_directory()}\italic{frame_change_directory}(c\ urrentwindow, new-directory) - Changes the working directory for the current process to be that named by the second argument. *************** *** 1159,1165 **** --- 1231,1305 ---- (The new window can be closed by typing in it control-X-control-D.) } + \{\{Future: B) Nessrun. + + These function apply if the process has been started with nessrun. The order + may be important; see the discussion in the Ness Author's Manual. + + + \italic{framecmds-set-program-name}(name) - Sets the program name, that is, + the string displayed in the upper left of a window. This string is also used + for preferences. The name specified by this function will take effect for + subsequent window creations, so this function must be called before creating a + window. + + + \italic{framecmds-open-file}(filename) - Returns an object for a new window + created to edit the file named by the argument. The returned value is a + "frame"object suitable as argument to proctable functions which take frames as + their first argument. + + + \italic{framecmds-open-view}(object) - Returns an object for a new window + created to edit the given object. The object should be either a view or a + dataobject. The returned value is a "frame"object suitable as argument to + proctable functions which take frames as their first argument. + + + \italic{framecmds-set-window-title}(frame, title) - If the window is not + editting a file, the name displayed in the center of the window title bar will + be "Buffer: " followed by the second argument of this function. + + + \italic{framecmds-set-command-enable}(frame, enable) - Returns boolean + value. Frames supply a number of menu and keyboard commands for saving the + file and switching between buffers. With windows created via + framecmds-open-..., the frame user commands are disabled by default. They can + be enabled by calling this function with the second argument set True. The + return value is the value of the enable option prior to calling this function. + + + \italic{framecmds-interact}() - This function provides an interaction loop. + It waits for user input and responds. The function does not return until the + user selects the Quit option, so the program should not count on doing much + after calling this function. Since the user may interact for a long while, it + is probably best to release the typescript by specifying the -f switch to + nessrun in order to fork the process.\}\} + + + \{\{Future: 5.3 Interactive Nessrun applications + + + Although ATK applications can be written as documents with embedded Ness + scripts, this has two disadvantages: the embedded Ness occupies screen space + and the user must empower the embedded Ness each time the application is + started. These problems can be avoided by writing the application as a + standalone Ness program which opens a window and interacts with the user. See + the functions fileInteract, markerInteract, and openInteract in nessfunc.d; + note that these functions do not return until the user exits from the + application. In order to intercept events to an object named in the file or + marker, the program may "extend" those objects. To initialize them there can + be an event handler for "view named". + + + also: settitle() and setcommandenable(). + + ProperPtr will be extended to deal with buffer and frame as well. + + \}\} + + \subsection{5.3 \index{Functions on Arbitrary Classes}} \description{ *************** *** 1511,1514 **** \}\} ! \enddata{text,2126136} --- 1651,1654 ---- \}\} ! \enddata{text,269765016} *** atk/org/orgv.c Wed Apr 11 14:20:04 1990 --- atk/org/orgv.c.NEW Thu Jul 12 13:02:06 1990 *************** *** 4,10 **** \* ********************************************************************** */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/org/RCS/orgv.c,v 1.35 90/03/02 18:56:09 gk5g Exp $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* --- 4,10 ---- \* ********************************************************************** */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/org/RCS/orgv.c,v 1.35 90/03/02 18:56:09 gk5g Exp Locker: gk5g $"; #endif /** SPECIFICATION -- External Facility Suite ********************************* *** atk/preview/preview.c Wed Nov 22 12:24:29 1989 --- atk/preview/preview.c.NEW Fri Jul 20 11:27:37 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/preview/RCS/preview.c,v 2.12 89/11/07 17:35:25 cfe Exp $ */ /* $ACIS:preview.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/preview/RCS/preview.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/preview/RCS/preview.c,v 2.12 89/11/07 17:35:25 cfe Exp $"; #endif /* lint */ /* --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/preview/RCS/preview.c,v 2.13 90/07/16 15:47:08 gk5g Exp $ */ /* $ACIS:preview.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/preview/RCS/preview.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/preview/RCS/preview.c,v 2.13 90/07/16 15:47:08 gk5g Exp $"; #endif /* lint */ /* *************** *** 660,670 **** char buf[512]; n = self->PageTable[page].FileOffset; if((fo = popen(PrintCommand,"w")) == NULL){ ! printf(stderr,"Can't execute %s",PrintCommand); exit(1); } if((fi = fopen(self->DviFileName,"r")) == NULL){ ! printf(stderr,"Can't open %s",self->DviFileName); exit(1); } diff = self->PageTable[1].FileOffset; --- 660,670 ---- char buf[512]; n = self->PageTable[page].FileOffset; if((fo = popen(PrintCommand,"w")) == NULL){ ! fprintf(stderr,"Can't execute %s",PrintCommand); exit(1); } if((fi = fopen(self->DviFileName,"r")) == NULL){ ! fprintf(stderr,"Can't open %s",self->DviFileName); exit(1); } diff = self->PageTable[1].FileOffset; *** atk/raster/Imakefile Wed Nov 22 12:24:45 1989 --- atk/raster/Imakefile.NEW Wed Jun 13 17:01:18 1990 *************** *** 4,7 **** --- 4,11 ---- \* ********************************************************************** */ #define IHaveSubdirs + #ifndef _IBMR2 SUBDIRS = lib convert cmd scan rasters + #else + SUBDIRS = lib convert cmd rasters + #endif /* _IBMR2 */ *** atk/raster/cmd/raster.c Wed Nov 22 12:24:57 1989 --- atk/raster/cmd/raster.c.NEW Thu Apr 26 17:32:40 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/cmd/RCS/raster.c,v 2.9 89/10/02 09:41:14 msp Exp $ */ /* $ACIS:raster.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/cmd/RCS/raster.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/cmd/RCS/raster.c,v 2.9 89/10/02 09:41:14 msp Exp $"; #endif /* lint */ /* raster.c --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/raster.c,v 2.11 90/04/26 17:29:09 gk5g Exp $ */ /* $ACIS:raster.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/raster.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/raster.c,v 2.11 90/04/26 17:29:09 gk5g Exp $"; #endif /* lint */ /* raster.c *************** *** 29,34 **** --- 29,35 ---- #include #include + #include #include #include #include *************** *** 43,48 **** --- 44,50 ---- register struct raster *self; { self->pix = NULL; + self->readOnly = FALSE; rectangle_EmptyRect(&self->subraster); /* default scaling is one half screen size */ self->xScale = (raster_UNITSCALE * 12 + 12) / 25; *************** *** 382,388 **** It clears out the options and subraster in the rasterimage */ raster_Resize(self, rasterimage_GetWidth(pix), rasterimage_GetHeight(pix)); ! rasterimage_NotifyObservers(pix, rasterimage_DATACHANGED); return retval; } --- 384,390 ---- It clears out the options and subraster in the rasterimage */ raster_Resize(self, rasterimage_GetWidth(pix), rasterimage_GetHeight(pix)); ! rasterimage_SetRO(self->pix,self->readOnly); rasterimage_NotifyObservers(pix, rasterimage_DATACHANGED); return retval; } *************** *** 476,482 **** (via the magic of ungetc) */ while ( ! feof(file) && getc(file) != '\\') {}; /* scan for \enddata */ fgets(s, MAXFILELINE + 2, file); /* discard \enddata{...} */ ! rasterimage_NotifyObservers(pix, rasterimage_DATACHANGED); return retval; } --- 478,484 ---- (via the magic of ungetc) */ while ( ! feof(file) && getc(file) != '\\') {}; /* scan for \enddata */ fgets(s, MAXFILELINE + 2, file); /* discard \enddata{...} */ ! rasterimage_SetRO(pix,self->readOnly); rasterimage_NotifyObservers(pix, rasterimage_DATACHANGED); return retval; } *************** *** 614,621 **** /* XXX BUG BUG the raster_Read will Defile(self) */ ! rasterimage_SetRO(pix, TRUE); ! /* XXX enter rasterimage into namespace with objectid as key unless the option bit says it is singly referenced */ --- 616,622 ---- /* XXX BUG BUG the raster_Read will Defile(self) */ ! rasterimage_SetRO(pix,self->readOnly); /* XXX enter rasterimage into namespace with objectid as key unless the option bit says it is singly referenced */ *************** *** 678,683 **** --- 679,685 ---- self->options = options; self->xScale = xscale; self->yScale = yscale; + rasterimage_SetRO(pix,self->readOnly); } return result; } *************** *** 750,756 **** (via the magic of ungetc) */ while ( ! feof(file) && getc(file) != '\\') {}; /* scan for \enddata */ fgets(s, MAXFILELINE + 2, file); /* discard \enddata{...} */ ! rasterimage_NotifyObservers(pix, rasterimage_DATACHANGED); return result; } --- 752,770 ---- (via the magic of ungetc) */ while ( ! feof(file) && getc(file) != '\\') {}; /* scan for \enddata */ fgets(s, MAXFILELINE + 2, file); /* discard \enddata{...} */ ! rasterimage_SetRO(pix,self->readOnly); rasterimage_NotifyObservers(pix, rasterimage_DATACHANGED); return result; + } + + void + raster__SetAttributes(self, attributes) + struct raster *self; + struct attributes *attributes; + { + while(attributes) { + if(!strcmp(attributes->key, "readonly")) + self->readOnly = attributes->value.integer; + attributes = attributes->next; + } } *** atk/raster/cmd/raster.ch Wed Nov 22 12:25:14 1989 --- atk/raster/cmd/raster.ch.NEW Thu Apr 26 17:32:41 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/cmd/RCS/raster.ch,v 2.7 89/09/12 12:47:45 msp Exp $ */ /* $ACIS:raster.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/cmd/RCS/raster.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidraster_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/cmd/RCS/raster.ch,v 2.7 89/09/12 12:47:45 msp Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/raster.ch,v 2.8 90/04/26 16:52:04 gk5g Exp $ */ /* $ACIS:raster.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/raster.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidraster_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/raster.ch,v 2.8 90/04/26 16:52:04 gk5g Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* *************** *** 38,43 **** --- 38,44 ---- Write(/* struct raster *self, */ FILE *file, long id, long level) returns long; ObservedChanged(/* struct raster *self, */ struct rasterimage *pix, long status); + SetAttributes( struct attributes *attributes ); methods: *************** *** 73,79 **** data: struct rasterimage *pix; /* the image storage */ ! struct rectangle subraster; /* choose subraster of rasterimage */ /* the raster may be a negative image or reflection of the bits in the --- 74,80 ---- data: struct rasterimage *pix; /* the image storage */ ! boolean readOnly; struct rectangle subraster; /* choose subraster of rasterimage */ /* the raster may be a negative image or reflection of the bits in the *** atk/raster/cmd/rasterv.c Wed Apr 11 14:20:19 1990 --- atk/raster/cmd/rasterv.c.NEW Thu Apr 26 17:32:44 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/rasterv.c,v 2.19 90/04/03 11:49:07 gk5g Exp $ */ /* $ACIS:rasterv.c 1.3$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/rasterv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/rasterv.c,v 2.19 90/04/03 11:49:07 gk5g Exp $"; #endif /* lint */ /* Added X Window Dump read/write menu opitons -paul@athena.mit.edu 3/7/90 */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/rasterv.c,v 2.20 90/04/26 17:29:33 gk5g Exp $ */ /* $ACIS:rasterv.c 1.3$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/rasterv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/cmd/RCS/rasterv.c,v 2.20 90/04/26 17:29:33 gk5g Exp $"; #endif /* lint */ /* Added X Window Dump read/write menu opitons -paul@athena.mit.edu 3/7/90 */ *************** *** 1490,1505 **** } } - void ExitTouchUp(self) - struct rasterview *self; - { - struct raster *ras = (struct raster *)rasterview_GetDataObject(self); - struct rasterimage *pix; - if (ras == NULL || (pix = raster_GetPix(ras)) == NULL) return; - /* Notify Observers here instead of each pixel changed level. */ - rasterimage_NotifyObservers(pix, raster_BITSCHANGED); - } - void RegionSelectCommand(self, rock) struct rasterview *self; long rock; --- 1490,1495 ---- *************** *** 1510,1518 **** message_DisplayString(self, 0, "Region Select Mode"); rasterview_RetractCursor(self, self->Cursor[self->Mode]); ! if (TouchUp(self)) ! ExitTouchUp(self); ! else if (Pan(self)) DrawPanHighlight(self, graphic_WHITE); self->Mode = RegionSelectMode; --- 1500,1506 ---- message_DisplayString(self, 0, "Region Select Mode"); rasterview_RetractCursor(self, self->Cursor[self->Mode]); ! if (Pan(self)) DrawPanHighlight(self, graphic_WHITE); self->Mode = RegionSelectMode; *************** *** 1560,1567 **** if (RegionSelect(self)) ViewHideHighlight(self); - if (TouchUp(self)) - ExitTouchUp(self); self->Mode = PanMode; DrawPanHighlight(self, graphic_BLACK); --- 1548,1553 ---- *************** *** 1691,1699 **** {} /* skip to end of header */ readresult = raster_Read(ras, f, 0); } fclose(f); ! if (! self->embedded) ! buffer_SetFilename(frame_GetBuffer(frame_Enumerate(FindFrameHelp, rasterview_GetIM(self))), filename); /* XXX need to inform observers of scroll change. */ if (readresult == dataobject_NOREADERROR) { --- 1677,1688 ---- {} /* skip to end of header */ readresult = raster_Read(ras, f, 0); } fclose(f); ! if (! self->embedded) { ! struct buffer *buffer = NULL; + buffer = frame_GetBuffer(frame_Enumerate(FindFrameHelp, rasterview_GetIM(self))); + if(buffer) buffer_SetFilename(buffer, filename); + } /* XXX need to inform observers of scroll change. */ if (readresult == dataobject_NOREADERROR) { *************** *** 1854,1862 **** } fclose(f); ! if (! self->embedded && inputop) ! buffer_SetFilename(frame_GetBuffer(frame_Enumerate(FindFrameHelp, rasterview_GetIM(self))), filename); if ( ! inputop) { char msg[MAXPATHLEN + 50]; sprintf(msg, "Wrote file %s", filename); --- 1843,1854 ---- } fclose(f); ! if (! self->embedded && inputop) { ! struct buffer *buffer = NULL; + buffer = frame_GetBuffer(frame_Enumerate(FindFrameHelp, rasterview_GetIM(self))); + if(buffer) buffer_SetFilename(buffer, filename); + } if ( ! inputop) { char msg[MAXPATHLEN + 50]; sprintf(msg, "Wrote file %s", filename); *************** *** 1903,1909 **** if (FullySelected(self) && Uncropped(self)) { raster_Read(ras, pasteFile, 1); self->ViewSelection = self->DesiredSelection = ras->subraster; ! CenterViewSelection(self); } else raster_ReadSubRaster(ras, pasteFile, &self->DesiredSelection); } --- 1895,1901 ---- if (FullySelected(self) && Uncropped(self)) { raster_Read(ras, pasteFile, 1); self->ViewSelection = self->DesiredSelection = ras->subraster; ! } else raster_ReadSubRaster(ras, pasteFile, &self->DesiredSelection); } *************** *** 2245,2251 **** struct rasterimage *pix = NULL; long menumask; ! if ( ! self->HasInputFocus) return; if (ras != NULL) pix = raster_GetPix(ras); /* choose 'menumask' value */ --- 2237,2243 ---- struct rasterimage *pix = NULL; long menumask; ! if ( !self->HasInputFocus ) return; if (ras != NULL) pix = raster_GetPix(ras); /* choose 'menumask' value */ *************** *** 2252,2258 **** if (pix == NULL) menumask = menuNoPix; else { ! if (rasterimage_GetRO(pix)) { /* XXX probably should have a readonly bit in the raster data object */ menumask = menuReadOnly; if (self->InMessages) { --- 2244,2250 ---- if (pix == NULL) menumask = menuNoPix; else { ! if (ras->readOnly) { /* XXX probably should have a readonly bit in the raster data object */ menumask = menuReadOnly; if (self->InMessages) { *************** *** 2261,2271 **** menumask |= menuPan | menuCenter; else if (Pan(self)) menumask |= menuSelect; - if (Uncropped(self) && FullySelected(self)) /* Selection and subraster are both full image, include Negative */ menumask |= menuNegative; } } else { menumask = menuReadWrite; --- 2253,2268 ---- menumask |= menuPan | menuCenter; else if (Pan(self)) menumask |= menuSelect; if (Uncropped(self) && FullySelected(self)) /* Selection and subraster are both full image, include Negative */ menumask |= menuNegative; } + else { + if (RegionSelect(self)) + menumask |= menuPan | menuCenter; + else if (Pan(self)) + menumask |= menuSelect; + } } else { menumask = menuReadWrite; *************** *** 2276,2291 **** menumask |= menuSelect | menuPan; else if (Pan(self)) menumask |= menuSelect | menuTouchUp; - if (FullSize(self)) menumask |= menuScale; - if (Uncropped(self) && FullySelected(self)) { /* Selection and subraster are both full image, include Rotate */ /* Until this work in Zoomed mode: */ if (FullSize(self)) { menumask |= menuRotate; } - if (! self->Shrunken && MatExtendPossible(self)) menumask |= menuExtend; } --- 2273,2285 ---- *************** *** 2825,2831 **** switch (status) { case 0: ! self->UpdateWanted = FALSE; /* What the hell! */ self->needsFullUpdate = TRUE; rasterview_WantUpdate(self,self); break; --- 2819,2825 ---- switch (status) { case 0: ! self->UpdateWanted = FALSE; self->needsFullUpdate = TRUE; rasterview_WantUpdate(self,self); break; *************** *** 2849,2858 **** ReflectChangesInExpansion(self, C); } else rectangle_UnionRect(&self->PixChanged, &self->PixChanged, ! rasterimage_GetChanged(pix)); } DEBUG(("PixChanged: (%d,%d,%d,%d)\n", self->PixChanged.left, self->PixChanged.top, self->PixChanged.width, self->PixChanged.height)); rasterview_WantUpdate(self, self); break; case raster_BOUNDSCHANGED: --- 2843,2855 ---- ReflectChangesInExpansion(self, C); } else rectangle_UnionRect(&self->PixChanged, &self->PixChanged, ! rasterimage_GetChanged(pix)); ! } DEBUG(("PixChanged: (%d,%d,%d,%d)\n", self->PixChanged.left, self->PixChanged.top, self->PixChanged.width, self->PixChanged.height)); + if(rectangle_IsEmptyRect(&self->PixChanged)) + self->PixChanged = self->ViewSelection; rasterview_WantUpdate(self, self); break; case raster_BOUNDSCHANGED: *************** *** 2877,2882 **** --- 2874,2884 ---- if ( ! self->embedded) rasterview_WantUpdate(self, self); break; + default: + self->UpdateWanted = FALSE; + self->needsFullUpdate = TRUE; + rasterview_WantUpdate(self,self); + break; } if (dobj == ras) raster_SetModified(ras); /* this is a bogus place for this XXX */ *************** *** 2966,2972 **** if (strcmp(nm, "messages") == 0) { self->InMessages = TRUE; if (pix != NULL) ! rasterimage_SetRO(pix, TRUE); break; } } DEBUG(("Done Checking parents.\n")); } if (type == view_FullRedraw) { --- 2968,2974 ---- if (strcmp(nm, "messages") == 0) { self->InMessages = TRUE; if (pix != NULL) ! rasterimage_SetRO(pix, ras->readOnly = TRUE); break; } } DEBUG(("Done Checking parents.\n")); } if (type == view_FullRedraw) { *** atk/raster/lib/heximage.c Wed Nov 22 12:26:06 1989 --- atk/raster/lib/heximage.c.NEW Wed Jun 13 17:01:46 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/heximage.c,v 2.8 89/04/22 19:53:24 pgc Exp $ */ /* $ACIS:heximage.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/heximage.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/heximage.c,v 2.8 89/04/22 19:53:24 pgc Exp $"; #endif /* lint */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/heximage.c,v 2.8 89/04/22 19:53:24 pgc Exp $ */ /* $ACIS:heximage.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/heximage.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/heximage.c,v 2.8 89/04/22 19:53:24 pgc Exp $"; #endif /* lint */ *** atk/raster/lib/heximage.ch Wed Nov 22 12:26:00 1989 --- atk/raster/lib/heximage.ch.NEW Wed Jun 13 17:01:52 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/heximage.ch,v 2.4 89/02/17 17:01:53 ghoti Exp Locker: pgc $ */ /* $ACIS:heximage.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/heximage.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidheximage_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/heximage.ch,v 2.4 89/02/17 17:01:53 ghoti Exp Locker: pgc $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/heximage.ch,v 2.4 89/02/17 17:01:53 ghoti Exp $ */ /* $ACIS:heximage.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/heximage.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidheximage_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/heximage.ch,v 2.4 89/02/17 17:01:53 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ *** atk/raster/lib/oldrf.c Wed Nov 22 12:26:15 1989 --- atk/raster/lib/oldrf.c.NEW Wed Jun 13 17:01:54 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/oldrf.c,v 2.5 89/02/17 17:01:57 ghoti Exp Locker: pgc $ */ /* $ACIS:oldrf.c 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/oldrf.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/oldrf.c,v 2.5 89/02/17 17:01:57 ghoti Exp Locker: pgc $"; #endif /* lint */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/oldrf.c,v 2.5 89/02/17 17:01:57 ghoti Exp $ */ /* $ACIS:oldrf.c 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/oldrf.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/oldrf.c,v 2.5 89/02/17 17:01:57 ghoti Exp $"; #endif /* lint */ *** atk/raster/lib/oldrf.ch Wed Nov 22 12:26:05 1989 --- atk/raster/lib/oldrf.ch.NEW Wed Jun 13 17:01:56 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/oldrf.ch,v 2.5 89/02/23 09:32:37 ghoti Exp Locker: pgc $ */ /* $ACIS:oldrf.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/oldrf.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidoldRF_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/oldrf.ch,v 2.5 89/02/23 09:32:37 ghoti Exp Locker: pgc $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/oldrf.ch,v 2.5 89/02/23 09:32:37 ghoti Exp $ */ /* $ACIS:oldrf.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/oldrf.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidoldRF_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/oldrf.ch,v 2.5 89/02/23 09:32:37 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ *** atk/raster/lib/paint.c Wed Nov 22 12:26:11 1989 --- atk/raster/lib/paint.c.NEW Wed Jun 13 17:01:57 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/paint.c,v 2.6 89/02/23 14:34:09 ghoti Exp Locker: pgc $ */ /* $ACIS:paint.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/paint.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/paint.c,v 2.6 89/02/23 14:34:09 ghoti Exp Locker: pgc $"; #endif /* lint */ /* paint.c --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/paint.c,v 2.6 89/02/23 14:34:09 ghoti Exp $ */ /* $ACIS:paint.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/paint.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/paint.c,v 2.6 89/02/23 14:34:09 ghoti Exp $"; #endif /* lint */ /* paint.c *** atk/raster/lib/paint.ch Wed Nov 22 12:26:08 1989 --- atk/raster/lib/paint.ch.NEW Wed Jun 13 17:01:59 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/paint.ch,v 2.4 89/02/17 17:02:10 ghoti Exp Locker: pgc $ */ /* $ACIS:paint.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/paint.ch,v $ */ #ifndef lint ! static char *rcsidpaint_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/paint.ch,v 2.4 89/02/17 17:02:10 ghoti Exp Locker: pgc $"; #endif /* lint */ /* paint.H --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/paint.ch,v 2.4 89/02/17 17:02:10 ghoti Exp $ */ /* $ACIS:paint.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/paint.ch,v $ */ #ifndef lint ! static char *rcsidpaint_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/paint.ch,v 2.4 89/02/17 17:02:10 ghoti Exp $"; #endif /* lint */ /* paint.H *** atk/raster/lib/plusspc.c Wed Nov 22 12:26:12 1989 --- atk/raster/lib/plusspc.c.NEW Wed Jun 13 17:02:01 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/plusspc.c,v 2.5 89/02/23 14:34:18 ghoti Exp Locker: pgc $ */ /* $ACIS:plusspc.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/plusspc.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/plusspc.c,v 2.5 89/02/23 14:34:18 ghoti Exp Locker: pgc $"; #endif /* lint */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/plusspc.c,v 2.5 89/02/23 14:34:18 ghoti Exp $ */ /* $ACIS:plusspc.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/plusspc.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/plusspc.c,v 2.5 89/02/23 14:34:18 ghoti Exp $"; #endif /* lint */ *** atk/raster/lib/plusspc.ch Wed Nov 22 12:26:10 1989 --- atk/raster/lib/plusspc.ch.NEW Wed Jun 13 17:02:03 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/plusspc.ch,v 2.5 89/02/23 09:32:44 ghoti Exp Locker: pgc $ */ /* $ACIS:plusspc.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/plusspc.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidplusspace_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/plusspc.ch,v 2.5 89/02/23 09:32:44 ghoti Exp Locker: pgc $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/plusspc.ch,v 2.5 89/02/23 09:32:44 ghoti Exp $ */ /* $ACIS:plusspc.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/plusspc.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidplusspace_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/plusspc.ch,v 2.5 89/02/23 09:32:44 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ *** atk/raster/lib/rasterio.c Wed Nov 22 12:26:17 1989 --- atk/raster/lib/rasterio.c.NEW Wed Jun 13 17:02:05 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/rasterio.c,v 2.6 89/04/20 19:48:37 pgc Exp $ */ /* $ACIS:bitz.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/rasterio.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/rasterio.c,v 2.6 89/04/20 19:48:37 pgc Exp $"; #endif /* lint */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/rasterio.c,v 2.6 89/04/20 19:48:37 pgc Exp $ */ /* $ACIS:bitz.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/rasterio.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/rasterio.c,v 2.6 89/04/20 19:48:37 pgc Exp $"; #endif /* lint */ *** atk/raster/lib/rasterio.ch Wed Nov 22 12:26:14 1989 --- atk/raster/lib/rasterio.ch.NEW Wed Jun 13 17:02:07 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/rasterio.ch,v 2.4 89/02/17 17:02:28 ghoti Exp Locker: pgc $ */ /* $ACIS:rasterio.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/rasterio.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidrasterio_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/rasterio.ch,v 2.4 89/02/17 17:02:28 ghoti Exp Locker: pgc $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/rasterio.ch,v 2.4 89/02/17 17:02:28 ghoti Exp $ */ /* $ACIS:rasterio.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/rasterio.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidrasterio_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/rasterio.ch,v 2.4 89/02/17 17:02:28 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* *** atk/raster/lib/rastfile.h Wed Nov 22 12:26:18 1989 --- atk/raster/lib/rastfile.h.NEW Wed Jun 13 17:02:08 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/rastfile.h,v 2.4 89/02/17 17:02:31 ghoti Exp Locker: pgc $ */ /* $ACIS:rastfile.h 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/rastfile.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidRasterFile = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/raster/lib/RCS/rastfile.h,v 2.4 89/02/17 17:02:31 ghoti Exp Locker: pgc $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* *********************************************** *\ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/rastfile.h,v 2.4 89/02/17 17:02:31 ghoti Exp $ */ /* $ACIS:rastfile.h 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/rastfile.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidRasterFile = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/raster/lib/RCS/rastfile.h,v 2.4 89/02/17 17:02:31 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* *********************************************** *\ *** atk/rofftext/roffstyl.h Wed Nov 22 12:27:41 1989 --- atk/rofftext/roffstyl.h.NEW Mon Jun 18 23:54:03 1990 *************** *** 2,16 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/roffstyl.h,v 2.5 89/02/17 17:05:32 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/roffstyl.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/roffstyl.h,v 2.5 89/02/17 17:05:32 ghoti Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* style code for be2roff */ InitText(); --- 2,17 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/roffstyl.h,v 2.6 90/06/06 14:48:01 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/roffstyl.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/roffstyl.h,v 2.6 90/06/06 14:48:01 gk5g Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ + #ifndef _AIX /* style code for be2roff */ InitText(); *************** *** 19,21 **** --- 20,23 ---- ChangeStyle(); CloseStyle(); CloseAllStyles(); + #endif /* _AIX */ *** atk/rofftext/rofftext.h Wed Nov 22 12:27:51 1989 --- atk/rofftext/rofftext.h.NEW Mon Jun 18 23:54:07 1990 *************** *** 2,15 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/rofftext.h,v 2.3 89/02/17 17:05:58 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/rofftext.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/rofftext.h,v 2.3 89/02/17 17:05:58 ghoti Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* type checking */ SetIndent(/*struct rofftext *self,int u*/); SetTempIndent(/*struct rofftext *self,int u*/); --- 2,16 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/rofftext.h,v 2.4 90/06/06 14:48:15 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/rofftext.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/rofftext.h,v 2.4 90/06/06 14:48:15 gk5g Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ + #ifndef _AIX /* type checking */ SetIndent(/*struct rofftext *self,int u*/); SetTempIndent(/*struct rofftext *self,int u*/); *************** *** 37,39 **** --- 38,41 ---- get(/*struct rofftext *self, Trickle t*/); DoCommand(/*struct rofftext *self, Trickle t, char *name, boolean br*/); Scan(/*struct rofftext *self, Trickle t, char *cmd*/); + #endif /* _AIX */ *** atk/rofftext/roffutil.h Wed Nov 22 12:27:56 1989 --- atk/rofftext/roffutil.h.NEW Mon Jun 18 23:54:10 1990 *************** *** 2,15 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/roffutil.h,v 2.3 89/02/17 17:06:13 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/roffutil.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/rofftext/RCS/roffutil.h,v 2.3 89/02/17 17:06:13 ghoti Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* utilities for rofftext */ Add2Buf(); BUF NewBuf(); --- 2,16 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/roffutil.h,v 2.4 90/06/06 14:48:27 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/roffutil.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/rofftext/RCS/roffutil.h,v 2.4 90/06/06 14:48:27 gk5g Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ + #ifndef _AIX /* utilities for rofftext */ Add2Buf(); BUF NewBuf(); *************** *** 21,23 **** --- 22,25 ---- DestroyDiversion(); PushDiversion(); PopDiversion(); + #endif /* _AIX */ *** atk/support/Imakefile Wed Nov 22 12:28:45 1989 --- atk/support/Imakefile.NEW Thu Jul 12 14:00:39 1990 *************** *** 3,8 **** --- 3,9 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ DOBJS = buffer.do \ + bufferlist.do \ complete.do \ dict.do \ envrment.do \ *************** *** 17,22 **** --- 18,24 ---- viewref.do IHFILES = buffer.ih \ + bufferlist.ih \ complete.ih \ dict.ih \ envrment.ih \ *************** *** 31,36 **** --- 33,39 ---- viewref.ih OBJS = buffer.o \ + bufferlist.o \ complete.o \ dict.o \ envrment.o \ *** atk/support/buffer.c Wed Apr 11 14:20:55 1990 --- atk/support/buffer.c.NEW Thu Jul 12 14:00:41 1990 *************** *** 4,15 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/buffer.c,v 2.20 90/03/07 11:37:41 gk5g Exp Locker: gk5g $ */ /* $ACIS:buffer.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/buffer.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/buffer.c,v 2.20 90/03/07 11:37:41 gk5g Exp Locker: gk5g $"; #endif /* lint */ /* Fixed problem in buffer_WriteToFile 3/2/90 cch@mtgzx.att.com. --- 4,15 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/buffer.c,v 2.22 90/07/12 13:34:52 ajp Exp $ */ /* $ACIS:buffer.c 1.6$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/buffer.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/buffer.c,v 2.22 90/07/12 13:34:52 ajp Exp $"; #endif /* lint */ /* Fixed problem in buffer_WriteToFile 3/2/90 cch@mtgzx.att.com. *************** *** 41,62 **** #include #include #include #include #ifndef MAXPATHLEN #include #endif - #define DEFAULTOBJECT "text" - extern int errno; ! static struct buffer *allBuffers; static char *backupExtension = NULL; static char *checkpointExtension = ".CKP"; static char *checkpointDirectory = NULL; static boolean overwriteFiles = TRUE; - static char defaultobjectname[64] = DEFAULTOBJECT; ! static void SetCheckpointFilename(self) struct buffer *self; { /* For this routine to work properly buffer names must be unique. */ --- 41,61 ---- #include #include #include + #include + #include #ifndef MAXPATHLEN #include #endif extern int errno; ! static struct bufferlist *allBuffers; static char *backupExtension = NULL; static char *checkpointExtension = ".CKP"; static char *checkpointDirectory = NULL; static boolean overwriteFiles = TRUE; ! void buffer__SetCheckpointFilename(self) struct buffer *self; { /* For this routine to work properly buffer names must be unique. */ *************** *** 107,115 **** self->scratch = FALSE; self->readOnly = FALSE; self->madeBackup = FALSE; - self->next = allBuffers; self->viewname = NULL; ! allBuffers = self; return TRUE; } --- 106,113 ---- self->scratch = FALSE; self->readOnly = FALSE; self->madeBackup = FALSE; self->viewname = NULL; ! bufferlist_AddBuffer(allBuffers, self); return TRUE; } *************** *** 119,125 **** struct buffer *self; { int counter; - struct buffer *traverse, **previous; for (counter = 0; counter < self->viewsUsed; counter++) { if (self->viewList[counter].bufferApplicationView != NULL) --- 117,122 ---- *************** *** 127,133 **** view_Destroy(self->viewList[counter].bufferView); } free(self->viewList); ! if (self->destroyData) dataobject_Destroy(self->bufferData); if (self->filename != NULL) free(self->filename); --- 124,130 ---- view_Destroy(self->viewList[counter].bufferView); } free(self->viewList); ! if (self->destroyData && self->bufferData) dataobject_Destroy(self->bufferData); if (self->filename != NULL) free(self->filename); *************** *** 137,201 **** free(self->bufferName); if(self->viewname != NULL) free(self->viewname); ! previous = &allBuffers; ! for (traverse = allBuffers; traverse != NULL && traverse != self; traverse = traverse->next) ! previous = &traverse->next; ! if (traverse != NULL) /* Bad error if this is false. */ ! *previous = traverse->next; } struct buffer *buffer__Create(classID, bufferName, filename, objectName, data) struct classheader *classID; char *bufferName, *filename, *objectName; struct dataobject *data; { ! char realName[MAXPATHLEN]; ! struct buffer *thisBuffer; ! ! /* Probably ought to insure that buffer names are unique. */ ! thisBuffer = buffer_New(); ! ! thisBuffer->bufferName = malloc(strlen(bufferName) + 1); ! strcpy(thisBuffer->bufferName, bufferName); ! ! if (filename != NULL) { ! int len; ! filetype_CanonicalizeFilename(realName, filename, sizeof(realName) - 1); ! filename = realName; ! len = strlen(filename); ! thisBuffer->filename = malloc(len + 1); ! strcpy(thisBuffer->filename, filename); ! } ! ! SetCheckpointFilename(thisBuffer); ! ! if (data == NULL) { ! struct attributes *attributes = NULL; ! ! if (objectName == NULL) { ! if (filename != NULL) ! objectName = filetype_Lookup(NULL, filename, NULL, &attributes); ! else ! objectName = filetype_Lookup(NULL, bufferName, NULL, &attributes); ! if (objectName == NULL) ! objectName = defaultobjectname; ! } ! if ((data = (struct dataobject *) class_NewObject(objectName)) == NULL) { ! buffer_Destroy(thisBuffer); ! return NULL; ! } ! if (attributes != NULL) ! dataobject_SetAttributes(data, attributes); ! thisBuffer->destroyData = TRUE; ! } ! else ! thisBuffer->destroyData = FALSE; ! ! thisBuffer->bufferData = data; ! thisBuffer->ckpVersion = thisBuffer->writeVersion = dataobject_GetModified(data); ! thisBuffer->lastTouchDate = buffer_GetFileDate(thisBuffer); ! ! return thisBuffer; } struct view *buffer__GetView(self, inputFocus, targetView, viewName) --- 134,149 ---- free(self->bufferName); if(self->viewname != NULL) free(self->viewname); ! bufferlist_RemoveBuffer(allBuffers, self); } + /* Changed bufferlist */ struct buffer *buffer__Create(classID, bufferName, filename, objectName, data) struct classheader *classID; char *bufferName, *filename, *objectName; struct dataobject *data; { ! return bufferlist_CreateBuffer(allBuffers, bufferName, filename, objectName, data); } struct view *buffer__GetView(self, inputFocus, targetView, viewName) *************** *** 262,280 **** return FALSE; } struct buffer *buffer__Enumerate(classID, mapFunction, functionData) struct classheader *classID; boolean (*mapFunction)(); long functionData; { ! struct buffer *traverse, *next; ! ! for (traverse = allBuffers; traverse != NULL; traverse = next) { ! next = traverse->next; /* So mapFunction is allowed to delete the buffer. */ ! if ((*mapFunction)(traverse, functionData)) ! return traverse; ! } ! return NULL; } void buffer__SetData(self, bufferData) --- 210,222 ---- return FALSE; } + /* Changed bufferlist */ struct buffer *buffer__Enumerate(classID, mapFunction, functionData) struct classheader *classID; boolean (*mapFunction)(); long functionData; { ! return bufferlist_Enumerate(allBuffers, mapFunction, functionData); } void buffer__SetData(self, bufferData) *************** *** 317,323 **** len = strlen(filename); self->filename = malloc(len + 1); strcpy(self->filename, filename); ! SetCheckpointFilename(self); self->lastTouchDate = buffer_GetFileDate(self); buffer_NotifyObservers(self, 0);/* Tuck it into slot. */ } --- 259,265 ---- len = strlen(filename); self->filename = malloc(len + 1); strcpy(self->filename, filename); ! buffer_SetCheckpointFilename(self); self->lastTouchDate = buffer_GetFileDate(self); buffer_NotifyObservers(self, 0);/* Tuck it into slot. */ } *************** *** 374,422 **** value = NULL; ! for (counter = 0; counter < self->viewsUsed; counter++) ! if (self->viewList[counter].used && (value = (*mapFunction)(self->viewList[counter].bufferApplicationView, self->viewList[counter].bufferView, ! self->viewList[counter].bufferInputFocus, functionData))) ! break; ! if (counter < self->viewsUsed) ! return value; ! else ! return NULL; } struct buffer *buffer__FindBufferByFile(classID, filename) struct classheader *classID; char *filename; { ! ! char realName[MAXPATHLEN]; ! struct buffer *traverse; ! ! filetype_CanonicalizeFilename(realName, filename, sizeof(realName) - 1); ! filename = realName; ! for (traverse = allBuffers; traverse != NULL && ((traverse->filename == NULL) || (strcmp(traverse->filename, filename) != 0)); traverse = traverse->next) ! ; ! return traverse; } struct buffer *buffer__FindBufferByData(classID, bufferData) struct classheader *classID; struct dataobject *bufferData; { ! struct buffer *traverse; ! ! for (traverse = allBuffers; traverse != NULL && (traverse->bufferData != bufferData); traverse = traverse->next); ! return traverse; } struct buffer *buffer__FindBufferByName(classID, bufferName) struct classheader *classID; char *bufferName; { ! struct buffer *traverse; ! for (traverse = allBuffers; traverse != NULL && strcmp(traverse->bufferName, bufferName); traverse = traverse->next) ! ; ! return traverse; } /* This routine is supposed to be used for re-reading a file into a buffer. --- 316,358 ---- value = NULL; ! for (counter = 0; counter < self->viewsUsed; counter++) { ! if (self->viewList[counter].used) { ! if ((value = (*mapFunction)(self->viewList[counter].bufferApplicationView, ! self->viewList[counter].bufferView, ! self->viewList[counter].bufferInputFocus, ! functionData)) != NULL) { ! return value; ! } ! } ! } ! ! return NULL; } + /* Changed bufferlist */ struct buffer *buffer__FindBufferByFile(classID, filename) struct classheader *classID; char *filename; { ! return bufferlist_FindBufferByFile(allBuffers, filename); } + /* Changed Bufferlist */ struct buffer *buffer__FindBufferByData(classID, bufferData) struct classheader *classID; struct dataobject *bufferData; { ! return bufferlist_FindBufferByData(allBuffers, bufferData); } + /* Changed Bufferlist */ + struct buffer *buffer__FindBufferByName(classID, bufferName) struct classheader *classID; char *bufferName; { ! return bufferlist_FindBufferByName(allBuffers, bufferName); } /* This routine is supposed to be used for re-reading a file into a buffer. *************** *** 485,495 **** return returnCode; } ! /* The interaction between this routine and buffer_Create is treacherous. ! * I have buffer_Create allocate the data object so buffer_Destroy will ! * deallocate it. Yet this routine must look up the class of the data ! * object because it has the FILE *. Perhaps this is all bogus... ! */ struct buffer *buffer__GetBufferOnFile(classID, filename, flags) struct classheader *classID; --- 421,427 ---- return returnCode; } ! /* Changed bufferlist */ struct buffer *buffer__GetBufferOnFile(classID, filename, flags) struct classheader *classID; *************** *** 496,661 **** char *filename; long flags; { ! char realName[MAXPATHLEN]; ! struct buffer *thisBuffer; ! struct stat statBuf; ! boolean fileExists, fileIsDir; ! int objectID; ! long version; ! boolean readOnly; ! char bufferName[100], *objectName; ! FILE *thisFile; ! struct attributes *attributes, *tempAttribute, readOnlyAttribute; ! ! filetype_CanonicalizeFilename(realName, filename, sizeof (realName) - 1); ! filename = realName; ! ! fileExists = fileIsDir = FALSE; ! if (stat(filename, &statBuf) >= 0) { ! fileExists = TRUE; ! if ((statBuf.st_mode & S_IFMT) == S_IFDIR) ! fileIsDir = TRUE; ! } ! ! if (fileIsDir) { ! struct attributes attr; ! struct dataobject *dobj; ! /* Force filename to end in '/' before visiting directories. */ ! if (filename[strlen(filename) - 1] != '/') { ! errno = EISDIR; ! return NULL; ! } ! objectName = "dired"; ! strcpy(bufferName, "Directory-Edit-1"); ! /* Use existing dired buffer and dired if exists */ ! thisBuffer = buffer_FindBufferByName(bufferName); ! if (thisBuffer) { ! /* In case it exists by accident */ ! dobj = thisBuffer->bufferData; ! if (strcmp(class_GetTypeName(dobj), objectName) != 0) ! thisBuffer = NULL; ! } else { ! /* Create a new dired and dired buffer */ ! if ((flags & buffer_MustExist) && ! fileExists) ! return NULL; ! dobj = (struct dataobject *) class_NewObject(objectName); ! if (dobj == NULL) ! thisBuffer = NULL; ! else ! thisBuffer = buffer_Create("Directory-Edit-1", NULL, NULL, dobj); ! } ! if (thisBuffer == NULL) { ! errno = EISDIR; ! return NULL; ! } ! /* Tell it which dir to use */ ! attr.key = "dir"; ! attr.value.string = filename; ! attr.next = NULL; ! dataobject_SetAttributes(dobj, &attr); ! if (thisBuffer->filename != NULL) { ! free(thisBuffer->filename); ! thisBuffer->filename = NULL; ! } ! } else { ! ! if ((flags & buffer_MustExist) && ! fileExists) ! return NULL; ! ! /* Try to find existing buffer. */ ! ! if ((flags & buffer_ForceNew) == 0) ! if ((thisBuffer = buffer_FindBufferByFile(filename)) != NULL) ! return thisBuffer; ! ! if ((thisFile = fopen(filename, "r")) == NULL) { ! if (access(filename, W_OK) < 0) { ! extern char *rindex(); ! char *slash; ! if (errno != ENOENT) ! return NULL; ! slash = rindex(filename, '/'); ! if (slash == NULL) ! return NULL; ! *slash = '\0'; ! if (access(filename, W_OK) < 0) { ! *slash = '/'; return NULL; ! } ! *slash = '/'; ! } ! } ! ! objectName = filetype_Lookup(thisFile, filename, &objectID, &attributes); ! ! readOnly = FALSE; ! for (tempAttribute = attributes; tempAttribute != NULL; tempAttribute = tempAttribute->next) ! if (strcmp(tempAttribute->key, "readonly") == 0) ! readOnly = tempAttribute->value.integer; ! ! if (!readOnly && (flags & buffer_ReadOnly)) { ! readOnlyAttribute.next = attributes; ! readOnlyAttribute.key = "readonly"; ! readOnlyAttribute.value.integer = TRUE; ! attributes = &readOnlyAttribute; ! readOnly = TRUE; ! } ! ! buffer_GuessBufferName(filename, bufferName, sizeof(bufferName)); ! thisBuffer = buffer_Create(bufferName, filename, objectName, NULL); ! ! if (thisBuffer == NULL) { ! errno = 0; /* Don't signal Unix error unless one occurred */ ! return NULL; ! } ! ! dataobject_SetAttributes(buffer_GetData(thisBuffer), attributes); ! if (thisFile != NULL) { ! dataobject_Read(buffer_GetData(thisBuffer), thisFile, objectID); ! fclose(thisFile); ! /* thisBuffer->lastTouchDate = (long) time(0); */ ! thisBuffer->lastTouchDate = (long) statBuf.st_mtime; ! } ! ! thisBuffer->readOnly = readOnly; ! } ! ! version = dataobject_GetModified(buffer_GetData(thisBuffer)); ! buffer_SetCkpClock(thisBuffer, 0); ! buffer_SetCkpVersion(thisBuffer, version); ! buffer_SetWriteVersion(thisBuffer, version); ! return thisBuffer; } void buffer__GuessBufferName (classID, filename, bufferName, nameSize) struct classheader *classID; char *filename, *bufferName; int nameSize; { ! ! register int uniquefier, nameLength; ! char *slash; ! extern char *rindex(); ! ! slash = rindex(filename, '/'); ! if (slash != NULL) ! strncpy(bufferName, ++slash, nameSize - 2); /* Save room for uniquefier. */ ! else ! strncpy(bufferName, filename, nameSize - 2); /* Save room for uniquefier. */ ! ! /* Find out if buffer exists. */ ! if (buffer_FindBufferByName(bufferName) == NULL) ! return; ! /* Otherwise we must uniquify it. ! * This is a bug, it may overflow the string buffer we were given... ! */ ! nameLength = strlen(bufferName); ! for (uniquefier = 1; uniquefier < 100; uniquefier++) { ! sprintf(bufferName + nameLength, "-%d", uniquefier); ! if (buffer_FindBufferByName(bufferName) == NULL) ! return; ! } ! *bufferName = '\0'; /* Make sure we don't return a non-unique buffername. */ ! return; } int buffer__WriteToFile(self, filename, flags) --- 428,444 ---- char *filename; long flags; { ! return bufferlist_GetBufferOnFile(allBuffers, filename, flags); } + /* Changed bufferlist */ + void buffer__GuessBufferName (classID, filename, bufferName, nameSize) struct classheader *classID; char *filename, *bufferName; int nameSize; { ! bufferlist_GuessBufferName(allBuffers, filename, bufferName, nameSize); } int buffer__WriteToFile(self, filename, flags) *************** *** 848,865 **** overwriteFiles = environ_GetProfileSwitch("OverwriteFiles", overwriteFiles); return TRUE; } void buffer__SetDefaultObject(classID, objectname) struct classheader *classID; char *objectname; { ! if (objectname != NULL) ! strncpy(defaultobjectname,objectname, sizeof(defaultobjectname)); ! else ! strncpy(defaultobjectname, DEFAULTOBJECT, sizeof(defaultobjectname)); } void buffer__SetDefaultViewname(self,name) struct buffer *self; char *name; --- 631,649 ---- overwriteFiles = environ_GetProfileSwitch("OverwriteFiles", overwriteFiles); + allBuffers = bufferlist_New(); return TRUE; } + /* Changed BufferList */ + void buffer__SetDefaultObject(classID, objectname) struct classheader *classID; char *objectname; { ! bufferlist_SetDefaultObject(allBuffers, objectname); } + void buffer__SetDefaultViewname(self,name) struct buffer *self; char *name; *************** *** 872,875 **** --- 656,686 ---- if(self->viewname == NULL) return; strcpy(self->viewname, name); } + } + + void buffer__SetDestroyData(self, destroy) + struct buffer *self; + boolean destroy; + { + self->destroyData = destroy; + } + + void buffer__SetLastTouchDate(self, dateStamp) + struct buffer *self; + long dateStamp; + { + self->lastTouchDate = dateStamp;; + } + + void buffer__SetReadOnly(self, readOnly) + struct buffer *self; + boolean readOnly; + { + self->readOnly = readOnly; + } + + struct bufferlist *buffer__GetGlobalBufferList(classID) + struct classheader *classID; + { + return allBuffers; } *** atk/support/buffer.ch Wed Nov 22 12:28:48 1989 --- atk/support/buffer.ch.NEW Thu Jul 12 14:00:43 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/support/RCS/buffer.ch,v 2.7 89/06/07 12:20:58 tpn Exp $ */ /* $ACIS:buffer.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/support/RCS/buffer.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidbuffer_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/support/RCS/buffer.ch,v 2.7 89/06/07 12:20:58 tpn Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ struct bufferContents { /* May not have to be in this file. */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/buffer.ch,v 2.8 90/07/12 13:35:25 ajp Exp $ */ /* $ACIS:buffer.ch 1.4$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/buffer.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidbuffer_H = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/buffer.ch,v 2.8 90/07/12 13:35:25 ajp Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ struct bufferContents { /* May not have to be in this file. */ *************** *** 44,50 **** WriteToFile(char *filename, long flags) returns int; /* Disk file date may differ from GetTouchDate if file is modified externally. */ GetFileDate() returns long; ! SetDefaultViewname(char *name); macromethods: GetData() ((self)->bufferData) GetName() ((self)->bufferName) --- 44,54 ---- WriteToFile(char *filename, long flags) returns int; /* Disk file date may differ from GetTouchDate if file is modified externally. */ GetFileDate() returns long; ! SetDefaultViewname(char *name); ! SetDestroyData(boolean destroy); ! SetReadOnly(boolean readOnly); ! SetLastTouchDate(long dataStamp); ! SetCheckpointFilename(); macromethods: GetData() ((self)->bufferData) GetName() ((self)->bufferName) *************** *** 62,68 **** GetDefaultViewname() ((self)->viewname) classprocedures: Enumerate(procedure mapFunction, long functionData) returns struct buffer *; ! Create(char *bufferName, char *fileName, char *objetName, struct dataobject *data) returns struct buffer *; InitializeClass() returns boolean; /* Lookup functions */ --- 66,75 ---- GetDefaultViewname() ((self)->viewname) classprocedures: Enumerate(procedure mapFunction, long functionData) returns struct buffer *; ! Create(char *bufferName, char *fileName, char *objetName, struct dataobject *data) returns struct buffer *; ! ! GetGlobalBufferList() returns struct bufferlist *; ! InitializeClass() returns boolean; /* Lookup functions */ *************** *** 78,84 **** SetDefaultObject(char *objectname); data: - struct buffer *next; /* Used to chain buffers. */ struct dataobject *bufferData; /* The dataobject associated with this buffer. Can't be NULL.*/ char *bufferName; /* This buffers name. Must be filled in. */ char *filename; /* The filename this dataobject is saved in. May be NULL. */ --- 85,90 ---- *** atk/support/envrment.c Wed Nov 22 12:28:24 1989 --- atk/support/envrment.c.NEW Thu Jul 12 13:02:52 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/support/RCS/envrment.c,v 2.10 89/11/12 14:23:11 zs01 Exp $ */ /* $ACIS:envrment.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/support/RCS/envrment.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/support/RCS/envrment.c,v 2.10 89/11/12 14:23:11 zs01 Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/envrment.c,v 2.11 90/07/09 15:39:57 rr2b Exp $ */ /* $ACIS:envrment.c 1.4$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/envrment.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/envrment.c,v 2.11 90/07/09 15:39:57 rr2b Exp $"; #endif /* lint */ #include *************** *** 232,260 **** struct removestruct *data; { long pos; - if (self->type != data->type && data->type != environment_Any) return 0; ! pos = environment_Eval(self); if (pos < data->pos + data->length && pos + self->header.nestedmark.length > data->pos) { data->anyChange = TRUE; if (pos < data->pos) { /* Delete end of the environment */ ! struct environment *endPart = environment_Split(self, data->pos - pos); ! /* Delete child environments if necessary. */ ! if (data->deleteall && endPart->header.nestedmark.children != NULL) ! tree23int_Enumerate(self->header.nestedmark.children, AlterEnvironmentSize, data); ! environment_Delete(endPart); } else if (pos + self->header.nestedmark.length > data->pos + data->length) { /* Delete beginning of the environment */ ! /* Is this split position corect? */ ! environment_Split(self, data->pos - pos + data->length); ! if (data->deleteall && self->header.nestedmark.children != NULL) tree23int_Enumerate(self->header.nestedmark.children, AlterEnvironmentSize, data); --- 232,261 ---- struct removestruct *data; { long pos; if (self->type != data->type && data->type != environment_Any) return 0; ! pos = environment_Eval(self); if (pos < data->pos + data->length && pos + self->header.nestedmark.length > data->pos) { data->anyChange = TRUE; if (pos < data->pos) { /* Delete end of the environment */ + struct environment *endPart; ! if(data->pos + data->length < pos + self->header.nestedmark.length) environment_Split(self, data->pos - pos + data->length); ! endPart=environment_Split(self,data->pos-pos); ! /* Delete child environments if necessary. */ ! if (data->deleteall && endPart->header.nestedmark.children != NULL) ! tree23int_Enumerate(endPart->header.nestedmark.children, AlterEnvironmentSize, data); ! environment_Delete(endPart); } else if (pos + self->header.nestedmark.length > data->pos + data->length) { + struct environment *env; /* Delete beginning of the environment */ ! /* Is this split position corect? */ ! (void)environment_Split(self, data->pos - pos + data->length); if (data->deleteall && self->header.nestedmark.children != NULL) tree23int_Enumerate(self->header.nestedmark.children, AlterEnvironmentSize, data); *************** *** 283,315 **** struct environment *env, *bottomenv; struct removestruct procdata; long envpos; ! beginenv = environment_GetInnerMost(self, pos); endenv = environment_GetInnerMost(self, pos + length - 1); ! parentenv = environment_GetCommonParent(beginenv, endenv); ! for (envpos = environment_Eval(parentenv); (pos == envpos || pos + length == envpos + parentenv->header.nestedmark.length); envpos = environment_Eval(parentenv)) { if (parentenv->header.nestedmark.parent == NULL) break; parentenv = (struct environment *) parentenv->header.nestedmark.parent; if (! deleteall) break; } ! if (parentenv->header.nestedmark.children != NULL) { procdata.pos = pos; procdata.length = length; procdata.deleteall = deleteall; procdata.type = type; - procdata.anyChange = FALSE; tree23int_Enumerate(parentenv->header.nestedmark.children, AlterEnvironmentSize, &procdata); ! if(procdata.anyChange) return TRUE; } /* no child envs were modified, so apply to parent instead */ if(parentenv->header.nestedmark.parent==NULL) ! return FALSE; /* can't plainer top environment */ bottomenv=parentenv; --- 284,321 ---- struct environment *env, *bottomenv; struct removestruct procdata; long envpos; ! ! procdata.anyChange = FALSE; beginenv = environment_GetInnerMost(self, pos); endenv = environment_GetInnerMost(self, pos + length - 1); ! parentenv = environment_GetCommonParent(beginenv, endenv); ! for (envpos = environment_Eval(parentenv); (pos == envpos || pos + length == envpos + parentenv->header.nestedmark.length); envpos = environment_Eval(parentenv)) { if (parentenv->header.nestedmark.parent == NULL) break; parentenv = (struct environment *) parentenv->header.nestedmark.parent; if (! deleteall) break; } ! if (parentenv->header.nestedmark.children != NULL) { procdata.pos = pos; procdata.length = length; procdata.deleteall = deleteall; procdata.type = type; tree23int_Enumerate(parentenv->header.nestedmark.children, AlterEnvironmentSize, &procdata); ! if(procdata.anyChange && !deleteall) return TRUE; + if(parentenv->header.nestedmark.parent!=NULL) { + AlterEnvironmentSize(parentenv,&procdata); + if(procdata.anyChange && !deleteall) + return TRUE; + } } /* no child envs were modified, so apply to parent instead */ if(parentenv->header.nestedmark.parent==NULL) ! return procdata.anyChange; /* can't plainer top environment */ bottomenv=parentenv; *************** *** 318,339 **** parentenv=(struct environment *)parentenv->header.nestedmark.parent; }while(parentenv->header.nestedmark.parent!=NULL && deleteall); - #if 0 - (void)environment_Split(env,pos-environment_Eval(env)+length); ! while(bottomenv!=parentenv){ ! environment_SetLength(bottomenv,environment_GetLength(bottomenv)-length); ! bottomenv=(struct environment *)bottomenv->header.nestedmark.parent; ! } ! #else ! procdata.pos = pos - environment_Eval(env); procdata.length = length; procdata.deleteall = deleteall; procdata.type = type; AlterEnvironmentSize(env, &procdata); - #endif ! return FALSE; } void environment__Dump(self, level) --- 324,337 ---- parentenv=(struct environment *)parentenv->header.nestedmark.parent; }while(parentenv->header.nestedmark.parent!=NULL && deleteall); ! procdata.pos = pos; procdata.length = length; procdata.deleteall = deleteall; procdata.type = type; AlterEnvironmentSize(env, &procdata); ! return procdata.anyChange; } void environment__Dump(self, level) *** atk/support/print.c Wed Jan 17 16:38:47 1990 --- atk/support/print.c.NEW Wed Jun 13 17:02:45 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/support/RCS/print.c,v 2.19 89/11/17 10:58:49 tpn Exp $ */ /* $ACIS:print.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/support/RCS/print.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/support/RCS/print.c,v 2.19 89/11/17 10:58:49 tpn Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/print.c,v 2.22 90/06/06 13:47:53 ajp Exp $ */ /* $ACIS:print.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/print.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/print.c,v 2.22 90/06/06 13:47:53 ajp Exp $"; #endif /* lint */ #include *************** *** 54,60 **** #define print_PRINTERTYPE "psc" #endif #else /* CMU_ENV */ ! #ifdef IBM032_ENV #ifndef print_FORMATCOMMAND #define print_FORMATCOMMAND "cat /tmp/%s.n | /usr/ibm/eqn | /usr/ibm/troff -T3812 -t |" /* overridden by the profile 'formatcommand' entry */ #endif --- 54,60 ---- #define print_PRINTERTYPE "psc" #endif #else /* CMU_ENV */ ! #if 0 /*IBM032_ENV*/ #ifndef print_FORMATCOMMAND #define print_FORMATCOMMAND "cat /tmp/%s.n | /usr/ibm/eqn | /usr/ibm/troff -T3812 -t |" /* overridden by the profile 'formatcommand' entry */ #endif *************** *** 133,142 **** #ifndef DIVERTPRINTTROFF #define DIVERTPRINTTROFF " 2>&1 | sort -f | indexpro | troff -ms -T$PRINTERTYPE" #endif ! #ifdef hp9000s300 print_sigAlrm() { } #endif /* hp9000s300 */ static insert(src,c) char *src,*c; { /* inserts string src into the begining of string c , assumes enough space */ --- 133,144 ---- #ifndef DIVERTPRINTTROFF #define DIVERTPRINTTROFF " 2>&1 | sort -f | indexpro | troff -ms -T$PRINTERTYPE" #endif ! ! #if defined(hp9000s300) && HP_OS < 70 print_sigAlrm() { } #endif /* hp9000s300 */ + static insert(src,c) char *src,*c; { /* inserts string src into the begining of string c , assumes enough space */ *************** *** 198,204 **** if(print == print_PRINTPOSTSCRIPT && strcmp(pt,"psc") != 0 && strcmp(pt,"postscript") != 0){ return (-1); } ! if (*DocumentName == 0) { sprintf(dname, "%d", getpid()); } else { --- 200,206 ---- if(print == print_PRINTPOSTSCRIPT && strcmp(pt,"psc") != 0 && strcmp(pt,"postscript") != 0){ return (-1); } ! if (DocumentName == NULL || *DocumentName == 0) { sprintf(dname, "%d", getpid()); } else { *************** *** 334,340 **** fflush(stdout); #endif /*DEBUG */ if (dofork) { ! #ifdef hp9000s300 { int status; struct sigvec vecAlrm; --- 336,342 ---- fflush(stdout); #endif /*DEBUG */ if (dofork) { ! #if defined(hp9000s300) && HP_OS < 70 { int status; struct sigvec vecAlrm; *************** *** 371,378 **** for (fd = 3; fd < numfds; fd++) close(fd); #ifdef hpux ! pg = getpid(); ! setpgrp(); #else /* hpux */ setpgrp(0, pg = getpid()); #endif /* hpux */ --- 373,379 ---- for (fd = 3; fd < numfds; fd++) close(fd); #ifdef hpux ! setpgrp2(0, pg = getpid()); #else /* hpux */ setpgrp(0, pg = getpid()); #endif /* hpux */ *************** *** 385,390 **** --- 386,394 ---- } else { FILE *temp,*popen(); + #if SY_AIX221 + signal(SIGCLD, SIG_DFL); + #endif if ((temp = popen(PrintCommand, "w"))) { /* while(( c = getc(temp))!= EOF) putc(c,stdout); */ if (pclose(temp)) { *** atk/support/bufferlist.c Fri Jul 27 13:57:46 1990 --- atk/support/bufferlist.c.NEW Thu Jul 12 14:00:45 1990 *************** *** 0 **** --- 1,406 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/bufferlist.c,v 1.1 90/07/12 13:35:32 ajp Exp $ */ + /* $ACIS:bufferlist.c 1.6$ */ + /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/bufferlist.c,v $ */ + + #ifndef lint + static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/bufferlist.c,v 1.1 90/07/12 13:35:32 ajp Exp $"; + #endif /* lint */ + + #include + #include /* sys/types.h sys/file.h */ + #include + #include + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + #include + + #ifndef MAXPATHLEN + #include + #endif + #define DEFAULTOBJECT "text" + + struct listentry { + struct buffer *buffer; + struct listentry *next; + }; + + extern int errno; + static char defaultobjectname[64] = DEFAULTOBJECT; + + boolean bufferlist__InitializeObject(classID, self) + struct classheader *classID; + struct bufferlist *self; + { + self->head = NULL; + + return TRUE; + } + + void bufferlist__FinalizeObject(classID, self) + struct classheader *classID; + struct bufferlist *self; + { + struct listentry *traverse; + struct listentry *next; + + for (traverse = self->head; traverse != NULL; traverse = next) { + next = traverse->next; + free(traverse); + } + } + void bufferlist__AddBuffer(self, buffer) + struct bufferlist *self; + struct buffer *buffer; + { + struct listentry *newElement; + struct listentry *traverse; + + for (traverse = self->head; traverse != NULL && traverse->buffer != buffer; traverse = traverse->next) { + } + + if (traverse == NULL) { + newElement = (struct listentry *) malloc(sizeof(struct listentry)); + if (newElement != NULL) { + newElement->buffer = buffer; + newElement->next = self->head; + self->head = newElement; + bufferlist_NotifyObservers(self, observable_OBJECTCHANGED); + } + } + } + + void bufferlist__RemoveBuffer(self, buffer) + struct bufferlist *self; + struct buffer *buffer; + { + struct listentry **previous = &self->head; + struct listentry *traverse; + + for (traverse = self->head; traverse != NULL && traverse->buffer != buffer; traverse = traverse->next) { + previous = &traverse->next; + } + + if (traverse != NULL) { /* Bad error if this is false. */ + *previous = traverse->next; + bufferlist_NotifyObservers(self, observable_OBJECTCHANGED); + free(traverse); + } + } + + struct buffer *bufferlist__CreateBuffer(self, bufferName, filename, objectName, data) + struct bufferlist *self; + char *bufferName, *filename, *objectName; + struct dataobject *data; + { + char realName[MAXPATHLEN]; + struct buffer *thisBuffer; + + /* Probably ought to insure that buffer names are unique. */ + thisBuffer = buffer_New(); + + buffer_SetName(thisBuffer, bufferName); + + if (filename != NULL) { + filetype_CanonicalizeFilename(realName, filename, sizeof(realName) - 1); + filename = realName; + + buffer_SetFilename(thisBuffer, filename); + } + + buffer_SetCheckpointFilename(thisBuffer); + + if (data == NULL) { + struct attributes *attributes = NULL; + + if (objectName == NULL) { + if (filename != NULL) + objectName = filetype_Lookup(NULL, filename, NULL, &attributes); + else + objectName = filetype_Lookup(NULL, bufferName, NULL, &attributes); + if (objectName == NULL) + objectName = defaultobjectname; + } + if ((data = (struct dataobject *) class_NewObject(objectName)) == NULL) { + buffer_Destroy(thisBuffer); + return NULL; + } + if (attributes != NULL) { + dataobject_SetAttributes(data, attributes); + } + buffer_SetData(thisBuffer, data); + buffer_SetDestroyData(thisBuffer, TRUE); + } + else { + buffer_SetData(thisBuffer, data); + } + + buffer_SetCkpVersion(thisBuffer, dataobject_GetModified(data)); + buffer_SetWriteVersion(thisBuffer, dataobject_GetModified(data)); + buffer_SetLastTouchDate(thisBuffer, buffer_GetFileDate(thisBuffer)); + + bufferlist_AddBuffer(self, thisBuffer); + + return thisBuffer; + } + + struct buffer *bufferlist__Enumerate(self, mapFunction, functionData) + struct bufferlist *self; + boolean (*mapFunction)(); + long functionData; + { + struct listentry *traverse, *next; + + for (traverse = self->head; traverse != NULL; traverse = next) { + next = traverse->next; /* So mapFunction is allowed to delete the buffer. */ + if ((*mapFunction)(traverse->buffer, functionData)) + return traverse->buffer; + } + return NULL; + } + + struct buffer *bufferlist__FindBufferByFile(self, filename) + struct bufferlist *self; + char *filename; + { + char realName[MAXPATHLEN]; + char *bufferFilename; + struct listentry *traverse; + + filetype_CanonicalizeFilename(realName, filename, sizeof(realName) - 1); + + for (traverse = self->head; traverse != NULL; traverse = traverse->next) { + bufferFilename = buffer_GetFilename(traverse->buffer); + if (bufferFilename != NULL && (strcmp(bufferFilename, realName) == 0)) { + return traverse->buffer; + } + } + + return NULL; + } + + struct buffer *bufferlist__FindBufferByData(self, bufferData) + struct bufferlist *self; + struct dataobject *bufferData; + { + struct listentry *traverse; + + for (traverse = self->head; traverse != NULL; traverse = traverse->next) { + if (buffer_GetData(traverse->buffer) == bufferData) { + return traverse->buffer; + } + } + return NULL; + } + + /* Changed Bufferlist */ + + struct buffer *bufferlist__FindBufferByName(self, name) + struct bufferlist *self; + char *name; + { + char *bufferName; + struct listentry *traverse; + + for (traverse = self->head; traverse != NULL; traverse = traverse->next) { + bufferName = buffer_GetName(traverse->buffer); + if (bufferName != NULL && (strcmp(bufferName, name) == 0)) { + return traverse->buffer; + } + } + + return NULL; + } + + /* The interaction between this routine and buffer_Create is treacherous. + * I have buffer_Create allocate the data object so buffer_Destroy will + * deallocate it. Yet this routine must look up the class of the data + * object because it has the FILE *. Perhaps this is all bogus... + */ + + struct buffer *bufferlist__GetBufferOnFile(self, filename, flags) + struct bufferlist *self; + char *filename; + long flags; + { + char realName[MAXPATHLEN]; + struct buffer *thisBuffer; + struct stat statBuf; + boolean fileExists, fileIsDir; + int objectID; + long version; + boolean readOnly; + char bufferName[100], *objectName; + FILE *thisFile; + struct attributes *attributes, *tempAttribute, readOnlyAttribute; + + filetype_CanonicalizeFilename(realName, filename, sizeof (realName) - 1); + filename = realName; + + fileExists = fileIsDir = FALSE; + if (stat(filename, &statBuf) >= 0) { + fileExists = TRUE; + if ((statBuf.st_mode & S_IFMT) == S_IFDIR) + fileIsDir = TRUE; + } + + if (fileIsDir) { + struct attributes attr; + struct dataobject *dobj; + /* Force filename to end in '/' before visiting directories. */ + if (filename[strlen(filename) - 1] != '/') { + errno = EISDIR; + return NULL; + } + objectName = "dired"; + strcpy(bufferName, "Directory-Edit-1"); + /* Use existing dired buffer and dired if exists */ + thisBuffer = bufferlist_FindBufferByName(self, bufferName); + if (thisBuffer) { + /* In case it exists by accident */ + dobj = buffer_GetData(thisBuffer); + if (strcmp(class_GetTypeName(dobj), objectName) != 0) + thisBuffer = NULL; + } else { + /* Create a new dired and dired buffer */ + if ((flags & buffer_MustExist) && ! fileExists) + return NULL; + dobj = (struct dataobject *) class_NewObject(objectName); + if (dobj == NULL) + thisBuffer = NULL; + else + thisBuffer = bufferlist_CreateBuffer(self, "Directory-Edit-1", NULL, NULL, dobj); + } + if (thisBuffer == NULL) { + errno = EISDIR; + return NULL; + } + /* Tell it which dir to use */ + attr.key = "dir"; + attr.value.string = filename; + attr.next = NULL; + dataobject_SetAttributes(dobj, &attr); + buffer_SetFilename(thisBuffer, NULL); + } else { + + if ((flags & buffer_MustExist) && ! fileExists) + return NULL; + + /* Try to find existing buffer. */ + + if ((flags & buffer_ForceNew) == 0) + if ((thisBuffer = bufferlist_FindBufferByFile(self, filename)) != NULL) + return thisBuffer; + + if ((thisFile = fopen(filename, "r")) == NULL) { + if (access(filename, W_OK) < 0) { + extern char *rindex(); + char *slash; + if (errno != ENOENT) + return NULL; + slash = rindex(filename, '/'); + if (slash == NULL) + return NULL; + *slash = '\0'; + if (access(filename, W_OK) < 0) { + *slash = '/'; return NULL; + } + *slash = '/'; + } + } + + objectName = filetype_Lookup(thisFile, filename, &objectID, &attributes); + + readOnly = FALSE; + for (tempAttribute = attributes; tempAttribute != NULL; tempAttribute = tempAttribute->next) + if (strcmp(tempAttribute->key, "readonly") == 0) + readOnly = tempAttribute->value.integer; + + if (!readOnly && (flags & buffer_ReadOnly)) { + readOnlyAttribute.next = attributes; + readOnlyAttribute.key = "readonly"; + readOnlyAttribute.value.integer = TRUE; + attributes = &readOnlyAttribute; + readOnly = TRUE; + } + + bufferlist_GuessBufferName(self, filename, bufferName, sizeof(bufferName)); + thisBuffer = bufferlist_CreateBuffer(self, bufferName, filename, objectName, NULL); + + if (thisBuffer == NULL) { + errno = 0; /* Don't signal Unix error unless one occurred */ + return NULL; + } + + dataobject_SetAttributes(buffer_GetData(thisBuffer), attributes); + if (thisFile != NULL) { + dataobject_Read(buffer_GetData(thisBuffer), thisFile, objectID); + fclose(thisFile); + buffer_SetLastTouchDate(thisBuffer, (long) statBuf.st_mtime); + } + + buffer_SetReadOnly(thisBuffer, readOnly); + } + + version = dataobject_GetModified(buffer_GetData(thisBuffer)); + buffer_SetCkpClock(thisBuffer, 0); + buffer_SetCkpVersion(thisBuffer, version); + buffer_SetWriteVersion(thisBuffer, version); + return thisBuffer; + } + + void bufferlist__GuessBufferName (self, filename, bufferName, nameSize) + struct bufferlist *self; + char *filename, *bufferName; + int nameSize; + { + + register int uniquefier, nameLength; + char *slash; + extern char *rindex(); + + slash = rindex(filename, '/'); + if (slash != NULL) + strncpy(bufferName, ++slash, nameSize - 2); /* Save room for uniquefier. */ + else + strncpy(bufferName, filename, nameSize - 2); /* Save room for uniquefier. */ + + /* Find out if buffer exists. */ + if (buffer_FindBufferByName(bufferName) == NULL) + return; + /* Otherwise we must uniquify it. + * This is a bug, it may overflow the string buffer we were given... + */ + nameLength = strlen(bufferName); + for (uniquefier = 1; uniquefier < 100; uniquefier++) { + sprintf(bufferName + nameLength, "-%d", uniquefier); + if (buffer_FindBufferByName(bufferName) == NULL) + return; + } + *bufferName = '\0'; /* Make sure we don't return a non-unique buffername. */ + return; + } + + + void bufferlist__SetDefaultObject(self, objectname) + struct bufferlist *self; + char *objectname; + { + if (objectname != NULL) + strncpy(defaultobjectname,objectname, sizeof(defaultobjectname)); + else + strncpy(defaultobjectname, DEFAULTOBJECT, sizeof(defaultobjectname)); + } *** atk/support/bufferlist.ch Fri Jul 27 13:58:01 1990 --- atk/support/bufferlist.ch.NEW Thu Jul 12 14:00:47 1990 *************** *** 0 **** --- 1,35 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/bufferlist.ch,v 1.1 90/07/12 13:36:59 ajp Exp $ */ + /* $ACIS:bufferlist.ch 1.4$ */ + /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/bufferlist.ch,v $ */ + + #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) + static char *rcsidbufferlist_H = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/support/RCS/bufferlist.ch,v 1.1 90/07/12 13:36:59 ajp Exp $"; + #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ + + class bufferlist : observable[observe] { + methods: + AddBuffer(struct buffer *buffer); + RemoveBuffer(struct buffer *buffer); + Enumerate(procedure mapFunction, long functionData) returns struct buffer *; + CreateBuffer(char *bufferName, char *fileName, char *objetName, struct dataobject *data) returns struct buffer *; + + /* Lookup functions */ + FindBufferByName(char *bufferName) returns struct buffer *; + FindBufferByFile(char *filename) returns struct buffer *; + FindBufferByData(struct dataobject *data) returns struct buffer *; + + /* File functions. */ + GetBufferOnFile(char *filename, long flags) returns struct buffer *; + GuessBufferName( char *filename, char *bufferName, int nameSize); + SetDefaultObject(char *objectname); + classprocedures: + FinalizeObject(struct buffer *self); + InitializeObject(struct buffer *self) returns boolean; + data: + struct listentry *head; + }; + *** atk/supportviews/scroll.c Wed Apr 11 14:21:01 1990 --- atk/supportviews/scroll.c.NEW Wed Jun 13 17:02:59 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/scroll.c,v 2.13 90/04/03 11:19:55 gk5g Exp $ */ /* $ACIS:scroll.c 1.4$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/scroll.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/scroll.c,v 2.13 90/04/03 11:19:55 gk5g Exp $"; #endif /* lint */ /* Scrollbar code for be2. */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/scroll.c,v 2.18 90/06/12 09:58:37 ajp Exp $ */ /* $ACIS:scroll.c 1.4$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/scroll.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/scroll.c,v 2.18 90/06/12 09:58:37 ajp Exp $"; #endif /* lint */ /* Scrollbar code for be2. */ *************** *** 33,40 **** #define ENDZONELENGTH 12 #define ENDTOBARSPACE 4 #define BARWIDTH 20 ! #define DOTLEFTEDGE 6 ! #define DOTRIGHTEDGE 12 #define MINDOTLENGTH 6 #define SMALLDIST 5 --- 33,39 ---- #define ENDZONELENGTH 12 #define ENDTOBARSPACE 4 #define BARWIDTH 20 ! #define DOTWIDTH 6 #define MINDOTLENGTH 6 #define SMALLDIST 5 *************** *** 42,51 **** /* The descriptions of the different types of scrollbars */ static int Type[scroll_SIDES] = {scroll_VERT, scroll_VERT, scroll_HORIZ, scroll_HORIZ}, ! LeftChange[scroll_SIDES] = {BARWIDTH, 0, 0, 0}, ! TopChange[scroll_SIDES] = {0, 0, BARWIDTH, 0}, ! WidthChange[scroll_SIDES] = {-BARWIDTH, -BARWIDTH, 0, 0}, ! HeightChange[scroll_SIDES] = {0, 0, -BARWIDTH, -BARWIDTH}; static char *InterfaceName[scroll_TYPES] = {"scroll,vertical", "scroll,horizontal"}; --- 41,50 ---- /* The descriptions of the different types of scrollbars */ static int Type[scroll_SIDES] = {scroll_VERT, scroll_VERT, scroll_HORIZ, scroll_HORIZ}, ! LeftChange[scroll_SIDES] = {1, 0, 0, 0}, ! TopChange[scroll_SIDES] = {0, 0, 1, 0}, ! WidthChange[scroll_SIDES] = {-1, -1, 0, 0}, ! HeightChange[scroll_SIDES] = {0, 0, -1, -1}; static char *InterfaceName[scroll_TYPES] = {"scroll,vertical", "scroll,horizontal"}; *************** *** 87,104 **** #define INTERSECT(top1, bot1, top2, bot2) ((bot1) >= (top2) && (top1) <= (bot2)) - #if 0 - static boolean INTERSECT(top1, bot1, top2, bot2) - long top1, top2, bot2, bot2;{ - /* which ordering of rectangle? */ - if (top1 top2; - else return bot2>top1; - } - #endif /* 0 */ - #if 0 - #define INTERSECT(top1, bot1, top2, bot2) ((bot1) > (top2) && (top1) < (bot2)) - #endif /* 0 */ - /* Variables used by elevator redraw code. Statics instead to parameters for speed. */ static struct { --- 86,91 ---- *************** *** 151,156 **** --- 138,147 ---- self->ideal_location = scroll_LEFT; self->endzone_threshold = 80; self->bar_threshold = 0; + self->endzoneLength = ENDZONELENGTH; + self->endbarSpace = ENDTOBARSPACE; + self->barWidth = BARWIDTH; + self->dotWidth = DOTWIDTH; self->min_elevator[0] = 5; self->min_elevator[1] = 18; self->button = NEITHER; *************** *** 287,292 **** --- 278,355 ---- *with = self->min_elevator[1]; } + void scroll__SetWidth(self, newWidth) + struct scroll *self; + long newWidth; + { + self->barWidth = newWidth; + if (self->dotWidth > newWidth - 2) { + scroll_SetDotWidth(self, newWidth - 2); + } + scroll_WantUpdate(self, self); + } + + long scroll__GetWidth(self) + struct scroll *self; + { + return self->barWidth; + } + + void scroll__SetDotWidth(self, newWidth) + struct scroll *self; + long newWidth; + { + if (newWidth > self->barWidth - 2) { + newWidth = self->barWidth - 2; + } + if (newWidth < 0) { + newWidth = 0; + } + self->dotWidth = newWidth; + scroll_WantUpdate(self, self); + } + + long scroll__GetDotWidth(self) + struct scroll *self; + { + return self->dotWidth; + } + + void scroll__SetEndZoneLength(self, newLength) + struct scroll *self; + long newLength; + { + self->endzoneLength = newLength; + if ((self->endzoneLength + self->endbarSpace) * 2 > self->endzone_threshold) { + self->endzone_threshold = (self->endzoneLength + self->endbarSpace) * 2; + } + scroll_WantUpdate(self, self); + } + + long scroll__GetEndZoneLength(self) + struct scroll *self; + { + return self->endzoneLength; + } + + void scroll__SetEndToBarSpace(self, newSpace) + struct scroll *self; + long newSpace; + { + self->endbarSpace = newSpace; + if ((self->endzoneLength + self->endbarSpace) * 2 > self->endzone_threshold) { + self->endzone_threshold = (self->endzoneLength + self->endbarSpace) * 2; + } + scroll_WantUpdate(self, self); + } + + + long scroll__GetEndToBarSpace(self) + struct scroll *self; + { + return self->endbarSpace; + } + /* Interface routines. */ static void get_interface(self, type) *************** *** 412,421 **** struct scrollbar *bar; long posn; { ! int endzones = bar->endzones ? ENDZONELENGTH : 0; ! long cords = bar_height(self, side) - 2*(endzones + ENDTOBARSPACE) - 1; ! long retval = endzones + ENDTOBARSPACE ! + (posn - bar->total.beg) * cords / (bar->total.end - bar->total.beg); return retval; } --- 475,484 ---- struct scrollbar *bar; long posn; { ! int endzones = bar->endzones ? self->endzoneLength : 0; ! long cords = bar_height(self, side) - 2*(endzones + self->endbarSpace) - 1; ! long retval = endzones + self->endbarSpace ! + ((posn - bar->total.beg) * cords + (bar->total.end - bar->total.beg) / 2) / (bar->total.end - bar->total.beg); return retval; } *************** *** 425,434 **** struct scrollbar *bar; long posn; { ! int endzones = bar->endzones ? ENDZONELENGTH : 0; long height = bar_height(self, side), ! cords = height - 2*(endzones + ENDTOBARSPACE), ! retval = bar->total.beg + (bar->total.end - bar->total.beg) * (posn - ENDTOBARSPACE - endzones) / cords; if (posn < 0 || posn >= height) *status = OUTSIDEBAR; --- 488,497 ---- struct scrollbar *bar; long posn; { ! int endzones = bar->endzones ? self->endzoneLength : 0; long height = bar_height(self, side), ! cords = height - 2*(endzones + self->endbarSpace), ! retval = bar->total.beg + (((bar->total.end - bar->total.beg) * (posn - self->endbarSpace - endzones) + cords / 2) / cords); if (posn < 0 || posn >= height) *status = OUTSIDEBAR; *************** *** 470,479 **** } else { /* Otherwise allocate it's space. */ ! self->left += LeftChange[i]; ! self->top += TopChange[i]; ! self->width += WidthChange[i]; ! self->height += HeightChange[i]; } } --- 533,542 ---- } else { /* Otherwise allocate it's space. */ ! self->left += LeftChange[i] * self->barWidth; ! self->top += TopChange[i] * self->barWidth; ! self->width += WidthChange[i] * self->barWidth; ! self->height += HeightChange[i] * self->barWidth; } } *************** *** 523,530 **** *y1 = from_range_to_bar(self, side, bar, bar->dot.beg); *y2 = from_range_to_bar(self, side, bar, bar->dot.end); ! *x1 = DOTLEFTEDGE; ! *x2 = DOTRIGHTEDGE; if (bar->dot.beg == bar->dot.end) { *y1--; --- 586,593 ---- *y1 = from_range_to_bar(self, side, bar, bar->dot.beg); *y2 = from_range_to_bar(self, side, bar, bar->dot.end); ! *x1 = (self->barWidth - self->dotWidth + 1) / 2; ! *x2 = *x1 + self->dotWidth; if (bar->dot.beg == bar->dot.end) { *y1--; *************** *** 546,552 **** { int min, height = bar_height(self, side), ! extra = ENDTOBARSPACE + (bar->endzones ? ENDZONELENGTH : 0); if (bar->seen.end < bar->seen.beg || bar->seen.end < bar->total.beg || bar->seen.beg > bar->total.end) return 0; --- 609,615 ---- { int min, height = bar_height(self, side), ! extra = self->endbarSpace + (bar->endzones ? self->endzoneLength : 0); if (bar->seen.end < bar->seen.beg || bar->seen.end < bar->total.beg || bar->seen.beg > bar->total.end) return 0; *************** *** 555,561 **** *y2 = from_range_to_bar(self, side, bar, bar->seen.end); *x1 = 0; ! *x2 = BARWIDTH - 2; if (bar->endzones) min = self->min_elevator[1]; --- 618,624 ---- *y2 = from_range_to_bar(self, side, bar, bar->seen.end); *x1 = 0; ! *x2 = self->barWidth - 2; if (bar->endzones) min = self->min_elevator[1]; *************** *** 589,595 **** struct rectangle rect; rectangle_SetRectSize(&rect, MIN(x1,x2), MIN(y1,y2), ABS(x1-x2) + 1, ABS(y1-y2) + 1); ! scroll_SetTransferMode(self, graphic_SOURCE); /* scroll_FillRectSize(self, MIN(x1,x2), MIN(y1,y2), ABS(x1-x2) + 1, ABS(y1-y2) + 1, tile); */ scroll_FillRect(self, &rect, tile); } --- 652,658 ---- struct rectangle rect; rectangle_SetRectSize(&rect, MIN(x1,x2), MIN(y1,y2), ABS(x1-x2) + 1, ABS(y1-y2) + 1); ! scroll_SetTransferMode(self, graphic_COPY); /* scroll_FillRectSize(self, MIN(x1,x2), MIN(y1,y2), ABS(x1-x2) + 1, ABS(y1-y2) + 1, tile); */ scroll_FillRect(self, &rect, tile); } *************** *** 608,614 **** rotate(self, side, x2, y2, &x2, &y2); rectangle(self, x1, y1, x2, y2, self->elevatorFill); ! scroll_SetTransferMode(self, graphic_BLACK); left = (x1elevatorFill); ! scroll_SetTransferMode(self, graphic_COPY); left = (x1endzones) { rotate(self, side, 0, 0, &x1, &y1); ! rotate(self, side, BARWIDTH - 2, ENDZONELENGTH - 1, &x2, &y2); rectangle(self, x1, y1, x2, y2, self->endzoneFill); ! rotate(self, side, 0, height - ENDZONELENGTH, &x1, &y1); ! rotate(self, side, BARWIDTH - 2, height - 1, &x2, &y2); rectangle(self, x1, y1, x2, y2, self->endzoneFill); } ! rotate(self, side, 0, bar->endzones ? ENDZONELENGTH : 0, &x1, &y1); ! rotate(self, side, BARWIDTH - 2, ! height - (bar->endzones ? ENDZONELENGTH : 0) - 1, &x2, &y2); rectangle(self, x1, y1, x2, y2, self->barFill); draw_elevator(self, side); --- 736,762 ---- int height = bar_height(self, side); long x1, y1, x2, y2; ! scroll_SetTransferMode(self, graphic_COPY); /* line between bar and child */ ! rotate(self, side, self->barWidth - 1, 0, &x1, &y1); scroll_MoveTo(self, x1, y1); ! rotate(self, side, self->barWidth - 1, height /*- 1*/, &x1, &y1); scroll_DrawLineTo(self, x1, y1); if (bar->endzones) { rotate(self, side, 0, 0, &x1, &y1); ! rotate(self, side, self->barWidth - 2, self->endzoneLength - 1, &x2, &y2); rectangle(self, x1, y1, x2, y2, self->endzoneFill); ! rotate(self, side, 0, height - self->endzoneLength, &x1, &y1); ! rotate(self, side, self->barWidth - 2, height - 1, &x2, &y2); rectangle(self, x1, y1, x2, y2, self->endzoneFill); } ! rotate(self, side, 0, bar->endzones ? self->endzoneLength : 0, &x1, &y1); ! rotate(self, side, self->barWidth - 2, ! height - (bar->endzones ? self->endzoneLength : 0) - 1, &x2, &y2); rectangle(self, x1, y1, x2, y2, self->barFill); draw_elevator(self, side); *************** *** 791,797 **** rotate(self, side, right, range[i].bot, &lr_x, &lr_y); if (range[i].whitep) { rectangle(self, ul_x, ul_y, lr_x, lr_y, self->elevatorFill); ! scroll_SetTransferMode(self, graphic_BLACK); /* One last pixel hack works for vertical scroll bars but I don't know about horizontal -- these calculations confuse me as to how they work horizontally -- maybe the rotations do work correctly, but it seems strange. */ #if 0 /* Old way that almost works */ --- 854,860 ---- rotate(self, side, right, range[i].bot, &lr_x, &lr_y); if (range[i].whitep) { rectangle(self, ul_x, ul_y, lr_x, lr_y, self->elevatorFill); ! scroll_SetTransferMode(self, graphic_COPY); /* One last pixel hack works for vertical scroll bars but I don't know about horizontal -- these calculations confuse me as to how they work horizontally -- maybe the rotations do work correctly, but it seems strange. */ #if 0 /* Old way that almost works */ *************** *** 874,880 **** } /* end of test for any white part to be drawn */ else { rectangle(self, ul_x, ul_y, lr_x, lr_y, self->barFill); ! scroll_SetTransferMode(self, graphic_BLACK); if (seen_top == range[i].bot) { draw_end_line(self,ll_x,ll_y,lr_x,lr_y); /* scroll_MoveTo(self, ll_x, ll_y); --- 937,943 ---- } /* end of test for any white part to be drawn */ else { rectangle(self, ul_x, ul_y, lr_x, lr_y, self->barFill); ! scroll_SetTransferMode(self, graphic_COPY); if (seen_top == range[i].bot) { draw_end_line(self,ll_x,ll_y,lr_x,lr_y); /* scroll_MoveTo(self, ll_x, ll_y); *************** *** 898,908 **** } ! static void full_update(self, type, left, top, width, height) ! struct scroll *self; ! enum view_UpdateType type; ! long left, top, width, height; { int i; struct rectangle rect, crect, VB; --- 961,971 ---- } ! static void full_update(self, type, left, top, width, height) ! struct scroll *self; ! enum view_UpdateType type; ! long left, top, width, height; { int i; struct rectangle rect, crect, VB; *************** *** 952,967 **** draw_whole_bar(self, i); switch (i) { case scroll__LEFT: ! rectangle_SetRectSize(&rect, 0, self->top, BARWIDTH, self->height); break; case scroll__RIGHT: ! rectangle_SetRectSize(&rect, self->left + self->width, self->top, BARWIDTH, self->height); break; case scroll__TOP: ! rectangle_SetRectSize(&rect, self->left, 0, self->width, BARWIDTH); break; case scroll__BOTTOM: ! rectangle_SetRectSize(&rect, self->left, self->top + self->height, self->width, BARWIDTH); break; } scroll_PostCursor(self, &rect, self->cursor[i]); --- 1015,1030 ---- draw_whole_bar(self, i); switch (i) { case scroll__LEFT: ! rectangle_SetRectSize(&rect, 0, self->top, self->barWidth, self->height); break; case scroll__RIGHT: ! rectangle_SetRectSize(&rect, self->left + self->width, self->top, self->barWidth, self->height); break; case scroll__TOP: ! rectangle_SetRectSize(&rect, self->left, 0, self->width, self->barWidth); break; case scroll__BOTTOM: ! rectangle_SetRectSize(&rect, self->left, self->top + self->height, self->width, self->barWidth); break; } scroll_PostCursor(self, &rect, self->cursor[i]); *************** *** 1090,1155 **** int posn = 0, status, side = 0, length, delta, i, endzones; long coord = 0, temp, y1, y2; struct scrollbar *cur = NULL, *des = NULL; if (action == view_LeftDown || action == view_RightDown) { ! if (self->button != NEITHER) ! return (struct view *)self; /* We already are dealing with the other button. */ ! if (x >= self->left ! && y >= self->top ! && x < self->left + self->width ! && y < self->top + self->height ! && self->child) { ! struct view *retval = view_Hit(self->child, action, x - self->left, y - self->top, num_clicks); ! return retval; ! } ! else if (x < self->left && (self->current.location & scroll_LEFT)) { ! cur = &self->current.bar[Type[side = scroll__LEFT]]; ! posn = from_bar_to_range(self, side, cur, self->hitcoord = (y - self->top), &status); ! } ! else if (x >= self->left + self->width && (self->current.location & scroll_RIGHT)) { ! cur = &self->current.bar[Type[side = scroll__RIGHT]]; ! posn = from_bar_to_range(self, side, cur, self->hitcoord = (y - self->top), &status); ! } ! else if (y < self->top && (self->current.location & scroll_TOP)) { ! cur = &self->current.bar[Type[side = scroll__TOP]]; ! posn = from_bar_to_range(self, side, cur, self->hitcoord = (x - self->left), &status); ! } ! else if (y >= self->top + self->height && (self->current.location & scroll_BOTTOM)) { ! cur = &self->current.bar[Type[side = scroll__BOTTOM]]; ! posn = from_bar_to_range(self, side, cur, self->hitcoord = (x - self->left), &status); ! } ! else ! status = OUTSIDEBAR; ! switch (status) { ! case OUTSIDEBAR: ! self->thumbing = NOPE; ! /* These -1's are dangerous. I am fairly certain they don't get used outside ! * of this routine, and that they are handled properly within it. But you never ! * know... ! */ ! self->side = -1; ! self->button = NEITHER; ! break; ! case INTOPZONE: ! case INBOTZONE: ! self->thumbing = NOPE; ! self->side = -1; ! self->button = NEITHER; ! endzone(self, side, status, action); ! break; ! case INSIDEBAR: ! if (calc_elevator(self, side, cur, &temp, &y1, &temp, &y2) && y1 <= self->hitcoord && self->hitcoord <= y2) ! self->thumbing = MAYBE; ! else ! self->thumbing = NOPE; ! self->side = side; ! if (action == view_LeftDown) ! self->button = LEFT; ! else ! self->button = RIGHT; self->hitposn = posn; if (startScrollTime > 0) { --- 1153,1221 ---- int posn = 0, status, side = 0, length, delta, i, endzones; long coord = 0, temp, y1, y2; struct scrollbar *cur = NULL, *des = NULL; + long logicalTop, logicalHeight, logicalPos; if (action == view_LeftDown || action == view_RightDown) { ! if (self->button != NEITHER) ! return (struct view *)self; /* We already are dealing with the other button. */ ! if (x >= self->left ! && y >= self->top ! && x < self->left + self->width ! && y < self->top + self->height ! && self->child) { ! struct view *retval = view_Hit(self->child, action, x - self->left, y - self->top, num_clicks); ! return retval; ! } ! else if (x < self->left && (self->current.location & scroll_LEFT)) { ! cur = &self->current.bar[Type[side = scroll__LEFT]]; ! posn = from_bar_to_range(self, side, cur, self->hitcoord = (y - self->top), &status); ! } ! else if (x >= self->left + self->width && (self->current.location & scroll_RIGHT)) { ! cur = &self->current.bar[Type[side = scroll__RIGHT]]; ! posn = from_bar_to_range(self, side, cur, self->hitcoord = (y - self->top), &status); ! } ! else if (y < self->top && (self->current.location & scroll_TOP)) { ! cur = &self->current.bar[Type[side = scroll__TOP]]; ! posn = from_bar_to_range(self, side, cur, self->hitcoord = (x - self->left), &status); ! } ! else if (y >= self->top + self->height && (self->current.location & scroll_BOTTOM)) { ! cur = &self->current.bar[Type[side = scroll__BOTTOM]]; ! posn = from_bar_to_range(self, side, cur, self->hitcoord = (x - self->left), &status); ! } ! else ! status = OUTSIDEBAR; ! switch (status) { ! case OUTSIDEBAR: ! self->thumbing = NOPE; ! /* These -1's are dangerous. I am fairly certain they don't get used outside ! * of this routine, and that they are handled properly within it. But you never ! * know... ! */ ! self->side = -1; ! self->button = NEITHER; ! break; ! case INTOPZONE: ! case INBOTZONE: ! self->thumbing = NOPE; ! self->side = -1; ! self->button = NEITHER; ! endzone(self, side, status, action); ! break; ! case INSIDEBAR: ! if (calc_elevator(self, side, cur, &temp, &y1, &temp, &y2) && y1 <= self->hitcoord && self->hitcoord <= y2) { ! self->thumbing = MAYBE; ! self->seenLength = cur->seen.end - cur->seen.beg; ! } ! else ! self->thumbing = NOPE; ! self->side = side; ! if (action == view_LeftDown) ! self->button = LEFT; ! else ! self->button = RIGHT; self->hitposn = posn; if (startScrollTime > 0) { *************** *** 1156,1244 **** self->scrollEvent = im_EnqueueEvent(RepeatScroll, self, event_MSECtoTU(startScrollTime)); } ! break; ! } ! return (struct view *)self; } /* Assure that we have the correct button */ if (((action == view_LeftMovement || action == view_LeftUp) && ((self->button & LEFT) == 0)) || ((action == view_RightMovement || action == view_RightUp) && ((self->button & RIGHT) == 0))) ! return (struct view *)self; if (self->side != -1) { ! cur = &self->current.bar[Type[self->side]]; ! des = &self->desired.bar[Type[self->side]]; ! if (self->side == scroll__LEFT || self->side == scroll__RIGHT) ! coord = y - self->top; ! else ! coord = x - self->left; } if (action == view_LeftMovement || action == view_RightMovement) { ! switch (self->thumbing) { ! case YES: ! endzones = (cur->endzones ? ENDZONELENGTH : 0) + ENDTOBARSPACE; ! if (self->side == scroll__LEFT || self->side == scroll__RIGHT) { ! if (y < self->top + endzones) ! y = self->top + endzones; ! if (y > self->top + self->height - endzones) ! y = self->top + self->height - endzones; ! posn = from_bar_to_range(self, self->side, cur, y - self->top, &status); ! } ! else { ! if (x < self->left + endzones) ! x = self->left + endzones; ! if (x > self->left + self->width - endzones) ! x = self->left + self->width - endzones; ! posn = from_bar_to_range(self, self->side, cur, x - self->left, &status); ! } ! if (status == INSIDEBAR) { ! delta = posn - self->hitposn; ! length = des->seen.end - des->seen.beg; ! des->seen.beg += delta; ! if (des->seen.beg < des->total.beg) { ! des->seen.beg = des->total.beg; ! des->seen.end = MIN(des->total.end, des->seen.beg + length); ! } ! else if (des->seen.beg + length - 1 > des->total.end) { ! des->seen.beg = MAX(des->total.end - length + 1, des->total.beg); ! des->seen.end = des->total.end; ! } ! else ! des->seen.end = des->seen.beg + length; ! ! for (i = 0; i < scroll_SIDES; i++) { ! if ((self->current.location & (1<side]) { ! move_elevator(self, i); ! if (thumbScroll && self->button == LEFT) { ! set_frame(self, self->side, des->seen.beg, 0); } } } ! *cur = *des; ! self->hitposn = posn; ! } ! break; ! case MAYBE: ! if (ABS(coord - self->hitcoord) > SMALLDIST) { ! self->thumbing = YES; ! if (self->scrollEvent != NULL) { ! event_Cancel(self->scrollEvent); ! self->scrollEvent = NULL; } - cursor_SetStandard(self->cursor[self->side], ThumbIcon); - im_SetWindowCursor(self->header.view.imPtr, self->cursor[self->side]); } break; - case NOPE: if (adjustScroll) { self->hitcoord = coord; } ! break; ! } ! return (struct view *)self; } /* The action must be an up transition to get to here. */ --- 1222,1360 ---- self->scrollEvent = im_EnqueueEvent(RepeatScroll, self, event_MSECtoTU(startScrollTime)); } ! break; ! } ! return (struct view *)self; } /* Assure that we have the correct button */ if (((action == view_LeftMovement || action == view_LeftUp) && ((self->button & LEFT) == 0)) || ((action == view_RightMovement || action == view_RightUp) && ((self->button & RIGHT) == 0))) ! return (struct view *)self; if (self->side != -1) { ! cur = &self->current.bar[Type[self->side]]; ! des = &self->desired.bar[Type[self->side]]; ! if (self->side == scroll__LEFT || self->side == scroll__RIGHT) { ! logicalTop = self->top; ! logicalHeight = self->height; ! logicalPos = y; ! } ! else { ! logicalTop = self->top; ! logicalHeight = self->height; ! logicalPos = x; ! } ! coord = logicalPos - logicalTop; } if (action == view_LeftMovement || action == view_RightMovement) { ! endzones = (cur->endzones ? self->endzoneLength : 0) + self->endbarSpace; ! switch (self->thumbing) { ! long newPos, x1, y1, x2, y2; ! ! case MAYBE: ! if (ABS(coord - self->hitcoord) <= SMALLDIST) { ! break; ! } ! ! self->hitposn = self->current.bar[Type[self->side]].seen.beg; ! ! self->thumbing = YES; ! if (self->scrollEvent != NULL) { ! event_Cancel(self->scrollEvent); ! self->scrollEvent = NULL; ! } ! cursor_SetStandard(self->cursor[self->side], ThumbIcon); ! im_SetWindowCursor(self->header.view.imPtr, self->cursor[self->side]); ! ! /* Fall through into the yes clause */ ! ! case YES: ! if (coord == self->hitcoord) { ! /* ! No movemove in the cursor - handles bottom of the ! screen which for some reason the following code ! doesn't get correct ! */ ! break; ! } ! ! if (coord < self->hitcoord) { ! if (self->hitposn == 0) { ! /* ! The elevator is at the top of the bar and we want to ! reset the hitcoordinate. ! */ ! ! if (coord < logicalTop + endzones) { ! self->hitcoord = logicalTop + endzones; ! } ! else { ! self->hitcoord = coord; ! } ! break; ! } ! else if (logicalPos > (logicalTop + logicalHeight - endzones)) { ! /* ! We are moving back up from below the scroll bar ! Do not start moving backwards until we are back in ! the scroll bar area ! */ ! ! self->hitcoord = coord; ! break; ! } ! } ! ! newPos = from_range_to_bar(self, self->side, cur, cur->seen.beg) + coord - self->hitcoord; ! ! if (newPos < logicalTop + endzones) ! newPos = logicalTop + endzones; ! if (newPos > logicalTop + logicalHeight - endzones) ! newPos = logicalTop + logicalHeight - endzones; ! posn = from_bar_to_range(self, self->side, cur, newPos, &status); ! ! if (status == INSIDEBAR) { ! delta = posn - self->hitposn; ! if (delta != 0) { ! des->seen.beg += delta; ! if (des->seen.beg < des->total.beg) { ! des->seen.beg = des->total.beg; ! des->seen.end = MIN(des->total.end, des->seen.beg + self->seenLength); ! } ! else if (des->seen.beg > des->total.end) { ! des->seen.beg = des->total.end; ! des->seen.end = des->total.end; ! } ! else ! des->seen.end = MIN(des->total.end, des->seen.beg + self->seenLength); ! ! ! for (i = 0; i < scroll_SIDES; i++) { ! if ((self->current.location & (1<side]) { ! move_elevator(self, i); ! if (thumbScroll && self->button == LEFT) { ! set_frame(self, self->side, des->seen.beg, 0); ! } } } + *cur = *des; + self->hitposn = posn; + self->hitcoord = coord; } ! else if (self->hitposn == 0 && coord < self->hitcoord) { ! self->hitcoord = coord; } } break; case NOPE: if (adjustScroll) { self->hitcoord = coord; } ! break; ! } ! return (struct view *)self; } /* The action must be an up transition to get to here. */ *************** *** 1247,1289 **** event_Cancel(self->scrollEvent); self->scrollEvent = NULL; } if (self->thumbing != NOPE) { ! cursor_SetStandard(self->cursor[self->side], CursorIcon[Type[self->side]]); ! im_SetWindowCursor(self->header.view.imPtr, NULL); ! if (ABS(coord - self->hitcoord) > SMALLDIST) { ! posn = from_bar_to_range(self, self->side, cur, coord, &status); ! if (status == INSIDEBAR) { ! delta = posn - self->hitposn; ! length = des->seen.end - des->seen.beg; ! des->seen.beg += delta; ! if (des->seen.beg < des->total.beg) ! des->seen.beg = des->total.beg; ! else if (des->seen.beg + length - 1 > des->total.end) ! des->seen.beg = MAX(des->total.end - length + 1, des->total.beg); ! } ! set_frame(self, self->side, des->seen.beg, 0); ! scroll_WantUpdate(self, self); ! self->button = NEITHER; ! self->thumbing = NOPE; ! return (struct view *)self; ! } } - self->thumbing = NULL; ! if (adjustScroll) { ! self->hitcoord = coord; } - if (self->button == LEFT) - set_frame(self, self->side, what_is_at(self, self->side, self->hitcoord), 0); - else if (self->button == RIGHT) - set_frame(self, self->side, cur->seen.beg, self->hitcoord); - self->button = NEITHER; return (struct view *)self; } --- 1363,1407 ---- event_Cancel(self->scrollEvent); self->scrollEvent = NULL; } + if (self->thumbing != NOPE) { ! cursor_SetStandard(self->cursor[self->side], CursorIcon[Type[self->side]]); ! im_SetWindowCursor(self->header.view.imPtr, NULL); ! if (ABS(coord - self->hitcoord) > SMALLDIST || (self->thumbing == YES && (self->button == RIGHT || ! thumbScroll))) { ! long newPos = from_range_to_bar(self, self->side, cur, cur->seen.beg) + coord - self->hitcoord; ! posn = from_bar_to_range(self, self->side, cur, newPos, &status); ! if (status == INSIDEBAR) { ! delta = posn - self->hitposn; ! des->seen.beg += delta; ! if (des->seen.beg < des->total.beg) ! des->seen.beg = des->total.beg; ! else if (des->seen.beg > des->total.end) { ! des->seen.beg = des->total.end; ! } ! } ! set_frame(self, self->side, des->seen.beg, 0); ! scroll_WantUpdate(self, self); ! self->thumbing = YES; ! } } ! if (self->thumbing != YES) { ! if (adjustScroll) { ! self->hitcoord = coord; ! } ! ! if (self->button == LEFT) ! set_frame(self, self->side, what_is_at(self, self->side, self->hitcoord), 0); ! else if (self->button == RIGHT) ! set_frame(self, self->side, cur->seen.beg, self->hitcoord); } self->button = NEITHER; + self->thumbing = NOPE; return (struct view *)self; } *** atk/supportviews/scroll.ch Wed Nov 22 12:29:51 1989 --- atk/supportviews/scroll.ch.NEW Thu May 10 16:30:10 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/supportviews/RCS/scroll.ch,v 2.9 89/08/02 16:59:19 mss Exp $ */ /* $ACIS:scroll.ch 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/supportviews/RCS/scroll.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidscroll_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/supportviews/RCS/scroll.ch,v 2.9 89/08/02 16:59:19 mss Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/scroll.ch,v 2.10 90/05/09 14:35:31 ajp Exp $ */ /* $ACIS:scroll.ch 1.2$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/scroll.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidscroll_H = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/supportviews/RCS/scroll.ch,v 2.10 90/05/09 14:35:31 ajp Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ *************** *** 81,86 **** --- 81,95 ---- SetParameters(long endzone, long bar, int without, int with); GetParameters(long *endzone, long *bar, int *without, int *with); + SetWidth(long newWidth); + GetWidth() returns long; + SetDotWidth(long newWidth); + GetDotWidth() returns long; + SetEndZoneLength(long newHeight); + GetEndZoneLength() returns long; + SetEndToBarSpace(long space); + GetEndToBarSpace() returns long; + /* The ``child'' is the view directly under the scrollbars, while the ``scrollee'' is the view being scrolled. Normally, both of these are the same, and set with the SetView method. SetChild and SetScrollee can be used to change them individually. */ SetView(struct view *view); SetChild(struct view *child); *************** *** 112,117 **** --- 121,131 ---- short bar_threshold; /* if height < this val, bar disapears. */ short min_elevator[2]; /* min size for elevator w/o and w/ endzones. */ + short endzoneLength; /* length of the endzone */ + short endbarSpace; /* space between endzeone and rest of scroll bar */ + short barWidth; /* Width of the scroll bar */ + short dotWidth; /* Width of Dot indicator */ + char pending_update; /* TRUE iff we have an update that is pending */ char ideal_location; /* The ideal location(s) for the bars */ char thumbing; *************** *** 121,126 **** --- 135,141 ---- short side; int hitcoord; int hitposn; + long seenLength; /* Used for thumbing to get handle end of the scroll bar */ struct cursor *cursor[scroll_SIDES]; *** atk/table/funs.c Wed Nov 22 12:31:32 1989 --- atk/table/funs.c.NEW Thu Jul 12 13:03:08 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/funs.c,v 1.5 89/11/13 08:06:09 jhh Exp $ */ /* $ACIS:funs.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/funs.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/funs.c,v 1.5 89/11/13 08:06:09 jhh Exp $"; #endif /* funs.c - function evaluation for table */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/funs.c,v 1.6 90/06/27 10:49:51 rr2b Exp $ */ /* $ACIS:funs.c 1.3$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/funs.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/funs.c,v 1.6 90/06/27 10:49:51 rr2b Exp $"; #endif /* funs.c - function evaluation for table */ *************** *** 15,20 **** --- 15,21 ---- /* * %%%% the need to undefine _C_func appears to be a bug in AIX...pgc */ + #include /* sys/time.h */ #if SY_AIX221 #ifdef _C_func #undef _C_func *************** *** 21,27 **** #endif /* ifdef _C_func */ #endif /* if SY_AIX221 */ #include - #include /* sys/time.h */ #ifdef hpux #define random rand #endif /* hpux */ --- 22,27 ---- *** atk/table/menu.c Wed Nov 22 12:31:09 1989 --- atk/table/menu.c.NEW Wed Jun 6 15:11:12 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/menu.c,v 1.6 89/10/17 17:24:50 cfe Exp $ */ /* $ACIS:menu.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/menu.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/menu.c,v 1.6 89/10/17 17:24:50 cfe Exp $"; #endif /* lint */ /* menu.c - menu operations for table */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/menu.c,v 1.7 90/06/06 14:45:36 rr2b Exp $ */ /* $ACIS:menu.c 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/menu.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/menu.c,v 1.7 90/06/06 14:45:36 rr2b Exp $"; #endif /* lint */ /* menu.c - menu operations for table */ *************** *** 138,150 **** k_TellUser (V, "Please select region to cut"); else { FILE * writeFile = im_ToCutBuffer(getIM(V)); ! /* write to cutbuffer */ table_WriteASCII(MyTable(V), writeFile, &(V->selection)); im_CloseToCutBuffer(getIM(V), writeFile); - table_Destroy(table_ExtractData(MyTable(V), &(V->selection))); /* delete entire rows */ if (V->selection.LeftCol < 0 && V->selection.RightCol == table_NumberOfColumns(MyTable(V)) - 1) { --- 138,155 ---- k_TellUser (V, "Please select region to cut"); else { FILE * writeFile = im_ToCutBuffer(getIM(V)); ! ! struct table *T; ! /* write to cutbuffer */ table_WriteASCII(MyTable(V), writeFile, &(V->selection)); im_CloseToCutBuffer(getIM(V), writeFile); + T=table_ExtractData(MyTable(V), &(V->selection)); + table_AddObserver(T,V); + table_Destroy(T); + /* delete entire rows */ if (V->selection.LeftCol < 0 && V->selection.RightCol == table_NumberOfColumns(MyTable(V)) - 1) { *************** *** 161,166 **** --- 166,174 ---- remnant.TopRow = n1; remnant.BotRow = n2 - 1; Q = table_ExtractData (MyTable(V), &remnant); + + table_AddObserver(Q,V); + remnant.TopRow -= (n1 - n0); remnant.BotRow -= (n1 - n0); table_InsertData (MyTable(V), Q, &remnant); *************** *** 190,195 **** --- 198,206 ---- remnant.LeftCol = n1; remnant.RightCol = n2 - 1; Q = table_ExtractData (MyTable(V), &remnant); + + table_AddObserver(Q,V); + remnant.LeftCol -= (n1 - n0); remnant.RightCol -= (n1 - n0); table_InsertData (MyTable(V), Q, &remnant); *************** *** 265,271 **** /* paste in data read */ table_InsertData (MyTable(V), S, &(V->selection)); ! table_Destroy (S); } view_WantNewSize(getView(V).parent, &getView(V)); } --- 276,282 ---- /* paste in data read */ table_InsertData (MyTable(V), S, &(V->selection)); ! table_Destroy (S); } view_WantNewSize(getView(V).parent, &getView(V)); } *** atk/table/print.c Wed Apr 11 14:21:04 1990 --- atk/table/print.c.NEW Wed Jun 27 11:10:57 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/print.c,v 1.5 90/03/01 13:12:13 tpn Exp $ */ /* $ACIS:print.c 1.4$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/print.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/print.c,v 1.5 90/03/01 13:12:13 tpn Exp $"; #endif /* lint */ extern char * fcvt(); --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/print.c,v 1.6 90/06/19 16:01:48 jhh Exp $ */ /* $ACIS:print.c 1.4$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/print.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/print.c,v 1.6 90/06/19 16:01:48 jhh Exp $"; #endif /* lint */ extern char * fcvt(); *************** *** 14,19 **** --- 14,20 ---- #include #include + #include #include #define AUXMODULE *************** *** 341,346 **** --- 342,356 ---- register struct table *T = MyTable(V); int r; static int saveno = 30; + + /* set up top-level stuff */ + + if (class_Load("texttroff") == NULL) + printf("Can't load texttroff - document initializtion missing.\n"); + if (toplevel && class_IsLoaded("texttroff")) + texttroff_BeginDoc(f); + + fprintf(f, "\\\"table begins\n"); /* save state in macro 30, 31, ... */ *************** *** 348,367 **** fprintf(f, ".if \\n(.u .fi\n"); /* filling */ fprintf(f, ".if \\n(.j .ad\n"); /* adjusting */ fprintf(f, ".if \\n(.j=0 .na\n"); - fprintf(f, ".ft \\n(.f\n"); /* font */ - fprintf(f, ".ps \\n(.s\n"); /* point size */ - fprintf(f, ".vs \\n(.vu\n"); /* vertical spacing */ - fprintf(f, ".ll \\n(.lu\n"); /* line length */ - fprintf(f, ".in \\n(.iu\n"); /* indentation */ fprintf(f, "..\n"); /* set up my state */ - if (toplevel) { - fprintf(f, ".ft HR\n"); /* set my font */ - fprintf(f, ".ps 10\n"); /* 10 point */ - fprintf(f, ".vs 12p\n"); /* 12 point vertical spacing */ - } fprintf(f, ".nf\n"); /* no filling */ fprintf(f, ".br\n"); fprintf(f, ".nr 31 \\w'0123456789.jJ'\n"); --- 358,367 ---- *************** *** 369,377 **** /* save line bounds in macro 40, 41, ... */ ! fprintf(f, ".de %d\n", saveno+9); /* stack line bounds in macro */ ! fprintf(f, ".ll \\n(.lu\n"); /* line length */ ! fprintf(f, ".in \\n(.iu\n"); /* indentation */ fprintf(f, "..\n"); /* format the table a row at a time */ --- 369,379 ---- /* save line bounds in macro 40, 41, ... */ ! fprintf(f, ".de %d\n", saveno+9); /* stack line bounds in macro */ ! fprintf(f, ".ft \\n(.f\n"); /* font */ ! fprintf(f, ".ps \\n(.s\n"); /* point size */ ! fprintf(f, ".ll \\n(.lu\n"); /* line length */ ! fprintf(f, ".in \\n(.iu\n"); /* indentation */ fprintf(f, "..\n"); /* format the table a row at a time */ *************** *** 397,400 **** --- 399,406 ---- fprintf(f, ".sp 1v\n"); fprintf(f, ".%d\n", --saveno); /* restore state */ + fprintf(f, "\\\"table ends\n"); + + if (toplevel && class_IsLoaded("texttroff")) + texttroff_EndDoc(f); } *** atk/table/spread.c Wed Nov 22 12:31:13 1989 --- atk/table/spread.c.NEW Wed Jun 6 15:11:02 1990 *************** *** 4,15 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/spread.c,v 1.4 89/02/17 17:27:04 ghoti Exp $ */ /* $ACIS:spread.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/spread.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/spread.c,v 1.4 89/02/17 17:27:04 ghoti Exp $"; #endif /* lint */ --- 4,15 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/spread.c,v 1.5 90/06/06 14:46:18 rr2b Exp $ */ /* $ACIS:spread.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/spread.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/spread.c,v 1.5 90/06/06 14:46:18 rr2b Exp $"; #endif /* lint */ *************** *** 61,66 **** --- 61,67 ---- if (debug) printf("spread__InitializeObject(%x, %x)\n", classID, V); + V->finalizing = FALSE; V->hasInputFocus = FALSE; V->updateRequests = 0; V->borderDrawn = FALSE; *************** *** 545,552 **** return vl->child; } ! static void DestroySubviews(V) register struct spread * V; { register struct cell * cell; register struct viewlist *vl; --- 546,555 ---- return vl->child; } ! ! static void DestroySubviews(V,T) register struct spread * V; + struct table *T; { register struct cell * cell; register struct viewlist *vl; *************** *** 553,561 **** struct viewlist *prevvl, *nextvl; register int r, c; ! for (r = 0; r < table_NumberOfRows(MyTable(V)); r++) { ! for (c = 0; c < table_NumberOfColumns(MyTable(V)); c++) { ! cell = table_GetCell(MyTable(V), r, c); if (cell->celltype == table_ImbeddedObject) { for (vl = cell->interior.ImbeddedObject.views, prevvl = NULL; vl != NULL; vl = nextvl) { if (vl->parent == &getView(V)) { --- 556,564 ---- struct viewlist *prevvl, *nextvl; register int r, c; ! for (r = 0; r < table_NumberOfRows(T); r++) { ! for (c = 0; c < table_NumberOfColumns(T); c++) { ! cell = table_GetCell(T, r, c); if (cell->celltype == table_ImbeddedObject) { for (vl = cell->interior.ImbeddedObject.views, prevvl = NULL; vl != NULL; vl = nextvl) { if (vl->parent == &getView(V)) { *************** *** 588,597 **** { if (debug) printf("spread_FinalizeObject(%x, %x)\n", classID, V); ! if (V->rowInfo) free(V->rowInfo); ! DestroySubviews(V); } void spread__LinkTree(V, parent) --- 591,600 ---- { if (debug) printf("spread_FinalizeObject(%x, %x)\n", classID, V); ! V->finalizing=TRUE; if (V->rowInfo) free(V->rowInfo); ! DestroySubviews(V,MyTable(V)); } void spread__LinkTree(V, parent) *************** *** 622,627 **** --- 625,641 ---- } } + + void spread__UnlinkNotification(V,tree) + struct spread *V; + struct view *tree; + { + if(!V->finalizing) table_RemoveViewFromTable(MyTable(V),tree); + super_UnlinkNotification((struct view *)V,tree); + V->lastTime=(-1); + spread_WantUpdate(V, &getView(V)); + } + void spread__ObservedChanged(V, changed, status) register struct spread *V; struct observable *changed; *************** *** 630,639 **** if (debug) printf("spread_ObservedChanged(%x, %x, %ld)\n", V, changed, status); ! if (changed == (struct observable *) MyTable(V)) { ! if (status == observable_OBJECTDESTROYED) { ! DestroySubviews(V); ! } } super_ObservedChanged(&getView(V), changed, status); } --- 644,651 ---- if (debug) printf("spread_ObservedChanged(%x, %x, %ld)\n", V, changed, status); ! if(status == observable_OBJECTDESTROYED && !strcmp(class_GetTypeName(changed),"table")) { ! DestroySubviews(V,(struct table *)changed); } super_ObservedChanged(&getView(V), changed, status); } *** atk/table/spread.ch Wed Nov 22 12:31:04 1989 --- atk/table/spread.ch.NEW Wed Jun 6 15:11:05 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/spread.ch,v 1.5 89/03/29 09:15:41 jhh Exp $ */ /* $ACIS:spread.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/spread.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidspread_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/spread.ch,v 1.5 89/03/29 09:15:41 jhh Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* spread.ch - table view definition and interface */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/spread.ch,v 1.6 90/06/06 14:46:36 rr2b Exp $ */ /* $ACIS:spread.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/spread.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidspread_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/spread.ch,v 1.6 90/06/06 14:46:36 rr2b Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* spread.ch - table view definition and interface */ *************** *** 71,77 **** GetInterface(char *type) returns struct scrollfns *; LinkTree(struct view * parent); ObservedChanged(struct observable *changed, long status); ! methods: classprocedures: --- 71,77 ---- GetInterface(char *type) returns struct scrollfns *; LinkTree(struct view * parent); ObservedChanged(struct observable *changed, long status); ! UnlinkNotification(struct view *unlinkedTree); methods: classprocedures: *************** *** 112,117 **** --- 112,118 ---- struct graphic *grayPix; /* halftone filler */ struct graphic *blackPix; /* pure black filler */ + boolean finalizing; /* being finalized? */ }; /* end of spread.ch */ *** atk/table/tabio.c Wed Nov 22 12:31:18 1989 --- atk/table/tabio.c.NEW Wed Jun 6 15:11:28 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/tabio.c,v 1.9 89/10/13 10:35:39 jhh Exp $ */ /* $ACIS:tabio.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/tabio.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/tabio.c,v 1.9 89/10/13 10:35:39 jhh Exp $"; #endif /* lint */ /* tabio.c - input/output for table */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/tabio.c,v 1.10 90/06/06 14:46:59 rr2b Exp $ */ /* $ACIS:tabio.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/tabio.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/tabio.c,v 1.10 90/06/06 14:46:59 rr2b Exp $"; #endif /* lint */ /* tabio.c - input/output for table */ *************** *** 567,572 **** --- 567,575 ---- cell->interior.ImbeddedObject.data = newobject; cell->interior.ImbeddedObject.views = NULL; newobject->id = uniqueID; + + dataobject_AddObserver(newobject,T); + if (f) { dataobject_Read(newobject, f, uniqueID); if (debug) *** atk/table/table.c Wed Nov 22 12:31:23 1989 --- atk/table/table.c.NEW Thu Jun 21 11:50:55 1990 *************** *** 4,15 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/table.c,v 1.9 89/09/21 09:52:12 ajp Exp $ */ /* $ACIS:table.c 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/table.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/table.c,v 1.9 89/09/21 09:52:12 ajp Exp $"; #endif /* lint */ #include --- 4,15 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/table.c,v 1.14 90/06/21 11:40:10 jhh Exp $ */ /* $ACIS:table.c 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/table.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/table.c,v 1.14 90/06/21 11:40:10 jhh Exp $"; #endif /* lint */ #include *************** *** 22,30 **** --- 22,35 ---- #include + #ifndef _IBMR2 extern char * malloc (); + #endif /* _IBMR2 */ + extern char * realloc (); + extern double atof(); + struct table * ReadASCII (); /* initialize entire class */ *************** *** 36,41 **** --- 41,47 ---- printf("table_InitializeClass()\n"); DefaultPrecision = 2; + debug = 0; return TRUE; } *************** *** 70,75 **** --- 76,82 ---- T->aboveedge = NULL; T->edgeChanged = T->cellChanged = T->fileWritten = 0; T->everythingChanged = T->timeStamper = 1; + T->inGetModified = FALSE; /* the following is unnecessary for internal tables */ *************** *** 79,84 **** --- 86,106 ---- return TRUE; } + + void IgnoreObserved(T) + struct table *T; + { + long r,c; + struct cell *cell; + for (r = 0; r < table_NumberOfRows(T); r++) { + for (c = 0; c < table_NumberOfColumns(T); c++) { + cell = table_GetCell(T, r, c); + if (cell->celltype == table_ImbeddedObject && cell->interior.ImbeddedObject.data!=NULL) + dataobject_RemoveObserver( cell->interior.ImbeddedObject.data,T); + } + } + } + /* tear down a table */ void table__FinalizeObject (classID, T) *************** *** 86,95 **** register struct table * T; { register struct table * S; ! if (debug) printf("table_FinalizeObject(%s)\n", table_Name(T)); if (T->tablename) { if (T == table_List) table_List = T->NextTable; --- 108,120 ---- register struct table * T; { register struct table * S; ! if (debug) printf("table_FinalizeObject(%s)\n", table_Name(T)); + table_NotifyObservers(T,observable_OBJECTDESTROYED); + IgnoreObserved(T); + if (T->tablename) { if (T == table_List) table_List = T->NextTable; *************** *** 103,108 **** --- 128,143 ---- table_ChangeSize (T, 0, 0); } + void table__ObservedChanged(T, changed, value) + struct table *T; + struct observable *changed; + long value; + { + T->cellChanged = ++(T->timeStamper); + table_NotifyObservers(T, 0); + table_SetModified(T); + } + /* toggle debugging flag */ void table__ToggleDebug (T) *************** *** 393,399 **** cell = table_GetCell(S, r + r0, c + c0); DestroyCell (S, cell); CreateCell (S, cell, table_GetCell(T, r % r1, c % c1)); ! if (iscombined != 0) break; /* replace interior boundaries */ --- 428,437 ---- cell = table_GetCell(S, r + r0, c + c0); DestroyCell (S, cell); CreateCell (S, cell, table_GetCell(T, r % r1, c % c1)); ! ! if(cell->celltype==table_ImbeddedObject) ! dataobject_RemoveObserver( cell->interior.ImbeddedObject.data,T); ! if (iscombined != 0) break; /* replace interior boundaries */ *************** *** 451,466 **** if (getDataObject(T).writeID != writeID) { getDataObject(T).writeID = writeID; ! fprintf (f, "\\begindata{table,%ld}\n", table_UniqueID(T)); chunk.LeftCol = -1; chunk.RightCol = table_NumberOfColumns(T) - 1; chunk.TopRow = -1; chunk.BotRow = table_NumberOfRows(T) - 1; WriteASCII (T, f, &chunk, level); ! fprintf (f, "\\enddata{table,%ld}\n", table_UniqueID(T)); ! getDataObject(T).modified = FALSE; } ! return getDataObject(T).id; } /* read table from file */ --- 489,503 ---- if (getDataObject(T).writeID != writeID) { getDataObject(T).writeID = writeID; ! fprintf (f, "\\begindata{%s,%ld}\n", class_GetTypeName(T), table_GetID(T)); chunk.LeftCol = -1; chunk.RightCol = table_NumberOfColumns(T) - 1; chunk.TopRow = -1; chunk.BotRow = table_NumberOfRows(T) - 1; WriteASCII (T, f, &chunk, level); ! fprintf (f, "\\enddata{%s,%ld}\n", class_GetTypeName(T), table_GetID(T)); } ! return table_GetID(T); } /* read table from file */ *************** *** 473,484 **** if (debug) printf("table_Read(%s,, %d)\n", table_Name(T), id); ! getDataObject(T).id = id; ! getDataObject(T).modified = FALSE; ReadASCII (T, f); T->fileWritten = T->timeStamper; ! table_NotifyObservers(T, 0); return dataobject_NOREADERROR; } --- 510,521 ---- if (debug) printf("table_Read(%s,, %d)\n", table_Name(T), id); ! table_SetID(T, table_UniqueID(T)); ! table_SetModified(T); ReadASCII (T, f); T->fileWritten = T->timeStamper; ! table_NotifyObservers(T, observable_OBJECTCHANGED); return dataobject_NOREADERROR; } *************** *** 536,542 **** /* create and copy a cell */ ! static CreateCell (T, newcell, oldcell) register struct table *T; struct cell *newcell, *oldcell; { --- 573,580 ---- /* create and copy a cell */ ! ! static CreateCell (T, newcell, oldcell) register struct table *T; struct cell *newcell, *oldcell; { *************** *** 569,574 **** --- 607,615 ---- newcell->interior.ImbeddedObject.data = oldcell->interior.ImbeddedObject.data; newcell->interior.ImbeddedObject.views = oldcell->interior.ImbeddedObject.views; oldcell->celltype = table_EmptyCell; + + dataobject_AddObserver(newcell->interior.ImbeddedObject.data, T); + default: newcell->lastcalc = ++(T->timeStamper); } *************** *** 582,587 **** --- 623,671 ---- } } + void RemoveCellView(T,c,v) + struct table *T; + struct cell *c; + struct view *v; + { + struct viewlist *vl=c->interior.ImbeddedObject.views; + if(vl==NULL) return; + if(vl->child==v) { + c->interior.ImbeddedObject.views=vl->next; + if(vl->next==NULL) { + CreateCell(T,c,NULL); + } + free(vl); + } else { + struct viewlist *last=vl; + while(vl=vl->next) { + if(vl->child==v) { + last->next=vl->next; + free(vl); + return; + } else last=vl; + } + } + } + + void table__RemoveViewFromTable(T,v) + struct table *T; + struct view *v; + { + long r,c; + struct cell *cell; + for (r = 0; r < table_NumberOfRows(T); r++) { + for (c = 0; c < table_NumberOfColumns(T); c++) { + cell = table_GetCell(T, r, c); + if (cell->celltype == table_ImbeddedObject) + RemoveCellView(T,cell,v); + } + } + T->cellChanged = ++(T->timeStamper); + table_NotifyObservers(T, 0); + table_SetModified(T); + } + /* delete a cell */ DestroyCell(T, oldcell) *************** *** 598,603 **** --- 682,688 ---- free(oldcell->interior.ValCell.formula); break; case table_ImbeddedObject: + if (oldcell->interior.ImbeddedObject.data) { dataobject_Destroy(oldcell->interior.ImbeddedObject.data); oldcell->interior.ImbeddedObject.data = NULL; *************** *** 610,618 **** /* end of misuse */ oldcell->interior.ImbeddedObject.views = vl->next; free((char *) vl); ! } if (debug) printf("imbedded remove complete\n"); break; } oldcell->format = GENERALFORMAT; --- 695,704 ---- /* end of misuse */ oldcell->interior.ImbeddedObject.views = vl->next; free((char *) vl); ! } if (debug) printf("imbedded remove complete\n"); + break; } oldcell->format = GENERALFORMAT; *************** *** 811,836 **** } } cell = table_GetCell(T, r, c); ! if (cell->celltype == table_ValCell) { ! table_ReEval (T, r, c); ! if (IsBogus(&(cell->interior.ValCell.value)) && ExtractBogus(&(cell->interior.ValCell.value)) != circ) { ! MakeBogus(result, "REF!"); ! } ! else { ! *result = cell->interior.ValCell.value; ! } } - else if (cell->celltype == table_EmptyCell) - MakeStandard(result, (double)0.0); - else { - MakeBogus(result, "NOVAL!"); - } } else { MakeBogus(result, "CELL!"); } } - #define inside(r,c,ch) ( (r)>=((ch)->TopRow) && (r)<=((ch)->BotRow) && (c)>=((ch)->LeftCol) && (c) <= ((ch)->RightCol) ) struct movetrstate { --- 897,937 ---- } } cell = table_GetCell(T, r, c); ! ! switch(cell->celltype) { ! case table_ValCell: ! table_ReEval (T, r, c); ! if (IsBogus(&(cell->interior.ValCell.value)) && ExtractBogus(&(cell->interior.ValCell.value)) != circ) { ! MakeBogus(result, "REF!"); ! } ! else { ! *result = cell->interior.ValCell.value; ! } ! break; ! case table_EmptyCell: ! MakeStandard(result, (double)0.0); ! break; ! case table_ImbeddedObject: ! { ! struct atom *rock1=atom_Intern("rock1"); ! struct atom *string=atom_Intern("string"); ! struct atom *value=atom_Intern("value"); ! long rock; ! char *rockp; ! if(dataobject_Get(cell->interior.ImbeddedObject.data,value, &string,&rockp)) MakeStandard(result,atof(rockp)); ! else ! if( !dataobject_Get( cell->interior.ImbeddedObject.data, value, &rock1, &rock)) MakeBogus(result,"NOVAL!"); ! else MakeStandard(result,(double)rock); ! break; ! } ! default: ! MakeBogus(result, "NOVAL!"); } } else { MakeBogus(result, "CELL!"); } } #define inside(r,c,ch) ( (r)>=((ch)->TopRow) && (r)<=((ch)->BotRow) && (c)>=((ch)->LeftCol) && (c) <= ((ch)->RightCol) ) struct movetrstate { *************** *** 946,951 **** --- 1047,1054 ---- cell->interior.ImbeddedObject.data = newobject; cell->interior.ImbeddedObject.views = NULL; cell->lastcalc = T->cellChanged; + + dataobject_AddObserver(newobject,T); } } } *************** *** 1039,1042 **** --- 1142,1175 ---- { ExtendedType(x) = extended_BOGUS; ExtractBogus(x) = message; + } + + /* check to see if modified */ + + long table__GetModified(self) + struct table *self; + { + int r, c; + struct cell *cell; + long rc, cc; + + rc = super_GetModified(self); + if (!self->inGetModified) { + self->inGetModified = TRUE; + for (r = 0; r < self->rows; r++) { + for (c = 0; c < self->cols; c++) { + cell = table_GetCell(self, r, c); + if (cell->celltype == table_ImbeddedObject && cell->interior.ImbeddedObject.data != NULL) { + cc = dataobject_GetModified(cell->interior.ImbeddedObject.data); + if (cc > rc) rc = cc; + } + } + } + self->inGetModified = FALSE; + } + + if (debug) + printf("table_GetModified = %d\n", rc); + + return rc; } *** atk/table/table.ch Wed Nov 22 12:31:05 1989 --- atk/table/table.ch.NEW Wed Jun 20 13:25:11 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/table.ch,v 1.6 89/03/10 17:38:20 jhh Exp $ */ /* $ACIS:table.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/table.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtable_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/table/RCS/table.ch,v 1.6 89/03/10 17:38:20 jhh Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* table.ch - table data object definition and interface */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/table.ch,v 1.10 90/06/19 15:58:31 jhh Exp $ */ /* $ACIS:table.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/table.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtable_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/table/RCS/table.ch,v 1.10 90/06/19 15:58:31 jhh Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* table.ch - table data object definition and interface */ *************** *** 130,138 **** --- 130,140 ---- class table: dataobject[dataobj] { overrides: + ObservedChanged (struct observable *changed, long value); ViewName() returns char *; Read (FILE * f, long id) returns long; Write (FILE * f, long writeid, int level) returns long; + GetModified() returns long; methods: ToggleDebug (); *************** *** 155,160 **** --- 157,164 ---- Imbed (char *name, Chunk chunk); Lock (char ch, Chunk chunk); FormatDate (double fdate, char *buf, char format); + + RemoveViewFromTable(struct view *v); macromethods: Name() SafeFromNull(self->tablename) *************** *** 195,200 **** --- 199,205 ---- int cellChanged; /* timestamp when cell contents changed */ int fileWritten; /* timestamp when file read/written */ int timeStamper; /* current timestamp */ + boolean inGetModified; /* recursion loop stopper for GetModified */ }; /* end of table.ch */ *** atk/text/pcompch.ch Fri Jul 27 14:00:23 1990 --- atk/text/pcompch.ch.NEW Wed Jun 20 13:25:29 1990 *************** *** 0 **** --- 1,26 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + #define MAXCHAR 127 + #define BADCHAR MAXCHAR+1 + + struct composites { + unsigned char exts[16],style[32]; + unsigned short code; + struct composites *next; + }; + + class pcompch { + classprocedures: + InitializeClass() returns boolean; + ATKToASCII(struct text *text); + ASCIIToATK(struct text *text,long pos, long len, procedure func, long rock); + ReadCompositesFile(char *file) returns boolean; + ClearComposites(); + DeleteComposite(char key,char *exts); + EnumerateComposites(char key, procedure func,long rock) returns long; + CharacterToTroff(unsigned char ch, struct environment *env, struct textview *tv) returns char *; + StringToTroff(unsigned char *str,char *buf, long bufsize, struct environment *env,struct textview *tv) returns unsigned char *; + }; *** atk/text/Imakefile Wed Nov 22 12:32:54 1989 --- atk/text/Imakefile.NEW Wed Jun 20 16:40:21 1990 *************** *** 20,26 **** texttag.do \ textref.do \ texttagv.do \ ! textrefv.do IHFILES = be1be2.ih \ be1be2a.ih \ --- 20,27 ---- texttag.do \ textref.do \ texttagv.do \ ! textrefv.do \ ! pcompch.do IHFILES = be1be2.ih \ be1be2a.ih \ *************** *** 40,46 **** texttag.ih \ textref.ih \ texttagv.ih \ ! textrefv.ih OBJS = be1be2.o \ be1be2a.o \ --- 41,48 ---- texttag.ih \ textref.ih \ texttagv.ih \ ! textrefv.ih \ ! pcompch.ih OBJS = be1be2.o \ be1be2a.o \ *************** *** 63,69 **** texttag.o \ textref.o \ texttagv.o \ ! textrefv.o NormalObjectRule() --- 65,72 ---- texttag.o \ textref.o \ texttagv.o \ ! textrefv.o \ ! pcompch.o NormalObjectRule() *************** *** 70,75 **** --- 73,79 ---- NormalATKRule() MkdirTarget(${DESTDIR}/lib/tmac) + MkdirTarget(${DESTDIR}/lib/compchar) DynamicObject(smpltext, ${UTILLIB},) DynamicMultiObject(text.do, text.o tpllist.o,,) *************** *** 87,92 **** --- 91,99 ---- InstallFile(tmac.atk, $(INSTINCFLAGS), $(DESTDIR)/lib/tmac) InstallFile(tmac.arf, $(INSTINCFLAGS), $(DESTDIR)/lib/tmac) + InstallFile(tmac.acc,$(INSTINCFLAGS),$(DESTDIR)/lib/tmac) + + InstallFile(comps,$(INSTINCFLAGS),$(DESTDIR)/lib/compchar) InstallFile(txtstvec.h, ${INSTINCFLAGS}, ${DESTDIR}/include/atk) *** atk/text/content.c Wed Nov 22 12:33:05 1989 --- atk/text/content.c.NEW Wed Jun 13 17:03:33 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/content.c,v 1.9 89/10/20 13:03:52 tpn Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/content.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/content.c,v 1.9 89/10/20 13:03:52 tpn Exp $"; #endif /* lint */ #include "class.h" --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/content.c,v 1.10 90/06/04 13:28:17 gk5g Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/content.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/content.c,v 1.10 90/06/04 13:28:17 gk5g Exp $"; #endif /* lint */ #include "class.h" *************** *** 54,60 **** char *ostr; int TEST; { /* BUG -- OVERFLOWS NOT DETECTED */ ! char *malloc(),*str; long len; int next = 1; ; --- 54,63 ---- char *ostr; int TEST; { /* BUG -- OVERFLOWS NOT DETECTED */ ! #ifndef _IBMR2 ! extern char *malloc(); ! #endif /* _IBMR2 */ ! char *str; long len; int next = 1; ; *** atk/text/drawtxtv.c Wed Apr 11 14:21:08 1990 --- atk/text/drawtxtv.c.NEW Fri Jul 20 11:28:28 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/drawtxtv.c,v 2.22 90/04/03 11:37:50 gk5g Exp $ */ /* $ACIS:drawtxtv.c 1.6$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/drawtxtv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/drawtxtv.c,v 2.22 90/04/03 11:37:50 gk5g Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/drawtxtv.c,v 2.27 90/07/19 16:13:01 gk5g Exp $ */ /* $ACIS:drawtxtv.c 1.6$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/drawtxtv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/drawtxtv.c,v 2.27 90/07/19 16:13:01 gk5g Exp $"; #endif /* lint */ #include *************** *** 44,50 **** static long StringWidth(widths, s) register short *widths; ! register char *s; { register short w = 0; while (*s) --- 44,50 ---- static long StringWidth(widths, s) register short *widths; ! register unsigned char *s; { register short w = 0; while (*s) *************** *** 83,91 **** ; pos++; ! text_InitStateVector(&mysv); ! myEnv = environment_GetInnerMost(text->rootEnvironment, pos); ! text_ApplyEnvironment(&mysv, self->defaultStyle, myEnv); font = fontdesc_Create(mysv.CurFontFamily, mysv.CurFontAttributes, mysv.CurFontSize); --- 83,89 ---- ; pos++; ! myEnv = textview_GetStyleInformation(self, &mysv, pos, NULL); font = fontdesc_Create(mysv.CurFontFamily, mysv.CurFontAttributes, mysv.CurFontSize); *************** *** 102,107 **** --- 100,108 ---- else width = ((width + tabWidth) / tabWidth) * tabWidth; } + + textview_ReleaseStyleInformation(self, myEnv); + return width; } *************** *** 110,119 **** register long width; register short *widths; register long bump; ! register char *string; { int tabWidth; ! register char tc; tabWidth = 8 * self->tabWidth; --- 111,120 ---- register long width; register short *widths; register long bump; ! register unsigned char *string; { int tabWidth; ! register unsigned char tc; tabWidth = 8 * self->tabWidth; *************** *** 151,157 **** info->locateX = startX; /* Default x */ while (1) { ! register char tc = info->lineBuffer[linePos++]; if (startPos == searchPos) { info->locateX = startX; return; --- 152,158 ---- info->locateX = startX; /* Default x */ while (1) { ! register unsigned char tc = (unsigned char ) info->lineBuffer[linePos++]; if (startPos == searchPos) { info->locateX = startX; return; *************** *** 194,204 **** info->locateX = startPos; /* Default pos */ while (1) { ! register char tc; register int endX; endX = startX; ! tc = info->lineBuffer[linePos++]; if (tc == ' ') endX += spaceShim; if (tc == '\t') { --- 195,205 ---- info->locateX = startPos; /* Default pos */ while (1) { ! register unsigned char tc; register int endX; endX = startX; ! tc = (unsigned char) info->lineBuffer[linePos++]; if (tc == ' ') endX += spaceShim; if (tc == '\t') { *************** *** 352,357 **** --- 353,360 ---- /* This definitely should be in the view */ #define NCXS 50 + /* Need to look here - ajp */ + static void ComputeStyleItem(self, startPos, endPos, pixelAddr, charAddr, info) long startPos, endPos; struct textview *self; *************** *** 362,368 **** register struct environment *cparent, *te; struct environment *envStack[NCXS]; struct text *text; ! register char *tp; long newChars, newPixels, i, nextSlot; if (exposeStylesFont == NULL) { --- 365,371 ---- register struct environment *cparent, *te; struct environment *envStack[NCXS]; struct text *text; ! register unsigned char *tp; long newChars, newPixels, i, nextSlot; if (exposeStylesFont == NULL) { *************** *** 384,396 **** if (endPos == 0) startEnv = text->rootEnvironment; else if (text_GetChar(text, endPos-1) == '\n') ! startEnv = ! environment_GetInnerMost(text->rootEnvironment, ! endPos - 1); else { ! startEnv = ! environment_GetInnerMost(text->rootEnvironment, ! endPos); i = endPos; /* Where we should not move from */ while (1) { /* Keep going up tree until find root or new left edge */ --- 387,396 ---- if (endPos == 0) startEnv = text->rootEnvironment; else if (text_GetChar(text, endPos-1) == '\n') ! startEnv = textview_GetStyleInformation(self, NULL, endPos - 1, NULL); else { ! startEnv = textview_GetStyleInformation(self, NULL, endPos, NULL); ! i = endPos; /* Where we should not move from */ while (1) { /* Keep going up tree until find root or new left edge */ *************** *** 402,413 **** startEnv->header.nestedmark.parent; } } ! } else ! startEnv = ! environment_GetInnerMost(text->rootEnvironment, ! startPos); ! endEnv = ! environment_GetInnerMost(text->rootEnvironment, endPos); tp = &info->lineBuffer[info->lineBP]; cparent = environment_GetCommonParent(startEnv, endEnv); newChars = 0; --- 402,414 ---- startEnv->header.nestedmark.parent; } } ! } ! else { ! startEnv = textview_GetStyleInformation(self, NULL, startPos, NULL); ! } ! ! endEnv = textview_GetStyleInformation(self, NULL, endPos, NULL); ! tp = &info->lineBuffer[info->lineBP]; cparent = environment_GetCommonParent(startEnv, endEnv); newChars = 0; *************** *** 461,466 **** --- 462,470 ---- *pixelAddr = newPixels; *charAddr = newChars; info->lineBP += newChars; + + textview_ReleaseStyleInformation(self, endEnv); + textview_ReleaseStyleInformation(self, startEnv); } /* Note: When trying to speed up redisplay, GenerateLineItems is a */ *************** *** 521,531 **** return; } ! text_InitStateVector(tsv); /* Initialize an empty state vector */ - myEnv = environment_GetInnerMost(text->rootEnvironment, pos); envLength = environment_GetLength(myEnv); - text_ApplyEnvironment(tsv, self->defaultStyle, myEnv); /* The hidden flag handling probably does not work. */ --- 525,533 ---- return; } ! myEnv = textview_GetStyleInformation(self, tsv, pos, &nChars); envLength = environment_GetLength(myEnv); /* The hidden flag handling probably does not work. */ *************** *** 559,565 **** tsv->CurView = NULL; } ! nChars = environment_GetNextChange(text->rootEnvironment, pos); /* Break up line items at dot so we can skimp on line redrawing */ --- 561,567 ---- tsv->CurView = NULL; } ! textview_ReleaseStyleInformation(self, myEnv); /* Break up line items at dot so we can skimp on line redrawing */ *************** *** 677,683 **** localWidth = info->totalWidth; localRubber = 0; ! tp = &info->lineBuffer[info->lineBP]; bufLen = 0; /* Refresh GetBuf since pos may have changed */ --- 679,685 ---- localWidth = info->totalWidth; localRubber = 0; ! tp = &(info->lineBuffer[info->lineBP]); bufLen = 0; /* Refresh GetBuf since pos may have changed */ *************** *** 714,720 **** } *tp++ = 0; ! info->lineBP = tp - info->lineBuffer; info->totalWidth = localWidth; info->lineLength = pos - initPos; /* No rubber spaces, otherwise we'd wrap the line there */ --- 716,722 ---- } *tp++ = 0; ! info->lineBP = (int)(tp - info->lineBuffer); info->totalWidth = localWidth; info->lineLength = pos - initPos; /* No rubber spaces, otherwise we'd wrap the line there */ *************** *** 737,743 **** info->lineLength = lastPos - initPos; info->lineIP = lastIP; *lastBP++ = NULL; ! info->lineBP = lastBP - info->lineBuffer; localRubber--; /* Include deleted one */ info->rubberSpaces += localRubber; info->clp->ti_rSpaces = localRubber; --- 739,745 ---- info->lineLength = lastPos - initPos; info->lineIP = lastIP; *lastBP++ = NULL; ! info->lineBP = (int)(lastBP - info->lineBuffer); localRubber--; /* Include deleted one */ info->rubberSpaces += localRubber; info->clp->ti_rSpaces = localRubber; *************** *** 761,767 **** localWidth += info->myWidths[(int) tc]; } else if (tc == '\n') { *tp++ = '\0'; ! info->lineBP = tp - info->lineBuffer; info->totalWidth = localWidth; info->lineLength = pos - initPos; info->markLength = info->lineLength; --- 763,769 ---- localWidth += info->myWidths[(int) tc]; } else if (tc == '\n') { *tp++ = '\0'; ! info->lineBP = (int)(tp - info->lineBuffer); info->totalWidth = localWidth; info->lineLength = pos - initPos; info->markLength = info->lineLength; *************** *** 819,825 **** info->lineLength = pos - initPos; info->totalWidth = localWidth; *tp++ = 0; ! info->lineBP = tp - info->lineBuffer; } if (FoundmarkPos) { --- 821,827 ---- info->lineLength = pos - initPos; info->totalWidth = localWidth; *tp++ = 0; ! info->lineBP = (int)(tp - info->lineBuffer); } if (FoundmarkPos) { *************** *** 900,906 **** struct text *text = Text(self); long zapMe; int k, lli, delta, zapPos = 0, foundSpaces = 0, pos, by, bx = 0; ! char *sPtr; boolean isBlack = FALSE; struct fontdesc *fontID = textview_GetFont(self); register int i, j = 0; --- 902,908 ---- struct text *text = Text(self); long zapMe; int k, lli, delta, zapPos = 0, foundSpaces = 0, pos, by, bx = 0; ! unsigned char *sPtr; boolean isBlack = FALSE; struct fontdesc *fontID = textview_GetFont(self); register int i, j = 0; *************** *** 1326,1338 **** /* Set marks to indicate what text prior to the dot */ /* we can avoid redrawing next time around. */ int cp, ep, WillClear; ! char chr; struct fontdesc_charInfo cinfo; cp = mark_GetPos(currentLine); ep = mark_GetPos(self->dot); chr = text_GetChar(text, ep); fontdesc_CharSummary(info->itemAtDot->ti_font, ! textview_GetDrawable(self), chr, &cinfo); WillClear = (cinfo.xOriginOffset <= 0); for (ep--; ep >= cp; ep--) { chr = text_GetChar(text, ep); --- 1328,1352 ---- /* Set marks to indicate what text prior to the dot */ /* we can avoid redrawing next time around. */ int cp, ep, WillClear; ! long chr; struct fontdesc_charInfo cinfo; cp = mark_GetPos(currentLine); ep = mark_GetPos(self->dot); + + /* I think what ep is trying to get at is */ + /* everything on this line before the dot */ + /* so if the dot is at the end of the document */ + /* this will try to avoid the EOF -rr2b */ + if(ep>=text_GetLength(text)) ep--; + chr = text_GetChar(text, ep); + /* If ep got an EOF anyway make it something */ + /* innocuous to avoid possible problems */ + /* getting a font description for EOF */ + /* Note that this doesn't appear to be necessary */ + if(chr==EOF) chr=' '; fontdesc_CharSummary(info->itemAtDot->ti_font, ! textview_GetDrawable(self), (unsigned char)chr, &cinfo); WillClear = (cinfo.xOriginOffset <= 0); for (ep--; ep >= cp; ep--) { chr = text_GetChar(text, ep); *************** *** 1346,1352 **** } if (ep >= info->lastFontPos) { fontdesc_CharSummary(info->itemAtDot->ti_font, ! textview_GetDrawable(self), chr, &cinfo); if (WillClear && cinfo.width <= cinfo.xSpacing + cinfo.xOriginOffset) break; --- 1360,1366 ---- } if (ep >= info->lastFontPos) { fontdesc_CharSummary(info->itemAtDot->ti_font, ! textview_GetDrawable(self),(unsigned char)chr, &cinfo); if (WillClear && cinfo.width <= cinfo.xSpacing + cinfo.xOriginOffset) break; *************** *** 1372,1378 **** } if (ep >= info->lastFontPos) { fontdesc_CharSummary(info->itemAtDot->ti_font, ! textview_GetDrawable(self), chr, &cinfo); if (WillClear && cinfo.width <= cinfo.xSpacing + cinfo.xOriginOffset) break; --- 1386,1392 ---- } if (ep >= info->lastFontPos) { fontdesc_CharSummary(info->itemAtDot->ti_font, ! textview_GetDrawable(self), (unsigned char)chr, &cinfo); if (WillClear && cinfo.width <= cinfo.xSpacing + cinfo.xOriginOffset) break; *************** *** 1425,1432 **** end = i + lineStructure->nChars; while (i < end) { ! curenv = environment_GetInnerMost(text->rootEnvironment, i); ! elen = environment_GetNextChange(text->rootEnvironment, i); if (elen + i > end) elen = end - i; if (curenv->type == environment_View && --- 1439,1446 ---- end = i + lineStructure->nChars; while (i < end) { ! curenv = textview_GetStyleInformation(self, NULL, i, &elen); ! if (elen + i > end) elen = end - i; if (curenv->type == environment_View && *************** *** 1453,1457 **** --- 1467,1473 ---- } elen += i; i = elen; + + textview_ReleaseStyleInformation(self, curenv); } } *** atk/text/fnotev.c Wed Nov 22 12:33:18 1989 --- atk/text/fnotev.c.NEW Fri Jul 27 12:52:41 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/fnotev.c,v 1.6 89/07/24 11:20:37 tpn Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/fnotev.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/fnotev.c,v 1.6 89/07/24 11:20:37 tpn Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/fnotev.c,v 1.7 90/07/24 20:45:02 rr2b Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/fnotev.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/fnotev.c,v 1.7 90/07/24 20:45:02 rr2b Exp $"; #endif /* lint */ #include *************** *** 126,132 **** } else{ clevel = toplevel; ! texttroff_WriteTroff( self, d, f, toplevel); } fprintf(f,".FE\n"); clevel = -100; --- 126,132 ---- } else{ clevel = toplevel; ! texttroff_WriteSomeTroff( self, d, f, toplevel, 0); } fprintf(f,".FE\n"); clevel = -100; *** atk/text/search.c Wed Nov 22 12:32:21 1989 --- atk/text/search.c.NEW Wed Jun 20 13:25:34 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/search.c,v 2.5 89/02/24 08:43:45 ghoti Exp $ */ /* $ACIS:search.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/search.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/search.c,v 2.5 89/02/24 08:43:45 ghoti Exp $"; #endif /* lint */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/search.c,v 2.6 90/06/15 16:06:27 tpn Exp $ */ /* $ACIS:search.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/search.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/search.c,v 2.6 90/06/15 16:06:27 tpn Exp $"; #endif /* lint */ *************** *** 16,23 **** #include #include #include ! static char FoldTRT[128] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', --- 16,25 ---- #include #include #include + /* array to fold upper case to lower case + Now modified to handle the iso 8859 char set # 1 */ ! static unsigned char FoldTRT[256] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, ' ', '!', '"', '#', '$', '%', '&', '\'', '(', ')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', *************** *** 25,31 **** 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', ! 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', 127 }; struct SearchPattern { --- 27,41 ---- 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '[', '\\', ']', '^', '_', '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', ! 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', 127, ! 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143, ! 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159, ! 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175, ! 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191, ! 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, ! 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223, ! 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207, ! 208,209,210,211,212,213,214,247,216,217,218,219,220,221,222,255 }; struct SearchPattern { *************** *** 40,46 **** #define EPAR 0202 /* end parenthesized expression */ #define SET 0203 /* match any of the following set (16 chars of bits follow to define the set) */ #define ANY1 0204 /* match any single character */ ! #define isop(c) ((c) & 0200) /* true if c is a special op */ search__GetMatchLength (classID) --- 50,56 ---- #define EPAR 0202 /* end parenthesized expression */ #define SET 0203 /* match any of the following set (16 chars of bits follow to define the set) */ #define ANY1 0204 /* match any single character */ ! #define isop(c) (((c) & 0200) && ((c) < 0205)) /* true if c is a special op */ search__GetMatchLength (classID) *************** *** 72,78 **** char * search__CompilePattern (classID, string, result) struct classheader *classID; ! register char *string; struct SearchPattern **result; { register struct SearchPattern *p; register used = 0; --- 82,88 ---- char * search__CompilePattern (classID, string, result) struct classheader *classID; ! register unsigned char *string; struct SearchPattern **result; { register struct SearchPattern *p; register used = 0; *************** *** 189,195 **** register unsigned char optchar; register int dl; long bufLen; ! char *buf = NULL; MatchLength = 0; if (p == 0 || p -> used <= 0) return -1; --- 199,205 ---- register unsigned char optchar; register int dl; long bufLen; ! unsigned char *buf = NULL; MatchLength = 0; if (p == 0 || p -> used <= 0) return -1; *************** *** 200,206 **** for (; pos < dl; ++pos) { int n; if (bufLen == 0) ! buf = simpletext_GetBuf(d, pos, 1024, &bufLen); if (canopt) if (optchar != FoldTRT[bufLen--, *buf++]) continue; --- 210,216 ---- for (; pos < dl; ++pos) { int n; if (bufLen == 0) ! buf = (unsigned char *) simpletext_GetBuf(d, pos, 1024, &bufLen); if (canopt) if (optchar != FoldTRT[bufLen--, *buf++]) continue; *************** *** 223,229 **** register int canopt; register unsigned char optchar; long bufLen; ! char *buf = NULL; MatchLength = 0; if (p == 0 || p -> used <= 0) return -1; --- 233,239 ---- register int canopt; register unsigned char optchar; long bufLen; ! unsigned char *buf = NULL; MatchLength = 0; if (p == 0 || p -> used <= 0) return -1; *************** *** 233,239 **** for (; pos >= 0; --pos) { int n; if (bufLen == 0) ! buf = simpletext_GetBufEnd(d, pos + 1, 1024, &bufLen); if (canopt) if (optchar != FoldTRT[bufLen--, *--buf]) continue; --- 243,249 ---- for (; pos >= 0; --pos) { int n; if (bufLen == 0) ! buf = (unsigned char *)simpletext_GetBufEnd(d, pos + 1, 1024, &bufLen); if (canopt) if (optchar != FoldTRT[bufLen--, *--buf]) continue; *************** *** 253,259 **** register unsigned char **s; { register unsigned char c, dc; ! char *buf = NULL; long bufLen = 0; long length = simpletext_GetLength(d); --- 263,269 ---- register unsigned char **s; { register unsigned char c, dc; ! unsigned char *buf = NULL; long bufLen = 0; long length = simpletext_GetLength(d); *************** *** 268,274 **** return pos; case ANY1: if (bufLen == 0) ! buf = simpletext_GetBuf(d, pos, 1024, &bufLen); dc = *buf++, bufLen--; if (pos >= length || dc == '\n') return -1; --- 278,284 ---- return pos; case ANY1: if (bufLen == 0) ! buf = (unsigned char *)simpletext_GetBuf(d, pos, 1024, &bufLen); dc = *buf++, bufLen--; if (pos >= length || dc == '\n') return -1; *************** *** 276,282 **** break; case SET: if (bufLen == 0) ! buf = simpletext_GetBuf(d, pos, 1024, &bufLen); dc = *buf++, bufLen--; if (((*s)[dc >> 3] & (1 << (dc & 7))) == 0) return -1; --- 286,292 ---- break; case SET: if (bufLen == 0) ! buf = (unsigned char *)simpletext_GetBuf(d, pos, 1024, &bufLen); dc = *buf++, bufLen--; if (((*s)[dc >> 3] & (1 << (dc & 7))) == 0) return -1; *************** *** 303,309 **** default: if (pos >= length) return -1; if (bufLen == 0) ! buf = simpletext_GetBuf(d, pos, 1024, &bufLen); dc = *buf++, bufLen--; if (c != FoldTRT[dc]) return - 1; --- 313,319 ---- default: if (pos >= length) return -1; if (bufLen == 0) ! buf = (unsigned char *)simpletext_GetBuf(d, pos, 1024, &bufLen); dc = *buf++, bufLen--; if (c != FoldTRT[dc]) return - 1; *** atk/text/smpltext.c Mon Mar 12 13:16:29 1990 --- atk/text/smpltext.c.NEW Thu May 10 16:30:38 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/smpltext.c,v 2.17 90/02/23 13:52:02 gk5g Exp $ */ /* $ACIS:smpltext.c 1.6$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/smpltext.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/smpltext.c,v 2.17 90/02/23 13:52:02 gk5g Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/smpltext.c,v 2.17 90/02/23 13:52:02 gk5g Exp $ */ /* $ACIS:smpltext.c 1.6$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/smpltext.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/smpltext.c,v 2.17 90/02/23 13:52:02 gk5g Exp $"; #endif /* lint */ #include *** atk/text/smpltext.ch Mon Mar 12 13:16:26 1990 --- atk/text/smpltext.ch.NEW Thu May 10 16:30:39 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/smpltext.ch,v 2.9 89/09/13 16:27:06 zs01 Exp $ */ /* $ACIS:smpltext.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/smpltext.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidsimpletext_H = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/smpltext.ch,v 2.9 89/09/13 16:27:06 zs01 Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* Simple text conatins a string of text that can be manipulated. --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/smpltext.ch,v 2.9 89/09/13 16:27:06 zs01 Exp $ */ /* $ACIS:smpltext.ch 1.4$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/smpltext.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidsimpletext_H = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/smpltext.ch,v 2.9 89/09/13 16:27:06 zs01 Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* Simple text conatins a string of text that can be manipulated. *** atk/text/text.c Fri Jul 27 16:11:27 1990 --- atk/text/text.c.NEW Fri Aug 3 16:15:16 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/text.c,v 2.24 89/11/02 10:21:17 tpn Exp Locker: tpn $ */ /* $ACIS:text.c 1.7$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/text.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/text/RCS/text.c,v 2.24 89/11/02 10:21:17 tpn Exp Locker: tpn $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/text.c,v 2.28 90/08/03 16:13:09 tpn Exp $ */ /* $ACIS:text.c 1.7$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/text.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/text.c,v 2.28 90/08/03 16:13:09 tpn Exp $"; #endif /* lint */ #include *************** *** 60,65 **** --- 60,66 ---- static struct environmentelement *envBegin = NULL;; static struct environmentelement *envptr = NULL; + static long HighBitStart = -1; static void ClearStyles(); static int DataStreamVersion = 0; *************** *** 254,272 **** for(ptr = list ; ptr < cptr; ptr++) if (*ptr == ob) break; if(ptr == cptr) { ! *cptr++ = ob; ! if(count++ == size) if (!growYourOwn) return count; else { size *= 2; list = (struct dataobject **) ! realloc(size * sizeof(*list)); if (list == NULL) return -1; ! else *stash = list; } } } i += curenv->header.nestedmark.length; --- 255,276 ---- for(ptr = list ; ptr < cptr; ptr++) if (*ptr == ob) break; if(ptr == cptr) { ! if(count == size) if (!growYourOwn) return count; else { size *= 2; list = (struct dataobject **) ! realloc(list,size * sizeof(struct dataobject **)); if (list == NULL) return -1; ! else{ *stash = list; + cptr = list + count; + } } + *cptr++ = ob; + count++; } } i += curenv->header.nestedmark.length; *************** *** 527,532 **** --- 531,543 ---- return 0; } + if( *keyword == '^' && keyword[1] == '\0'){ + /* Note that the high order bit needs set for the following characters + This works because these are always the inner-most brackets */ + HighBitStart = pos; + return(0); + } + else HighBitStart = -1; /* just to be safe */ /* Assume Style keyword: */ /* Insert an environment with a yet undetermined length, */ *************** *** 552,564 **** long pos; FILE *file; { if (envptr != envBegin) { long len = pos - envptr->pos; ! if (len > 0){ ! environment_SetLength(envptr->environment, len); if((stylesIncludeEnd != text_USEDEFAULT) && (envptr->environment->type == environment_Style)) environment_SetStyle(envptr->environment, stylesIncludeBeginning,stylesIncludeEnd); } else environment_Delete(envptr->environment); --- 563,586 ---- long pos; FILE *file; { + if(HighBitStart != -1){ + unsigned char *foo; + long rl; + foo =(unsigned char *) text_GetBuf(self,HighBitStart,pos - HighBitStart,&rl); + while(rl-- > 0) + *foo++ = (unsigned char )( ((int) *foo) | 128); + HighBitStart = -1; + return(0); + } + if (envptr != envBegin) { long len = pos - envptr->pos; ! if (len > 0){ ! environment_SetLength(envptr->environment, len); if((stylesIncludeEnd != text_USEDEFAULT) && (envptr->environment->type == environment_Style)) environment_SetStyle(envptr->environment, stylesIncludeBeginning,stylesIncludeEnd); + } else environment_Delete(envptr->environment); *************** *** 789,795 **** static void TryConversion(self) struct text *self; { ! fprintf(stderr, "File contains nonascii characters\n"); if (class_Load("be1be2") == NULL) { fprintf(stderr, "Be1be2 not found; skipping BE1 check\n"); return; --- 811,817 ---- static void TryConversion(self) struct text *self; { ! /* fprintf(stderr, "File contains nonascii characters\n"); */ if (class_Load("be1be2") == NULL) { fprintf(stderr, "Be1be2 not found; skipping BE1 check\n"); return; *************** *** 896,904 **** rootenv = environment_GetEnclosing(self->rootEnvironment, pos); envptr->environment = rootenv; envptr->pos = environment_Eval(rootenv); len = super_ReadSubString(self, pos, file, quoteCharacters); - if (envptr != environmentStack) { fprintf(stderr, "All environments not closed. - Closing them by default\n"); --- 918,926 ---- rootenv = environment_GetEnclosing(self->rootEnvironment, pos); envptr->environment = rootenv; envptr->pos = environment_Eval(rootenv); + HighBitStart = -1 ; len = super_ReadSubString(self, pos, file, quoteCharacters); if (envptr != environmentStack) { fprintf(stderr, "All environments not closed. - Closing them by default\n"); *************** *** 971,979 **** char c; long envpos; int realcount; ! char outbuf[100],*outp,*endp,*temp,*lastblank; char *buf = NULL; long bufLen; endp = outbuf + 78; outp = outbuf;lastblank = NULL; --- 993,1002 ---- char c; long envpos; int realcount; ! char outbuf[120],*outp,*endp,*temp,*lastblank; char *buf = NULL; long bufLen; + boolean writinghighbit; endp = outbuf + 78; outp = outbuf;lastblank = NULL; *************** *** 1069,1075 **** elen += i; bufLen = 0; ! while (i < elen) { /* Code for writing out actual text */ --- 1092,1098 ---- elen += i; bufLen = 0; ! writinghighbit = FALSE; while (i < elen) { /* Code for writing out actual text */ *************** *** 1077,1082 **** --- 1100,1121 ---- buf = text_GetBuf(self, i, 1024, &bufLen); bufLen--, c = *buf++; + if(((int)c & 128 )!= 0){ + if(!writinghighbit){ + *outp++ = '\\'; + *outp++ = '^'; + *outp++ = '{'; + writinghighbit = TRUE; + } + c = (char) (((int)c) & 127); + } + else{ + if(writinghighbit){ + *outp++ = '}'; + writinghighbit = FALSE; + } + } + if (c == '\\' || c == '{' || c == '}') *outp++ = '\\'; *************** *** 1116,1121 **** --- 1155,1165 ---- else realcount++; i++; } + if(writinghighbit){ + *outp++ = '}'; + writinghighbit = FALSE; + } + } /* flush out cached characters */ *** atk/text/text.ch Wed Nov 22 12:32:29 1989 --- atk/text/text.ch.NEW Thu May 10 16:30:46 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/text.ch,v 2.10 89/09/26 11:51:34 tpn Exp $ */ /* $ACIS:text.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/text.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtext_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/text.ch,v 2.10 89/09/26 11:51:34 tpn Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #define text_VERSION 1 --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/text.ch,v 2.10 89/09/26 11:51:34 tpn Exp $ */ /* $ACIS:text.ch 1.4$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/text.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtext_H = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/text.ch,v 2.10 89/09/26 11:51:34 tpn Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #define text_VERSION 1 *** atk/text/textv.c Wed Apr 11 14:21:12 1990 --- atk/text/textv.c.NEW Fri Jul 20 11:28:32 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/textv.c,v 2.18 90/04/03 11:35:54 gk5g Exp $ */ /* $ACIS:textv.c 1.7$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/textv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/textv.c,v 2.18 90/04/03 11:35:54 gk5g Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/textv.c,v 2.21 90/07/19 16:15:14 gk5g Exp $ */ /* $ACIS:textv.c 1.7$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/textv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/textv.c,v 2.21 90/07/19 16:15:14 gk5g Exp $"; #endif /* lint */ #include *************** *** 156,203 **** } } ! void textview__FinalizeObject(classID, self) ! struct classheader *classID; ! struct textview *self; { struct text *t = Text(self); - int cnt; - if((cnt = dictionary_CountRefs(self)) > 0){ - char **list; - struct viewref **vr; - struct view *view; - if((list = (char **)malloc(cnt * sizeof(char *))) != NULL){ - dictionary_ListRefs(self,list,cnt); - for(vr = (struct viewref **)list; cnt--; vr++){ - view = (struct view *) dictionary_LookUp(self,(char *)*vr); - if(view) view_Destroy(view); - dictionary_Delete(self,(char *)*vr); - viewref_RemoveObserver(*vr,self); - } - free(list); - } - } if(t!=NULL){ if (self->dot != NULL) { text_RemoveMark(t, self->dot); mark_Destroy(self->dot); } if (self->top != NULL) { text_RemoveMark(t, self->top); mark_Destroy(self->top); } if (self->frameDot != NULL) { text_RemoveMark(t, self->frameDot); mark_Destroy(self->frameDot); } if (self->predrawn != NULL) { text_RemoveMark(t, self->predrawn); mark_Destroy(self->predrawn); } if (self->prepredrawn != NULL) { text_RemoveMark(t, self->prepredrawn); mark_Destroy(self->prepredrawn); } } --- 156,191 ---- } } ! static void FreeTextData(self) ! struct textview *self; { struct text *t = Text(self); if(t!=NULL){ if (self->dot != NULL) { text_RemoveMark(t, self->dot); mark_Destroy(self->dot); + self->dot = NULL; } if (self->top != NULL) { text_RemoveMark(t, self->top); mark_Destroy(self->top); + self->top = NULL; } if (self->frameDot != NULL) { text_RemoveMark(t, self->frameDot); mark_Destroy(self->frameDot); + self->frameDot = NULL; } if (self->predrawn != NULL) { text_RemoveMark(t, self->predrawn); mark_Destroy(self->predrawn); + self->predrawn = NULL; } if (self->prepredrawn != NULL) { text_RemoveMark(t, self->prepredrawn); mark_Destroy(self->prepredrawn); + self->prepredrawn = NULL; } } *************** *** 210,218 **** --- 198,239 ---- mark_Destroy(self->lines[i].data); } free(self->lines); + self->lines = NULL; + self->nLines = 0; + self->aLines = 0; } + } + + + void textview__FinalizeObject(classID, self) + struct classheader *classID; + struct textview *self; + { + int cnt; + if((cnt = dictionary_CountRefs(self)) > 0){ + char **list; + struct viewref **vr; + struct view *view; + if((list = (char **)malloc(cnt * sizeof(char *))) != NULL){ + dictionary_ListRefs(self,list,cnt); + for(vr = (struct viewref **)list; cnt--; vr++){ + view = (struct view *) dictionary_LookUp(self,(char *)*vr); + if(view) view_Destroy(view); + dictionary_Delete(self,(char *)*vr); + viewref_RemoveObserver(*vr,self); + } + free(list); + } + } + + + FreeTextData(self); + style_Destroy(self->defaultStyle); keystate_Destroy(self->keystate); + if (self->menus != NULL) { + menulist_Destroy(self->menus); + } if (self->styleMenus != NULL) { menulist_Destroy(self->styleMenus); } *************** *** 225,234 **** { struct view *vself = (struct view *) self; if (changed == (struct observable *) vself->dataobject) { ! if (value == observable_OBJECTDESTROYED) vself->dataobject = NULL; ! else view_WantUpdate(vself, vself); } else if (value == observable_OBJECTDESTROYED && (class_IsTypeByName(class_GetTypeName(changed), "viewref"))) { --- 246,261 ---- { struct view *vself = (struct view *) self; if (changed == (struct observable *) vself->dataobject) { ! if (value == observable_OBJECTDESTROYED) { ! if (self->displayEnvironment != NULL) { ! textview_ReleaseStyleInformation(self, self->displayEnvironment); ! self->displayEnvironment = NULL; ! } vself->dataobject = NULL; ! } ! else { view_WantUpdate(vself, vself); + } } else if (value == observable_OBJECTDESTROYED && (class_IsTypeByName(class_GetTypeName(changed), "viewref"))) { *************** *** 265,271 **** --- 292,307 ---- return; } + if (self->displayEnvironment != NULL) { + textview_ReleaseStyleInformation(self, self->displayEnvironment); + self->displayEnvironment = NULL; + } + + FreeTextData(self); + self->force = TRUE; + super_SetDataObject(self, dataObject); + self->dot = text_CreateMark((struct text *) dataObject, 0, 0); self->top = text_CreateMark((struct text *) dataObject, 0, 0); self->frameDot = text_CreateMark((struct text *) dataObject, -1, 0); *************** *** 285,290 **** --- 321,327 ---- self->lastStyleMenuVersion = -1; menulist_SetMask(self->menus, textview_NoMenus); self->movePosition = -1; + textview_WantUpdate(self, self); } struct view *textview__GetApplicationLayer(self) *************** *** 502,507 **** --- 539,545 ---- struct menulist *styleMenus; text_InitStateVector(&info.sv); + text_ApplyEnvironment(&info.sv, self->defaultStyle, Text(self)->rootEnvironment); info.sv.CurCachedFont = fontdesc_Create(info.sv.CurFontFamily, info.sv.CurFontAttributes, info.sv.CurFontSize); *************** *** 546,551 **** --- 584,590 ---- /* Scrolling toward the end of the document */ /* Determine area that has to be moved */ + if(self->lines[self->nLines - 1].height > self->lines[self->nLines - 1].textheight) { /* last line contains a view that will probably need a full redraw */ stopline = self->nLines - 2; *************** *** 617,623 **** self->cehPos -= self->ceyPos - lasty; self->ceyPos = lasty; ! rectangle_SetRectSize(&tempSrcRect,0,lasty,textview_GetLogicalWidth(self), textview_GetLogicalHeight(self) - lasty); pat = textview_WhitePattern(self); textview_FillRect(self,&tempSrcRect, pat); } --- 656,662 ---- self->cehPos -= self->ceyPos - lasty; self->ceyPos = lasty; ! rectangle_SetRectSize(&tempSrcRect,0,lasty,textview_GetLogicalWidth(self), textview_GetVisualHeight(self) - lasty); pat = textview_WhitePattern(self); textview_FillRect(self,&tempSrcRect, pat); } *************** *** 1907,1916 **** char *s = text_GetBuf(d, pos, 10240, &gotlen); while (gotlen--) { if (*s == TEXT_VIEWREFCHAR) { ! struct environment *env = ! environment_GetInnerMost(d->rootEnvironment, pos); if (env != NULL && env->type == environment_View) CreateMatte(self, env->data.viewref); } s++, pos++; } --- 1946,1958 ---- char *s = text_GetBuf(d, pos, 10240, &gotlen); while (gotlen--) { if (*s == TEXT_VIEWREFCHAR) { ! /* Need to look here - ajp */ ! struct environment *env = textview_GetStyleInformation(self, NULL, pos, NULL); ! if (env != NULL && env->type == environment_View) CreateMatte(self, env->data.viewref); + + textview_ReleaseStyleInformation(self, env); } s++, pos++; } *************** *** 1922,1925 **** --- 1964,2006 ---- char *TypeName; { return class_IsTypeByName(TypeName, "text"); + } + + struct environment *textview__GetStyleInformation(self, sv, pos, length) + struct textview *self; + struct text_statevector *sv; + long pos; + long *length; + { + struct environment *env; + + env = environment_GetInnerMost(Text(self)->rootEnvironment, pos); + if (sv != NULL) { + text_InitStateVector(sv); + text_ApplyEnvironment(sv, self->defaultStyle, env); + } + if (length != NULL) { + *length = environment_GetNextChange(Text(self)->rootEnvironment, pos); + } + return env; + } + + struct environment *textview__GetEnclosedStyleInformation(self, pos, length) + struct textview *self; + long pos; + long *length; + { + struct environment *env; + + env = environment_GetEnclosing(Text(self)->rootEnvironment, pos); + if (length != NULL) { + *length = environment_GetNextChange(Text(self)->rootEnvironment, pos); + } + return env; + } + + void textview__ReleaseStyleInformation(self, env) + struct textview *self; + struct environment *env; + { } *** atk/text/textv.ch Wed Nov 22 12:32:39 1989 --- atk/text/textv.ch.NEW Thu May 10 16:30:51 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/textv.ch,v 2.8 89/09/08 16:52:22 ghoti Exp $ */ /* $ACIS:textv.ch 1.7$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/textv.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtextview_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/textv.ch,v 2.8 89/09/08 16:52:22 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #define textview_VERSION 1 --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/textv.ch,v 2.9 90/05/10 14:02:27 ajp Exp $ */ /* $ACIS:textv.ch 1.7$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/textv.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtextview_H = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/textv.ch,v 2.9 90/05/10 14:02:27 ajp Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #define textview_VERSION 1 *************** *** 104,109 **** --- 104,112 ---- SetDefaultStyle(struct style *styelptr); GetDefaultStyle() returns struct style *; ViewMove(struct mark *currentLine,long movement); + GetStyleInformation(struct text_statevector *sv, long pos, long *length) returns struct environment *; + GetEnclosedStyleInformation(long pos, long *length) returns struct environment *; + ReleaseStyleInformation(struct environment *env); classprocedures: FinalizeObject(struct textview *self); InitializeClass() returns boolean; *** atk/text/txttroff.c Fri Jul 27 16:11:52 1990 --- atk/text/txttroff.c.NEW Mon Jul 30 13:49:29 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txttroff.c,v 2.26 90/03/29 15:11:52 tpn Exp $ */ /* $ACIS:txttroff.c 1.3$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txttroff.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txttroff.c,v 2.26 90/03/29 15:11:52 tpn Exp $"; #endif /* lint */ /* --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txttroff.c,v 2.34 90/07/30 11:34:00 susan Exp $ */ /* $ACIS:txttroff.c 1.3$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txttroff.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txttroff.c,v 2.34 90/07/30 11:34:00 susan Exp $"; #endif /* lint */ /* *************** *** 45,50 **** --- 45,52 ---- #include #include #include + #include + #include struct tran { *************** *** 166,171 **** --- 168,177 ---- #define text_TMACFILE environ_AndrewDir(text_TMACBASE) #endif/* text_TMACFILE */ + #ifndef text_TMACACCENTSFILE + #define text_TMACACCENTSFILE environ_AndrewDir("/lib/tmac/tmac.acc") + #endif /* text_TMACACCENTSFILE */ + #ifndef text_INLINEMACROS #define text_INLINEMACROS FALSE #endif *************** *** 481,486 **** --- 487,496 ---- /* * Built in pathname for now. Needs to be cleaned up */ + if((macfile = environ_GetProfile("tmacaccentsfile")) != NULL || (macfile = environ_GetConfiguration("tmacaccentsfile")) != NULL) + handlemac(f,macfile); + else handlemac(f,text_TMACACCENTSFILE); + if((macfile = environ_GetProfile("tmacfile")) != NULL || (macfile =environ_GetConfiguration("tmacfile")) != NULL) handlemac(f,macfile); *************** *** 642,648 **** char *ostr; int TEST; { /* BUG -- OVERFLOWS NOT DETECTED */ ! char *malloc(),*str; long len; int next = 1; ; --- 652,661 ---- char *ostr; int TEST; { /* BUG -- OVERFLOWS NOT DETECTED */ ! #ifndef _IBMR2 ! char *malloc(); ! #endif /* _IBMR2 */ ! char *str; long len; int next = 1; ; *************** *** 935,946 **** #endif /* 0 */ ! void texttroff__WriteTroff(classID, view, dd, f, toplevel) struct classheader *classID; struct view *view; struct dataobject *dd; FILE * f; int toplevel; { int elen, cs, ln , flag,count,indexfontface,hitchars; register long i, doclen; --- 948,960 ---- #endif /* 0 */ ! void texttroff__WriteSomeTroff(classID, view, dd, f, toplevel, flags) struct classheader *classID; struct view *view; struct dataobject *dd; FILE * f; int toplevel; + unsigned long flags; { int elen, cs, ln , flag,count,indexfontface,hitchars; register long i, doclen; *************** *** 1267,1279 **** } ln++; } ! if(!isprint(c) && c != '\t'){ ! if (ln > 80) { ! fputc('\n', f); ! ln = 0; } - fprintf(f,"\\\\%3.3o",c); - ln += 3; } else { #ifdef BOGUS3812 --- 1281,1302 ---- } ln++; } ! if((!isascii(c) || !isprint(c)) && c != '\t'){ ! char *ccp= pcompch_CharacterToTroff(c,nenv,&sv); ! if(ccp) { ! while(*ccp) { ! fputc(*ccp,f); ! ccp++; ! ln++; ! } ! } else { ! if (ln > 80) { ! fputc('\n', f); ! ln = 0; ! } ! fprintf(f,"\\\\%3.3o",c); ! ln += 3; } } else { #ifdef BOGUS3812 *************** *** 1332,1338 **** else { /* write troff to return to parents state */ nsv = safesv; ! ChangeState(); sv = safesv; } #endif /* ENUMERATE */ --- 1355,1361 ---- else { /* write troff to return to parents state */ nsv = safesv; ! if(flags&texttroff_Revert) ChangeState(); sv = safesv; } #endif /* ENUMERATE */ *************** *** 1349,1354 **** --- 1372,1387 ---- textview_Destroy(tv); text_Destroy(ttxt); } + } + + void texttroff__WriteTroff(classID, view, dd, f, toplevel) + struct classheader *classID; + struct view *view; + struct dataobject *dd; + FILE * f; + int toplevel; + { + texttroff_WriteSomeTroff(view,dd,f,toplevel,texttroff_Revert); } void texttroff__BeginDoc(classID, f) *** atk/text/txttroff.ch Wed Nov 22 12:32:35 1989 --- atk/text/txttroff.ch.NEW Fri Jul 27 12:52:47 1990 *************** *** 2,18 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/txttroff.ch,v 2.5 89/02/23 09:21:44 ghoti Exp $ */ /* $ACIS:txttroff.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/txttroff.ch,v $ */ #ifndef lint ! static char *rcsidtexttroff_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/txttroff.ch,v 2.5 89/02/23 09:21:44 ghoti Exp $"; #endif /* lint */ ! package texttroff[txttroff] { classprocedures: WriteTroff(struct view *view,struct dataobject *dd,FILE * f,int toplevel); /* BeginDoc / EndDoc --- 2,21 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txttroff.ch,v 2.6 90/07/24 20:24:53 rr2b Exp $ */ /* $ACIS:txttroff.ch 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txttroff.ch,v $ */ #ifndef lint ! static char *rcsidtexttroff_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txttroff.ch,v 2.6 90/07/24 20:24:53 rr2b Exp $"; #endif /* lint */ ! /* Flags for various things texttroff should or should not do. (each should be a power of 2) */ ! #define texttroff_Revert 1 /* if set texttroff will revert to the parents state after processing, otherwise the state will be left however it ended up. */ ! package texttroff[txttroff] { classprocedures: + WriteSomeTroff(struct view *view,struct dataobject *dd,FILE *f,int toplevel,unsigned long revert); WriteTroff(struct view *view,struct dataobject *dd,FILE * f,int toplevel); /* BeginDoc / EndDoc *** atk/text/txtvcmds.c Fri Jul 27 16:12:05 1990 --- atk/text/txtvcmds.c.NEW Mon Jul 30 13:49:34 1990 *************** *** 3,14 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txtvcmds.c,v 2.40 90/03/28 19:56:27 gk5g Exp $ */ /* $ACIS:txtvcmds.c 1.7$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txtvcmds.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txtvcmds.c,v 2.40 90/03/28 19:56:27 gk5g Exp $"; #endif /* lint */ #include --- 3,14 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txtvcmds.c,v 2.47 90/07/30 11:06:49 gk5g Exp $ */ /* $ACIS:txtvcmds.c 1.7$ */ /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txtvcmds.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txtvcmds.c,v 2.47 90/07/30 11:06:49 gk5g Exp $"; #endif /* lint */ #include *************** *** 64,79 **** boolean hasViews; static char *yesOrNo[] = {"Yes", "No", NULL}; long answer; d = Text(self); for (hasViews = FALSE; len--; pos++) ! if (text_GetChar(d, pos) == TEXT_VIEWREFCHAR && ! environment_GetInnerMost(d->rootEnvironment, pos)->type == ! environment_View) { ! hasViews = TRUE; ! break; ! } if (! hasViews) return TRUE; --- 64,83 ---- boolean hasViews; static char *yesOrNo[] = {"Yes", "No", NULL}; long answer; + struct environment *env; d = Text(self); for (hasViews = FALSE; len--; pos++) ! if (text_GetChar(d, pos) == TEXT_VIEWREFCHAR) { ! env = textview_GetStyleInformation(self, NULL, pos, NULL); ! if (env->type == environment_View) { ! hasViews = TRUE; ! textview_ReleaseStyleInformation(self, env); ! break; ! } ! textview_ReleaseStyleInformation(self, env); ! } if (! hasViews) return TRUE; *************** *** 180,186 **** text_InsertCharacters(d,pos,&tc,1); i++; } ! text_NotifyObservers(d, 0); } /* This is no longer a command you can type; --- 184,190 ---- text_InsertCharacters(d,pos,&tc,1); i++; } ! text_NotifyObservers(d, observable_OBJECTCHANGED); } /* This is no longer a command you can type; *************** *** 206,212 **** message_DisplayString(self, 0, "Sorry; can't add style."); else ! text_NotifyObservers(d, 0); } void textview_PlainerCmd(self) --- 210,216 ---- message_DisplayString(self, 0, "Sorry; can't add style."); else ! text_NotifyObservers(d, observable_OBJECTCHANGED); } void textview_PlainerCmd(self) *************** *** 218,223 **** --- 222,228 ---- if (ConfirmReadOnly(self)) return; + d = Text(self); pos = textview_GetDotPosition(self); len = textview_GetDotLength(self); *************** *** 243,249 **** text_SetModified(d); } text_RegionModified(d, pos, len); ! text_NotifyObservers(d, 0); } void textview_PlainestCmd(self) --- 248,254 ---- text_SetModified(d); } text_RegionModified(d, pos, len); ! text_NotifyObservers(d, observable_OBJECTCHANGED); } void textview_PlainestCmd(self) *************** *** 254,259 **** --- 259,265 ---- if (ConfirmReadOnly(self)) return; + d = Text(self); pos = textview_GetDotPosition(self); len = textview_GetDotLength(self); *************** *** 263,269 **** pos, len, environment_Style, TRUE)) text_SetModified(d); text_RegionModified(d, pos, len); ! text_NotifyObservers(d, 0); } static objecttest(self,name,desiredname) --- 269,275 ---- pos, len, environment_Style, TRUE)) text_SetModified(d); text_RegionModified(d, pos, len); ! text_NotifyObservers(d, observable_OBJECTCHANGED); } static objecttest(self,name,desiredname) *************** *** 315,321 **** if(objecttest(self,viewname,"view") == FALSE) return; } self->currentViewreference = text_InsertObject(Text(self), textview_GetDotPosition(self), iname,viewname); ! text_NotifyObservers(Text(self), 0); } /* Inserts a lookz view in front of the current paragraph. */ --- 321,327 ---- if(objecttest(self,viewname,"view") == FALSE) return; } self->currentViewreference = text_InsertObject(Text(self), textview_GetDotPosition(self), iname,viewname); ! text_NotifyObservers(Text(self), observable_OBJECTCHANGED); } /* Inserts a lookz view in front of the current paragraph. */ *************** *** 346,352 **** self->currentViewreference = text_InsertObject(Text(self), pos, "lookz", "lookzview"); textview_FrameDot(self, pos); ! text_NotifyObservers(d, 0); } void textview_GotoParagraphCmd(self) --- 352,358 ---- self->currentViewreference = text_InsertObject(Text(self), pos, "lookz", "lookzview"); textview_FrameDot(self, pos); ! text_NotifyObservers(d, observable_OBJECTCHANGED); } void textview_GotoParagraphCmd(self) *************** *** 748,753 **** --- 754,761 ---- pos = self->displayEnvironmentPosition; } else { + textview_ReleaseStyleInformation(self, self->displayEnvironment); + self->displayEnvironment = NULL; textview_CollapseDot(self); pos = textview_GetDotPosition(self); } *************** *** 755,763 **** strcpy(tbuf, "Styles: "); flag = 0; d = Text(self); ! te = d->rootEnvironment; /* now its the root */ ! if (te) ! te = environment_GetEnclosing(te, pos); /* now its not */ if (te) { if (te == d->rootEnvironment) { strcat(tbuf, "None"); --- 763,769 ---- strcpy(tbuf, "Styles: "); flag = 0; d = Text(self); ! te = textview_GetEnclosedStyleInformation(self, pos, NULL); if (te) { if (te == d->rootEnvironment) { strcat(tbuf, "None"); *************** *** 981,987 **** textview_SetDotLength(self, originalLength); } textview_FrameDot(self, originalPos); ! text_NotifyObservers(d, 0); } sprintf(messageString, "Found %d occurrences; replaced %d.", numFound, numReplaced); --- 987,993 ---- textview_SetDotLength(self, originalLength); } textview_FrameDot(self, originalPos); ! text_NotifyObservers(d, observable_OBJECTCHANGED); } sprintf(messageString, "Found %d occurrences; replaced %d.", numFound, numReplaced); *************** *** 1021,1027 **** for(i=0;iheader.view.imPtr, lcYank); ! text_NotifyObservers(Text(self), self); } void textview_YankCmd(self) --- 1064,1070 ---- textview_SetDotPosition(self,initialPos); textview_SetDotLength(self, pos - initialPos); im_SetLastCmd(self->header.view.imPtr, lcYank); ! text_NotifyObservers(Text(self), observable_OBJECTCHANGED); } void textview_YankCmd(self) *************** *** 1092,1098 **** textview_SetDotPosition(self,initialPos); textview_SetDotLength(self, pos - initialPos); im_SetLastCmd(self->header.view.imPtr, lcYank); ! text_NotifyObservers(d, self); } static textview_DoRotatePaste(self, count) --- 1098,1104 ---- textview_SetDotPosition(self,initialPos); textview_SetDotLength(self, pos - initialPos); im_SetLastCmd(self->header.view.imPtr, lcYank); ! text_NotifyObservers(d, observable_OBJECTCHANGED); } static textview_DoRotatePaste(self, count) *************** *** 1191,1197 **** text_DeleteCharacters(Text(self), pos, len); textview_SetDotLength(self, 0); im_SetLastCmd(self->header.view.imPtr, lcKill); ! text_NotifyObservers(Text(self), 0); } /* In order to safely allow killing multiple lines of text, each possibly */ --- 1197,1203 ---- text_DeleteCharacters(Text(self), pos, len); textview_SetDotLength(self, 0); im_SetLastCmd(self->header.view.imPtr, lcKill); ! text_NotifyObservers(Text(self), observable_OBJECTCHANGED); } /* In order to safely allow killing multiple lines of text, each possibly */ *************** *** 1233,1239 **** text_DeleteCharacters(Text(self), pos, endpos - pos); textview_SetDotLength(self, 0); im_SetLastCmd(self->header.view.imPtr, lcKill); ! text_NotifyObservers(Text(self), 0); } } --- 1239,1245 ---- text_DeleteCharacters(Text(self), pos, endpos - pos); textview_SetDotLength(self, 0); im_SetLastCmd(self->header.view.imPtr, lcKill); ! text_NotifyObservers(Text(self), observable_OBJECTCHANGED); } } *************** *** 1276,1282 **** pos++; } textview_SetDotPosition (self,pos); ! text_NotifyObservers(d, 0); } void textview_StartOfParaCmd (self) --- 1282,1288 ---- pos++; } textview_SetDotPosition (self,pos); ! text_NotifyObservers(d, observable_OBJECTCHANGED); } void textview_StartOfParaCmd (self) *************** *** 1342,1348 **** if (ConfirmViewDeletion(self, pos, len)) { text_DeleteCharacters(d, pos, len); textview_FrameDot(self, pos); ! text_NotifyObservers(d, 0); } } --- 1348,1354 ---- if (ConfirmViewDeletion(self, pos, len)) { text_DeleteCharacters(d, pos, len); textview_FrameDot(self, pos); ! text_NotifyObservers(d, observable_OBJECTCHANGED); } } *************** *** 1372,1378 **** ((tc = text_GetChar (d,ep)) != EOF) && (tc =='\t' || tc == ' '); ep++) ; text_DeleteCharacters(d, p, ep - p); ! text_NotifyObservers(d, 0); } int textview_GetSpace(self, pos) --- 1378,1384 ---- ((tc = text_GetChar (d,ep)) != EOF) && (tc =='\t' || tc == ' '); ep++) ; text_DeleteCharacters(d, p, ep - p); ! text_NotifyObservers(d, observable_OBJECTCHANGED); } int textview_GetSpace(self, pos) *************** *** 1489,1495 **** text_InsertCharacters(d,pos++,&a,1); textview_SetDotPosition(self,pos); textview_FrameDot(self, pos); ! text_NotifyObservers(d, 0); } void textview_RuboutCmd (self) --- 1495,1501 ---- text_InsertCharacters(d,pos++,&a,1); textview_SetDotPosition(self,pos); textview_FrameDot(self, pos); ! text_NotifyObservers(d, observable_OBJECTCHANGED); } void textview_RuboutCmd (self) *************** *** 1517,1523 **** text_DeleteCharacters(d, endpos - len, len); textview_SetDotPosition(self, endpos - len); textview_FrameDot(self, endpos - len); ! text_NotifyObservers(d, 0); } } --- 1523,1529 ---- text_DeleteCharacters(d, endpos - len, len); textview_SetDotPosition(self, endpos - len); textview_FrameDot(self, endpos - len); ! text_NotifyObservers(d, observable_OBJECTCHANGED); } } *************** *** 1808,1814 **** pos - 2, 1, vr2); textview_FrameDot(self, pos); ! text_NotifyObservers(text, 0); } void textview_DeleteWordCmd (self) --- 1814,1820 ---- pos - 2, 1, vr2); textview_FrameDot(self, pos); ! text_NotifyObservers(text, observable_OBJECTCHANGED); } void textview_DeleteWordCmd (self) *************** *** 1835,1841 **** if (ConfirmViewDeletion(self, pos, len)) { text_DeleteCharacters(d, pos, len); textview_FrameDot(self, pos); ! text_NotifyObservers(d, self); } } --- 1841,1847 ---- if (ConfirmViewDeletion(self, pos, len)) { text_DeleteCharacters(d, pos, len); textview_FrameDot(self, pos); ! text_NotifyObservers(d, observable_OBJECTCHANGED); } } *************** *** 1863,1869 **** if (ConfirmViewDeletion(self, endpos - len, len)) { text_DeleteCharacters(d, endpos - len, len); textview_FrameDot(self, endpos - len); ! text_NotifyObservers(d, self); } } --- 1869,1875 ---- if (ConfirmViewDeletion(self, endpos - len, len)) { text_DeleteCharacters(d, endpos - len, len); textview_FrameDot(self, endpos - len); ! text_NotifyObservers(d, observable_OBJECTCHANGED); } } *************** *** 1991,1997 **** message_DisplayString(self, 100, "Could not read template file."); else { text_RegionModified(d, 0, text_GetLength(d)); ! text_NotifyObservers(d, 0); message_DisplayString(self, 0, "Done."); } } --- 1997,2003 ---- message_DisplayString(self, 100, "Could not read template file."); else { text_RegionModified(d, 0, text_GetLength(d)); ! text_NotifyObservers(d, observable_OBJECTCHANGED); message_DisplayString(self, 0, "Done."); } } *************** *** 2042,2048 **** pos++; } ! text_NotifyObservers(Text(self), 0); } void textview_UppercaseWord(self, key) --- 2048,2054 ---- pos++; } ! text_NotifyObservers(Text(self), observable_OBJECTCHANGED); } void textview_UppercaseWord(self, key) *************** *** 2087,2093 **** new = i; text_ReplaceCharacters(Text(self), pos, 1, &new, 1); ! text_NotifyObservers(Text(self), 0); textview_SetDotPosition(self, pos + 1); } --- 2093,2099 ---- new = i; text_ReplaceCharacters(Text(self), pos, 1, &new, 1); ! text_NotifyObservers(Text(self), observable_OBJECTCHANGED); textview_SetDotPosition(self, pos + 1); } *************** *** 2170,2176 **** if (p[0] == '\0') strcpy(p,d->currentViewreference->viewType); if(objecttest(self,p,"view") == FALSE) return; text_AddView(d,pos,p, d->currentViewreference->dataObject); ! text_NotifyObservers(d,0); } void textview_CheckSpelling(self) --- 2176,2182 ---- if (p[0] == '\0') strcpy(p,d->currentViewreference->viewType); if(objecttest(self,p,"view") == FALSE) return; text_AddView(d,pos,p, d->currentViewreference->dataObject); ! text_NotifyObservers(d,observable_OBJECTCHANGED); } void textview_CheckSpelling(self) *************** *** 2196,2202 **** message_DisplayString(self, 0, "Text is now read only."); else message_DisplayString(self, 0, "Text is now writable."); ! text_NotifyObservers(myText, 0); /* Handles updating of menus on read only transition. */ } #define BADCURPOS -1 --- 2202,2208 ---- message_DisplayString(self, 0, "Text is now read only."); else message_DisplayString(self, 0, "Text is now writable."); ! text_NotifyObservers(myText, observable_OBJECTCHANGED); /* Handles updating of menus on read only transition. */ } #define BADCURPOS -1 *************** *** 2233,2239 **** /* self->currentViewreference = */ text_InsertObject(d, pos,"bp","bpv"); ! text_NotifyObservers(d,0); } static void textview_NextPage (self) register struct textview *self; --- 2239,2245 ---- /* self->currentViewreference = */ text_InsertObject(d, pos,"bp","bpv"); ! text_NotifyObservers(d,observable_OBJECTCHANGED); } static void textview_NextPage (self) register struct textview *self; *************** *** 2325,2331 **** text_AddView(Text(self), pos,"fnotev",fn); fnote_addenv(fn,Text(self),pos); ! text_NotifyObservers(Text(self),0); textview_SetDotPosition(self,pos + 1); } static void textview_OpenFootnotes(self) --- 2331,2337 ---- text_AddView(Text(self), pos,"fnotev",fn); fnote_addenv(fn,Text(self),pos); ! text_NotifyObservers(Text(self),observable_OBJECTCHANGED); textview_SetDotPosition(self,pos + 1); } static void textview_OpenFootnotes(self) *************** *** 2467,2475 **** {"textview-lowercase-word", "\033l",0,NULL,0,0,textview_LowercaseWord,"Convert word (or region) to lower case."}, {"textview-uppercase-word",NULL,0,NULL,0,0,textview_UppercaseWord,"Convert word (or region) to upper case."}, {"textview-capitalize-word",NULL,0,NULL,0,0,textview_CapitalizeWord,"Capitalize word (or all words within a region)."}, ! {"textview-cursor-to-top", "\033,",0,NULL,0,0,textview_CursorToTop,"Moves cursor to the beggining of the line currently at the top of the screen."}, ! {"textview-cursor-to-bottom", "\033.",0,NULL,0,0,textview_CursorToBottom,"Moves cursor to the beggining of the line currently at the bottom of the screen."}, ! {"textview-cursor-to-center", "\033/",0,NULL,0,0,textview_CursorToCenter,"Moves cursor to the beggining of the line currently at the center of the screen."}, {"textview-change-template",NULL,0,"File~10,Add Template~31",0,textview_NotReadOnlyMenus,textview_ChangeTemplate, NULL, "Change to named template."}, --- 2473,2481 ---- {"textview-lowercase-word", "\033l",0,NULL,0,0,textview_LowercaseWord,"Convert word (or region) to lower case."}, {"textview-uppercase-word",NULL,0,NULL,0,0,textview_UppercaseWord,"Convert word (or region) to upper case."}, {"textview-capitalize-word",NULL,0,NULL,0,0,textview_CapitalizeWord,"Capitalize word (or all words within a region)."}, ! {"textview-cursor-to-top", "\033,",0,NULL,0,0,textview_CursorToTop,"Moves cursor to the beginning of the line currently at the top of the screen."}, ! {"textview-cursor-to-bottom", "\033.",0,NULL,0,0,textview_CursorToBottom,"Moves cursor to the beginning of the line currently at the bottom of the screen."}, ! {"textview-cursor-to-center", "\033/",0,NULL,0,0,textview_CursorToCenter,"Moves cursor to the beginning of the line currently at the center of the screen."}, {"textview-change-template",NULL,0,"File~10,Add Template~31",0,textview_NotReadOnlyMenus,textview_ChangeTemplate, NULL, "Change to named template."}, *************** *** 2493,2499 **** { struct keymap *newKeymap = keymap_New(); register long i; ! char str[2]; struct proctable_Entry *si,*dig; if(normalMenus!=NULL) --- 2499,2505 ---- { struct keymap *newKeymap = keymap_New(); register long i; ! unsigned char str[2]; struct proctable_Entry *si,*dig; if(normalMenus!=NULL) *************** *** 2516,2521 **** --- 2522,2533 ---- keymap_BindToKey(newKeymap, str, si, i); else keymap_BindToKey(newKeymap, str, dig, i); + str[0]++; + } + /* add bindings for iso keyboards */ + str[0] = (unsigned char ) 160; + for (i = 160 ; i < 256; i++) { + keymap_BindToKey(newKeymap, str, si, i); str[0]++; } keymap_BindToKey(newKeymap, "\t", si, '\t'); *** atk/text/txtvinfo.h Wed Nov 22 12:32:52 1989 --- atk/text/txtvinfo.h.NEW Mon Jul 16 15:18:45 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/txtvinfo.h,v 2.7 89/04/27 01:30:24 cm26 Exp $ */ /* $ACIS:txtvinfo.h 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/txtvinfo.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtextviewinfo = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/text/RCS/txtvinfo.h,v 2.7 89/04/27 01:30:24 cm26 Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txtvinfo.h,v 2.8 90/07/13 16:50:07 rr2b Exp $ */ /* $ACIS:txtvinfo.h 1.3$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txtvinfo.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtextviewinfo = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/txtvinfo.h,v 2.8 90/07/13 16:50:07 rr2b Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ #include *************** *** 80,86 **** int lineAbove; /* Above of tallest font on line */ int spaceBump; /* Extra space added per rubber space */ int lineBP; /* Pointer into line buffer array */ ! char lineBuffer[LBSIZE]; /* Line buffer array */ int lineIP; /* Pointer into lineitem array */ struct lineitem *clp; /* Pointer to lineitems[lineip-1] */ struct lineitem lineItems[NTITEMS]; /* Line item array */ --- 80,86 ---- int lineAbove; /* Above of tallest font on line */ int spaceBump; /* Extra space added per rubber space */ int lineBP; /* Pointer into line buffer array */ ! unsigned char lineBuffer[LBSIZE]; /* Line buffer array */ int lineIP; /* Pointer into lineitem array */ struct lineitem *clp; /* Pointer to lineitems[lineip-1] */ struct lineitem lineItems[NTITEMS]; /* Line item array */ *** atk/text/pcompch.c Fri Jul 27 14:04:32 1990 --- atk/text/pcompch.c.NEW Fri Jul 20 11:28:35 1990 *************** *** 0 **** --- 1,518 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1990 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + #include + #include + #include + #include /* sys/file.h */ + + #include + #include + #include + #include + #include + + #include + #define MAXMACROLEN 15 + + static struct composites *composites[MAXCHAR+1]; + static char *troffmagic[256]; + static char *asciimagic[256]; + static unsigned char order[256]; + + static char hex[]="0123456789abcdef"; + static char octal[]="01234567"; + + + void cleanmagic() + { + int i; + for(i=0;i<=255;i++) { + if(troffmagic[i]) free(troffmagic[i]); + if(asciimagic[i]) free(asciimagic[i]); + } + } + + /* The following two function were taken from basics/common/init.c on June 12, 1990 */ + /* Translate a key sequence that has ^A, \ddd, and \c conventions. */ + static int TranslateKeySequence(from, to) + char *from; + char *to; + { + while (*from != '\0') { + if (*from == '\\') { + + int temp = parseBackslashed(&from); + + if (temp == -1) + return -1; + else + *to++ = temp; + } + else if (*from == '^') { + ++from; + if (*from == 0) + return -1; + *to++ = (*from++) & 0x1f; + } + else + *to++ = *from++; + } + *to++ = 0; + return 0; + } + + static int parseBackslashed(fromChars) + char **fromChars; + { + + int returnChar; + char *from = *fromChars; + static char *bsSource = "ebrnt"; + static char *bsDest = "\033\b\r\n\t"; + + if (*from == '\\') { + ++from; + if (*from == 0) + return -1; + if (isdigit(*from)) { + + int sum = 0, i; + + for (i = 0; i < 3; ++i) { + if (!isdigit(*from)) + break; + if (*from == '8' || *from == '9') + return -1; + sum = sum * 8 + *from - '0'; + ++from; + } + returnChar = sum; + } + else { + + char *p; + + p = index(bsSource, *from); + if (p != NULL) + returnChar = bsDest[p-bsSource]; + else + returnChar = *from; + ++from; + } + } + else + return -1; + *fromChars = from; + return returnChar; + } + + /* ahotoi: used by pcompch_insert to parse a hexadecimal or octal number depending on if base is 3 or 4. */ + unsigned char ahotoi(ptr,base2) + char *ptr; + int base2; + { + unsigned char result; + char c,*i,*base=(base2==3)?octal:hex; + while(*ptr && *ptr!=' ') { + result<<=base2; + c=(*ptr); + if(isupper(c)) c=tolower(c); + i=index(base,c); + if(!i) return '\0'; + result+=i-base; + ptr++; + } + return result; + } + + /* parsecode: parse a code in decimal,hex, octal or simply set the high bit of an ASCII character. */ + unsigned char parsecode(ptr) + char *ptr; + { + switch(*ptr) { + case '|': + return ptr[1]|0x80; + case 'x': + return ahotoi(ptr+1,4); + case 'o': + return ahotoi(ptr+1,3); + case 'd': + ptr++; + default: + return atoi(ptr); + } + } + + void scanerr(msg,key,new,line) + char *msg; + char key; + struct composites *new; + long line; + { + fprintf(stderr,msg,line); + printf(msg,line); + if(key) fprintf(stderr,"Key: %c\n",key); + if(new) free(new); + } + + /* scanstring: returns a pointer to the first un-escaped terminator in a string */ + char *scanstring(str) + char **str; + { + boolean flag=FALSE; + char *end=(*str); + if(*end=='\"') { + (*str)++; + end++; + while(*end && (flag || *end!='\"')) { + if(flag) flag=FALSE; + else if(*end=='\\') flag=TRUE; + end++; + } + } else { + /* find the terminator, a space or tab */ + while(*end && *end!=' ' && *end!='\t') end++; + } + return end; + } + + /* scancomposites: reads in (from the line pointed to by PTR) the extensions which may be used with the character KEY and puts the entries into the composites table giving the extensions and corresponding character code. + */ + boolean scancomposites(ptr,line) + char *ptr; + long line; + { + char *end,*ptr2,*style=NULL; + unsigned char code; + struct composites *new=NULL; + /* Skip leading spaces */ + while(*ptr==' ' || *ptr =='\t') ptr++; + + /* Handle a quoted key sequence, setting end to the ending + quote if there is one */ + end=scanstring(&ptr); + + /* Terminate the keysequence string with a nul. */ + if(*end) *end='\0'; + else { + /* if there is no code assume this is a request to delete + the given key sequence from the table */ + pcompch_DeleteComposite(*ptr,ptr+1); + return TRUE; + } + ptr2=end; + /* Skip any white space after the key sequence */ + while(*++ptr2==' ' || *ptr2=='\t'); + + if(!*ptr2) { + scanerr("No character code in line %ld\n",*ptr,new,line); + return FALSE; + } + + code=parsecode(ptr2); + + /* skip the character code and any whitespace following + it */ + while(*ptr2 && *ptr2!=' ' && *ptr2!='\t') ptr2++; + while(*ptr2==' ' || *ptr2=='\t') ptr2++; + + /* if there is anything after the trailing white space + assume it is a troff macro for the character */ + if(*ptr2&&*ptr2!='!') { + for(end=ptr2+1;*end && *end!=' ' && *end!='\t';end++); + if(*end) *end++='\0'; + if(strlen(ptr2)>MAXMACROLEN) { + scanerr("troff macro too long in line %ld\n",*ptr,new,line); + return FALSE; + } + if(troffmagic[code]) free(troffmagic[code]); + troffmagic[code]=(char *)malloc(strlen(ptr2)+1); + if(!troffmagic[code]) { + scanerr("Memory error in line %ld\n",*ptr,new,line); + return FALSE; + } + strcat(troffmagic[code],ptr2); + ptr2=end; + } else if (*ptr2=='!') ptr2++; + + while(*ptr2==' ' || *ptr2=='\t') ptr2++; + + if(*ptr2) { + end=scanstring(&ptr2); + if(*end) *end++='\0'; + if(*ptr2) style=ptr2; + ptr2=end; + while(*ptr2==' ' || *ptr2=='\t') ptr2++; + if(*ptr2 && *ptr2!='!') { + end=scanstring(&ptr2); + if(*end) *end++='\0'; + if(*ptr2) { + if(asciimagic[code]) free(asciimagic[code]); + asciimagic[code]=(char *)malloc(strlen(ptr2)+1); + if(!asciimagic[code]) { + scanerr("Memory error in line %ld\n",*ptr,new,line); + return FALSE; + } + strcpy(asciimagic[code],ptr2); + } + } else if(*ptr2=='!') ptr2++; + } + + /* Add the keysequence to the compositions table */ + new=(struct composites *) malloc(sizeof(struct composites)); + + if(!new) { + scanerr("Memory error while reading composites file.\n", 0, new, line); + return FALSE; + } + + if(*ptr) { + if(strlen(ptr)>sizeof(new->exts)) { + scanerr("Extension too long in line %ld.\n",*ptr, new, line); + return FALSE; + } + TranslateKeySequence(ptr,ptr); + strcpy(new->exts,ptr+1); + if(style) strcpy(new->style,style); + else new->style[0]='\0'; + new->code=code; + pcompch_DeleteComposite(*ptr,new->exts); + new->next=composites[*ptr]; + composites[*ptr]=new; + } + return TRUE; + } + + + /* fix_fgets: just changes the first newline in BUF to a null. This is just to make things easy after using fgets. */ + void fix_fgets(buf) + char *buf; + { + char *p=index(buf,'\n'); + if(p) *p='\0'; + } + + void pcompch__ATKToASCII(classID,text) + struct classheader *classID; + struct text *text; + { + int i; + for(i=0;i<256;i++) { + if(asciimagic[i]) { + long pos=0; + do { + pos=text_Index(text, pos, (unsigned char)i,text_GetLength(text)-pos); + if(pos!=EOF) { + text_AlwaysReplaceCharacters(text, pos, 1, asciimagic[i], strlen(asciimagic[i])); + pos+=strlen(asciimagic[i]); + } + } while(pos!=EOF); + } + } + } + + void pcompch__ASCIIToATK(classID,text,pos,len,func,rock) + struct classheader *classID; + struct text *text; + long pos,len; + procedure func; + long rock; + { + int i,j; + long end; + struct mark *area; + if(len==0) { + len=text_GetLength(text); + pos=0; + } + area=text_CreateMark(text,pos,len); + if(!area) return; + for(i=0;i<256;i++) { + pos=mark_GetPos(area); + j=order[i]; + if(asciimagic[j]) { + long len=strlen(asciimagic[j]); + end=mark_GetPos(area)+mark_GetLength(area); + do { + pos=text_Index(text, pos, asciimagic[j][0], end-pos); + if(pos!=EOF && pos+len<=end && !text_Strncmp(text, pos, asciimagic[j], len)) { + pos=func(text,pos,(unsigned char)j,asciimagic[j],rock); + } + end=mark_GetPos(area)+mark_GetLength(area); + } while(pos!=EOF && pos+len <= end); + } + } + text_RemoveMark(text,area); + mark_Destroy(area); + } + + int lenorder(e1,e2) + unsigned char *e1,*e2; + { + if(!asciimagic[*e2] || !asciimagic[*e1]) return 0; + return strlen(asciimagic[*e2])-strlen(asciimagic[*e1]); + } + + + /* pcompch_ReadCompositesFile: reads COMPFILE and places the composites defined in it into the composites table. */ + boolean pcompch__ReadCompositesFile(classID,compfile) + struct classheader *classID; + char *compfile; + { + char buf[1024],*ptr=buf; + boolean end=FALSE,err=FALSE; + FILE *fp=fopen(compfile,"r"); + long line=0,i; + if(!fp) return FALSE; + while(!feof(fp)&!end) { + *buf='\0'; + if(!fgets(buf,sizeof(buf),fp)) end=TRUE; + fix_fgets(buf); + line++; + if(*buf=='#'||!*buf) continue; + while(*ptr==' ' || *ptr=='\t') ptr++; + if(!scancomposites(ptr,line)) err=end=TRUE; + } + for(i=0;i<=255;i++) order[i]=(unsigned char)i; + qsort(order,256,1,lenorder); + return !err; + } + + /* pcompch_ClearComposites: clears out all defined compositions, + not tested yet but should be correct. */ + void pcompch__ClearComposites(classID) + struct classheader *classID; + { + int i; + for(i=1;i<=MAXCHAR;i++) { + struct composites *next=composites[i]; + while(next) { + struct composites *this=next; + next=this->next; + free(this); + } + composites[i]=NULL; + } + } + + /* pcompch_DeleteComposite: finds and deletes one composite + from the composites table. */ + void pcompch__DeleteComposite(classID,key,exts) + { + struct composites *next=composites[key],*last=NULL; + while(next) { + struct composites *this=next; + next=this->next; + if(strcmp(exts,this->exts)) last=this; + else { + if(last) last->next=this->next; + else composites[key]=this->next; + free(this); + } + } + } + + /* pcompch_EnumerateComposites: the function FUNC is called on each + composite of key until it returns a non-zero value or there are no more + composites. + The call to func is made as below: + func(key,composite,rock); + where composite is of type struct composites. */ + long pcompch__EnumerateComposites(classID,key,func,rock) + struct classheader *classID; + char key; + procedure func; + long rock; + { + long result; + struct composites *next=composites[key]; + while(next) { + struct composites *this=next; + next=this->next; + if(result=func(key,this,rock)) return result; + } + return 0; + } + + char *pcompch__CharacterToTroff(classID,ch,env,tv) + struct classheader *classID; + unsigned char ch; + struct environment *env; + struct textview *tv; + { + return troffmagic[ch]; + } + + unsigned char *pcompch__StringToTroff(classID,str,buf,bufsize,env,tv) + struct classheader *classID; + unsigned char *str; + struct environment *env; + struct textview *tv; + char *buf; + long bufsize; + { + char buf2[16],*bp=buf; + bzero(buf,bufsize); + while(*str && buf-bp=bufsize-1) return str; + while(*ccp) *bp++=(*ccp++); + } else { + sprintf(buf2,"\\\\%3.3o",*str); + if((int)(buf-bp+strlen(buf2))>=bufsize-1) return str; + strcat(bp,buf2); + bp+=strlen(buf2); + } + str++; + } + } + return str; + } + + + boolean pcompch__InitializeClass(ClassID) + struct classheader *ClassID; + { + char *compfile=environ_GetProfile("compositesfile"); + boolean override= environ_GetProfileSwitch("overridecomposites",FALSE); + char *libfile=environ_AndrewDir("/lib/compchar/comps"); + int i; + + for(i=0;i<=MAXCHAR;i++) composites[i]=NULL; + + for(i=0;i<=255;i++) { + troffmagic[i]=NULL; + asciimagic[i]=NULL; + } + + if(override || access(libfile,F_OK)) { + if(!compfile) { + fprintf(stderr,"No composites file given in preferences.\n"); + return FALSE; + } + } else if(!override && !pcompch_ReadCompositesFile(libfile)) { + fprintf(stderr,"Error reading default composites file:%s\n", libfile); + pcompch_ClearComposites(); + cleanmagic(); + return FALSE; + } + if(compfile && !pcompch_ReadCompositesFile(compfile)) { + fprintf(stderr,"Error reading composites file:%s.\n", compfile); + pcompch_ClearComposites(); + cleanmagic(); + return FALSE; + } + return TRUE; + } *** atk/text/comps Fri Jul 27 14:04:43 1990 --- atk/text/comps.NEW Mon Jul 16 15:18:47 1990 *************** *** 0 **** --- 1,172 ---- + #just to make sure comments work + ag xe0 a\*(l` + aa 225 a\*(l' + a^ 226 a\*(l^ + a~ 227 a\*(l~ + a: 228 a\*(l: + ao 229 a\*(lo + Ag 192 A\*(u` + Aa 193 A\*(u' + A^ 194 A\*(u^ + A~ 195 A\*(u~ + A: 196 A\*(u: + Ao 197 A\*(uo + + Eg 200 E\*(u` + eg 232 e\*(l` + Ea 201 E\*(u' + ea 233 e\*(l' + E^ 202 E\*(u^ + e^ 234 e\*(l^ + E: 203 E\*(u: + e: 235 e\*(l: + + Ig 204 I\*(u` + ig 236 i\*(l` + Ia 205 I\*(u' + ia 237 i\*(l' + I^ 206 I\*(u^ + i^ 238 i\*(l^ + I: 207 I\*(u: + i: 239 i\*(l: + + N~ 209 N\*(u~ + n~ 241 n\*(l~ + + Og 210 O\*(u` + og 242 o\*(l` + Oa 211 O\*(u' + oa 243 o\*(l' + O^ 212 O\*(u^ + o^ 244 o\*(l^ + O~ 213 O\*(u~ + o~ 245 o\*(l~ + O: 214 O\*(u: + o: 246 o\*(l: + + Ug 217 U\*(u` + ug 249 u\*(l` + Ua 218 U\*(u' + ua 250 u\*(l' + U^ 219 U\*(u^ + u^ 251 u\*(l^ + U: 220 U\*(u: + u: 252 u\*(l: + + Ya 221 Y\*(u' + ya 253 y\*(l' + y: 255 y\*(l: + + Ae 198 \*(Ae + AE 198 \*(Ae + ae 230 \*(ae + aE 230 \*(ae + + C, 199 C\*(u, + c, 231 c\*(l, + + D- 208 \*(D- + + + SS 223 \*8 + Ss 223 \*8 + + co 169 \(co + rg 174 \(rg + ct 162 \(ct + + 1/4 188 \(14 + 1/2 189 \(12 + 3/4 190 \(34 + + !q 191 \*? + !! 161 \*! + + P' 222 \*(Th + p' 254 \*(th + + ga 97 ! symbol + gb 98 ! symbol + gg 103 ! symbol + gd 100 ! symbol + ge 101 ! symbol + gz 122 ! symbol + gy 104 ! symbol + gh 113 ! symbol + gi 105 ! symbol + gk 107 ! symbol + gl 108 ! symbol + gm 109 ! symbol + gn 110 ! symbol + gc 120 ! symbol + go 111 ! symbol + gp 112 ! symbol + pi 112 + gr 114 ! symbol + gs 115 ! symbol + gt 116 ! symbol + gu 117 ! symbol + gf 102 ! symbol + gx 99 ! symbol + gq 121 ! symbol + gw 119 ! symbol + gA 65 ! symbol + gB 66 ! symbol + gG 71 ! symbol + gD 68 ! symbol + gE 69 ! symbol + gZ 90 ! symbol + gY 72 ! symbol + gH 81 ! symbol + gI 73 ! symbol + gK 75 ! symbol + gL 76 ! symbol + gM 77 ! symbol + gN 78 ! symbol + gC 88 ! symbol + gO 79 ! symbol + gP 80 ! symbol + gR 82 \*(R symbol + gS 83 ! symbol + gT 84 ! symbol + gU 85 ! symbol + gF 70 ! symbol + gX 67 ! symbol + gQ 89 ! symbol + gW 87 ! symbol + m+ 43 ! symbol + m- 45 ! symbol + m= 61 ! symbol + m* 42 ! symbol + ms 86 ! symbola + me 96 ! symbol + >= 51 ! symbola + <= 35 ! symbola + == 58 ! symbola + ~= 64 ! symbol + ap 126 ! symbol + != 57 ! symbola + -> 46 ! symbola + <- 44 ! symbola + \^| 45 ! symbola + |^ 47 ! symbola + xx 52 ! symbola + // 56 ! symbola + +- 49 ! symbola + un 72 ! symbola + in 71 ! symbola + ps 76 ! symbola + pS 73 ! symbola + is 77 ! symbola + iS 74 ! symbola + if 37 ! symbola + pd 54 ! symbola + gr 81 ! symbola + no 88 ! symbola + it 114 ! symbola + pt 53 ! symbola + es 70 ! symbola + mo 78 ! symbola + br 61 ! symbola + + *** atk/text/tmac.acc Fri Jul 27 14:04:56 1990 --- atk/text/tmac.acc.NEW Mon Jul 2 15:28:22 1990 *************** *** 0 **** --- 1,121 ---- + .\" Including the accents macro file from the ms macro package + .\" $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/tmac.acc,v 1.5 90/07/02 15:23:23 tpn Exp $ + .\" $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/text/RCS/tmac.acc,v $ + .\" AM - accent mark definitions + .bd S B 3 + . \" fudge factors for nroff and troff + .if n \{\ + . ds #H 0 + . ds #V .8m + . ds #F .3m + . ds #[ \f1 + . ds #] \fP + .\} + .if t \{\ + . ds #H ((1u-(\\\\n(.fu%2u))*.13m) + . ds #V .6m + . ds #F 0 + . ds #[ \& + . ds #] \& + .\} + . \" simple accents for nroff and troff + .if n \{\ + . ds ' \h'-1'\' + . ds ` \h'-1'\` + . ds ^ \h'-1'^ + . ds , \h'-1', + . ds ~ \h'-1'~ + . ds ? ? + . ds ! ! + . ds / \h'-1'\(sl + . ds q o\h'-1', + .\} + .if t \{\ + . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" + . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' + . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' + . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' + . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' + . ds ? \s-2c\h'-\w'c'u*7/10'\u\h'\*(#H'\zi\d\s+2\h'\w'c'u*8/10' + . ds ! \s-2\(or\s+2\h'-\w'\(or'u'\v'-.8m'.\v'.8m' + . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' + . ds q o\h'-\w'o'u*8/10'\s-4\v'.4m'\z\(*i\v'-.4m'\s+4\h'\w'o'u*8/10' + .\} + . \" troff and (daisy-wheel) nroff accents + .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' + .ds 8 \h'\*(#H'\(*b\h'-\*(#H' + .ds v \\k:\h'-(\\n(.wu*9/10-\*(#H)'\v'-\*(#V'\*(#[\s-4v\s0\v'\*(#V'\h'|\\n:u'\*(#] + .ds _ \\k:\h'-(\\n(.wu*9/10-\*(#H+(\*(#F*2/3))'\v'-.4m'\z\(hy\v'.4m'\h'|\\n:u' + .ds . \\k:\h'-(\\n(.wu*8/10)'\v'\*(#V*4/10'\z.\v'-\*(#V*4/10'\h'|\\n:u' + .ds 3 \*(#[\v'.2m'\s-2\&3\s0\v'-.2m'\*(#] + .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] + .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' + .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' + .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] + .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] + .ds ae a\h'-(\w'a'u*4/10)'e + .ds Ae A\h'-(\w'A'u*4/10)'E + .ds oe o\h'-(\w'o'u*4/10)'e + .ds Oe O\h'-(\w'O'u*4/10)'E + . \" corrections for vroff + .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' + .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' + . \" for low resolution devices (crt and lpr) + .if \n(.H>23 .if \n(.V>19 \ + \{\ + . ds : \h'-1'" + . ds 8 B + . ds v \h'-1'\o'\(aa\(ga' + . ds _ \h'-1'^ + . ds . \h'-1'. + . ds 3 3 + . ds o a + . ds d- d\h'-1'\(ga + . ds D- D\h'-1'\(hy + . ds th \o'bp' + . ds Th \o'LP' + . ds ae ae + . ds Ae AE + . ds oe oe + . ds Oe OE + .\} + .rm #[ #] #H #V #F C + .\" An apparently modified copy of the chars.me macro file provied by Bill Cattey (wdc@athena.mit.edu) is included below + .nr _0 \n(c. + .\" @(#)chars.me 2.2 8/29/80 + .\" %beginstrip% + .\" *** special characters *** + .\" this file uses temp strings of the form #x. + . ds #h ((1u-(\\\\n(.fu%2u))*0.13m) + .\" \" accents + .ds l' \k_\h'-(\\n(.wu*8/10-\*(#h)'\(aa\h'|\\n_u' + .ds u' \k_\h'-(\\n(.wu*8/10-\*(#h)'\v'-(0.2v)'\(aa\v'0.2v'\h'|\\n_u' + .ds l` \k_\h'-(\\n(.wu*7/10-\*(#h)'\(ga\h'|\\n_u' + .ds u` \k_\h'-(\\n(.wu*7/10-\*(#h)'\v'-(0.2v)'\(ga\v'0.2v'\h'|\\n_u' + .\" \" umlaut + .ds l: \k_\h'-(\\n(.wu*8/10-\*(#h+0.1m)'\v'-0.6m'\z.\h'0.2m'.\h'|\\n_u'\v'0.6m' + .ds u: \k_\h'-(\\n(.wu*8/10-\*(#h)'\v'-0.8m'\z.\h'0.2m'.\v'0.8m'\h'|\\n_u' + .\" \" circumflex + .ds l^ \k_\h'-(\\n(.wu-\*(#h-0.05m)'^\h'|\\n_u' + .ds u^ \k_\h'-(\\n(.wu-\*(#h-0.15m)'\v'-(0.2v)'^\v'0.2v'\h'|\\n_u' + .\" \" tilde + .ds l~ \k_\h'-(\\n(.wu-\*(#h-0.05m)'~\h'|\\n_u' + .ds u~ \k_\h'-(\\n(.wu-\*(#h-0.15m)'\v'-(0.2v)'\s2~\s0\v'0.2v'\h'|\\n_u' + .\" \" cedilla + .ds l, \k_\h'-(\\n(.wu)',\h'|\\n_u' + .ds u, \k_\h'-(\\n(.wu-0.2m)',\h'|\\n_u' + .\" \" czech + .ds lv \k_\h'-(\\n(.wu*9/10-\*(#h)'\v'-0.5m'\s-4v\s0\v'0.5m'\h'|\\n_u' + .ds uv \k_\h'-(\\n(.wu*9/10-\*(#h-0.1m)'\v'-0.65m'\s-4v\s0\v'0.65m'\h'|\\n_u' + .\" \" Norwegian A or angstrom + .ds lo \k_\h'-(\\n(.wu+\w'\(de'u-\*(#h)/2u'\v'-0.2n'\&\z\(de\v'0.2n'\h'|\\n_u'\& + .ds uo \k_\h'-(\\n(.wu+\w'\(de'u-\*(#h)/2u'\v'-0.4n'\&\z\(de\v'0.4n'\h'|\\n_u'\& + .\" \" there exists, for all + .ds qe \&\v'0.5m'\z\(em\v'-0.65m'\z\(em\v'-0.65m'\z\(em\v'0.8m'\h'0.3m'|\h'-0.3m'\& + .ds qa \&\h'-0.24m'\z\e\h'0.48m'\z\(sl\h'-0.24m'\v'-0.15m'\(em\v'0.15m'\& + .if t \ + \{\ + . ds qe \s-2\v'0.45m'\z\(em\v'-0.625m'\z\(em\v'-0.625m'\(em\v'0.8m'\s0\h'-0.1m'\v'-0.05m'\(br\v'0.05m'\h'0.1m' + . ds qa \z\e\h'0.35m'\z\(sl\h'-0.33m'\v'-0.3m'\s-4\(em\s0\v'0.3m'\h'0.15m' + .\} + .rm #h *** atk/textaux/compchar.c Fri Jul 27 14:05:09 1990 --- atk/textaux/compchar.c.NEW Fri Jul 20 11:28:44 1990 *************** *** 0 **** --- 1,747 ---- + /*********************************************************************** *\ + * Copyright IBM Corporation 1990 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/textaux/RCS/compchar.c,v 1.10 90/07/17 10:27:25 rr2b Exp $ */ + /* $ACIS:$ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/textaux/RCS/compchar.c,v $ */ + + #ifndef lint + static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/textaux/RCS/compchar.c,v 1.10 90/07/17 10:27:25 rr2b Exp $"; + #endif /* lint */ + + #include + #include + #include + #include /* sys/file.h */ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + static struct style *boldulined=NULL,*fixed=NULL; + + static struct proctable_Entry *nop=NULL,*insertchar=NULL; + + static procedure textview_SelfInsertCmd=NULL; + + static char leftaccent[]="AEIOUYaeiouy"; + static unsigned char leftaccentcodes[]={0xc1,0xc9,0xcd,0xd3,0xda,0xdd,0xe1,0xe9, 0xed,0xf3,0xfa,0xfd}; + + static char rightaccent[]="AEIOUaeiou"; + static unsigned char rightaccentcodes[]={0xc0,0xc8,0xcc,0xd2,0xd9,0xe0,0xe8,0xec, 0xf2,0xf9}; + + static char hat[]="AEIOUaeiou"; + static unsigned char hatcodes[]={0xc2,0xca,0xce,0xd4,0xdb,0xe2,0xea,0xee,0xf4,0xfb}; + + static char tilde[]="ANOano"; + static unsigned char tildecodes[]={0xc3,0xd1,0xd5,0xe3,0xf1,0xf5}; + + static char umlaut[]="AEIOUaeiouy"; + static unsigned char umlautcodes[]={0xc4,0xcb,0xcf,0xd6,0xdc,0xe4,0xeb,0xef,0xf6, 0xfc,0xff}; + + static char hex[]="0123456789abcdef"; + static char octal[]="01234567"; + + /* ahotoi: used by compchar_insert to parse a hexadecimal or octal number depending on if base is 3 or 4. */ + unsigned char ahotoi(ptr,base2) + char *ptr; + int base2; + { + unsigned char result; + char c,*i,*base=(base2==3)?octal:hex; + while(*ptr && *ptr!=' ') { + result<<=base2; + c=(*ptr); + if(isupper(c)) c=tolower(c); + i=index(base,c); + if(!i) return '\0'; + result+=i-base; + ptr++; + } + return result; + } + + /* parsecode: parse a code in decimal,hex, octal or simply set the high bit of an ASCII character. */ + unsigned char parsecode(ptr) + char *ptr; + { + switch(*ptr) { + case '|': + return ptr[1]|0x80; + case 'x': + return ahotoi(ptr+1,4); + case 'o': + return ahotoi(ptr+1,3); + case 'd': + ptr++; + default: + return atoi(ptr); + } + } + + void SelfInsertCmd(tv,code,style) + struct textview*tv; + unsigned char code; + char *style; + { + struct text *t=(struct text *)textview_GetDataObject(tv); + struct stylesheet *s=text_GetStyleSheet(t); + struct style *st; + struct environment *env; + long pos=textview_GetDotPosition(tv),pos2; + char *tmpl2,*tmpl; + textview_SelfInsertCmd(tv,code); + if(style[0]) { + char *tstyle=(char *)malloc(strlen(style)+1); + if(!tstyle) return; + if(!s) { + message_DisplayString(tv,0,"No styles available.\n"); + return; + } + pos2=textview_GetDotPosition(tv); + if(pos2<=pos) return; + + strcpy(tstyle,style); + tmpl=index(tstyle,','); + if(tmpl) { + tmpl2=tmpl+1; + *tmpl='\0'; + while(*tmpl2==' ') tmpl2++; + } else tmpl2="symbol"; + + if(text_ReadTemplate(t,tmpl2,FALSE)) message_DisplayString(tv,99,"Warning: proper template could not be loaded."); + + st=stylesheet_Find(s,tstyle); + free(tstyle); + if(!st) { + message_DisplayString(tv,0,"Couldn't find style.\n"); + return; + } + env=text_AddStyle(t,pos,pos2-pos,st); + if(!env) { + message_DisplayString(tv,0,"Couldn't add style to document\n"); + return; + } + environment_SetStyle(env,FALSE,FALSE); + text_NotifyObservers(t,0); + } + } + + /* compchar_insert: inserts an arbitrary character specified in an init file. The following characters are treated specially when they occur as the first character of the argument: + '|': inserts the character following it with the high bit set. + 'x': inserts the character whose code is given in hexadecimal. + 'o': inserts the character whose code is given in octal. + 'd': inserts the character whose code is given in decimal. + If the first character of the argument isn't one of the above it is taken to be the decimal code for the character to be inserted. */ + void compchar_insert(tv,ptr) + struct textview *tv; + char *ptr; + { + if((long)ptrMAXCHAR) { + unsigned char *i=(unsigned char *)index(list,*ptr); + if(!i) { + message_DisplayString(tv,0,"Character not available."); + return; + } + textview_SelfInsertCmd(tv,codes[i-(unsigned char *)list]); + } else { + long pos=textview_GetDotPosition(tv)-1; + unsigned char *i; + if(pos<0) { + message_DisplayString(tv,0,"No character before the cursor."); + return; + } + i=(unsigned char *)index(list,text_GetChar(t,pos)); + if(!i) { + message_DisplayString(tv,0,"Character not available."); + return; + } + text_ReplaceCharacters(t,pos, 1, codes+(i-(unsigned char *)list),1); + } + text_NotifyObservers(t,observable_OBJECTCHANGED); + } + + struct arock { + struct textview *tv; + char *list; + unsigned char *codes; + procedure oldoverride; + long oldrock; + }; + + /* doafter: the keystate override function for applying a umlaut, hat, tilde, etc to the next character typed; + */ + enum keymap_Types doafter(rock,key,ppe,prock) + struct arock *rock; + char key; + struct proctable_Entry **ppe; + long *prock; + { + struct textview *tv=rock->tv; + unsigned char *i=(unsigned char *)index(rock->list,key); + if(!i) { + keystate_SetOverride(tv->keystate,rock->oldoverride, rock->oldrock); + free(rock); + message_DisplayString(tv,0,"No such character."); + *prock=0; + *ppe=nop; + return keymap_Proc; + } + keystate_SetOverride(tv->keystate,rock->oldoverride, rock->oldrock); + free(rock); + *prock=rock->codes[i-(unsigned char *)rock->list]; + *ppe=insertchar; + return keymap_Proc; + } + + /* after: the function which actually handles the work for all the compchar_*after functions, sets doafter as the override function on the textviews keystate, if the override function is alread doafter it cancels the operation and if the .*init file so indicated will insert a character. */ + void after(tv,list,codes,ch) + struct textview *tv; + char *list; + unsigned char *codes; + char *ch; + { + struct arock *rock; + rock=(struct arock *)malloc(sizeof(struct arock)); + if(!rock) return; + rock->tv=tv; + rock->list=list; + rock->codes=codes; + keystate_GetOverride(tv->keystate,&rock->oldoverride, &rock->oldrock); + if(rock->oldoverride==(procedure)doafter) { + free(rock); + free((struct arock *)rock->oldrock); + if((long)ch>MAXCHAR) textview_SelfInsertCmd(tv,*ch); + keystate_SetOverride(tv->keystate,NULL,0); + return; + } + keystate_SetOverride(tv->keystate,(procedure)doafter ,(long)rock); + } + /* + compchar_leftaccentafter: + compchar_rightaccentafter: + compchar_umlautafter: + compchar_tildeafter: + compchar_hatafter: + front-end functions to pass the appropriate list and codes + arguments to after. */ + + compchar_leftaccentafter(tv,rock) + struct textview *tv; + char *rock; + { + after(tv,leftaccent,leftaccentcodes,rock); + } + + compchar_rightaccentafter(tv,rock) + struct textview *tv; + char *rock; + { + after(tv,rightaccent,rightaccentcodes,rock); + } + + compchar_umlautafter(tv,rock) + struct textview *tv; + char *rock; + { + after(tv,umlaut,umlautcodes,rock); + } + + compchar_tildeafter(tv,rock) + struct textview *tv; + char *rock; + { + after(tv,tilde,tildecodes,rock); + } + + compchar_hatafter(tv,rock) + struct textview *tv; + char *rock; + { + after(tv,hat,hatcodes,rock); + } + + /* + compchar_leftaccent: + compchar_rightaccent: + compchar_umlaut: + compchar_tilde: + compchar_hat: + front-end functions to pass the appropriate list and codes + arguments to compchar_modifier. */ + + void compchar_leftaccent(tv,ptr) + struct textview *tv; + char *ptr; + { + compchar_modifier(tv,ptr,leftaccent,leftaccentcodes); + } + + void compchar_rightaccent(tv,ptr) + struct textview *tv; + char *ptr; + { + compchar_modifier(tv,ptr,rightaccent,rightaccentcodes); + } + + void compchar_umlaut(tv,ptr) + struct textview *tv; + char *ptr; + { + compchar_modifier(tv,ptr,umlaut,umlautcodes); + } + + + void compchar_tilde(tv,ptr) + struct textview *tv; + char *ptr; + { + compchar_modifier(tv,ptr,tilde,tildecodes); + } + + void compchar_hat(tv,ptr) + struct textview *tv; + char *ptr; + { + compchar_modifier(tv,ptr,hat,hatcodes); + } + + + /* composework: called from pcompch_EnumerateComposites with ROCK being the textview in which the compose operation began and C being the composite to be checked. If the current composite is equal to the user's entry the appropriate character is inserted in the text and a value of one is returned to terminate the search. Otherwise it simply returns 0. */ + struct composites *composework(key,c,exts) + char key; + struct composites *c; + char *exts; + { + if(strcmp(c->exts,exts)) return NULL; + else return c; + } + + struct helpRock { + procedure HelpWork; + struct text *text; + long rock; + char *partial; + }; + + /* match: called from compchar_EnumerateComposites with ROCK being a struct helpRock as defined above. If the user's entry up until this point matches one of the composites of KEY then that composite will be displayed in the help buffer. */ + long match(key,c,rock) + char key; + struct composites *c; + long rock; + { + struct helpRock *h=(struct helpRock *)rock; + unsigned char buf[256]; + unsigned char ch[2],*t; + if(*(h->partial)&&strncmp(h->partial+1,c->exts, strlen(h->partial+1))) return 0; + ch[0]=(unsigned char)c->code; + ch[1]='\0'; + buf[0]=(unsigned char)key; + strcpy(buf+1,c->exts); + strcat(buf,"\t "); + strcat(buf,ch); + strcat(buf,"\t\t"); + (*h->HelpWork)(h->rock,message_HelpGenericItem,buf,NULL); + if(c->style[0]) { + struct style *st; + char *tmpl; + strcpy(buf,c->style); + tmpl=index(buf,','); + if(tmpl) { + t=tmpl+1; + *tmpl='\0'; + while(*t==' ') t++; + } else t="symbol"; + text_ReadTemplate(h->text,t,FALSE); + st=stylesheet_Find(text_GetStyleSheet(h->text),buf); + if(st) { + struct environment *env=text_AddStyle(h->text, text_GetLength(h->text)-3, 1,st); + if(env) environment_SetStyle(env,FALSE,FALSE); + } + if(tmpl) *tmpl=','; + } else buf[0]='\0'; + strcat(buf,"\n"); + (*h->HelpWork)(h->rock,message_HelpGenericItem,buf,NULL); + return 0; + } + + /* helpProc: called by frameview__Help after having been set as the help procedure for a message_AskForStringCompleted. Initializes data needed by match for it to see if a composite matches the user's entry so far and procedes to use pcompch_EnumerateComposites to display a list of available composites in the help buffer. */ + static void helpProc(partial,myrock,HelpWork,rock) + char *partial; + struct helpRock *myrock; + procedure HelpWork; + long rock; + { + int i; + struct text *t=myrock->text; + text_ReadTemplate(myrock->text,"default",FALSE); + (*HelpWork)(rock, + message_HelpGenericItem, + "Entry\tCharacter\tStyle\n", + NULL); + + myrock->HelpWork=HelpWork; + myrock->rock=rock; + myrock->partial=partial; + if(*partial) (void)pcompch_EnumerateComposites(*partial, + (procedure)match, + (long)myrock); + else for(i=1;i<=MAXCHAR;i++) { + (void)pcompch_EnumerateComposites(i, + (procedure)match, + (long)myrock); + } + text_SetGlobalStyle(t,fixed); + text_AddStyle(t,0,5,boldulined); + text_AddStyle(t,6,9,boldulined); + text_AddStyle(t,16,5,boldulined); + } + + /* compchar_compose: if an argument is given for this function in a .*init file then it will be taken as a string designating the composite character to be inserted. Otherwise this function prompts the user to specify a character to insert in the text. Typing a '?' will cause a list of available characters to be displayed. */ + void compchar_compose(tv,ptr) + struct textview *tv; + char *ptr; + { + char buf[1024]; + struct composites *c; + struct helpRock myrock; + int result; + struct framemessage *fmsg= (struct framemessage *)textview_WantHandler(tv,"message"); + if((long)ptr>MAXCHAR) { + c=(struct composites *)pcompch_EnumerateComposites(*ptr, (procedure)composework,(long)ptr+1); + if(!c) { + message_DisplayString(tv,0,"No such composition found.\n"); + return; + } + SelfInsertCmd(tv,c->code,c->style); + return; + } + if(fmsg) { + struct buffer *b=frame_GetHelpBuffer(fmsg->frame); + myrock.text=(struct text *)buffer_GetData(b); + } else myrock.text=NULL; + result=message_AskForStringCompleted(tv, + 0, + "Character: " , + NULL, /* no default */ + buf, + sizeof(buf), + NULL, /* no special keymap */ + NULL,/* no completion */ + helpProc, /* will give help */ + (long)&myrock, + message_NoInitialString); + if(result<0) { + message_DisplayString(tv,0,"Character composition cancelled."); + return; + } + c=(struct composites *)pcompch_EnumerateComposites(*buf, (procedure)composework,(long)buf+1); + if(!c) { + message_DisplayString(tv,0,"No such composition found.\n"); + return; + } + SelfInsertCmd(tv,c->code,c->style); + } + + /* YARock: Yet Another Rock for keeping track of information as a composition is being typed. */ + struct YARock{ + struct textview *tv; + procedure oldoverride; + long oldrock; + struct composites *c; + unsigned short key; + unsigned char exts[9]; + int count; + unsigned char possibilities[512]; + }; + + /* keywork: used by handle key to determine what the possible matches for the current composition are. */ + unsigned char keywork(key,c,rock) + char key; + struct composites *c; + struct YARock *rock; + { + char buf[6]; + if(strncmp(c->exts,rock->exts,strlen(rock->exts))) return 0; + if(!strcmp(c->exts,rock->exts)) { + rock->c=c; + return c->code; + } + if(strlen(rock->possibilities)+4possibilities)) { + sprintf(buf,"%s%c-%c, ",c->style[0]?"*":"",c->code,c->exts[strlen(rock->exts)]); + strcat(rock->possibilities,buf); + } + rock->count++; + return 0; + } + + /* handlekey: add a key to the composition in progress, if the composition is then completely specified return the appropriate code, otherwise list the current possibilities. */ + long handlekey(rock,key) + struct YARock *rock; + char key; + { + char buf[16]; + unsigned char c; + buf[1]='\0'; + if(key==127||key==8) { + if(!*rock->exts) rock->key=BADCHAR; + else { + rock->exts[strlen(rock->exts)-1]='\0'; + if(!*rock->exts) rock->key=BADCHAR; + } + } else { + if(rock->key==BADCHAR) rock->key=key; + else if(strlen(rock->exts)exts)-1) { + buf[0]=key; + strcat(rock->exts,buf); + } + } + rock->count=0; + if(rock->key==BADCHAR) { + message_DisplayString(rock->tv,0,"Initial character: "); + return 0; + } else { + strcpy(rock->possibilities,"Possible completions: "); + c=(unsigned char)pcompch_EnumerateComposites(rock->key, (procedure)keywork,(long)rock); + if(c) return c; + else { + int len=strlen(rock->possibilities); + if(len>=2) { + if(rock->possibilities[len-2]==',') rock->possibilities[len-2]='\0'; + } + message_DisplayString(rock->tv,0,rock->possibilities); + if(rock->count==0) return -1; + else return 0; + } + } + } + + /* docomposing: intercepts lookups on the textview keystate to see if a valid composition is taking place, if not it removes the override on the textviews keystate and frees the rock. Otherwise It checks to see if the composition has been completely specified yet. If it has the appropriate character is inserted in the text. */ + enum keymap_Types docomposing(rock,key,ppe,prock) + struct YARock *rock; + char key; + struct proctable_Entry **ppe; + long *prock; + { + enum keymap_Types code; + struct keystate *ks=rock->tv->keystate; + long handle=handlekey(rock,key); + if(handle>0) { + keystate_SetOverride(ks,rock->oldoverride,rock->oldrock); + message_DisplayString(rock->tv,0,""); + SelfInsertCmd(rock->tv,handle,rock->c->style); + free(rock); + } + if(handle>=0) { + *ppe=nop; + *prock=0; + return keymap_Proc; + } + message_DisplayString(rock->tv,0,""); + if(rock->oldoverride) + code=(enum keymap_Types) (*rock->oldoverride)(rock->oldrock,key,ppe,prock); + else if(!ks->curMap) return keymap_Empty; + else code=keymap_Lookup(ks->curMap,key,ppe,prock); + keystate_SetOverride(ks,rock->oldoverride,rock->oldrock); + free(rock); + return code; + } + + /* compchar_nop: semi bogus proctable function so that the keys taken by docomposing don't have any other side-effects */ + void compchar_nop(tv) + struct textview *tv; + { + } + + /* compchar_compose2: basically the same as compchar_compose except that '?' help is not available and no return is needed at the end of the composed character. However, continuous help is given in the form of information in the message line. Automatically notices the end of a composition. */ + void compchar_compose2(tv,ch) + struct textview *tv; + char *ch; + { + struct YARock *rock; + rock=(struct YARock *)malloc(sizeof(struct YARock)); + rock->tv=tv; + rock->key=MAXCHAR+1; + rock->exts[0]='\0'; + rock->c=NULL; + keystate_GetOverride(tv->keystate,&rock->oldoverride, &rock->oldrock); + if(rock->oldoverride==(procedure)docomposing) { + free(rock); + free((struct YARock *)rock->oldrock); + if((long)ch>MAXCHAR) textview_SelfInsertCmd(tv,*ch); + keystate_SetOverride(tv->keystate,NULL,0); + message_DisplayString(tv,0,""); + return; + } + keystate_SetOverride(tv->keystate,(procedure)docomposing ,(long)rock); + message_DisplayString(tv,0,"Initial character: "); + } + + void compchar_ATKToASCII(tv,rock) + struct textview *tv; + long rock; + { + pcompch_ATKToASCII(textview_GetDataObject(tv)); + } + + + + struct SARock { + struct textview *tv; + boolean ask; + }; + + doreplacement(text,pos,ch,ascii,r) + struct text *text; + long pos; + unsigned char ch; + char *ascii; + struct SARock *r; + { + int c; + textview_SetDotPosition(r->tv, pos); + textview_SetDotLength(r->tv, strlen(ascii)); + textview_FrameDot(r->tv, pos); + do { + if(r->ask) { + textview_Update(r->tv); + c=im_GetCharacter(textview_GetIM(r->tv)); + } else c=' '; + if(c=='?') { + message_DisplayString(r->tv,0,"One of 'q'-quit, 'n'-next, '!'-replace all, or ' '-replace and continue."); + } + } while (c=='?'); + switch(c) { + case '\007': + case '\003': + case 'q': + case EOF: + pos=EOF; + break; + case 'n': + pos+=strlen(ascii); + break; + case '!': + r->ask=FALSE; + default: + text_AlwaysReplaceCharacters(text, pos, strlen(ascii), &ch, 1); + if(c=='.') return EOF; + pos++; + } + if(pos>=text_GetLength(text)) pos=text_GetLength(text)-1; + textview_SetDotPosition(r->tv,pos); + textview_SetDotLength(r->tv,0); + textview_FrameDot(r->tv,pos); + return pos; + } + + void compchar_ASCIIToATK(tv,rock) + struct textview *tv; + long rock; + { + long pos,len; + struct SARock r; + r.tv=tv; + r.ask=TRUE; + pos=textview_GetDotPosition(tv); + pcompch_ASCIIToATK(textview_GetDataObject(tv), pos, textview_GetDotLength(tv), doreplacement, &r); + len=text_GetLength((struct text *)textview_GetDataObject(tv)); + if(pos>=len) pos=len-1; + textview_SetDotPosition(tv,pos); + textview_SetDotLength(tv,0); + textview_FrameDot(tv,pos); + + } + + boolean compchar__InitializeClass(ClassID) + struct classheader *ClassID; + { + struct classinfo *textviewtype = class_Load("textview"); + + if(!class_Load("pcompch")) { + fprintf(stderr,"Unable to load pcompch.\n"); + return FALSE; + } + /* Get the styles to use in the help buffer. */ + boldulined=style_New(); + if(!boldulined) { + fprintf(stderr,"Unable to get bold underlined text style.\n"); + return FALSE; + } + fixed=style_New(); + if(!fixed) { + style_Destroy(boldulined); + fprintf(stderr,"Unable to get fixed-width text style.\n"); + return FALSE; + } + + style_AddNewFontFace(fixed,fontdesc_Fixed); + style_SetFontFamily(fixed,"andytype"); + + style_AddNewFontFace(boldulined,fontdesc_Bold); + style_AddUnderline(boldulined); + + /* Code from swedish.c to get the textview function to insert a single character in the text. */ + if((insertchar = proctable_Lookup("textview-self-insert")) != NULL && proctable_Defined(insertchar) ){ + textview_SelfInsertCmd = proctable_GetFunction(insertchar) ; + } else { + fprintf(stderr,"Couldn't get textview-self-insert procedure.\n"); + return FALSE; + } + + nop=proctable_DefineProc("compchar-nop",compchar_nop, textviewtype,NULL,"nop for use with compchar."); + + + proctable_DefineProc("compchar-ASCIIToATK",compchar_ASCIIToATK, textviewtype,NULL,"map local ASCII conventions to ATK ISO characters"); + proctable_DefineProc("compchar-ATKToASCII",compchar_ATKToASCII, textviewtype,NULL,"map ATK ISO characters to local ASCII"); + proctable_DefineProc("compchar-compose2", compchar_compose2, textviewtype,NULL,"improved compchar-compose."); + proctable_DefineProc("compchar-compose",compchar_compose, textviewtype,NULL,"start the composition of a character"); + + proctable_DefineProc("compchar-acuteaccent-after", compchar_leftaccentafter,textviewtype,NULL,"put a left accent over the next character"); + proctable_DefineProc("compchar-graveaccent-after", compchar_rightaccentafter,textviewtype,NULL,"put a right accent over the next character"); + proctable_DefineProc("compchar-circumflex-after", compchar_hatafter,textviewtype,NULL,"put a hat over the next character"); + proctable_DefineProc("compchar-tilde-after", compchar_tildeafter,textviewtype,NULL,"put a tilde over the next character"); + proctable_DefineProc("compchar-umlaut-after", compchar_umlautafter,textviewtype,NULL,"put an umlaut over the next character"); + + proctable_DefineProc("compchar-acuteaccent",compchar_leftaccent, textviewtype,NULL,"add a left accent to the character to the left of the cursor."); + proctable_DefineProc("compchar-graveaccent", compchar_rightaccent, textviewtype,NULL,"add a right accent to the character to the left of the cursor."); + proctable_DefineProc("compchar-circumflex",compchar_hat, textviewtype,NULL,"add a hat to the character to the left of the cursor."); + proctable_DefineProc("compchar-tilde",compchar_tilde, textviewtype,NULL,"add a tilde to the character to the left of the cursor."); + proctable_DefineProc("compchar-umlaut",compchar_umlaut, textviewtype,NULL,"add a umlaut to the character to the left of the cursor."); + + proctable_DefineProc("compchar-insert",compchar_insert, textviewtype,NULL,"inserts an arbitrary character specified in an initfile."); + + return TRUE; + } *** atk/textaux/Imakefile Wed Nov 22 12:35:24 1989 --- atk/textaux/Imakefile.NEW Thu Jul 12 13:04:03 1990 *************** *** 2,10 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ - DOBJS = contentv.do - IHFILES = contentv.ih NormalObjectRule() NormalATKRule() --- 2,11 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ + DOBJS = contentv.do compchar.do + IHFILES = contentv.ih compchar.ih + NormalObjectRule() NormalATKRule() *************** *** 13,20 **** --- 14,25 ---- DependTarget() NormalHelpRule() + InstallDocs(cpchar.help, ${DESTDIR}/help) + InstallHelpAlias(cpchar, compchar) InstallDocs(cntproc.help, ${DESTDIR}/help) InstallHelpAlias(cntproc, contentproc contentprocs) + + InstallFile(symbol.tpl, $(INSTINCFLAGS), ${DESTDIR}/lib/tpls) MkdirTarget(${DESTDIR}/doc/atk/text) *** atk/textaux/contentv.c Wed Nov 22 12:35:22 1989 --- atk/textaux/contentv.c.NEW Fri Jul 20 11:28:54 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/textaux/RCS/contentv.c,v 1.12 89/10/26 17:28:52 tpn Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/textaux/RCS/contentv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/textaux/RCS/contentv.c,v 1.12 89/10/26 17:28:52 tpn Exp $"; #endif /* lint */ #include "class.h" --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/textaux/RCS/contentv.c,v 1.13 90/07/13 15:01:50 rr2b Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/textaux/RCS/contentv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/textaux/RCS/contentv.c,v 1.13 90/07/13 15:01:50 rr2b Exp $"; #endif /* lint */ #include "class.h" *************** *** 276,294 **** {"contentv-denumerate",NULL,0,"Contents~1,Denumerate~2",0,0,denumerate,"Denumerate the heading"}, {"contentv-destroy",NULL,0,"Quit~99",0,0,destroy,"destroy the table of content"}, {"contentv-delete-window",NULL,0,"Delete Window~89",0,0,destroy,"destroy the table of content"}, - {"tindex-print",NULL,0,"Index~2,Print Index~21",0,0,NULL,"print index","tindex"}, - {"tindex-preview",NULL,0,"Index~2,Preview Index~20",0,0,NULL,"preview index","tindex"}, - {"tindex-index-term",NULL,0,"Index~2,Index term~1",0,0,NULL,"index all instances of a term","tindex"}, - {"tindex-read-index-file",NULL,0,"Index~2,Read list~10",0,0,NULL,"read a list of index terms ","tindex"}, - {"tindex-write-index-file",NULL,0,"Index~2,Write list~11",0,0,NULL,"write a list of index terms ","tindex"}, - {"tindex-index-italic",NULL,0,"Index~2,Italic Index~30",0,0,NULL,"make the index entries italic","tindex"}, - {"tindex-index-plain",NULL,0,"Index~2,Plain Index~31",0,0,NULL,"make the index entries plain","tindex"}, - {"tindex-expose-inv-index",NULL,0,"Index~2,Expose Inv. Index~32",0,0,NULL,"Expose the invisible index entries","tindex"}, - {"tindex-hide-inv-index",NULL,0,"Index~2,Hide Inv. Index~33",0,0,NULL,"Hide the invisible index entries","tindex"}, {"contentv-preview", NULL,0, "File~10,Preview~21",0,0, contentv_PreviewCmd, "Previews document."}, {"contentv-print", NULL,0, "File~10,Print~22",0,0, contentv_PrintCmd, "Prints document."}, NULL }; void contentv__PostMenus(self, menulist) struct contentv *self; struct menulist *menulist; --- 276,286 ---- {"contentv-denumerate",NULL,0,"Contents~1,Denumerate~2",0,0,denumerate,"Denumerate the heading"}, {"contentv-destroy",NULL,0,"Quit~99",0,0,destroy,"destroy the table of content"}, {"contentv-delete-window",NULL,0,"Delete Window~89",0,0,destroy,"destroy the table of content"}, {"contentv-preview", NULL,0, "File~10,Preview~21",0,0, contentv_PreviewCmd, "Previews document."}, {"contentv-print", NULL,0, "File~10,Print~22",0,0, contentv_PrintCmd, "Prints document."}, NULL }; + void contentv__PostMenus(self, menulist) struct contentv *self; struct menulist *menulist; *************** *** 304,311 **** contentvMenus = menulist_New(); contentvKeyMap = keymap_New(); bind_BindList(contentvBindings, contentvKeyMap , contentvMenus, &contentv_classinfo); ! ! proctable_DefineProc("contentv-make-window",contentv_MakeContents,textviewtype,NULL,"Make a table of contents window"); return TRUE; } --- 296,302 ---- contentvMenus = menulist_New(); contentvKeyMap = keymap_New(); bind_BindList(contentvBindings, contentvKeyMap , contentvMenus, &contentv_classinfo); ! proctable_DefineProc("contentv-make-window",contentv_MakeContents,textviewtype,NULL,"Make a table of contents window"); return TRUE; } *** atk/textaux/compchar.ch Fri Jul 27 14:05:47 1990 --- atk/textaux/compchar.ch.NEW Wed Jun 20 13:26:04 1990 *************** *** 0 **** --- 1,9 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + class compchar { + classprocedures: + InitializeClass() returns boolean; + }; *** atk/textaux/cpchar.help Fri Jul 27 14:05:59 1990 --- atk/textaux/cpchar.help.NEW Fri Jul 20 11:28:56 1990 *************** *** 0 **** --- 1,254 ---- + \begindata{text,268872428} + \textdsversion{12} + \template{help} + \define{^ + } + \define{sym + } + \chapter{Compchar: Entering International Characters + + } + \section{What Compchar is + + } + Compchar stands for Compose Character, it is a package for entering some + characters which are not normally available from the keyboard. + + + \section{Starting Compchar + + } + To use compchar you need to add a line to your .atkinit (or .ezinit) like: + + + \example{addkey compchar-compose2 ^Xx textview + + + or + + + addkey compchar-compose ^Xv textview + + } + If you then type ^Xx you will be prompted for an initial character, after you + type this character you will be shown a list of the characters available with + the prefix character you typed. + + + If instead you type ^Xv you will be prompted for a character, and the text + caret will appear in the message line, in this mode you can get a listing of + everything your entry so far can generate by typing a '?', if you haven't + entered anything yet when you type '?' you will be given a list of all the + characters defined in the compchar initialization file. + + + A default initialization file is provided which contains most language + characters and Greek and mathematical symbols defined is provided, see the + section \bold{Composites File Format} for more information. + + + These two functions are not the only ways to use the compchar package, see the + quick reference section of this document for more information. + + + + \section{Warnings + + } + Some characters (most notably those for languages) are only available under + X11 release 4. + + + \section{ Preferences} + + + CompositesFile: the name of a file to get additions or changes to the default + compositions from. + + OverrideComposites: Allows you to completely override the default list of + compositions, thus the file listed in your CompositesFile preference must + contain all the composites you wish to use. + + \begindata{bp,268919348} + \enddata{bp,268919348} + \view{bpv,268919348,3,0,0}\section{ + Composites File Format + + } + The composites file consists of one or more lines each of the form: + + + \example{keysequence code troff style ascii + + } + keysequence is a string giving the key sequence which will generate the + character, the syntax for these is the same as for key sequences given in a + .*init file, with the addition that they can be surrounded by double quotes so + you can easily include spaces and tabs in them if desired. If the keysequence + field has only a pair of double quotes the line simply defines the troff to + use for the specified code. If the line consists of just a keysequence any + previously defined composition having that keysequence will be deleted. + + + code is a number indicating the character's number within the font being used + The various ways to specify the code are covered under "insert" below. + + + The troff field is optional and can be omitted by having this field start with + a '!', to specify a '!' as the first printing character of a troff sequence + add a \\& before the '!'. It gives the troff macros or inline commands needed + to generate the character when printing. + + + The style field indicates what style should be wrapped around the code when it + is placed in a document. If no style should be used this field should be "". + If the style name is followed by a comma, the remainder of the field should + be the name of a template to get the style from. If no template is specified + the default template is called symbol. Note: you can have space after the + comma but not before). + + + As shown below if all fields if a particular field and all fields after it are + + not being used it and the following fields may be omitted. + + + For example: + + \example{ + # this line is a comment, the next line + + # specifies the character code in + + # hexadecimal. + + ag xe0 a\\*(l` + + #blank lines are allowed. + + + # the next line defines the troff string + + # and the ascii string for the code 129 + + # without adding or changing any keybinding. + + "" 129 u\\*(l' "" \{u'x + + # the line below demonstrates + + # using quotes around the keysequence. + + "a^X" 225 a\\*(l'} + + \begindata{bp,268915124} + \enddata{bp,268915124} + \view{bpv,268915124,4,0,0} + \section{Proctable Entries} + + (note all functions should be prefixed with compchar-) + + + ATKToASCII: \indent{\indent{\indent{converts all ISO characters with defined + ASCII representations to ASCII. + + }}} + ASCIIToATK: \leftindent{\leftindent{\leftindent{attempts to convert the + defined ASCII representations of ISO characters to their graphic + representation. Each occurrence of a ASCII representation for a character + will be selected and you can use the following keys to tell CompChar what to + do.\leftindent{ + + }\leftindent{space - replace this occurrence and continue. + + . - replace this occurrence and stop. + + n - skip this occurrence. + + ! - replace all remaining occurrences. + + q - quit ASCIIToATK. + + }}}} + compose: \indent{\indent{\indent{prompts for a character to insert, typing a + '?' will give a list of the characters available and the entries necessary to + obtain them. Giving this function an argument in a .*init file cause it to + automatically insert the character specified by the argument.}}} + + + compose2: \indent{\indent{\indent{basically same as compchar-compose except + that help is given continuously on the message line and there is no need to + hit return. Warning: this doesn't work properly in Typescript. }}} + + + insert: \indent{\indent{\indent{inserts a character specified in a .*init + file at the current cursor position. The character may be specified in octal, + decimal, or hexadecimal. + + Example: the following all represent an A with the high bit set. + + xC1 + + o301 + + d193 + + |A + + 193 + + }}}\ + \begindata{bp,268914980} + \enddata{bp,268914980} + \view{bpv,268914980,5,0,0} + Note: the following functions operate on the next character typed if their + name is extended with -after, if used in a .*init file and given an argument + they will first insert the first character of the argument in the text and + then add the appropriate accent. + + acuteaccent: \indent{\indent{\indent{puts an acute accent mark on the + character before the cursor.}}} + + + graveaccent: \indent{\indent{\indent{puts a grave accent mark on the character + before the cursor.}}} + + + circumflex: \indent{\indent{\indent{puts a circumflex over the character + before the cursor.}}} + + + tilde: \indent{\indent{\indent{puts a tilde over the character before the + cursor.}}} + + + umlaut: \indent{\indent{\indent{puts an umlaut over the character before the + cursor.}}} + + + \section{Quick reference + + }\leftindent{ + An example of giving an argument to a comphar function: + + + \example{addkey compchar-umlaut \\eS textview compchar inherit "u"} + + } + \section{Program Author} + + \leftindent{ + Rob Ryan (rr2b@andrew.cmu.edu)} + + + \section{Related tools} + + + Select (highlight) one of the italicized names and choose "Show Help on + Selected Word" from the pop-up menu to see the help file for: + + + \leftindent{initfiles + + + }\enddata{text,268872428} *** atk/textaux/symbol.tpl Fri Jul 27 14:06:09 1990 --- atk/textaux/symbol.tpl.NEW Fri Jul 20 11:28:58 1990 *************** *** 0 **** --- 1,7 ---- + \begindata{text, 1} + \textdsversion{12} + \define{symbola + attr:[FontFamily Symbola Int 0]} + \define{symbol + attr:[FontFamily Symbol Int 0]} + \enddata{text,1} *** atk/toez/readscrb.c Wed Nov 22 12:35:35 1989 --- atk/toez/readscrb.c.NEW Thu Jul 12 13:04:15 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1986,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/toez/RCS/readscrb.c,v 1.7 89/10/16 12:16:19 cfe Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/toez/RCS/readscrb.c,v $ */ #ifndef lint ! char *ReadScribe_rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/toez/RCS/readscrb.c,v 1.7 89/10/16 12:16:19 cfe Exp $"; #endif /* lint */ --- 2,12 ---- * Copyright IBM Corporation 1986,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/toez/RCS/readscrb.c,v 1.8 90/06/22 11:38:22 wjh Exp $ */ /* $ACIS:$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/toez/RCS/readscrb.c,v $ */ #ifndef lint ! char *ReadScribe_rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/toez/RCS/readscrb.c,v 1.8 90/06/22 11:38:22 wjh Exp $"; #endif /* lint */ *************** *** 16,21 **** --- 16,24 ---- /* $Log: readscrb.c,v $ + * Revision 1.8 90/06/22 11:38:22 wjh + * modified to ignore \r and ^Z, both of which are useless DOS-ian artifacts + * * Revision 1.7 89/10/16 12:16:19 cfe * Clean up after compiler warnings. * *************** *** 587,592 **** --- 590,599 ---- EmbeddedWhiteSpace++; else StartsWhite = TRUE; ouch(c); + c = getnextch(); + break; + case '\015': /* ignore carriage returns */ + case '\032': /* ignore ^Z from DOS */ c = getnextch(); break; case ' ': *** atk/typescript/tscript.c Mon Mar 12 13:16:52 1990 --- atk/typescript/tscript.c.NEW Fri Jul 20 11:29:08 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/typescript/RCS/tscript.c,v 2.28 89/11/21 15:26:55 jhh Exp Locker: tpn $ */ /* $ACIS:tscript.c 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/atk/typescript/RCS/tscript.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/atk/typescript/RCS/tscript.c,v 2.28 89/11/21 15:26:55 jhh Exp Locker: tpn $"; #endif /* lint */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/typescript/RCS/tscript.c,v 2.36 90/06/29 10:02:03 ajp Exp Locker: gk5g $ */ /* $ACIS:tscript.c 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/typescript/RCS/tscript.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/typescript/RCS/tscript.c,v 2.36 90/06/29 10:02:03 ajp Exp Locker: gk5g $"; #endif /* lint */ *************** *** 54,60 **** --- 54,75 ---- #include #endif /* #if SY_AIX221 */ + #if SY_AIX12 + #include + #include + static char io_buffer[4096]; + #define write ps2_write_pty + static int ps2_write_pty(); + /* WARNING: This assumes all writes go to a pty, which is not true. + The write after execlp is the only exception at the time this was written. + AIX/PS2 has a serious bug in the pty driver (REMOTE doesn't work). + Delete this crud once REMOTE works. + */ + FILE *myfile; + #endif /* SY_AIX12 */ + + /* #define DONTCUTSTYLES */ #define MyEnvinfo(text,pos) environment_GetInnerMost(text->rootEnvironment, pos) #define TEXT(A) ((struct text *)(A->header.view.dataobject)) *************** *** 63,68 **** --- 78,84 ---- 0, 0 }; #define ISPIPESCRIPT(self) (self->pipescript) + /* #define SENDRAW 1 */ static char **myarglist = NULL; static boolean Pipescript = FALSE; *************** *** 92,98 **** --- 108,116 ---- static int (*typescript_CopyRegionCmd)(); static int (*typescript_ZapRegionCmd)(); + #ifndef _IBMR2 extern char *realloc(); + #endif /* _IBMR2 */ static long maxSize; static long extraRoom; *************** *** 280,286 **** --- 298,308 ---- register struct typescript *self; { if ((self->readOnlyLen != -1)){ + #ifdef SENDRAW + write (self->SubChannel, "\010" , 1); + #else if(self->readOnlyLen > 0) self->readOnlyLen--; + #endif } else if(typescript_GetDotPosition(self) + typescript_GetDotLength(self) > text_GetFence(TEXT(self))) textview_RuboutCmd((struct textview *)self); *************** *** 485,490 **** --- 507,517 ---- } SetCmdSize(len + 1); + #ifdef SENDRAW + if (tv->readOnlyLen == 0) { + write(tv->SubChannel,"\n",1); + } + #else if (tv->readOnlyLen > 0) { if (len > 0){ text_CopySubString(d, stpos, len , cmd, FALSE); *************** *** 495,500 **** --- 522,528 ---- text_InsertCharacters (d, stpos + len++, "\n", 1); smashReadOnlyBuf(tv); } + #endif else { text_InsertCharacters (d, stpos + len++, "\n", 1); text_CopySubString(d, stpos, len, cmd, FALSE); *************** *** 556,566 **** register struct text *d; int maxpos; register stpos; ! if (tv->readOnlyLen != -1) { tv->readOnlyLen = 0; return; } d = TEXT(tv); maxpos = text_GetLength(d); stpos = mark_GetPos(tv->cmdStart); --- 584,600 ---- register struct text *d; int maxpos; register stpos; ! #ifdef SENDRAW ! if (tv->readOnlyLen == 0) { ! write(tv->SubChannel,"\025",1); ! return; ! } ! #else if (tv->readOnlyLen != -1) { tv->readOnlyLen = 0; return; } + #endif d = TEXT(tv); maxpos = text_GetLength(d); stpos = mark_GetPos(tv->cmdStart); *************** *** 712,721 **** #define WMTITLELEN 40 /* Can you say "Magic hack?" */ ! char titleBuffer[WMTITLELEN],*index(); ! int len, maxLen = sizeof(titleBuffer) - 1; *titleBuffer = '\0'; if (titleLine!= NULL){ char *home=environ_Get("HOME"); --- 746,772 ---- #define WMTITLELEN 40 /* Can you say "Magic hack?" */ ! char titleBuffer[1000],*index(); ! int len, maxLen = WMTITLELEN - 1; ! char *tb; ! *titleBuffer = '\0'; + tb = titleBuffer; + if (self->title != NULL) { + len = strlen(self->title); + if (len < WMTITLELEN - 3) { + strcpy(titleBuffer, self->title); + strcat(titleBuffer, ": "); + maxLen -= (len + 2); + tb = &titleBuffer[len + 2]; + } + else { + strcpy(titleBuffer, self->title); + titleLine = NULL; + } + } + if (titleLine!= NULL){ char *home=environ_Get("HOME"); *************** *** 722,728 **** if(home!=NULL){ int hlen=strlen(home); if(strncmp(titleLine,home,hlen)==0){ ! strcpy(titleBuffer,"~"); --maxLen; titleLine+=hlen; } --- 773,779 ---- if(home!=NULL){ int hlen=strlen(home); if(strncmp(titleLine,home,hlen)==0){ ! strcpy(tb,"~"); --maxLen; titleLine+=hlen; } *************** *** 737,750 **** partialName = titleLine + (len - maxLen); else ++partialName; /* Skip slash... */ ! strcpy(titleBuffer, "---"); ! strcat(titleBuffer, partialName); } else ! strcat(titleBuffer, titleLine); } ! im_SetTitle(typescript_GetIM( self), titleBuffer); } #define StartMagicChar 1 /* Ctrl A */ #define EndMagicChar 2 /* Ctrl B */ static char * ReadDirName(self,f,buf,bufsiz) --- 788,802 ---- partialName = titleLine + (len - maxLen); else ++partialName; /* Skip slash... */ ! strcpy(tb, "---"); ! strcat(tb, partialName); } else ! strcat(tb, titleLine); } ! im_SetTitle(typescript_GetIM(self), titleBuffer); } + #define StartMagicChar 1 /* Ctrl A */ #define EndMagicChar 2 /* Ctrl B */ static char * ReadDirName(self,f,buf,bufsiz) *************** *** 913,939 **** int pgrp = getpgrp(0); int ptyChannel; int masterChannel; ! #if SY_AIX221 char ptyname[MAXPATHLEN]; #endif /* if SY_AIX221 */ #ifndef hpux /* Disassociate this process from its controling tty. Must be done after opening the childs pty because that will become the controlling tty if we don't have one. */ { ! int fd = open ("/dev/tty", O_RDWR); if (fd >= 0) { ioctl (fd, TIOCNOTTY, 0); close (fd); } #if SY_AIX221 ! else { ! ioctl(0, TIOCNOTTY, 0); /* might help when /dev/tty is hosed */ ! setpgrp(); ! } #else else setpgrp(0, 0); #endif ! } #endif /* hpux */ tp->pipescript = FALSE; --- 965,995 ---- int pgrp = getpgrp(0); int ptyChannel; int masterChannel; ! #if SY_AIX221 || SY_AIX12 char ptyname[MAXPATHLEN]; #endif /* if SY_AIX221 */ #ifndef hpux /* Disassociate this process from its controling tty. Must be done after opening the childs pty because that will become the controlling tty if we don't have one. */ { ! int fd; ! ! (void)signal(SIGTTOU,SIG_IGN); /* For handling signals when changing the window size */ ! ! fd = open ("/dev/tty", O_RDWR); if (fd >= 0) { ioctl (fd, TIOCNOTTY, 0); close (fd); } #if SY_AIX221 ! else { ! ioctl(0, TIOCNOTTY, 0); /* might help when /dev/tty is hosed */ ! setpgrp(); ! } #else else setpgrp(0, 0); #endif ! } #endif /* hpux */ tp->pipescript = FALSE; *************** *** 974,980 **** tp->progname = malloc (strlen(*arglist) + 1); strcpy(tp->progname,*arglist); ! #if SY_AIX221 if (! GetPtyandName(&masterChannel, &ptyChannel,ptyname,MAXPATHLEN)) { #else /*if SY_AIX221 */ if (! GetPty(&masterChannel, &ptyChannel)) { --- 1030,1036 ---- tp->progname = malloc (strlen(*arglist) + 1); strcpy(tp->progname,*arglist); ! #if SY_AIX221 || SY_AIX12 if (! GetPtyandName(&masterChannel, &ptyChannel,ptyname,MAXPATHLEN)) { #else /*if SY_AIX221 */ if (! GetPty(&masterChannel, &ptyChannel)) { *************** *** 984,995 **** } tp->SubChannel = masterChannel; ! #if SY_AIX221 { int mode; mode = REMOTE; ioctl(tp->SubChannel, PTYSETM, &mode); } #else /* #if SY_AIX221 */ { --- 1040,1062 ---- } tp->SubChannel = masterChannel; ! ! #if SY_AIX221 || SY_AIX12 { int mode; mode = REMOTE; ioctl(tp->SubChannel, PTYSETM, &mode); + + /* In order to establish a controlling terminal on AIX (and SysV??) + * we need to close the server (slave) and let the child reopen it. + * since the child is the first to open it, it will become the + * controlling terminal. The master cannot have it open for this + * to happen. If someone else comes along and opens it between the + * close and the open below, we are S.O.L. + */ + signal(SIGHUP, SIG_IGN); /* ignore the hangup when we close the pty */ + close(ptyChannel); /* we reopen it in the child */ } #else /* #if SY_AIX221 */ { *************** *** 999,1005 **** of the encoding of ioctl's. BUT it compiles correctly with the ioctl.h from either 4.2 or 4.3. What can you do? Note that the ON flag is passed by reference in 4.3, by value in 4.2 */ ! #if defined(__STDC__) && !defined(__HIGHC__) if (ioctl (tp->SubChannel, _IOW('t', TIOCREMOTE&0xff, int), &ON) == -1) ioctl (tp->SubChannel, _IO('t', TIOCREMOTE&0xff), ON); #else /* defined(__STDC__) && !defined(__HIGHC__) */ --- 1066,1072 ---- of the encoding of ioctl's. BUT it compiles correctly with the ioctl.h from either 4.2 or 4.3. What can you do? Note that the ON flag is passed by reference in 4.3, by value in 4.2 */ ! #if defined(__STDC__) && !defined(__HIGHC__) || defined(_IBMR2) || defined(hpux) if (ioctl (tp->SubChannel, _IOW('t', TIOCREMOTE&0xff, int), &ON) == -1) ioctl (tp->SubChannel, _IO('t', TIOCREMOTE&0xff), ON); #else /* defined(__STDC__) && !defined(__HIGHC__) */ *************** *** 1009,1015 **** ioctl (tp->SubChannel, FIOCLEX, 0); } ! #endif /* #if SY_AIX221 */ if ((pid = osi_vfork ()) < 0) { --- 1076,1082 ---- ioctl (tp->SubChannel, FIOCLEX, 0); } ! #endif /* #if SY_AIX221 || SY_AIX12 */ if ((pid = osi_vfork ()) < 0) { *************** *** 1021,1029 **** #ifdef hpux setpgrp2(0, pid); #else /* hpux */ ! #if SY_AIX221 setpgrp(); - close(ptyChannel); /* reopen the terminal so it becomes the controlling terminal */ if ((ptyChannel = open(ptyname, 2)) < 0) { fprintf(stderr, "Could not open %s.\n", ptyname); --- 1088,1095 ---- #ifdef hpux setpgrp2(0, pid); #else /* hpux */ ! #if SY_AIX221 || SY_AIX12 setpgrp(); /* reopen the terminal so it becomes the controlling terminal */ if ((ptyChannel = open(ptyname, 2)) < 0) { fprintf(stderr, "Could not open %s.\n", ptyname); *************** *** 1093,1103 **** --- 1159,1175 ---- #ifdef hpux setpgrp2(0, pgrp); #else /* hpux */ + #if !SY_AIX12 setpgrp(0, pgrp); + #endif /* !SY_AIX12 */ #endif /* hpux */ #endif /* #if !SY_AIX221 */ tp->SCFile = fdopen(tp->SubChannel, "r"); + #if SY_AIX12 + setvbuf(tp->SCFile, io_buffer, _IOLBF, sizeof(io_buffer)); + myfile = tp->SCFile; + #endif if(df){ struct proctable_Entry *UserMenuProc; *************** *** 1124,1129 **** --- 1196,1202 ---- } tp->menulist = menulist_DuplicateML(typescriptMenus, tp); tp->keystate = keystate_Create(tp, ssmap); + tp->title = NULL; return TRUE; } *************** *** 1169,1174 **** --- 1242,1250 ---- struct classheader *classID; struct typescript *ap; { /* dataobject_Destroy(TEXTOBJ(ap)); */ /* the doc will destroy it's own marks */ + if (ap->title != NULL) { + free(ap->title); + } } void typescript__ObservedChanged(ap,ov, value) *************** *** 1229,1239 **** --- 1305,1319 ---- char c; { /* This will put characters in the read-only buffer without displaying them. Deals with the no-echo mode for entering passwords and the like. */ + #ifdef SENDRAW + write(self->SubChannel,&c,1); + #else if (isprint(c)) { if (self->readOnlyLen < (READONLYMAX - 1)) { /* Make sure to leave space for ending carriage return. */ self->readOnlyBuf[self->readOnlyLen++] = c; } } + #endif } static PositionDot(self) register struct typescript *self; *************** *** 1496,1501 **** --- 1576,1587 ---- super_Update(self); } + #ifdef TIOCGWINSZ + static NullWinSizeProc() + { + } + #endif /* TIOCGWINSZ */ + void typescript__FullUpdate(self, type, left, top, width, height) struct typescript *self; enum view_UpdateType type; *************** *** 1506,1512 **** --- 1592,1626 ---- { self->lastPosition = -1; super_FullUpdate(self, type, left, top, width, height); + + #ifdef TIOCGWINSZ + { + struct style *tsStyle; + enum style_FontSize dummy; + char ffamily[1000]; + long tssize; + struct fontdesc *tsfont; + long widthinchar; + struct winsize winSize; + + im_SignalHandler(SIGWINCH, NullWinSizeProc, NULL); + + tsStyle = typescript_GetDefaultStyle(self); + style_GetFontSize(tsStyle, &dummy, &tssize); + style_GetFontFamily(tsStyle, ffamily, 1000); + tsfont = fontdesc_Create(ffamily, style_GetAddedFontFaces(tsStyle), tssize); + + widthinchar = (width / fontdesc_FontSummary(tsfont, self)->maxSpacing) - 1; + + ioctl (self->SubChannel, TIOCGWINSZ, &winSize); + if (winSize.ws_col != widthinchar) { + winSize.ws_col = widthinchar; + ioctl(self->SubChannel, TIOCSWINSZ, &winSize); + } + } + #endif /* TIOCGWINSZ */ } + void typescript__GetClickPosition(self, position, numberOfClicks, action, startLeft, startRight, leftPos, rightPos) struct typescript *self; long position; *************** *** 1525,1530 **** --- 1639,1661 ---- super_GetClickPosition(self, position, numberOfClicks, action, startLeft, startRight, leftPos, rightPos); } + + #if SY_AIX12 + /* This is a workaround for the pty REMOTE bug. */ + static int + ps2_write_pty(fd, buf, len) + int fd; + char *buf; + int len; + { + struct ptywrraw praw; + + praw.ptr = buf; + praw.cnt = len; + return(ioctl(fd, PTYWRRAW, &praw)); + } + #endif /* SY_AIX12 */ + void typescript__SetDataObject(tp,obj) struct typescript *tp; struct dataobject *obj; *************** *** 1575,1577 **** --- 1706,1734 ---- typescript_SetDotPosition(tp,stpos); im_ForceUpdate(); } + + void typescript__SetTitle(self, title) + struct typescript *self; + char *title; + { + if (self->title != NULL) { + free(self->title); + } + if (title != NULL || *title != '\0') { + self->title = (char *) malloc(strlen(title) + 1); + if (self->title != NULL) { + strcpy(self->title, title); + } + } + else { + self->title = NULL; + } + } + + char *typescript__GetTitle(self) + struct typescript *self; + { + return self->title; + } + + *** atk/typescript/tscript.ch Wed Nov 22 12:35:43 1989 --- atk/typescript/tscript.ch.NEW Thu May 10 16:31:20 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/typescript/RCS/tscript.ch,v 2.8 89/11/06 11:31:21 tpn Exp $ */ /* $ACIS:tscript.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/typescript/RCS/tscript.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtypescript_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/typescript/RCS/tscript.ch,v 2.8 89/11/06 11:31:21 tpn Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/typescript/RCS/tscript.ch,v 2.9 90/05/10 14:10:22 ajp Exp $ */ /* $ACIS:tscript.ch 1.4$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/typescript/RCS/tscript.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtypescript_H = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/typescript/RCS/tscript.ch,v 2.9 90/05/10 14:10:22 ajp Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ *************** *** 33,38 **** --- 33,40 ---- SetDataObject(struct dataobject *dataObject); methods: + SetTitle(char *title); + GetTitle() returns char *; classprocedures: InitializeObject(struct typescript *self) returns boolean; Create(char **arglist,FILE *diskf,boolean filemenu) returns struct typescript *; *************** *** 61,64 **** --- 63,67 ---- #ifdef AIX int pgrpid; /* process group id for signalling */ #endif + char *title; }; *** atk/typescript/tscripta.c Wed Nov 22 12:35:45 1989 --- atk/typescript/tscripta.c.NEW Thu May 10 16:31:22 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/typescript/RCS/tscripta.c,v 2.10 89/10/09 13:48:59 tpn Exp $ */ /* $ACIS:tscripta.c 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/typescript/RCS/tscripta.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/typescript/RCS/tscripta.c,v 2.10 89/10/09 13:48:59 tpn Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/typescript/RCS/tscripta.c,v 2.11 90/05/10 14:09:40 ajp Exp $ */ /* $ACIS:tscripta.c 1.5$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/typescript/RCS/tscripta.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/typescript/RCS/tscripta.c,v 2.11 90/05/10 14:09:40 ajp Exp $"; #endif /* lint */ #include *************** *** 159,166 **** im = im_Create(NULL); frame_SetView(self->frame,vs); im_SetView(im, self->frame); ! if (self->titleLine != NULL) frame_SetTitle(self->frame, self->titleLine); typescript_WantInputFocus(self->ss,self->ss); im_PostDefaultHandler(im, "message", self->frame->messageLine); --- 159,168 ---- im = im_Create(NULL); frame_SetView(self->frame,vs); im_SetView(im, self->frame); ! if (self->titleLine != NULL) { frame_SetTitle(self->frame, self->titleLine); + typescript_SetTitle(self->ss, self->titleLine); + } typescript_WantInputFocus(self->ss,self->ss); im_PostDefaultHandler(im, "message", self->frame->messageLine); *** atk/textobjects/dired.c Wed Nov 22 12:36:17 1989 --- atk/textobjects/dired.c.NEW Thu Jul 12 13:04:26 1990 *************** *** 39,45 **** { struct stat stbuf; strcpy(buf, dname); ! strcat(buf, "/"); strcat(buf, fname); if (stat(buf, &stbuf) < 0) { strcpy(buf, "? "); --- 39,46 ---- { struct stat stbuf; strcpy(buf, dname); ! if(buf[strlen(buf) - 1] != '/') ! strcat(buf, "/"); strcat(buf, fname); if (stat(buf, &stbuf) < 0) { strcpy(buf, "? "); *** atk/textobjects/diredv.c Wed Nov 22 12:36:19 1989 --- atk/textobjects/diredv.c.NEW Thu Jul 12 13:04:30 1990 *************** *** 20,25 **** --- 20,26 ---- #include #include #include + #include #include #include *************** *** 122,129 **** struct diredview *self; char *fname; { ! return 0; ! /* We may only visit files if there is a frame immediately above us */ } static void ptproc_Zoom(self, rock) --- 123,179 ---- struct diredview *self; char *fname; { ! register struct buffer *buffer; ! char realName[1000], buf[1000]; ! boolean fileIsDir, fileExists; ! struct stat statBuf; ! struct frame *newFrame; ! struct im *window; ! ! filetype_CanonicalizeFilename(realName, fname, sizeof (realName) - 1); ! fname = realName; ! ! fileExists = fileIsDir = FALSE; ! if (stat(fname, &statBuf) >= 0) { ! fileExists = TRUE; ! if ((statBuf.st_mode & S_IFMT) == S_IFDIR) ! fileIsDir = TRUE; ! } ! ! if (!fileExists) ! { ! sprintf (buf, "No such file %s.", fname); ! message_DisplayString (self, 0, buf); ! return; ! } ! if (fileIsDir && (fname[strlen(fname)-1] != '/')) ! /* buffer_GetBufferOnFile won't work unless dir names end in '/' */ ! { ! strcpy (buf, fname); ! strcat (buf, "/"); ! strcpy (realName, buf); ! fname = realName; ! } ! ! buffer = buffer_GetBufferOnFile(fname, 0); ! if (buffer == NULL) ! { ! sprintf (buf, "Could not access file %s.\n", fname); ! message_DisplayString (self, 0, buf); ! return; ! } ! ! newFrame = frame_New(); ! ! /* Note that frame menulist procs are bound in this procedure */ ! frame_SetCommandEnable(newFrame, TRUE); ! ! window = im_Create(NULL); ! im_SetView(window, newFrame); ! ! frame_PostDefaultHandler(newFrame, "message", ! frame_WantHandler(newFrame, "message")); ! frame_SetBuffer(newFrame, buffer, TRUE); } static void ptproc_Zoom(self, rock) *************** *** 193,198 **** --- 243,249 ---- switch (stbuf.st_mode & S_IFMT) { case S_IFDIR: + /* sprintf(buf, "Reading directory: %s\n", fname); message_DisplayString(self, 0, buf); im_ForceUpdate(); *************** *** 201,211 **** --- 252,266 ---- else strcpy(buf, "Done.\n"); message_DisplayString(self, 0, buf); + */ + VisitFile (self, fname); break; case S_IFREG: + /* sprintf(buf, "Not implemented: Editing File: %s\n", fname); message_DisplayString(self, 0, buf); im_ForceUpdate(); + */ VisitFile(self, fname); break; default: /* S_IFLNK never occurs; other cases are devs. */ *************** *** 505,510 **** --- 560,566 ---- struct classheader *classID; struct diredview *self; { + if(self->menulist) menulist_Destroy(self->menulist); } /* *** atk/textobjects/panel.c Wed Apr 11 14:21:32 1990 --- atk/textobjects/panel.c.NEW Fri Jul 20 11:29:14 1990 *************** *** 8,16 **** #include #include #include #include #include - #include #include #include #include --- 8,16 ---- #include #include #include + #include #include #include #include #include #include *************** *** 18,23 **** --- 18,24 ---- #include #include #include + #include #include *************** *** 105,111 **** panel_LoseInputFocus(self); im_ForceUpdate(); ! (*self->handler)(self->globalTag, pe->tag, self); } static void KeyDispatch(self, rock) --- 106,113 ---- panel_LoseInputFocus(self); im_ForceUpdate(); ! if(self->handler) ! (*self->handler)(self->globalTag, pe->tag, self); } static void KeyDispatch(self, rock) *************** *** 187,192 **** --- 189,196 ---- self->keyList = NULL; self->keystate = keystate_Create(self, classKeymap); self->text = text_New(); + super_SetDataObject(self,self->text); + self->ourText = TRUE; self->handler = NULL; self->iconFont = defaultIconFont; self->icon = defaultIcon; *************** *** 197,203 **** panel_SetBorder(self, 5, 5); panel_SetDefaultStyle(self, defaultOverallStyle); - panel_SetDataObject(self, self->text); panel_AssignKey(self, 'P' - 64, ProcPrev, 0); panel_AssignKey(self, 'P', ProcPrev, 0); --- 201,206 ---- *************** *** 213,219 **** return TRUE; } ! void panel__FinalizeObject(self) register struct panel *self; { ClearHighlight(self); /* clears env */ --- 216,223 ---- return TRUE; } ! void panel__FinalizeObject(ClassID, self) ! register struct classheader *ClassID; register struct panel *self; { ClearHighlight(self); /* clears env */ *************** *** 222,228 **** DestroyKeyList(self->keyList); keystate_Destroy(self->keystate); ! text_Destroy(self->text); fontdesc_Destroy(self->iconFont); cursor_Destroy(self->cursor); style_Destroy(self->highlightStyle); --- 226,232 ---- DestroyKeyList(self->keyList); keystate_Destroy(self->keystate); ! if(self->ourText) text_Destroy(self->text); fontdesc_Destroy(self->iconFont); cursor_Destroy(self->cursor); style_Destroy(self->highlightStyle); *************** *** 241,250 **** register struct panel_Entry *new; register long len; register long textlen; ! register struct text *text = self->text; char c = '\n'; ! new = (struct panel_Entry *) malloc(sizeof (struct panel_Entry)); if (!new) return (struct panel_Entry *)NULL; --- 245,255 ---- register struct panel_Entry *new; register long len; register long textlen; ! register struct text *text = NULL; char c = '\n'; ! text = self->text; ! new = (struct panel_Entry*) malloc(sizeof (struct panel_Entry)); if (!new) return (struct panel_Entry *)NULL; *************** *** 286,291 **** --- 291,300 ---- *le = entry->next; + /* Clear highlight if the entry to be deleted is highlighted */ + if (entry == self->highlightEntry) + ClearHighlight(self); + /* Remove from display and deallocate */ len = entry->len + 1; *************** *** 409,414 **** --- 418,424 ---- struct menulist *ml; { /* Discard child menu postings */ + super_PostMenus(self,NULL); } void panel__PostKeyState(self, ks) *************** *** 426,436 **** enum view_MouseAction action; long x, y, numberOfClicks; { - if (self->handler == NULL) - return NULL; - super_Hit(self, action, x, y, numberOfClicks); - SelectAtPos(self, panel_GetDotPosition(self)); panel_SetDotLength(self, 0); panel_LoseInputFocus(self); --- 436,442 ---- *************** *** 449,451 **** --- 455,492 ---- free(tag); } + static void + AddLabels( self ) + struct panel *self; + { + static char answer[100]; + + while(1) { + *answer = '\0'; + if(message_AskForString(self,0,"Labels : ",NULL,answer, + sizeof(answer)) == -1) + break; + if((*answer == '\0') || !strcmp(answer,"")) + break; + panel_Add(self,answer,0,FALSE); + } + } + + void + panel__SetDataObject( self, dataObj ) + struct panel *self; + struct dataobject *dataObj; + { + struct text *text = NULL; + + if(dataObj) { + if((text = (struct text*)panel_GetDataObject(self)) != NULL && + (self->ourText == TRUE)) { + self->ourText = FALSE; + panel_FreeAllTags(self); + panel_RemoveAll(self); + text_Destroy(text); + } + super_SetDataObject(self, dataObj); + } + } *** atk/textobjects/panel.ch Mon Mar 12 13:16:57 1990 --- atk/textobjects/panel.ch.NEW Wed May 30 14:42:17 1990 *************** *** 97,102 **** --- 97,103 ---- FullUpdate(enum view_UpdateType type, long x, long y, long w, long h); PostMenus(struct menulist *ml); PostKeyState(struct keystate *ks); + SetDataObject(struct dataobject *dataObj); data: struct panel_Entry *panelList; *************** *** 108,113 **** --- 109,115 ---- struct keystate *keystate; struct text *text; + boolean ourText; /* This is TRUE if text is (de)allocated by panel. If the client sets his own text dataobj. we do nothing with self->text and self->ourText is FALSE. This is for backward compatibility with existing applications that rely on panel being a text/textview pair-- which is, of course, a no-no in an object-oriented environ that supports multiple views on a single dataobject. */ struct fontdesc *iconFont; char icon; *** atk/value/clklistv.c Wed Nov 22 12:37:08 1989 --- atk/value/clklistv.c.NEW Wed Jun 13 17:04:34 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/value/RCS/clklistv.c,v 1.9 89/07/05 17:37:15 tpn Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/value/RCS/clklistv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/value/RCS/clklistv.c,v 1.9 89/07/05 17:37:15 tpn Exp $ "; #endif /* lint */ #include #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/value/RCS/clklistv.c,v 1.10 90/06/05 12:25:34 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/value/RCS/clklistv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/value/RCS/clklistv.c,v 1.10 90/06/05 12:25:34 gk5g Exp $ "; #endif /* lint */ #include #include *************** *** 208,214 **** struct classheader *classID; struct clicklistV *self; { ! char *malloc(); self->text = NULL; self->cltextview = NULL; self->csize = 128; --- 208,216 ---- struct classheader *classID; struct clicklistV *self; { ! #ifndef _IBMR2 ! extern char *malloc(); ! #endif /* _IBMR2 */ self->text = NULL; self->cltextview = NULL; self->csize = 128; *** atk/value/value.c Wed Nov 22 12:37:42 1989 --- atk/value/value.c.NEW Wed Jun 6 15:14:09 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/value/RCS/value.c,v 2.10 89/09/13 16:52:11 tpn Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/value/RCS/value.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/value/RCS/value.c,v 2.10 89/09/13 16:52:11 tpn Exp $ "; #endif /* lint */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/value/RCS/value.c,v 2.11 90/06/06 14:11:07 rr2b Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/value/RCS/value.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/value/RCS/value.c,v 2.11 90/06/06 14:11:07 rr2b Exp $ "; #endif /* lint */ *************** *** 15,24 **** --- 15,28 ---- #include #include #include + #include + #include #include #include #define INITIALNUMOBSERVERS 4 + static struct atom *rock1atom, *rock2atom, *stringatom, *stringarrayatom, *valueatom; + /****************************************************************/ /* static support */ /****************************************************************/ *************** *** 88,93 **** --- 92,98 ---- self->updatecount = 0L; self->observers = NULL; self->rock1 = self->rock2 = 0l; + value_Put(self,valueatom,rock1atom,self->rock1); self->string = NULL; self->stringarray = NULL; self->notify = TRUE; *************** *** 193,201 **** char buf[256]; while(1){ if(fgets(buf,256,file) == NULL) return dataobject_PREMATUREEOF; ! if(*buf == '>') self->rock1 = atoi(buf + 1); else if(strncmp(buf,"\\enddata",8) == 0)return dataobject_NOREADERROR; } } void value__SetValueType(self,rock,type) --- 198,210 ---- char buf[256]; while(1){ if(fgets(buf,256,file) == NULL) return dataobject_PREMATUREEOF; ! if(*buf == '>') { ! self->rock1 = atoi(buf + 1); ! value_Put(self,valueatom,rock1atom,self->rock1); ! } else if(strncmp(buf,"\\enddata",8) == 0)return dataobject_NOREADERROR; } + } void value__SetValueType(self,rock,type) *************** *** 203,220 **** --- 212,242 ---- long rock; int type; { + switch(type){ case value_ROCK1: self->rock1 = rock; + + value_Put(self,valueatom,rock1atom,rock); + break; case value_ROCK2: self->rock2 = rock; + + value_Put(self,valueatom,rock2atom,rock); + break; case value_STRING: self->string = (char *) rock; + + value_Put(self,valueatom,stringatom,rock); + break; case value_STRINGARRAY: self->stringarray = (char **) rock; + + value_Put(self,valueatom,stringarrayatom,rock); + break; } (self->updatecount)++; *************** *** 233,236 **** --- 255,270 ---- self->stringarray = (char **) rock; self->rock2 = size; if(self->notify) value_NotifyObservers(self,value_NEWVALUE); + } + + boolean value__InitializeClass(classID) + struct classheader *classID; + { + valueatom=atom_Intern("value"); + rock1atom=atom_Intern("rock1"); + rock2atom=atom_Intern("rock2"); + stringatom=atom_Intern("string"); + stringarrayatom=atom_Intern("stringarray"); + if(rock1atom && rock2atom && stringatom && stringarrayatom) return TRUE; + else return FALSE; } *** atk/value/value.ch Wed Nov 22 12:37:38 1989 --- atk/value/value.ch.NEW Wed Jun 6 15:14:10 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/value/RCS/value.ch,v 2.8 89/09/13 16:53:11 tpn Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/value/RCS/value.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_value_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/value/RCS/value.ch,v 2.8 89/09/13 16:53:11 tpn Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/value/RCS/value.ch,v 2.9 90/06/06 14:16:03 rr2b Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/value/RCS/value.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_value_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/value/RCS/value.ch,v 2.9 90/06/06 14:16:03 rr2b Exp $ "; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ *************** *** 51,56 **** --- 51,59 ---- SetNotify(val) ((self)->notify = val) GetUpdateCount() ((self)->updatecount) classprocedures: + + InitializeClass() returns boolean; + InitializeObject( struct callBackObservable * self ) returns boolean; FinalizeObject( struct callBackObservable * self ); data: *** atk/zip/lib/zip.c Wed Nov 22 12:38:31 1989 --- atk/zip/lib/zip.c.NEW Mon Apr 23 13:57:30 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/zip/lib/RCS/zip.c,v 2.8 89/08/23 16:33:36 tom Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/zip/lib/RCS/zip.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/zip/lib/RCS/zip.c,v 2.8 89/08/23 16:33:36 tom Exp $"; #endif /* lint */ /* zip.c Zip Data-object */ --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/zip/lib/RCS/zip.c,v 2.9 90/04/11 14:12:17 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/zip/lib/RCS/zip.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/zip/lib/RCS/zip.c,v 2.9 90/04/11 14:12:17 gk5g Exp $"; #endif /* lint */ /* zip.c Zip Data-object */ *************** *** 97,103 **** register struct classheader *classID; { IN(zip_InitializeClass); ! /*===*/ OUT(zip_InitializeClass); return TRUE; } --- 97,103 ---- register struct classheader *classID; { IN(zip_InitializeClass); ! debug = 0; OUT(zip_InitializeClass); return TRUE; } *** atk/zip/lib/zipoarrw.c Wed Nov 22 12:39:14 1989 --- atk/zip/lib/zipoarrw.c.NEW Wed Jun 13 17:04:56 1990 *************** *** 6,12 **** /* Author TC Peters */ /* Information Technology Center Carnegie-Mellon University */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/zip/lib/RCS/zipoarrw.c,v 2.10 89/09/11 08:17:03 ghoti Exp $"; /** SPECIFICATION -- Internal Facility Suite ********************************* --- 6,12 ---- /* Author TC Peters */ /* Information Technology Center Carnegie-Mellon University */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/zip/lib/RCS/zipoarrw.c,v 2.11 90/06/06 14:49:10 gk5g Exp $"; /** SPECIFICATION -- Internal Facility Suite ********************************* *************** *** 32,38 **** --- 32,42 ---- #include "class.h" #include "zipobj.ih" #include "zipoarrw.eh" + + #ifndef _IBMR2 #include + #endif /* _IBMR2 */ + #include "environ.ih" *** atk/zip/lib/zipobj.c Wed Nov 22 12:39:18 1989 --- atk/zip/lib/zipobj.c.NEW Fri Jul 13 11:38:14 1990 *************** *** 6,15 **** /* Author TC Peters */ /* Information Technology Center Carnegie-Mellon University */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/zip/lib/RCS/zipobj.c,v 2.8 89/09/11 08:17:15 ghoti Exp $"; /* $Log: zipobj.c,v $ * Revision 2.8 89/09/11 08:17:15 ghoti * fix enumeration type clashes - specifically those dealing with mouse actions * --- 6,18 ---- /* Author TC Peters */ /* Information Technology Center Carnegie-Mellon University */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/zip/lib/RCS/zipobj.c,v 2.9 90/07/12 16:04:02 sg08 Exp $"; /* $Log: zipobj.c,v $ + * Revision 2.9 90/07/12 16:04:02 sg08 + * fix Object_Point to return at least SOME information (ie the first coordinate) + * * Revision 2.8 89/09/11 08:17:15 ghoti * fix enumeration type clashes - specifically those dealing with mouse actions * *************** *** 58,63 **** --- 61,67 ---- 04/13/88 Created (TC Peters) 07/12/89 Added Object_Visible stub (SCG) 08/07/89 Add Object_Modified stub (TCP) + 07/12/90 Have Object_Point return the first coordinate (SCG) END-SPECIFICATION ************************************************************/ *************** *** 585,592 **** register zip_type_point *x, *y; { IN(zipobject__Object_Point); ! /**** NULL ****/ ! *x = *y = 0; OUT(zipobject__Object_Point); return zip_failure; } --- 589,600 ---- register zip_type_point *x, *y; { IN(zipobject__Object_Point); ! if ( figure ) ! { /* just return the first coordinate */ ! *x = figure_x_point; ! *y = figure_y_point; ! } ! else *x = *y = 0; OUT(zipobject__Object_Point); return zip_failure; } *** atk/zip/lib/zipocirc.c Wed Nov 22 12:39:27 1989 --- atk/zip/lib/zipocirc.c.NEW Thu May 10 16:32:00 1990 *************** *** 6,15 **** /* Author TC Peters */ /* Information Technology Center Carnegie-Mellon University */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/zip/lib/RCS/zipocirc.c,v 2.8 89/09/08 17:41:44 ghoti Exp $"; /* $Log: zipocirc.c,v $ * Revision 2.8 89/09/08 17:41:44 ghoti * removal of unused variables * --- 6,18 ---- /* Author TC Peters */ /* Information Technology Center Carnegie-Mellon University */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/zip/lib/RCS/zipocirc.c,v 2.9 90/05/09 16:03:13 gk5g Exp $"; /* $Log: zipocirc.c,v $ + * Revision 2.9 90/05/09 16:03:13 gk5g + * Changes in support of i386_mach. + * * Revision 2.8 89/09/08 17:41:44 ghoti * removal of unused variables * *************** *** 241,257 **** --- 244,264 ---- { if ( (shade = ('0' + ((shade + 10) / 10)) - 1) > '9' ) shade = '9'; DEBUGdt(Shade-index,shade); + #if (!defined(MACH) || !defined(i386)) zipview_FillOvalSize( View, window_x_point - radius, window_y_point - radius, (radius << 1)+1, (radius << 1)+1, zipview_Define_Graphic( View,zip_Define_Font( Data, ShadeFontName, NULL ), shade ) ); + #endif } } else if ( action == zip_clear ) { + #if (!defined(MACH) || !defined(i386)) zipview_FillOvalSize( View, window_x_point - radius, window_y_point - radius, (radius << 1)+1, (radius << 1)+1, graphic_WHITE ); + #endif } } if (( width = zip_Contextual_Figure_Line_Width( Data, figure )) > 0 || *** atk/zip/lib/zipopath.c Wed Nov 22 12:39:44 1989 --- atk/zip/lib/zipopath.c.NEW Fri Jul 13 11:38:16 1990 *************** *** 6,15 **** /* Author TC Peters */ /* Information Technology Center Carnegie-Mellon University */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/zip/lib/RCS/zipopath.c,v 2.11 89/09/08 17:42:11 ghoti Exp $"; /* $Log: zipopath.c,v $ * Revision 2.11 89/09/08 17:42:11 ghoti * removal of unused variables * --- 6,18 ---- /* Author TC Peters */ /* Information Technology Center Carnegie-Mellon University */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/zip/lib/RCS/zipopath.c,v 2.12 90/07/12 16:02:14 sg08 Exp $"; /* $Log: zipopath.c,v $ + * Revision 2.12 90/07/12 16:02:14 sg08 + * fix Object_Point tp return at least SOME information (ie the first coordinate) + * * Revision 2.11 89/09/08 17:42:11 ghoti * removal of unused variables * *************** *** 69,74 **** --- 72,78 ---- 05/15/89 Improve performance by pre-checking TransferMode (TCP) 08/24/89 Remove excess SetTransferMode() activity in Draw() (SCG) 09/08/89 Fix Draw() to handle rubberbanding in both Builds and Edit Modifications (SCG) + 07/12/90 Have Object_Point return first coordinate (SCG) END-SPECIFICATION ************************************************************/ *************** *** 592,598 **** register long status = zip_ok; IN(zipopath__Object_Point); ! /*===*/ *x = *y = 0; OUT(zipopath__Object_Point); return status; } --- 596,607 ---- register long status = zip_ok; IN(zipopath__Object_Point); ! if ( figure ) ! { /* just return the first coordinate */ ! *x = figure_x_point; ! *y = figure_y_point; ! } ! else *x = *y = 0; OUT(zipopath__Object_Point); return status; } *** atk/zip/lib/zipopoly.c Wed Nov 22 12:39:48 1989 --- atk/zip/lib/zipopoly.c.NEW Thu May 10 16:32:04 1990 *************** *** 6,15 **** /* Author TC Peters */ /* Information Technology Center Carnegie-Mellon University */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/zip/lib/RCS/zipopoly.c,v 2.8 89/09/08 17:42:22 ghoti Exp $"; /* $Log: zipopoly.c,v $ * Revision 2.8 89/09/08 17:42:22 ghoti * removal of unused variables * --- 6,18 ---- /* Author TC Peters */ /* Information Technology Center Carnegie-Mellon University */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atk/zip/lib/RCS/zipopoly.c,v 2.9 90/05/09 16:02:23 gk5g Exp $"; /* $Log: zipopoly.c,v $ + * Revision 2.9 90/05/09 16:02:23 gk5g + * Changes in support of i386_mach. + * * Revision 2.8 89/09/08 17:42:22 ghoti * removal of unused variables * *************** *** 218,223 **** --- 221,237 ---- return status; } + #if (defined(MACH) && defined(i386)) + int calltosavecompile (pane, figure, self) + zip_type_pane pane; + zip_type_figure figure; + struct zipopolygon *self; + { + return (abs( zipview_X_Point_To_Pixel( View, pane, figure, + figure_x_point + figure_x_points(0) ) - window_x_point )); + } + #endif + static Draw( self, figure, pane, action ) register struct zipopolygon *self; *************** *** 248,255 **** --- 262,273 ---- even = false; theta = -1.57079; } + #if (defined(MACH) && defined(i386)) + radius = calltosavecompile(pane,figure,self); + #else radius = abs( zipview_X_Point_To_Pixel( View, pane, figure, figure_x_point + figure_x_points(0) ) - window_x_point ); + #endif points[0].x = points[sides].x = window_x_point + ((even) ? radius : 0); DEBUGdt(X,points[0].x); points[0].y = points[sides].y = window_y_point - ((even) ? 0 : radius); *** atk/zip/lib/zipvr00.c Wed Nov 22 12:40:54 1989 --- atk/zip/lib/zipvr00.c.NEW Wed Jun 13 17:05:02 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/zip/lib/RCS/zipvr00.c,v 2.14 89/10/16 11:10:48 cfe Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/zip/lib/RCS/zipvr00.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atk/zip/lib/RCS/zipvr00.c,v 2.14 89/10/16 11:10:48 cfe Exp $"; #endif /* lint */ /* zipvr00.c Zip PrintView-object */ --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/zip/lib/RCS/zipvr00.c,v 2.15 90/06/06 14:49:27 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/zip/lib/RCS/zipvr00.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atk/zip/lib/RCS/zipvr00.c,v 2.15 90/06/06 14:49:27 gk5g Exp $"; #endif /* lint */ /* zipvr00.c Zip PrintView-object */ *************** *** 167,173 **** --- 167,175 ---- IW72 = 72*InchWidth, W, H; register char *cursor; char *ZIP_postscript_header; + #ifndef _IBMR2 extern char *malloc(); + #endif /* _IBMR2 */ IN(zipprint_Write_Print_Datastream_Header); if ( PostScriptLanguage ) *** atk/zip/utility/ltv.c Wed Nov 22 12:42:10 1989 --- atk/zip/utility/ltv.c.NEW Thu May 10 16:32:18 1990 *************** *** 218,224 **** register struct classheader *classID; register struct ltv *self; { ! SELF=self; IN(ltv_InitializeObject); ForegroundPane = BackgroundPane = NULL; self->data = NULL; --- 218,224 ---- register struct classheader *classID; register struct ltv *self; { ! SELF=self; IN(ltv_InitializeObject); ForegroundPane = BackgroundPane = NULL; self->data = NULL; *************** *** 240,245 **** --- 240,263 ---- OUT(ltv_InitializeObject); return TRUE; } + + void + ltv__FinalizeObject( classID, self ) + register struct classheader *classID; + register struct ltv *self; + { + if(Menu) menulist_Destroy(Menu); + if(ZipView) { + zipview_UnlinkTree(ZipView); + zipview_Destroy(ZipView); + ZipView = NULL; + } + if(Buttons) { + suite_UnlinkTree(Buttons); + suite_Destroy(Buttons); + Buttons = NULL; + } + } void ltv__SetDataObject( self, data ) *** atk/zip/utility/ltv.ch Wed Nov 22 12:42:14 1989 --- atk/zip/utility/ltv.ch.NEW Thu May 10 16:32:22 1990 *************** *** 38,45 **** classprocedures: ! InitializeClass() returns boolean; ! InitializeObject( struct ltv *self ) returns boolean; data: --- 38,46 ---- classprocedures: ! InitializeClass( struct classheader *classID ) returns boolean; ! InitializeObject( struct classheader *classID, struct ltv *self ) returns boolean; ! FinalizeObject( struct classheader *classID, struct ltv *self ); data: *** atk/zip/utility/schedv.c Wed Nov 22 12:42:00 1989 --- atk/zip/utility/schedv.c.NEW Thu May 10 16:32:24 1990 *************** *** 172,177 **** --- 172,190 ---- } void + schedv__FinalizeObject( classID, self ) + register struct classheader *classID; + register struct schedv *self; + { + if(Menu) menulist_Destroy(Menu); + if(ZipView) { + zipview_UnlinkTree(ZipView); + zipview_Destroy(ZipView); + ZipView = NULL; + } + } + + void schedv__SetDataObject( self, data ) register struct schedv *self; register struct sched *data; *** atk/zip/utility/schedv.ch Wed Nov 22 12:42:04 1989 --- atk/zip/utility/schedv.ch.NEW Thu May 10 16:32:26 1990 *************** *** 34,41 **** classprocedures: ! InitializeClass() returns boolean; ! InitializeObject( struct schedv *self ) returns boolean; data: --- 34,42 ---- classprocedures: ! InitializeClass( struct classheader *classID ) returns boolean; ! InitializeObject( struct classheader *classID, struct schedv *self ) returns boolean; ! FinalizeObject( struct classheader *classID, struct schedv *self ); data: *** atkams/messages/lib/ams.c Wed Nov 22 12:43:23 1989 --- atkams/messages/lib/ams.c.NEW Thu May 10 16:32:39 1990 *************** *** 1800,1809 **** strcpy(AnsBuf, LineBuf); } } strncpy(buf, AnsBuf, size); fclose(fp); - ams_WaitCursor(FALSE); - if (ct == 0) return(message_Invalid); if (ct == 1) return(message_Complete); return(incomplete ? message_Valid : message_CompleteValid); } --- 1800,1812 ---- strcpy(AnsBuf, LineBuf); } } + ams_WaitCursor(FALSE); + if (ct == 0) { + strncpy(buf, part, size); + return(message_Invalid); + } strncpy(buf, AnsBuf, size); fclose(fp); if (ct == 1) return(message_Complete); return(incomplete ? message_Valid : message_CompleteValid); } *** atkams/messages/lib/captions.c Wed Nov 22 12:43:34 1989 --- atkams/messages/lib/captions.c.NEW Thu Jul 12 13:05:26 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/captions.c,v 2.28 89/10/09 22:04:00 wjh Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/captions.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/captions.c,v 2.28 89/10/09 22:04:00 wjh Exp $ "; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/captions.c,v 2.30 90/07/03 15:30:03 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/captions.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/captions.c,v 2.30 90/07/03 15:30:03 gk5g Exp $ "; #endif /* lint */ #include *************** *** 22,32 **** #include #include #include - #include #include #include #include - /* #include */ #include #include #include --- 22,30 ---- *************** *** 56,63 **** (*textview_EndOfLineCmd)() = AbsentProcedure, (*textview_GlitchDownCmd)() = AbsentProcedure; ! extern char *malloc(), *index(), *rindex(); void captions__ShowHelp(self) struct captions *self; { --- 54,65 ---- (*textview_EndOfLineCmd)() = AbsentProcedure, (*textview_GlitchDownCmd)() = AbsentProcedure; ! extern char *index(), *rindex(); + #ifndef _IBMR2 + extern char *malloc(); + #endif /* _IBMR2 */ + void captions__ShowHelp(self) struct captions *self; { *************** *** 188,196 **** ams_WaitCursor(TRUE); textview_BeginningOfLineCmd(tv); ! dot = textview_GetDotPosition(tv); textview_EndOfLineCmd(tv); ! tmpdot = textview_GetDotPosition(tv); len = tmpdot - dot; if (len > 0) { str = text_GetBuf(t, dot, len, &retlen); --- 190,198 ---- ams_WaitCursor(TRUE); textview_BeginningOfLineCmd(tv); ! dot = captions_GetDotPosition(captions); textview_EndOfLineCmd(tv); ! tmpdot = captions_GetDotPosition(captions); len = tmpdot - dot; if (len > 0) { str = text_GetBuf(t, dot, len, &retlen); *************** *** 208,214 **** if (tmpdot < 0) { message_DisplayString(NULL, 10, "Option not found."); } else { ! textview_SetTopPosition((struct textview *) captions_GetBodView(captions), tmpdot); } } } --- 210,217 ---- if (tmpdot < 0) { message_DisplayString(NULL, 10, "Option not found."); } else { ! t822view_SetTopPosition(captions_GetBodView(captions), tmpdot); ! } } } *************** *** 1264,1270 **** south = GetSouthernmostPoint(ci); captions_InsertCaptions(ci, ci->ShortName, ci->FullName, TimeBuf, FALSE); added = text_GetLength(ci->CaptText) - oldsize; ! captions_SetDotPosition(ci, olddot + added-1); captions_SetTopPosition(ci, oldtop + added); if (ci->HighlightLen > 0) { ci->HighlightStartPos += added; --- 1267,1273 ---- south = GetSouthernmostPoint(ci); captions_InsertCaptions(ci, ci->ShortName, ci->FullName, TimeBuf, FALSE); added = text_GetLength(ci->CaptText) - oldsize; ! captions_SetDotPosition(ci, olddot + added); captions_SetTopPosition(ci, oldtop + added); if (ci->HighlightLen > 0) { ci->HighlightStartPos += added; *** atkams/messages/lib/folders.c Wed Nov 22 12:44:23 1989 --- atkams/messages/lib/folders.c.NEW Thu Jul 12 13:05:30 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/folders.c,v 1.26 89/10/04 18:09:32 cfe Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/folders.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/folders.c,v 1.26 89/10/04 18:09:32 cfe Exp $ "; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/folders.c,v 1.28 90/07/03 15:34:33 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/folders.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/folders.c,v 1.28 90/07/03 15:34:33 gk5g Exp $ "; #endif /* lint */ #include *************** *** 21,39 **** #include #include #include - #include #include - /* #include */ #include #include #include - /* #include */ #include #include #include #include #include - #include #include #include --- 21,35 ---- *************** *** 50,57 **** #define Logstat(x,y,z) #endif /* DOTIMING */ ! extern char *malloc(), *index(), *rindex(); static char *ForgetItString = "Forget it -- do nothing."; void folders__HandleAsyncPrefetch(ci) --- 46,57 ---- #define Logstat(x,y,z) #endif /* DOTIMING */ ! extern char *index(), *rindex(); + #ifndef _IBMR2 + extern char *malloc(); + #endif /* _IBMR2 */ + static char *ForgetItString = "Forget it -- do nothing."; void folders__HandleAsyncPrefetch(ci) *************** *** 250,259 **** myoffset = hitpos - linestart; if ((myoffset > 1) && (myoffset < 5) && text_GetChar((struct text *) folders_GetDataObject(folders), linestart + 2) == ICON_FOLDER) { ! if (IsLeftClick) { captions_FileCurrent(folders_GetCaptions(folders), folders->MainDirCache[i].FullName, folders->MainDirCache[i].ShortName); } else { ! captions_FileCurrent(folders_GetCaptions(folders), folders->MainDirCache[i].FullName, folders->MainDirCache[i].ShortName); } } else { folders_ActionHit(folders, folders->MainDirCache[i].substatus, folders->MainDirCache[i].FullName, folders->MainDirCache[i].ShortName); --- 250,259 ---- myoffset = hitpos - linestart; if ((myoffset > 1) && (myoffset < 5) && text_GetChar((struct text *) folders_GetDataObject(folders), linestart + 2) == ICON_FOLDER) { ! if (IsLeftClick || !amsutil_GetOptBit(EXP_MARKING)) { captions_FileCurrent(folders_GetCaptions(folders), folders->MainDirCache[i].FullName, folders->MainDirCache[i].ShortName); } else { ! captions_FileMarked(folders_GetCaptions(folders), folders->MainDirCache[i].FullName, folders->MainDirCache[i].ShortName); } } else { folders_ActionHit(folders, folders->MainDirCache[i].substatus, folders->MainDirCache[i].FullName, folders->MainDirCache[i].ShortName); *************** *** 1159,1165 **** struct im *im; folders_GetLogicalBounds(self, &Rect); ! im = view_GetIM((struct view *)self); if (im && amsutil_GetOptBit(EXP_GROWFOLDS) && (Rect.height > 0 && Rect.width > 0)) { if (amsutil_GetOptBit(EXP_VANISH)) { im_VanishWindow(im); --- 1159,1165 ---- struct im *im; folders_GetLogicalBounds(self, &Rect); ! im = folders_GetIM(self); if (im && amsutil_GetOptBit(EXP_GROWFOLDS) && (Rect.height > 0 && Rect.width > 0)) { if (amsutil_GetOptBit(EXP_VANISH)) { im_VanishWindow(im); *** atkams/messages/lib/messages.c Wed Apr 11 14:21:43 1990 --- atkams/messages/lib/messages.c.NEW Mon Jul 23 09:34:05 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v 2.32 90/03/19 15:15:08 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v 2.32 90/03/19 15:15:08 gk5g Exp $ "; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v 2.33 90/05/15 11:42:52 gk5g Exp Locker: gk5g $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.c,v 2.33 90/05/15 11:42:52 gk5g Exp Locker: gk5g $ "; #endif /* lint */ #include *************** *** 25,31 **** #include #include #include - #include #include #include --- 25,30 ---- *** atkams/messages/lib/messages.ch Wed Apr 11 14:21:47 1990 --- atkams/messages/lib/messages.ch.NEW Mon Jul 23 09:34:09 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v 2.8 90/03/19 12:49:43 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v $ */ #ifndef lint ! static char *rcsid_messages_H = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v 2.8 90/03/19 12:49:43 gk5g Exp $ "; #endif /* lint */ #define WHATIAM_UNDEFINED -1 --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v 2.8 90/03/19 12:49:43 gk5g Exp Locker: gk5g $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v $ */ #ifndef lint ! static char *rcsid_messages_H = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/messages.ch,v 2.8 90/03/19 12:49:43 gk5g Exp Locker: gk5g $ "; #endif /* lint */ #define WHATIAM_UNDEFINED -1 *** atkams/messages/lib/sendmsg.c Wed Nov 22 12:43:57 1989 --- atkams/messages/lib/sendmsg.c.NEW Tue May 15 13:21:18 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/sendmsg.c,v 2.31 89/11/03 17:31:16 cfe Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/sendmsg.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/atkams/messages/lib/RCS/sendmsg.c,v 2.31 89/11/03 17:31:16 cfe Exp $ "; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendmsg.c,v 2.32 90/05/15 13:19:55 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendmsg.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/atkams/messages/lib/RCS/sendmsg.c,v 2.32 90/05/15 13:19:55 gk5g Exp $ "; #endif /* lint */ #include *************** *** 17,28 **** #include #include - #include #include #include #include #include - #include #include #include #include --- 17,26 ---- *************** *** 61,67 **** #define FORCE_SEND_FORMATTED 1 #define FORCE_SEND_UNFORMATTED 2 ! extern char *malloc(), *index(); void sendmessage__LinkTree(self, parent) struct sendmessage *self; --- 59,69 ---- #define FORCE_SEND_FORMATTED 1 #define FORCE_SEND_UNFORMATTED 2 ! extern char *index(); ! ! #ifndef _IBMR2 ! extern char *malloc(); ! #endif /* _IBMR2 */ void sendmessage__LinkTree(self, parent) struct sendmessage *self; *** contrib/Imakefile Wed Nov 22 12:44:58 1989 --- contrib/Imakefile.NEW Thu May 10 16:32:47 1990 *************** *** 1,3 **** #define IHaveSubdirs SUBDIRS = compress hyplink wpedit ltext m3text \ ! mtext ptext rctext rmtext tm --- 1,3 ---- #define IHaveSubdirs SUBDIRS = compress hyplink wpedit ltext m3text \ ! mtext ptext rctext rmtext tm time *** contrib/compress/compresv.c Wed Nov 22 12:45:15 1989 --- contrib/compress/compresv.c.NEW Wed Jun 13 17:05:41 1990 *************** *** 3,9 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/compress/RCS/compresv.c,v 1.4 89/10/23 15:57:04 ghoti Exp $ */ /*RSKmod butchered from 'fnotev.c'*/ --- 3,9 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/compress/RCS/compresv.c,v 1.5 90/06/11 23:50:07 gk5g Exp $ */ /*RSKmod butchered from 'fnotev.c'*/ *************** *** 25,31 **** #include /*RSKadd*/ #include "compresv.eh" ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/compress/RCS/compresv.c,v 1.4 89/10/23 15:57:04 ghoti Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; #define FONTNAME "andysans" --- 25,31 ---- #include /*RSKadd*/ #include "compresv.eh" ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/compress/RCS/compresv.c,v 1.5 90/06/11 23:50:07 gk5g Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; #define FONTNAME "andysans" *************** *** 114,121 **** } /* DecompressAll(self) first destroys all the views that have been initialized, then removes all the environments that haven't been initialized as views yet */ ! void compressv__DecompressAll(self) /*RSKadd*/ ! struct compressv *self; { while (firstcompress!=NULL) decompress(firstcompress,0); --- 114,121 ---- } /* DecompressAll(self) first destroys all the views that have been initialized, then removes all the environments that haven't been initialized as views yet */ ! void compressv__DecompressAll(classID) /*RSKadd*/ ! struct classheader *classID; { while (firstcompress!=NULL) decompress(firstcompress,0); *************** *** 127,134 **** } /* MakeBox(self,cprs) adds a node to the envlist linked list, which will actually be put into the text on the next call to UnhideBoxes(); this assumes that HideBoxes() has been called previously to avoid problems with nested (and hence hidden) views leaving their cursor descriptions in the text object's window */ ! void compressv__MakeBox(self,cprs) /*RSKadd*/ ! struct compressv *self; struct compress *cprs; { struct envlist *newenv=(struct envlist *)malloc(sizeof(struct envlist)); --- 127,134 ---- } /* MakeBox(self,cprs) adds a node to the envlist linked list, which will actually be put into the text on the next call to UnhideBoxes(); this assumes that HideBoxes() has been called previously to avoid problems with nested (and hence hidden) views leaving their cursor descriptions in the text object's window */ ! void compressv__MakeBox(classID,cprs) /*RSKadd*/ ! struct classheader *classID; struct compress *cprs; { struct envlist *newenv=(struct envlist *)malloc(sizeof(struct envlist)); *************** *** 154,161 **** } /* HideBoxes(self) destroys all the views that have been initialized and removes the uninitialized environments, but leaves the envlist linked list intact so that the boxes can be easily restored. This should be used by the parent text's Write routine to prevent the boxes from being saved to disk as \377 characters. */ ! void compressv__HideBoxes(self) /*RSKadd*/ ! struct compressv *self; { while (firstcompress!=NULL) compressv_Destroy(firstcompress); if (firstenv!=NULL) --- 154,161 ---- } /* HideBoxes(self) destroys all the views that have been initialized and removes the uninitialized environments, but leaves the envlist linked list intact so that the boxes can be easily restored. This should be used by the parent text's Write routine to prevent the boxes from being saved to disk as \377 characters. */ ! void compressv__HideBoxes(classID) /*RSKadd*/ ! struct classheader *classID; { while (firstcompress!=NULL) compressv_Destroy(firstcompress); if (firstenv!=NULL) *************** *** 172,179 **** } /* UnhideBoxes(self) goes through the envlist linked list and puts all the boxes back. Any that are visible in the parent textview's window will be initialized into views automatically. */ ! void compressv__UnhideBoxes(self) /*RSKadd*/ ! struct compressv *self; { if (firstenv!=NULL) { --- 172,179 ---- } /* UnhideBoxes(self) goes through the envlist linked list and puts all the boxes back. Any that are visible in the parent textview's window will be initialized into views automatically. */ ! void compressv__UnhideBoxes(classID) /*RSKadd*/ ! struct classheader *classID; { if (firstenv!=NULL) { *** contrib/compress/compresv.ch Wed Nov 22 12:45:18 1989 --- contrib/compress/compresv.ch.NEW Wed Jun 13 17:05:43 1990 *************** *** 3,9 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/compress/RCS/compresv.ch,v 1.1 89/09/10 14:58:25 ghoti Exp $ */ struct envlist { --- 3,9 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/compress/RCS/compresv.ch,v 1.1 89/09/10 14:58:25 ghoti Exp $ */ struct envlist { *** contrib/hyplink/link.c Wed Nov 22 12:45:28 1989 --- contrib/hyplink/link.c.NEW Wed Jun 13 17:05:53 1990 *************** *** 16,22 **** --- 16,25 ---- #define DS_VERSION 1 /* datastream version */ /* External declarations */ + + #ifndef _IBMR2 extern char *malloc(); + #endif /* _IBMR2 */ /* Forward Declarations */ static void WriteLine(); *** contrib/m3text/m3text.c Wed Jan 17 16:39:31 1990 --- contrib/m3text/m3text.c.NEW Wed Jun 13 17:06:06 1990 *************** *** 3,9 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/.andrew.cmu.edu/itc/src/andrew/contrib/m3text/RCS/m3text.c,v 1.4 89/11/15 09:00:33 ghoti Exp $ */ /* M3text, a Modula-3 mode for BE2. */ --- 3,9 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/m3text/RCS/m3text.c,v 1.5 90/06/11 23:52:29 gk5g Exp $ */ /* M3text, a Modula-3 mode for BE2. */ *************** *** 22,28 **** #include /*RSKadd*/ #include ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/contrib/m3text/RCS/m3text.c,v 1.4 89/11/15 09:00:33 ghoti Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; #define NPTOUPPER(c) (islower(c) ? toupper(c) : (c)) --- 22,28 ---- #include /*RSKadd*/ #include ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/m3text/RCS/m3text.c,v 1.5 90/06/11 23:52:29 gk5g Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; #define NPTOUPPER(c) (islower(c) ? toupper(c) : (c)) *************** *** 532,540 **** int level; { long temp; ! compressv_HideBoxes(NULL); temp=super_Write(self,file,writeID,level); ! compressv_UnhideBoxes(NULL); return temp; } --- 532,540 ---- int level; { long temp; ! compressv_HideBoxes(); temp=super_Write(self,file,writeID,level); ! compressv_UnhideBoxes(); return temp; } *** contrib/m3text/m3textv.c Wed Nov 22 12:46:14 1989 --- contrib/m3text/m3textv.c.NEW Wed Jun 13 17:06:09 1990 *************** *** 3,9 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/m3text/RCS/m3textv.c,v 1.3 89/10/03 09:20:57 ajp Exp $ */ /* M3textView, a ``Modula-3'' mode for BE2. */ --- 3,9 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/m3text/RCS/m3textv.c,v 1.4 90/06/11 23:53:38 gk5g Exp $ */ /* M3textView, a ``Modula-3'' mode for BE2. */ *************** *** 33,39 **** #include "compress.ih" /*RSKadd*/ #include "compresv.ih" /*RSKadd*/ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/m3text/RCS/m3textv.c,v 1.3 89/10/03 09:20:57 ajp Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; static long BounceTime = 0; --- 33,39 ---- #include "compress.ih" /*RSKadd*/ #include "compresv.ih" /*RSKadd*/ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/m3text/RCS/m3textv.c,v 1.4 90/06/11 23:53:38 gk5g Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; static long BounceTime = 0; *************** *** 357,363 **** return; } fn = compress_New(); ! compressv_HideBoxes(NULL); pos= m3textview_GetDotPosition(self); len= m3textview_GetDotLength(self); if (len==0 && m3text_GetChar(ct,pos)=='\n') pos--; --- 357,363 ---- return; } fn = compress_New(); ! compressv_HideBoxes(); pos= m3textview_GetDotPosition(self); len= m3textview_GetDotLength(self); if (len==0 && m3text_GetChar(ct,pos)=='\n') pos--; *************** *** 366,372 **** if (compress_IsHidden(fn,ct,pos+1)) { compress_Destroy(fn); ! compressv_UnhideBoxes(NULL); return; } /*if (environment_Remove(ct->header.text.rootEnvironment,pos,len, environment_Style,FALSE))*/ --- 366,372 ---- if (compress_IsHidden(fn,ct,pos+1)) { compress_Destroy(fn); ! compressv_UnhideBoxes(); return; } /*if (environment_Remove(ct->header.text.rootEnvironment,pos,len, environment_Style,FALSE))*/ *************** *** 377,383 **** fn->parentview=(struct textview *)(self->header.view.dataobject); compressv_MakeBox(fn); ! compressv_UnhideBoxes(NULL); m3text_RegionModified(ct,mark_GetPos(fn->cpmark)-1, mark_GetLength(fn->cpmark)+1); m3textview_CollapseDot(self); m3text_NotifyObservers(ct,0); --- 377,383 ---- fn->parentview=(struct textview *)(self->header.view.dataobject); compressv_MakeBox(fn); ! compressv_UnhideBoxes(); m3text_RegionModified(ct,mark_GetPos(fn->cpmark)-1, mark_GetLength(fn->cpmark)+1); m3textview_CollapseDot(self); m3text_NotifyObservers(ct,0); *************** *** 405,411 **** if (m3text_GetChar(ct,oldpos)=='\n') oldpos--; curInd=compress_CurrentIndentation(ct,oldpos); m3textview_CollapseDot(self); ! compressv_HideBoxes(NULL); while (pos>0) { fn=compress_New(); --- 405,411 ---- if (m3text_GetChar(ct,oldpos)=='\n') oldpos--; curInd=compress_CurrentIndentation(ct,oldpos); m3textview_CollapseDot(self); ! compressv_HideBoxes(); while (pos>0) { fn=compress_New(); *************** *** 427,433 **** } else compress_Destroy(fn); } ! compressv_UnhideBoxes(NULL); m3text_NotifyObservers(ct,0); im_SetWindowCursor(im,NULL); /*RSKadd*/ } --- 427,433 ---- } else compress_Destroy(fn); } ! compressv_UnhideBoxes(); m3text_NotifyObservers(ct,0); im_SetWindowCursor(im,NULL); /*RSKadd*/ } *************** *** 437,443 **** struct m3textview *self; long key; { ! compressv_DecompressAll(NULL); } /*-----------------RSKmod copied from 'compile.c'-------------------*/ --- 437,443 ---- struct m3textview *self; long key; { ! compressv_DecompressAll(); } /*-----------------RSKmod copied from 'compile.c'-------------------*/ *** contrib/ptext/ptext.c Wed Nov 22 12:47:00 1989 --- contrib/ptext/ptext.c.NEW Wed Jun 13 17:06:23 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/ptext/RCS/ptext.c,v 1.3 89/08/20 00:48:46 zs01 Exp $ */ /* $ACIS:ptext.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/ptext/RCS/ptext.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/ptext/RCS/ptext.c,v 1.3 89/08/20 00:48:46 zs01 Exp $"; #endif /* lint */ /* --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/ptext/RCS/ptext.c,v 1.4 90/06/05 15:02:15 gk5g Exp $ */ /* $ACIS:ptext.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/ptext/RCS/ptext.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/ptext/RCS/ptext.c,v 1.4 90/06/05 15:02:15 gk5g Exp $"; #endif /* lint */ /* *************** *** 67,73 **** boolean useTabs = FALSE; int levelIndent=4, contIndent=2, ! caseLevelIndent=4; idStyle=idstyle_CAPIT; struct keywd words[]={ --- 67,73 ---- boolean useTabs = FALSE; int levelIndent=4, contIndent=2, ! caseLevelIndent=4, idStyle=idstyle_CAPIT; struct keywd words[]={ *** contrib/rctext/rctext.c Wed Jan 17 16:39:34 1990 --- contrib/rctext/rctext.c.NEW Wed Jun 13 17:06:34 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/andrew/contrib/rctext/RCS/rctext.c,v 1.4 89/11/15 09:02:19 ghoti Exp $ */ /* $ACIS:rctext.c 1.2$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/andrew/contrib/rctext/RCS/rctext.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/contrib/rctext/RCS/rctext.c,v 1.4 89/11/15 09:02:19 ghoti Exp $"; #endif /* lint */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rctext/RCS/rctext.c,v 1.6 90/06/11 23:54:20 gk5g Exp $ */ /* $ACIS:rctext.c 1.2$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rctext/RCS/rctext.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rctext/RCS/rctext.c,v 1.6 90/06/11 23:54:20 gk5g Exp $"; #endif /* lint */ *************** *** 127,135 **** long temp; if (len > 0 && rctext_GetChar(self, len - 1) != '\n') rctext_InsertCharacters(self, len, "\n", 1); ! compressv_HideBoxes(NULL); /*RSKadd*/ temp=super_Write(self, file, id, level); ! compressv_UnhideBoxes(NULL); /*RSKadd*/ return temp; } --- 127,135 ---- long temp; if (len > 0 && rctext_GetChar(self, len - 1) != '\n') rctext_InsertCharacters(self, len, "\n", 1); ! compressv_HideBoxes(); /*RSKadd*/ temp=super_Write(self, file, id, level); ! compressv_UnhideBoxes(); /*RSKadd*/ return temp; } *** contrib/rctext/rctextv.c Wed Nov 22 12:47:22 1989 --- contrib/rctext/rctextv.c.NEW Wed Jun 13 17:06:37 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/rctext/RCS/rctextv.c,v 1.2 89/09/12 14:30:14 ghoti Exp $ */ /* $ACIS:rctextv.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/rctext/RCS/rctextv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/rctext/RCS/rctextv.c,v 1.2 89/09/12 14:30:14 ghoti Exp $"; #endif /* lint */ /* RCTextView, a ``c'' mode for BE2. (R-> Rochester contribution) */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rctext/RCS/rctextv.c,v 1.3 90/06/11 23:55:01 gk5g Exp $ */ /* $ACIS:rctextv.c 1.2$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rctext/RCS/rctextv.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rctext/RCS/rctextv.c,v 1.3 90/06/11 23:55:01 gk5g Exp $"; #endif /* lint */ /* RCTextView, a ``c'' mode for BE2. (R-> Rochester contribution) */ *************** *** 413,419 **** return; } fn = compress_New(); ! compressv_HideBoxes(NULL); pos= rctextview_GetDotPosition(self); len= rctextview_GetDotLength(self); if (len==0 && rctext_GetChar(ct,pos)=='\n') pos--; --- 413,419 ---- return; } fn = compress_New(); ! compressv_HideBoxes(); pos= rctextview_GetDotPosition(self); len= rctextview_GetDotLength(self); if (len==0 && rctext_GetChar(ct,pos)=='\n') pos--; *************** *** 422,428 **** if (compress_IsHidden(fn,ct,pos+1)) { compress_Destroy(fn); ! compressv_UnhideBoxes(NULL); return; } /*if (environment_Remove(ct->header.text.rootEnvironment,pos,len, environment_Style,FALSE))*/ --- 422,428 ---- if (compress_IsHidden(fn,ct,pos+1)) { compress_Destroy(fn); ! compressv_UnhideBoxes(); return; } /*if (environment_Remove(ct->header.text.rootEnvironment,pos,len, environment_Style,FALSE))*/ *************** *** 433,439 **** fn->parentview=(struct textview *)(self->header.view.dataobject); compressv_MakeBox(fn); ! compressv_UnhideBoxes(NULL); rctext_RegionModified(ct,mark_GetPos(fn->cpmark)-1, mark_GetLength(fn->cpmark)+1); rctextview_CollapseDot(self); rctext_NotifyObservers(ct,0); --- 433,439 ---- fn->parentview=(struct textview *)(self->header.view.dataobject); compressv_MakeBox(fn); ! compressv_UnhideBoxes(); rctext_RegionModified(ct,mark_GetPos(fn->cpmark)-1, mark_GetLength(fn->cpmark)+1); rctextview_CollapseDot(self); rctext_NotifyObservers(ct,0); *************** *** 461,467 **** if (rctext_GetChar(ct,oldpos)=='\n') oldpos--; curInd=compress_CurrentIndentation(ct,oldpos); rctextview_CollapseDot(self); ! compressv_HideBoxes(NULL); while (pos>0) { fn=compress_New(); --- 461,467 ---- if (rctext_GetChar(ct,oldpos)=='\n') oldpos--; curInd=compress_CurrentIndentation(ct,oldpos); rctextview_CollapseDot(self); ! compressv_HideBoxes(); while (pos>0) { fn=compress_New(); *************** *** 483,489 **** } else compress_Destroy(fn); } ! compressv_UnhideBoxes(NULL); rctext_NotifyObservers(ct,0); im_SetWindowCursor(im,NULL); /*RSKadd*/ } --- 483,489 ---- } else compress_Destroy(fn); } ! compressv_UnhideBoxes(); rctext_NotifyObservers(ct,0); im_SetWindowCursor(im,NULL); /*RSKadd*/ } *************** *** 493,497 **** struct rctextview *self; long key; { ! compressv_DecompressAll(NULL); } --- 493,497 ---- struct rctextview *self; long key; { ! compressv_DecompressAll(); } *** contrib/rmtext/rmtext.c Wed Jan 17 16:39:37 1990 --- contrib/rmtext/rmtext.c.NEW Wed Jun 13 17:06:45 1990 *************** *** 2,10 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/andrew/contrib/rmtext/RCS/rmtext.c,v 1.5 89/11/15 09:03:11 ghoti Exp $ */ /* $ACIS:rmtext.c 1.2$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/andrew/contrib/rmtext/RCS/rmtext.c,v $ */ /* rmtext, a Modula-2 mode for BE2. */ --- 2,10 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rmtext/RCS/rmtext.c,v 1.6 90/06/11 23:55:29 gk5g Exp $ */ /* $ACIS:rmtext.c 1.2$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rmtext/RCS/rmtext.c,v $ */ /* rmtext, a Modula-2 mode for BE2. */ *************** *** 22,28 **** #include /*RSKadd*/ #include ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/contrib/rmtext/RCS/rmtext.c,v 1.5 89/11/15 09:03:11 ghoti Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; /* --- 22,28 ---- #include /*RSKadd*/ #include ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rmtext/RCS/rmtext.c,v 1.6 90/06/11 23:55:29 gk5g Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; /* *************** *** 522,530 **** int level; { long temp; ! compressv_HideBoxes(NULL); temp=super_Write(self,file,writeID,level); ! compressv_UnhideBoxes(NULL); return temp; } --- 522,530 ---- int level; { long temp; ! compressv_HideBoxes(); temp=super_Write(self,file,writeID,level); ! compressv_UnhideBoxes(); return temp; } *** contrib/rmtext/rmtextv.c Wed Nov 22 12:47:37 1989 --- contrib/rmtext/rmtextv.c.NEW Wed Jun 13 17:06:49 1990 *************** *** 2,10 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/rmtext/RCS/rmtextv.c,v 1.4 89/10/03 09:27:35 ajp Exp $ */ /* $ACIS:rmtextview.c 1.2$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/rmtext/RCS/rmtextv.c,v $ */ /* RMtextView, a ``Modula-2'' mode for BE2. (R-> Rochester contribution) */ #include --- 2,10 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rmtext/RCS/rmtextv.c,v 1.5 90/06/11 23:56:15 gk5g Exp $ */ /* $ACIS:rmtextview.c 1.2$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rmtext/RCS/rmtextv.c,v $ */ /* RMtextView, a ``Modula-2'' mode for BE2. (R-> Rochester contribution) */ #include *************** *** 33,39 **** #include "compress.ih" /*RSKadd*/ #include "compresv.ih" /*RSKadd*/ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/rmtext/RCS/rmtextv.c,v 1.4 89/10/03 09:27:35 ajp Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; static long BounceTime = 0; --- 33,39 ---- #include "compress.ih" /*RSKadd*/ #include "compresv.ih" /*RSKadd*/ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/rmtext/RCS/rmtextv.c,v 1.5 90/06/11 23:56:15 gk5g Exp $"; static char CopyRight[] = " Copyright (c) IBM Corp. 1989"; static long BounceTime = 0; *************** *** 418,424 **** return; } fn = compress_New(); ! compressv_HideBoxes(NULL); pos = rmtextview_GetDotPosition(self); len = rmtextview_GetDotLength(self); if (len==0 && rmtext_GetChar(ct,pos)=='\n') pos--; --- 418,424 ---- return; } fn = compress_New(); ! compressv_HideBoxes(); pos = rmtextview_GetDotPosition(self); len = rmtextview_GetDotLength(self); if (len==0 && rmtext_GetChar(ct,pos)=='\n') pos--; *************** *** 427,433 **** if (compress_IsHidden(fn,ct,pos+1)) { compress_Destroy(fn); ! compressv_UnhideBoxes(NULL); return; } /*if (environment_Remove(ct->header.text.rootEnvironment,pos,len, environment_Style,FALSE))*/ --- 427,433 ---- if (compress_IsHidden(fn,ct,pos+1)) { compress_Destroy(fn); ! compressv_UnhideBoxes(); return; } /*if (environment_Remove(ct->header.text.rootEnvironment,pos,len, environment_Style,FALSE))*/ *************** *** 438,444 **** fn->parentview=(struct textview *)(self->header.view.dataobject); compressv_MakeBox(fn); ! compressv_UnhideBoxes(NULL); rmtext_RegionModified(ct,mark_GetPos(fn->cpmark)-1, mark_GetLength(fn->cpmark)+1); rmtextview_CollapseDot(self); rmtext_NotifyObservers(ct,0); --- 438,444 ---- fn->parentview=(struct textview *)(self->header.view.dataobject); compressv_MakeBox(fn); ! compressv_UnhideBoxes(); rmtext_RegionModified(ct,mark_GetPos(fn->cpmark)-1, mark_GetLength(fn->cpmark)+1); rmtextview_CollapseDot(self); rmtext_NotifyObservers(ct,0); *************** *** 465,471 **** if (rmtext_GetChar(ct,oldpos)=='\n') oldpos--; curInd=compress_CurrentIndentation(ct,oldpos); rmtextview_CollapseDot(self); ! compressv_HideBoxes(NULL); while (pos>0) { fn=compress_New(); --- 465,471 ---- if (rmtext_GetChar(ct,oldpos)=='\n') oldpos--; curInd=compress_CurrentIndentation(ct,oldpos); rmtextview_CollapseDot(self); ! compressv_HideBoxes(); while (pos>0) { fn=compress_New(); *************** *** 487,493 **** } else compress_Destroy(fn); } ! compressv_UnhideBoxes(NULL); rmtext_NotifyObservers(ct,0); im_SetWindowCursor(im,NULL); /*RSKadd*/ } --- 487,493 ---- } else compress_Destroy(fn); } ! compressv_UnhideBoxes(); rmtext_NotifyObservers(ct,0); im_SetWindowCursor(im,NULL); /*RSKadd*/ } *************** *** 496,502 **** struct rmtextview *self; long key; { ! compressv_DecompressAll(NULL); } /*-----------------RSKmod copied from 'compile.c'-------------------*/ --- 496,502 ---- struct rmtextview *self; long key; { ! compressv_DecompressAll(); } /*-----------------RSKmod copied from 'compile.c'-------------------*/ *** contrib/time/Imakefile Fri Jul 27 14:14:31 1990 --- contrib/time/Imakefile.NEW Wed Jun 13 17:07:00 1990 *************** *** 0 **** --- 1,41 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + DOBJS = timeoday.do \ + timeodayv.do \ + writestmp.do \ + writestmpv.do \ + clock.do \ + clockv.do + + IHFILES = timeoday.ih \ + timeodayv.ih \ + writestmp.ih \ + writestmpv.ih \ + clock.ih \ + clockv.ih + + /* LIBS = $(DESTDIR)/lib/libmail.a $(DESTDIR)/lib/libutil.a */ + LIBS = $(DESTDIR)/lib/libutil.a + + INCDIR = $(DESTDIR)/include/atk + + NormalHelpRule() + NormalObjectRule() + NormalATKRule() + DependTarget() + + DynamicMultiObject(timeoday.do, timeoday.o, ${LIBS}, -lm) + DynamicMultiObject(timeodayv.do, timeodayv.o, ${LIBS}, -lm) + DynamicMultiObject(writestmp.do, writestmp.o, ${LIBS}, -lm) + DynamicMultiObject(writestmpv.do, writestmpv.o, ${LIBS}, -lm) + DynamicMultiObject(clock.do, clock.o, ${LIBS}, -lm) + DynamicMultiObject(clockv.do, clockv.o, ${LIBS}, -lm) + InstallClassFiles($(DOBJS), $(IHFILES)) + InstallDocs(timeday.help, ${DESTDIR}/help) + InstallHelpAlias(timeday, timeoday time-of-day time date daytime time-inset date-inset) + InstallDocs(wrtstmp.help, ${DESTDIR}/help) + InstallHelpAlias(wrtstmp, writestamp write-stamp time-stamp) + InstallDocs(clock.help, ${DESTDIR}/help) + InstallHelpAlias(clock, clock-inset) *** contrib/time/clock.c Fri Jul 27 14:14:48 1990 --- contrib/time/clock.c.NEW Thu Apr 26 13:55:59 1990 *************** *** 0 **** --- 1,462 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + #include + #include + #include + #include + #include + #include + #include + #include + + /* Defined constants and macros */ + #define MAX_LINE_LENGTH 70 /* can't be less than 6 */ + #define DS_VERSION 1 /* datastream version */ + #define FONTFAMILY "andysans" + #define FONTTYPE fontdesc_Plain + #define BORDERWIDTH 2 /* border line width */ + #define HOURSWIDTH 4 /* hour hand line width */ + #define MINUTESWIDTH 2 /* minute hand line width */ + #define SECONDSWIDTH 1 /* second hand line width */ + #define HOURSLENGTH 60 /* hour hand length */ + #define MINUTESLENGTH 80 /* minute hand length */ + #define SECONDSLENGTH -20 /* second hand length */ + #define MIN(a,b) ((a)<(b)?(a):(b)) + + /* External declarations */ + + /* Forward Declarations */ + static void WriteLine(); + static char *GlomStrings(), *ReadLine(); + + /* Global variables */ + + + boolean + clock__InitializeClass(c) + struct classheader *c; + { + /* + Initialize all the class data. + */ + return(TRUE); + } + + + static void + UpdateTime(self) + struct clock *self; + { + struct tm *the_time; + + self->now = time(0); + self->ev = im_EnqueueEvent(UpdateTime, self, event_SECtoTU(self->epoch - (self->now % self->epoch))); + the_time = localtime(&(self->now)); + self->clockface.seconds = the_time->tm_sec; + self->clockface.minutes = the_time->tm_min + (the_time->tm_sec/12)/5.0; + self->clockface.hours = (the_time->tm_hour%12) + (the_time->tm_min/12)/5.0; + clock_NotifyObservers(self, NULL); + } + + + boolean + clock__InitializeObject(c, self) + struct classheader *c; + struct clock *self; + { + /* + Inititialize the object instance data. + */ + static char *labels[] = {"12", "3", "6", "9", NULL}; + + self->ev = NULL; + self->epoch = 1; /* update every second */ + self->options.timestamp = time(0); + self->options.hours_width = HOURSWIDTH; + self->options.minutes_width = MINUTESWIDTH; + self->options.seconds_width = SECONDSWIDTH; + self->options.border_width = BORDERWIDTH; + self->options.hours_length = HOURSLENGTH; + self->options.minutes_length = MINUTESLENGTH; + self->options.seconds_length = SECONDSLENGTH; + self->options.border_shape = square; + self->options.major_ticks = 12; + self->options.minor_ticks = 60; + self->options.tick_length = 5; + self->options.labels = labels; + for (self->options.num_labels = 0; self->options.labels[self->options.num_labels]; ++(self->options.num_labels)); + self->options.fontfamily = "Andy"; + self->options.fontface = fontdesc_Plain; + + UpdateTime(self); + return(TRUE); + } + + + void + clock__FinalizeObject(c, self) + struct classheader *c; + struct clock *self; + { + /* + Finalize the object instance data. + */ + if (self->ev) event_Cancel(self->ev); + /* if (self->tod) free(self->tod); */ + + return; + } + + + static void + clock__WriteDataPart(self, fp) + struct clock *self; + FILE *fp; + { + /* + Write the object data out onto the datastream. + */ + char outbuf[255]; + int i; + + sprintf(outbuf, "hand lengths, %d, %d, %d", + self->options.hours_length, + self->options.minutes_length, + self->options.seconds_length); + WriteLine(fp, outbuf); + + sprintf(outbuf, "hand widths, %d, %d, %d", + self->options.hours_width, + self->options.minutes_width, + self->options.seconds_width); + WriteLine(fp, outbuf); + + sprintf(outbuf, "ticks, %d, %d, %d", + self->options.tick_length, + self->options.major_ticks, + self->options.minor_ticks); + WriteLine(fp, outbuf); + + sprintf(outbuf, "border, %d, %d", + self->options.border_shape, + self->options.border_width); + WriteLine(fp, outbuf); + + sprintf(outbuf, "labels, %d, %d, %s", + self->options.num_labels, + self->options.fontface, + self->options.fontfamily); + WriteLine(fp, outbuf); + + if (self->options.num_labels > 0) { + for (i = 0; i < self->options.num_labels; ++i) { + WriteLine(fp, self->options.labels[i]); + } + } + } + + + long + clock__Write(self, fp, id, level) + struct clock *self; + FILE *fp; + long id; + int level; + { + /* + Write the object data out onto the datastream. + + Sample output from datastream version 1: + \begindata{clock, 1234567} + Datastream version: 1 + hand lengths, 60, 80, -20 + hand widths, 4, 2, 1 + ticks, 5, 12, 60 + border, 1, 4 + labels, 4, Andy, 0 + 12 + 3 + 6 + 9 + \enddata{clock, 1234567} + + */ + + long uniqueid = clock_UniqueID(self); + + if (id != clock_GetWriteID(self)) { + /* New Write Operation */ + clock_SetWriteID(self, id); + fprintf(fp, "\\begindata{%s,%d}\nDatastream version: %d\n", + class_GetTypeName(self), uniqueid, DS_VERSION); + + clock__WriteDataPart(self, fp); + + fprintf(fp, "\\enddata{%s,%d}\n", class_GetTypeName(self), uniqueid); + } + return(uniqueid); + } + + + static long + clock__ReadDataPart(self, fp) + struct clock *self; + FILE *fp; + { + /* + Read in the object from the file. + */ + char *buf; + + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + if (sscanf(buf, "hand lengths, %d, %d, %d", + &(self->options.hours_length), + &(self->options.minutes_length), + &(self->options.seconds_length)) < 3) + return(dataobject_PREMATUREEOF); + free(buf); + + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + if (sscanf(buf, "hand widths, %d, %d, %d", + &(self->options.hours_width), + &(self->options.minutes_width), + &(self->options.seconds_width)) < 3) + return(dataobject_PREMATUREEOF); + free(buf); + + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + if (sscanf(buf, "ticks, %d, %d, %d", + &(self->options.tick_length), + &(self->options.major_ticks), + &(self->options.minor_ticks)) < 3) + return(dataobject_PREMATUREEOF); + free(buf); + + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + if (sscanf(buf, "border, %d, %d", + &(self->options.border_shape), + &(self->options.border_width)) < 2) + return(dataobject_PREMATUREEOF); + free(buf); + + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + if ((self->options.fontfamily = (char *)malloc(201*sizeof(char))) == NULL) + return(dataobject_OBJECTCREATIONFAILED); + if (sscanf(buf, "labels, %d, %d, %200s", + &(self->options.num_labels), + &(self->options.fontface), + self->options.fontfamily) < 3) + return(dataobject_PREMATUREEOF); + free(buf); + + if ((self->options.labels = (char **)malloc(self->options.num_labels*sizeof(char *))) == NULL) + return(dataobject_OBJECTCREATIONFAILED); + {int i; + + for(i = 0; i < self->options.num_labels; ++i) { + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + self->options.labels[i] = buf; + } + } + + return(dataobject_NOREADERROR); + } + + + + long + clock__Read(self, fp, id) + struct clock *self; + FILE *fp; + long id; + { + /* + Read in the object from the file. + */ + char *buf, buf2[255]; + long result; + + clock_SetID(self, clock_UniqueID(self)); + + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + if (strncmp(buf,"Datastream version:",19)) + return(dataobject_BADFORMAT); + if (atoi(buf+19) != DS_VERSION) /* datastream version */ + return(dataobject_BADFORMAT); + free(buf); + + if ((result = clock__ReadDataPart(self, fp)) != dataobject_NOREADERROR) + return(result); + + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + sprintf(buf2, "\\enddata{%s,%ld}", class_GetTypeName(self), id); + if (strcmp(buf, buf2)) { + free(buf); + return(dataobject_MISSINGENDDATAMARKER); + } + free(buf); + + return(dataobject_NOREADERROR); + } + + + + void + clock__SetOptions(self, options) + struct clock *self; + struct clock_options *options; + { + /* BUG Pass back the same struct clock_options * that was returned via + GetOptions! */ + + options->timestamp = time(0); + clock_SetModified(self); + clock_NotifyObservers(self, NULL); + } + + + + static void + WriteLine(f, l) + FILE *f; + char *l; + { + /* + Output a single line onto the data stream, quoting + back slashes and staying within line length limits. + Warning: this routine wasn't meant to handle embedded + newlines. + */ + + char buf[MAX_LINE_LENGTH]; + int i = 0; + + for (;*l != '\0'; ++l) { + if (i > (MAX_LINE_LENGTH - 5)) { + buf[i++] = '\\'; /* signal for line continuation */ + buf[i++] = '\n'; + buf[i++] = '\0'; + fputs(buf,f); + i = 0; + } /* if (i > ...) */ + switch (*l) { + case '\\': + /* if a backslash, quote it. */ + buf[i++] = '\\'; + buf[i++] = *l; + break; + default: + buf[i++] = *l; + } /* switch (*l) */ + } /* for (; *l != ... ) */ + + /* Need to empty buffer */ + if ((i > 0) && (buf[i-1]==' ')) { + /* don't allow trailing whitespace */ + buf[i++] = '\\'; + buf[i++] = '\n'; + buf[i++] = '\0'; + fputs(buf,f); + fputs("\n",f); + } else { + buf[i++] = '\n'; + buf[i++] = '\0'; + fputs(buf,f); + } + } + + + static char * + GlomStrings(s, t) + char *s, *t; + { + /* + Safely (allocs more memory) concatenates the two strings, + freeing the first. Meant to build a new string of unknown length. + */ + + char *r; + + if (r = (char *)malloc(strlen(s)+strlen(t)+1)) { + *r = '\0'; + strcpy(r,s); + free(s); + strcat(r,t); + return(r); + } else { + free(s); + return(NULL); + } + } + + + static char * + ReadLine(f) + FILE *f; + { + /* + Reads from the datastream, attempting to return a single string. + Undoes quoting and broken lines. + Warning: this routine wasn't meant to handle embedded + newlines. + Warning: possible source of memory leaks; remember to + free the returned string when finished with it! + */ + + char buf[MAX_LINE_LENGTH], /* (BUG) What if the datastream is broken? */ + buf2[MAX_LINE_LENGTH], + *result; + int i,j; + + + if (result = (char *)malloc(1)) { + *result = '\0'; + + while (fgets(buf,sizeof(buf),f)) { + for (i = 0, j = 0; buf[i] != '\0'; ++i) { + switch (buf[i]) { + case '\\': + /* Unquote backslash or splice line */ + switch (buf[++i]) { + case '\\': + /* Unquote the backslash */ + buf2[j++] = buf[i]; + break; + case '\n': + /* broke long line */ + break; + default: + /* things like \enddata come through here */ + buf2[j++] = '\\'; + buf2[j++] = buf[i]; + break; + } /* switch (buf[++i]) */ + break; + case '\n': + /* An unquoted newline means end of string */ + buf2[j++] = '\0'; + result = GlomStrings(result, buf2); + return(result); + default: + buf2[j++] = buf[i]; + break; + } /* switch (buf[i]) */ + } /* for (i = 0, ...) */ + buf2[j++] = '\0'; + result = GlomStrings(result, buf2); + } /* while (fgets...) */ + /* Should not get here... it means we went off the end + of the data stream. Ooops. */ + } /* if (result = ... ) */ + return(NULL); + } *** contrib/time/clock.ch Fri Jul 27 14:15:02 1990 --- contrib/time/clock.ch.NEW Thu Apr 26 13:56:01 1990 *************** *** 0 **** --- 1,48 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* #include */ + #include + #include + + struct clock_time { + double hours, minutes, seconds; + }; + + enum border_shapes {circle = 0, square = 1}; + + struct clock_options { + long timestamp; + int hours_width, minutes_width, seconds_width, border_width; + int hours_length, minutes_length, seconds_length; /* -100 -> 100 */ + enum border_shapes border_shape; + int major_ticks, minor_ticks; + int tick_length; + int num_labels; + char **labels; + char *fontfamily; + int fontface; + }; + + class clock: dataobject[dataobj] { + classprocedures: + InitializeClass() returns boolean; + InitializeObject(struct clock *self) returns boolean; + FinalizeObject(struct clock *self); + overrides: + Read (FILE *fp, long id) returns long; + Write (FILE *fp, long id, int level) returns long; + methods: + SetOptions(struct clock_options *options); + macromethods: + ReadClock() (&(self->clockface)) + GetOptions() (&(self->options)); + data: + struct clock_time clockface; + struct clock_options options; + long now; + long epoch; + struct event *ev; + }; + *** contrib/time/clock.help Fri Jul 27 14:15:16 1990 --- contrib/time/clock.help.NEW Wed Jun 13 17:07:02 1990 *************** *** 0 **** --- 1,349 ---- + \begindata{text,268723324} + \textdsversion{12} + \template{help} + \chapter{The Clock Inset: an Analog Clock + + } + \section{What clock is + + }\leftindent{ + The clock inset is an analog clock which shows the current time. It has + several user selectable display options, and responds to resizes in a + reasonable fashion. It was designed for use in building consoles, but it can + be used to timestamp a document. + + } + \section{Starting clock + + } + \leftindent{To insert a clock inset into an \italic{ez} document, press the + \bold{Esc} key, and then the \bold{Tab} key, then type the word "clock" in + the prompt pane of your ez window, and press the \bold{Enter} key. You should + now see an analog clockface inserted into your document at the text caret. It + should look something like this: + + \begindata{clock,268750436} + Datastream version: 1 + hand lengths, 60, 80, -20 + hand widths, 4, 2, 1 + ticks, 5, 12, 60 + border, 1, 2 + labels, 4, 0, Andy + 12 + 3 + 6 + 9 + \enddata{clock,268750436} + \view{clockview,268750436,0,0,100} + } + \section{Warnings + + }\leftindent{ + Clock will currently print itself in a text only fashion (HH:MM:SS), not as an + analog clock. + + } + \section{Pop-up menu meanings + + }\leftindent{ + On the "Clock Shape" card, you can change the shape of the clock from circular + to rectangular: + + \begindata{table,268781140} + \rows 79 27 + \begindata{clock,268696492} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 0, 2 + labels, 0, 0, Andy + \enddata{clock,268696492} + \begindata{clock,268750196} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 2 + labels, 0, 0, Andy + \enddata{clock,268750196} + + ^Circle ^Square + \enddata{table,268781140} + \view{spread,268781140,1,0,0} + You can also change the border width: + + \begindata{table,268710232} + \rows 79 27 + \begindata{clock,268750028} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 0 + labels, 0, 0, Andy + \enddata{clock,268750028} + \begindata{clock,268738088} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 1 + labels, 0, 0, Andy + \enddata{clock,268738088} + \begindata{clock,268710064} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 2 + labels, 0, 0, Andy + \enddata{clock,268710064} + + ^No border Thin Border Thick Border + \enddata{table,268710232} + \view{spread,268710232,2,0,0} + + On the "Clock Labels" menu, you can specify how many labels you want: + + \begindata{table,268763616} + \rows 79 0 79 16 + \cols 83 96 + \begindata{clock,268709892} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 0 + labels, 0, 0, Andy + \enddata{clock,268709892} + \begindata{clock,268780404} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 0 + labels, 1, 0, Andy + 12 + \enddata{clock,268780404} + + ^None ^1 + \begindata{clock,268762780} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 0 + labels, 4, 0, Andy + 12 + 3 + 6 + 9 + \enddata{clock,268762780} + \begindata{clock,268762612} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 0 + labels, 12, 0, Andy + 12 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + \enddata{clock,268762612} + + ^4 ^12 + \enddata{table,268763616} + \view{spread,268763616,3,0,0} + + + and what kind of labelling you would like: + + + \begindata{table,268762444} + \rows 79 27 + \begindata{clock,268709652} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 0 + labels, 12, 0, Andy + 12 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + \enddata{clock,268709652} + \begindata{clock,268749468} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 0 + labels, 12, 0, Andy + XII + I + II + III + IIII + V + VI + VII + VIII + IX + X + XI + \enddata{clock,268749468} + \begindata{clock,268749240} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 0 + labels, 12, 0, Andy + Twelve + One + Two + Three + Four + Five + Six + Seven + Eight + Nine + Ten + Eleven + \enddata{clock,268749240} + + ^Arabic ^Roman ^English + \enddata{table,268762444} + \view{spread,268762444,4,0,0} + + On the "Clock Ticks" menu, you can choose how many major and minor tick marks + you would like to have: + + \begindata{table,268762096} + \rows 79 0 79 16 + \cols 83 96 + \begindata{clock,268779232} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 0 + labels, 0, 0, Andy + \enddata{clock,268779232} + \begindata{clock,268709176} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 1, 4 + border, 1, 0 + labels, 0, 0, Andy + \enddata{clock,268709176} + + ^None ^1/4 + \begindata{clock,268779056} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 4, 12 + border, 1, 0 + labels, 0, 0, Andy + \enddata{clock,268779056} + \begindata{clock,268761716} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 12, 60 + border, 1, 0 + labels, 0, 0, Andy + \enddata{clock,268761716} + + ^4/12 ^12/60 + \enddata{table,268762096} + \view{spread,268762096,5,0,0} + + + And finally, on the "Clock Seconds" menu, you can specify how the second hand + should be displayed: + + \begindata{table,268748724} + \rows 79 27 + \begindata{clock,268874872} + Datastream version: 1 + hand lengths, 60, 80, 0 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 0 + labels, 0, 0, Andy + \enddata{clock,268874872} + \begindata{clock,268778624} + Datastream version: 1 + hand lengths, 60, 80, 100 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 0 + labels, 0, 0, Andy + \enddata{clock,268778624} + \begindata{clock,268874512} + Datastream version: 1 + hand lengths, 60, 80, -20 + hand widths, 4, 2, 1 + ticks, 5, 0, 0 + border, 1, 0 + labels, 0, 0, Andy + \enddata{clock,268874512} + + ^No Seconds ^Radial ^Floating + \enddata{table,268748724} + \view{spread,268748724,6,0,0} + + + + } + \section{Program Author} + + \leftindent{ + Michael McInerny, Information Technology Center (address mail to + mcinerny+clock@andrew.cmu.edu). + + }\section{Related tools} + + + Select (highlight) one of the italicized names and choose "Show Help on + Selected Word" from the pop-up menu to see the help file for: + + + \leftindent{Names of other programs, in a vertical list, no commas or other + punctuation marks} + + + + \leftindent{\italic{insets + + ez + + timeoday + + writestamp + + + }}\enddata{text,268723324} *** contrib/time/clockv.c Fri Jul 27 14:15:27 1990 --- contrib/time/clockv.c.NEW Wed Jun 13 17:07:04 1990 *************** *** 0 **** --- 1,559 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + #include + #include + #include + #include + #include + #include + #include + #include + + /* Defined constants and macros */ + #define MENUTITLE "Clock %s,%s" + #define PI (double)3.14159265358979 + #define HOURSTORADIANS(x) ((15.0-(x))/6.0*PI) + #define MINUTESTORADIANS(x) ((75.0-(x))/30.0*PI) + #define MIN(a,b) ((a)<(b)?(a):(b)) + + /* External Declarations */ + + /* Forward Declarations */ + + /* Global Variables */ + static struct menulist *clockview_menulist = NULL; + static char *label_set1[3][1] = {{"12"}, {"XII"}, {"Twelve"}}; + static char *label_set4[3][4] = {{"12", "3", "6", "9"}, + {"XII", "III", "VI", "IX"}, + {"Twelve", "Three", "Six", "Nine"}}; + static char *label_set12[3][12] = {{"12", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"}, + {"XII", "I", "II", "III", "IIII", "V", "VI", "VII", "VIII", "IX", "X", "XI"}, + {"Twelve", "One", "Two", + "Three", "Four", "Five", + "Six", "Seven", "Eight", + "Nine", "Ten", "Eleven"}}; + + + static void MenuSetShape(self, format) + struct clockview *self; + char *format; + { + struct clock *b = (struct clock *) clockview_GetDataObject(self); + struct clock_options *options; + + options = clock_GetOptions(b); + switch (format[0]) { + case 'A': + options->border_shape = circle; + break; + case 'B': + options->border_shape = square; + break; + case '1': + options->border_width = 0; + break; + case '2': + options->border_width = 1; + break; + case '3': + options->border_width = 2; + break; + } + clock_SetOptions(b, options); + } + + + static void MenuSetLabels(self, format) + struct clockview *self; + char *format; + { + struct clock *b = (struct clock *) clockview_GetDataObject(self); + struct clock_options *options; + int style; + + options = clock_GetOptions(b); + if (options->num_labels > 0) { + switch (options->labels[0][0]) { + case '1': + style = 0; + break; + case 'X': + style = 1; + break; + case 'T': + style = 2; + break; + default: + style = 0; + break; + } + } else { + style = 0; + } + + switch (format[0]) { + case 'A': + options->num_labels = 0; + options->labels = NULL; + break; + case 'B': + options->num_labels = 1; + options->labels = label_set1[style]; + break; + case 'C': + options->num_labels = 4; + options->labels = label_set4[style]; + break; + case 'D': + options->num_labels = 12; + options->labels = label_set12[style]; + break; + case '1': + case '2': + case '3': + style = (int)(format[0] - '1'); + switch(options->num_labels) { + case 1: + options->labels = label_set1[style]; + break; + case 4: + options->labels = label_set4[style]; + break; + default: + options->labels = label_set12[style]; + options->num_labels = 12; + break; + } + } + clock_SetOptions(b, options); + } + + + static void MenuSetTicks(self, format) + struct clockview *self; + char *format; + { + struct clock *b = (struct clock *) clockview_GetDataObject(self); + struct clock_options *options; + + options = clock_GetOptions(b); + switch (format[0]) { + case 'A': + options->major_ticks = 0; + options->minor_ticks = 0; + break; + case 'B': + options->major_ticks = 1; + options->minor_ticks = 4; + break; + case 'C': + options->major_ticks = 4; + options->minor_ticks = 12; + break; + case 'D': + options->major_ticks = 12; + options->minor_ticks = 60; + break; + } + clock_SetOptions(b, options); + } + + + static void MenuSetSeconds(self, format) + struct clockview *self; + char *format; + { + struct clock *b = (struct clock *) clockview_GetDataObject(self); + struct clock_options *options; + + options = clock_GetOptions(b); + switch (format[0]) { + case 'A': + options->seconds_length = 0; + break; + case 'B': + options->seconds_length = 100; + break; + case 'C': + options->seconds_length = -20; + break; + } + clock_SetOptions(b, options); + } + + + boolean + clockview__InitializeClass(c) + struct classheader *c; + { + /* + Initialize all the class data. + */ + struct proctable_Entry *proc = NULL; + char menuname[255]; + + clockview_menulist = menulist_New(); + + proc = proctable_DefineProc("clock-set-num-labels", MenuSetShape, &clockview_classinfo, NULL, "Set the clock inset's shape parameters."); + sprintf(menuname, MENUTITLE, "Shape~10", "Circle~1"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "A", 0); + sprintf(menuname, MENUTITLE, "Shape~10", "Square~2"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "B", 0); + sprintf(menuname, MENUTITLE, "Shape~10", "No border~11"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "1", 0); + sprintf(menuname, MENUTITLE, "Shape~10", "Thin border~12"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "2", 0); + sprintf(menuname, MENUTITLE, "Shape~10", "Thick border~13"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "3", 0); + + proc = proctable_DefineProc("clock-set-labels", MenuSetLabels, &clockview_classinfo, NULL, "Set the clock inset's label parameters."); + sprintf(menuname, MENUTITLE, "Labels~11", "None~1"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "A", 0); + sprintf(menuname, MENUTITLE, "Labels~11", "1 (12)~2"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "B", 0); + sprintf(menuname, MENUTITLE, "Labels~11", "4 (12 3 6 9)~3"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "C", 0); + sprintf(menuname, MENUTITLE, "Labels~11", "12 (12 1 2 ...)~4"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "D", 0); + + sprintf(menuname, MENUTITLE, "Labels~11", "Arabic (12)~11"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "1", 0); + sprintf(menuname, MENUTITLE, "Labels~11", "Roman (XII)~12"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "2", 0); + sprintf(menuname, MENUTITLE, "Labels~11", "English (Twelve)~13"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "3", 0); + + proc = proctable_DefineProc("clock-set-ticks", MenuSetTicks, &clockview_classinfo, NULL, "Set the clock inset's tick count parameters."); + sprintf(menuname, MENUTITLE, "Ticks~12", "None~1"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "A", 0); + sprintf(menuname, MENUTITLE, "Ticks~12", "1 / 4~2"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "B", 0); + sprintf(menuname, MENUTITLE, "Ticks~12", "4 / 12~3"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "C", 0); + sprintf(menuname, MENUTITLE, "Ticks~12", "12 / 60~4"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "D", 0); + + proc = proctable_DefineProc("clock-set-seconds", MenuSetSeconds, &clockview_classinfo, NULL, "Set the clock inset's seconds hand parameters."); + sprintf(menuname, MENUTITLE, "Seconds~13", "No Second Hand~1"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "A", 0); + sprintf(menuname, MENUTITLE, "Seconds~13", "Radial Hand~2"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "B", 0); + sprintf(menuname, MENUTITLE, "Seconds~13", "Floating Tick~3"); + menulist_AddToML(clockview_menulist, NewString(menuname), proc, "C", 0); + + return(TRUE); + } + + + boolean + clockview__InitializeObject(c, self) + struct classheader *c; + struct clockview *self; + { + /* + Set up the data for each instance of the object. + */ + self->need_full_update = TRUE; + if (!(self->cursor = cursor_Create(self))) return(FALSE); + cursor_SetStandard(self->cursor, Cursor_Gunsight); + self->ml = menulist_DuplicateML(clockview_menulist, self); + self->last_options_timestamp = 0; + + return(TRUE); + } + + + void + clockview__FinalizeObject(c, self) + struct classheader *c; + struct clockview *self; + { + if (self->cursor) cursor_Destroy(self->cursor); + self->cursor = NULL; + if (self->ml) menulist_Destroy(self->ml); + self->ml = NULL; + return; + } + + + + static void + PlotLabels(self, theta, radius, label, shape) + struct clockview *self; + double theta; + int radius; + char *label; + enum border_shapes shape; + { + struct rectangle rect; + long max_radius; + long x0, y0, x1, y1, x2, y2; + + if (radius == 0) return; + + clockview_GetLogicalBounds(self, &rect); + max_radius = MIN(rect.width, rect.height)/2; + + /* center */ + x0 = (rect.left + rect.width)/2; + y0 = (rect.top + rect.height)/2; + if (radius>0) { + /* normal hand, from center */ + x2 = (x0) + (max_radius*((double)radius/100.0*cos(theta))); + y2 = (y0) - (max_radius*((double)radius/100.0*sin(theta))); + clockview_MoveTo(self, x0, y0); + } else { + /* hand from edge */ + if (shape == circle) { + x1 = (x0) + (max_radius*((1.0 + (double)radius/100.0)*cos(theta))); + y1 = (y0) - (max_radius*((1.0 + (double)radius/100.0)*sin(theta))); + clockview_MoveTo(self, x1, y1); + } else { + /* Canonicalize theta */ + while (theta>2*PI) theta = theta-2*PI; + if (theta<0) theta = theta+2*PI; + + if ((theta < PI/4.0) || (theta >= 7.0*PI/4.0)) { + x1 = max_radius; + y1 = max_radius*tan(theta); + } else if ((theta >= PI/4.0) && (theta < 3.0*PI/4.0)) { + x1 = -max_radius*tan(theta-PI/2.0); + y1 = max_radius; + } else if ((theta >= 3.0*PI/4.0) && (theta < 5.0*PI/4.0)) { + x1 = -max_radius; + y1 = -max_radius*tan(theta-PI); + } else { + y1 = -max_radius; + x1 = max_radius*tan(theta-3.0*PI/2.0); + } + x1 = x0 + x1; + y1 = y0 - y1; + x2 = (x1) + (max_radius*((double)radius/-100.0*cos(theta+PI))); + y2 = (y1) - (max_radius*((double)radius/-100.0*sin(theta+PI))); + clockview_MoveTo(self, x2, y2); + } + } + clockview_DrawString(self, label, graphic_BETWEENLEFTANDRIGHT | graphic_BETWEENTOPANDBOTTOM); + + return; + } + + + static void + PlotPoints(self, theta, radius, thickness, shape) + struct clockview *self; + double theta; + int radius, thickness; + enum border_shapes shape; + { + struct rectangle rect; + long max_radius; + long x0, y0, x1, y1, x2, y2; + + if (radius == 0) return; + + clockview_GetLogicalBounds(self, &rect); + max_radius = MIN(rect.width, rect.height)/2; + + /* center */ + x0 = (rect.left + rect.width)/2; + y0 = (rect.top + rect.height)/2; + clockview_SetLineWidth(self, thickness); + if (radius>0) { + /* normal hand, from center */ + x2 = (x0) + (max_radius*((double)radius/100.0*cos(theta))); + y2 = (y0) - (max_radius*((double)radius/100.0*sin(theta))); + clockview_MoveTo(self, x0, y0); + } else { + /* hand from edge */ + if (shape == circle) { + x1 = (x0) + (max_radius*((1.0 + (double)radius/100.0)*cos(theta))); + y1 = (y0) - (max_radius*((1.0 + (double)radius/100.0)*sin(theta))); + x2 = (x0) + (max_radius*cos(theta)); + y2 = (y0) - (max_radius*sin(theta)); + } else { + /* Canonicalize theta */ + while (theta>2*PI) theta = theta-2*PI; + if (theta<0) theta = theta+2*PI; + + if ((theta < PI/4.0) || (theta >= 7.0*PI/4.0)) { + x1 = max_radius; + y1 = max_radius*tan(theta); + } else if ((theta >= PI/4.0) && (theta < 3.0*PI/4.0)) { + x1 = -max_radius*tan(theta-PI/2.0); + y1 = max_radius; + } else if ((theta >= 3.0*PI/4.0) && (theta < 5.0*PI/4.0)) { + x1 = -max_radius; + y1 = -max_radius*tan(theta-PI); + } else { + y1 = -max_radius; + x1 = max_radius*tan(theta-3.0*PI/2.0); + } + x1 = x0 + x1; + y1 = y0 - y1; + x2 = (x1) + (max_radius*((double)radius/-100.0*cos(theta+PI))); + y2 = (y1) - (max_radius*((double)radius/-100.0*sin(theta+PI))); + } + clockview_MoveTo(self, x1, y1); + } + clockview_DrawLineTo(self, x2, y2); + + return; + } + + + static void + Redraw(self) + struct clockview *self; + { + /* + Redisplay this object. + */ + struct clock_time *clockface; + struct clock_options *options; + struct rectangle rect, border; + long min_dimension; + struct fontdesc *myfontdesc; + + clockface = clock_ReadClock((struct clock *) clockview_GetDataObject(self)); + options = clock_GetOptions((struct clock *) clockview_GetDataObject(self)); + if (self->last_options_timestamp != options->timestamp) { + self->last_options_timestamp = options->timestamp; + self->need_full_update = TRUE; + } + + clockview_GetLogicalBounds(self, &rect); + if (self->need_full_update) { + /* need to redraw face and hands */ + clockview_SetTransferMode(self, graphic_SOURCE); + clockview_EraseVisualRect(self); + min_dimension = MIN(rect.width, rect.height); + if (options->border_width > 0) { + border.left = rect.left+(rect.width-min_dimension+options->border_width)/2; + border.top = rect.top+(rect.height-min_dimension+options->border_width)/2; + border.width = min_dimension - options->border_width + (rect.width-min_dimension+options->border_width)%2; + border.height = min_dimension - options->border_width + (rect.height-min_dimension+options->border_width)%2; + + clockview_SetLineWidth(self, options->border_width); + if (options->border_shape == circle) { + clockview_DrawArc(self, &border, 0, 360); + } else { + clockview_DrawRect(self, &border); + } + } + + #define FACELOOP(num, func, where, what) \ + if (num) { \ + int i; \ + for (i = 0; i < (num); ++i) { \ + (func)(self, PI/2.0 - ((double)i)/((double)(num))*2.0*PI, (where)*(options->tick_length), what, options->border_shape); \ + } \ + } + + FACELOOP(options->minor_ticks, PlotPoints, -1, 1); + FACELOOP(options->major_ticks, PlotPoints, -2, 1); + myfontdesc = fontdesc_Create(options->fontfamily, options->fontface, (options->tick_length*min_dimension/(options->major_ticks?150:75))); + if (myfontdesc) clockview_SetFont(self, myfontdesc); + FACELOOP(options->num_labels, PlotLabels, -3, options->labels[i]); + + clockview_SetTransferMode(self, graphic_XOR); + PlotPoints(self, HOURSTORADIANS(clockface->hours), options->hours_length, options->hours_width, options->border_shape); + PlotPoints(self, MINUTESTORADIANS(clockface->minutes), options->minutes_length, options->minutes_width, options->border_shape); + PlotPoints(self, MINUTESTORADIANS(clockface->seconds), options->seconds_length, options->seconds_width, options->border_shape); + } else { + clockview_SetTransferMode(self, graphic_XOR); + if (self->lastclockface.hours != clockface->hours) { + /* redraw hour hand */ + PlotPoints(self, HOURSTORADIANS(self->lastclockface.hours), options->hours_length, options->hours_width, options->border_shape); + PlotPoints(self, HOURSTORADIANS(clockface->hours), options->hours_length, options->hours_width, options->border_shape); + } + + if (self->lastclockface.minutes != clockface->minutes) { + /* redraw minute hand */ + PlotPoints(self, MINUTESTORADIANS(self->lastclockface.minutes), options->minutes_length, options->minutes_width, options->border_shape); + PlotPoints(self, MINUTESTORADIANS(clockface->minutes), options->minutes_length, options->minutes_width, options->border_shape); + } + + if (self->lastclockface.seconds != clockface->seconds) { + /* redraw second hand */ + PlotPoints(self, MINUTESTORADIANS(self->lastclockface.seconds), options->seconds_length, options->seconds_width, options->border_shape); + PlotPoints(self, MINUTESTORADIANS(clockface->seconds), options->seconds_length, options->seconds_width, options->border_shape); + } + } + self->lastclockface.hours = clockface->hours; + self->lastclockface.minutes = clockface->minutes; + self->lastclockface.seconds = clockface->seconds; + self->need_full_update = FALSE; + } + + + void + clockview__FullUpdate(self, type, left, top, width, height) + struct clockview *self; + enum view_UpdateType type; + long left, top, width, height; + { + /* + Do an update. + */ + if ((type == view_FullRedraw) || (type == view_LastPartialRedraw)) { + self->need_full_update = TRUE; + Redraw(self); + } + } + + + void + clockview__Update(self) + struct clockview *self; + { + Redraw(self); + } + + + struct view * + clockview__Hit(self, action, x, y, numclicks) + struct clockview *self; + long x, y; + enum view_MouseAction action; + long numclicks; + { + /* + Handle the button event. Currently, semantics are: + */ + clockview_WantInputFocus(self, self); + return((struct view *)self); + } + + + void + clockview__Print(self, file, processor, finalFormat, topLevel) + struct clockview *self; + FILE *file; + char *processor, *finalFormat; + boolean topLevel; + { + long t; + + t = time(0); + fprintf(file, "%s", ctime(&t)); + } + + + + void + clockview__PostMenus(self, ml) + struct clockview *self; + struct menulist *ml; + { + /* + Enable the menus for this object. + */ + + menulist_ClearChain(self->ml); + if (ml) menulist_ChainAfterML(self->ml, ml, ml); + super_PostMenus(self, self->ml); + } *** contrib/time/clockv.ch Fri Jul 27 14:15:40 1990 --- contrib/time/clockv.ch.NEW Thu Apr 26 13:56:05 1990 *************** *** 0 **** --- 1,30 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + #include + #include + #include + #include + #include + + class clockview[clockv]: view { + classprocedures: + InitializeClass() returns boolean; + InitializeObject(struct clockview *self) returns boolean; + FinalizeObject(struct clockview *self); + overrides: + FullUpdate(enum view_UpdateType type, long left, long top, long width, long height); + Update(); + Hit (enum view_MouseAction action, long x, long y, long numberOfClicks) returns struct view *; + Print(FILE *file, char *processor, char *finalFormat, boolean topLevel); + PostMenus(struct menulist *ml); + data: + struct clock_time lastclockface; + int need_full_update; + struct cursor *cursor; + struct fontdesc *myfontdesc; + struct menulist *ml; + long last_options_timestamp; + }; + *** contrib/time/timeday.help Fri Jul 27 14:15:52 1990 --- contrib/time/timeday.help.NEW Wed Jun 13 17:07:06 1990 *************** *** 0 **** --- 1,212 ---- + \begindata{text,268888664} + \textdsversion{12} + \template{help} + \chapter{Time O'Day: a date and time inset + + } + \section{What timeoday is + + }\leftindent{ + Timeoday is a date and time inset. It is useful for print time stamping + documents, and for building consoles. When inserted into a document, not only + does it display the current time of day, it will also indicate the time a + document was printed. As part of a console, timeoday allows flexibility by + displaying the current time and/or date in a programmable fashion. + + } + \section{Starting timeoday + + }\leftindent{ + To insert a timeoday inset into an \italic{ez} document, press the \bold{Esc} + key, and then the \bold{Tab} key, then type the word "timeoday" in the prompt + pane of your ez window, and press the \bold{Enter} key. You should now see + the current date inserted into your document at the text caret. + + } + \section{Warnings + + }\leftindent{ + Because timeoday is an inset, you cannot edit it as if it were text (although + it appears to be text). You can change the font in which the text of the + timeoday inset will print by formatting the text surrounding the timeoday + inset. + + } + \section{Pop-up menu meanings + + }\leftindent{ + On the "Time O'Day" menu card, there are three format options (you can add + more in your \italic{atkinit} file, see below): + + + \leftindent{\bold{Default + \ + \begindata{timeoday,268900664} + Datastream version: 1 + %o %A, %Y + andysans12 + \enddata{timeoday,268900664} + \view{timeodayview,268900664,7,0,0} + + H:MM AM/PM + \begindata{timeoday,268904452} + Datastream version: 1 + %u:%M %P + andysans12 + \enddata{timeoday,268904452} + \view{timeodayview,268904452,8,0,0} + + Month DD YYYY + \begindata{timeoday,268904300} + Datastream version: 1 + %o %A, %Y + andysans12 + \enddata{timeoday,268904300} + \view{timeodayview,268904300,9,0,0}} + + } + Although the "Default" and "Month DD YYYY" selections are the same, you can + override the "Default" format via \italic{preferences} . + + + } + \section{Using timeoday + + }\leftindent{ + Generally, timeoday would be placed on a title page, or near the top of your + document. This is so that when you print a document, it will automatically + have the time "stamped" on it. This is particularly important for documents + "in-progress", or other material that needs to be dated. You cannot place the + timeoday inset into a header or footer, however (see \italic{ez-troff} for + more information on headers and footers). + + + You can also use the timeoday inset as part of an application, particularly + one constructed with \italic{arb} . This is an easy way to present the time + and date to the user without the overhead of \italic{console} . + + } + \section{Preferences + + }\leftindent{ + There are four preference options for timeoday: + + \leftindent{\italic{timeodaydefaultformat}: string + + \leftindent{The format string to use by default (i.e. when a timeoday inset is + first created, and what the "Default" menu choice will be; "%o %A, %Y" by + default). + + }}\leftindent{\italic{timeodaydefaultfontfamily}: string + + \leftindent{The font family name ("andysans" by default). + + }\italic{timeodaydefaultfonttype}: integer + + \leftindent{The font face code (a bitmask, from + ANDREWDIR/include/atk/fontdesc.ch; 0 by default). + + }\italic{timeodaydefaultfontsize}: integer + + \leftindent{The font size (12 by default). + + }} + }\section{Programming timeoday + + } + \leftindent{Format strings indicate what is displayed in a timeoday inset. A + format string is copied character for character except when a "%" character is + encountered. In this case, the character immediately following the "%" + character determines what is printed, according to the following chart: + + \leftindent{% insert a % sign + + n insert a new-line character + + t insert a tab character + + m month of year - 01 to 12 + + O month of year - 1 to 12 + + d day of month - 01 to 31 + + A day of month - 1 to 31 + + Z ordinal day of month - 1st to 31st + + y last 2 digits of year - 00 to 99 + + Y year - 1900 on ... + + D date as mm/dd/yy + + H hour - 00 to 23 + + u hour - 1 to 12 + + M minute - 00 to 59 + + S second - 00 to 59 + + T time as HH:MM:SS + + j day of year - 001 to 366 + + w day of week - Sunday = 0 + + W weekday - Sunday to Saturday + + a abbreviated weekday - Sun to Sat + + h abbreviated month - Jan to Dec + + o month - January to December + + r time in AM/PM notation + + P AM or PM + + } + Besides specifying the default format via preferences, you can add new menu + items to your \italic{atkinit} file like so: + + \leftindent{addmenu timeoday-set-format "Time + O'Day,\italic{myformatname}~\italic{myformatposition}" timeodayview + timeodayview noinherit "\italic{myformatstring}" + + + }for example: + + \leftindent{addmenu timeoday-set-format "Time O'Day,Weekday Month nth 'yy~21" + timeodayview timeodayview noinherit "%W, %o %Z, '%y" + + }} + + \section{Program Author} + + \leftindent{ + Michael McInerny, Information Technology Center (address mail to + mcinerny+timeoday@andrew.cmu.edu).} + + + \section{Related tools} + + + Select (highlight) one of the italicized names and choose "Show Help on + Selected Word" from the pop-up menu to see the help file for: + + + \leftindent{\italic{insets + + ez + + preferences + + atkinit + + clock + + writestamp + + }}\enddata{text,268888664} *** contrib/time/timeoday.c Fri Jul 27 14:16:02 1990 --- contrib/time/timeoday.c.NEW Fri Jul 27 12:54:28 1990 *************** *** 0 **** --- 1,639 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + #include + #include + #include + #include + #include + #include + #include + + /* Defined constants and macros */ + #define MAX_LINE_LENGTH 70 /* can't be less than 6 */ + #define DS_VERSION 1 /* datastream version */ + #define FONTFAMILY "andysans" + #define FONTTYPE 0 + #define FONTSIZE 12 + #define SECMIN 60 + #define MINHOUR 60 + #define HOURDAY 12 + #define MIN(a,b) ((a)<(b)?(a):(b)) + + /* External declarations */ + + /* Forward Declarations */ + static void WriteLine(); + static char *GlomStrings(), *ReadLine(), *EncodeFont(); + + /* Global variables */ + static char *months[] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", NULL}; + static char *weekdays[] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", NULL}; + static int maxdigraphlen; + + + boolean + timeoday__InitializeClass(c) + struct classheader *c; + { + /* + Initialize all the class data. + */ + int i, t; + + maxdigraphlen = 2; + for (i=0; months[i]; ++i) { + t = strlen(months[i]); + if (t>maxdigraphlen) maxdigraphlen = t; + } + for (i=0; weekdays[i]; ++i) { + t = strlen(weekdays[i]); + if (t>maxdigraphlen) maxdigraphlen = t; + } + return(TRUE); + } + + + void + timeoday__FormatTime(self) + struct timeoday *self; + { + /* Field Descriptors: + n insert a new-line character + t insert a tab character + m month of year - 01 to 12 + O month of year - 1 to 12 + d day of month - 01 to 31 + A day of month - 1 to 31 + Z ordinal day of month - 1st to 31st + y last 2 digits of year - 00 to 99 + Y year - 1900 on ... + D date as mm/dd/yy + H hour - 00 to 23 + u hour - 1 to 12 + M minute - 00 to 59 + S second - 00 to 59 + T time as HH:MM:SS + j day of year - 001 to 366 + w day of week - Sunday = 0 + W weekday - Sunday to Saturday + a abbreviated weekday - Sun to Sat + h abbreviated month - Jan to Dec + o month - January to December + r time in AM/PM notation + P AM or PM + */ + int i, j; + struct tm *the_time; + + if (self->tod == NULL) return; + + the_time = localtime(&(self->now)); + for(j = i = 0; self->format[i]; ++i) { + if (self->format[i]=='%') { + switch(self->format[++i]) { + case '%': + self->tod[j++] = '%'; + break; + case 'n': + self->tod[j++] = '\n'; + break; + case 't': + self->tod[j++] = '\t'; + break; + case 'm': + sprintf(self->tod+j, "%02d", the_time->tm_mon+1); + j = strlen(self->tod); + break; + case 'O': + sprintf(self->tod+j, "%d", the_time->tm_mon+1); + j = strlen(self->tod); + break; + case 'd': + sprintf(self->tod+j, "%02d", the_time->tm_mday); + j = strlen(self->tod); + break; + case 'A': + sprintf(self->tod+j, "%d", the_time->tm_mday); + j = strlen(self->tod); + break; + case 'Z': + sprintf(self->tod+j, "%d%s", the_time->tm_mday, + ORDINALIZE(the_time->tm_mday)); + j = strlen(self->tod); + break; + case 'y': + sprintf(self->tod+j, "%02d", (the_time->tm_year)%100); + j = strlen(self->tod); + break; + case 'Y': + sprintf(self->tod+j, "%4d", the_time->tm_year+1900); + j = strlen(self->tod); + break; + case 'D': + sprintf(self->tod+j, "%02d/%02d/%02d", the_time->tm_mon+1, + the_time->tm_mday, (the_time->tm_year)%100); + j = strlen(self->tod); + break; + case 'H': + sprintf(self->tod+j, "%02d", the_time->tm_hour); + j = strlen(self->tod); + break; + case 'M': + sprintf(self->tod+j, "%02d", the_time->tm_min); + j = strlen(self->tod); + break; + case 'S': + sprintf(self->tod+j, "%02d", the_time->tm_sec); + j = strlen(self->tod); + break; + case 'T': + sprintf(self->tod+j, "%02d:%02d:%02d", the_time->tm_hour, + the_time->tm_min, the_time->tm_sec); + j = strlen(self->tod); + break; + case 'j': + sprintf(self->tod+j, "%03d", the_time->tm_yday+1); + j = strlen(self->tod); + break; + case 'w': + sprintf(self->tod+j, "%01d", the_time->tm_wday); + j = strlen(self->tod); + break; + case 'a': + sprintf(self->tod+j, "%3s", weekdays[the_time->tm_wday]); + j += 3; + break; + case 'W': + sprintf(self->tod+j, "%s", weekdays[the_time->tm_wday]); + j = strlen(self->tod); + break; + case 'h': + sprintf(self->tod+j, "%3s", months[the_time->tm_mon]); + j += 3; + break; + case 'o': + sprintf(self->tod+j, "%s", months[the_time->tm_mon]); + j = strlen(self->tod); + break; + case 'r': + sprintf(self->tod+j, "%02d:%02d:%02d %s", + ((the_time->tm_hour)%12)==0?12: + ((the_time->tm_hour)%12), + the_time->tm_min, the_time->tm_sec, + the_time->tm_hour > 11 ? "PM" : "AM"); + j = strlen(self->tod); + break; + case 'u': + sprintf(self->tod+j, "%d", ((the_time->tm_hour)%12)==0?12:((the_time->tm_hour)%12)); + j = strlen(self->tod); + break; + case 'P': + sprintf(self->tod+j, "%s", the_time->tm_hour > 11 ? "PM" : "AM"); + j = strlen(self->tod); + break; + } + } else { + self->tod[j++] = self->format[i]; + } + } + self->tod[j] = '\0'; + timeoday_NotifyObservers(self,observable_OBJECTCHANGED); + } + + + static void + UpdateTime(self) + struct timeoday *self; + { + timeoday_UpdateTime(self); + } + + + void + timeoday__UpdateTime(self) + struct timeoday *self; + { + self->now = time(0); + self->ev = im_EnqueueEvent(UpdateTime, self, event_SECtoTU(self->epoch - (self->now % self->epoch))); + timeoday_FormatTime(self); + + return; + } + + + + void + timeoday__SetFormat(self, format) + struct timeoday *self; + char *format; + { + int i; + char prof_namebuf[100]; + + if (self->ev) { + event_Cancel(self->ev); + } + + if (self->format) free(self->format); + sprintf(prof_namebuf, "%sdefaultformat", class_GetTypeName(self)); + if (format != NULL) { + self->format = NewString(format); + } else { + self->format = environ_GetProfile(prof_namebuf); + if (self->format == NULL) { + self->format = NewString(""); + } else { + self->format = NewString(self->format); + } + } + if (strcmp(self->format, "")==0) { + if (self->format) free(self->format); + self->format = NewString("%o %A, %Y"); + } + self->epoch = SECMIN*MINHOUR*HOURDAY; + for(i=0; self->format[i]; ++i) { + if (self->format[i] == '%') { + switch(self->format[++i]) { + case 'S': case 'T': case 'r': + self->epoch = MIN(self->epoch, 1); + break; + case 'M': + self->epoch = MIN(self->epoch, SECMIN); + break; + case 'H': case 'u': + self->epoch = MIN(self->epoch, SECMIN*MINHOUR); + break; + } + } + } + if (self->tod) free(self->tod); + self->tod = malloc(strlen(self->format)/2*maxdigraphlen+1); + UpdateTime(self); + } + + + boolean + timeoday__InitializeDefaults(self) + struct timeoday *self; + { + char *fontfamily; + int fonttype, fontsize; + char prof_namebuf[100]; + + timeoday_SetFormat(self, NULL); + + sprintf(prof_namebuf, "%sdefaultfontfamily", class_GetTypeName(self)); + fontfamily = environ_GetProfile(prof_namebuf); + if ((fontfamily == NULL) || (strcmp(fontfamily, "") == 0)) fontfamily = FONTFAMILY; + + sprintf(prof_namebuf, "%sdefaultfonttype", class_GetTypeName(self)); + fonttype = environ_GetProfileInt(prof_namebuf, FONTTYPE); + + sprintf(prof_namebuf, "%sdefaultfontsize", class_GetTypeName(self)); + fontsize = environ_GetProfileInt(prof_namebuf, FONTSIZE); + self->myfontdesc = fontdesc_Create(fontfamily, fonttype, fontsize); + + timeoday_FormatTime(self); + return(TRUE); + } + + + boolean + timeoday__InitializeObject(c, self) + struct classheader *c; + struct timeoday *self; + { + /* + Inititialize the object instance data. + */ + + self->ev = NULL; + self->tod = NULL; + self->format = NULL; + + return(timeoday_InitializeDefaults(self)); + } + + + void + timeoday__FinalizeObject(c, self) + struct classheader *c; + struct timeoday *self; + { + /* + Finalize the object instance data. + */ + if (self->ev) event_Cancel(self->ev); + if (self->tod) free(self->tod); + if (self->format) free(self->format); + return; + } + + + void + timeoday__WriteDataPart(self, fp) + struct timeoday *self; + FILE *fp; + { + /* + Write the object data out onto the datastream. + */ + char *encfont; + + WriteLine(fp, self->format); + encfont = self->myfontdesc ? EncodeFont(self) : NULL; + WriteLine(fp, encfont ? encfont : ""); + if (encfont) { + free(encfont); + encfont = NULL; + } + } + + + long + timeoday__Write(self, fp, id, level) + struct timeoday *self; + FILE *fp; + long id; + int level; + { + /* + Write the object data out onto the datastream. + + Sample output from datastream version 1: + \begindata{timeoday, 1234567} + Datastream version: 1 + format string + font + \enddata{timeoday, 1234567} + + */ + + long uniqueid = timeoday_UniqueID(self); + + if (id != timeoday_GetWriteID(self)) { + /* New Write Operation */ + timeoday_SetWriteID(self, id); + fprintf(fp, "\\begindata{%s,%d}\nDatastream version: %d\n", + class_GetTypeName(self), uniqueid, DS_VERSION); + + timeoday_WriteDataPart(self, fp); + + fprintf(fp, "\\enddata{%s,%d}\n", class_GetTypeName(self), uniqueid); + } + return(uniqueid); + } + + + long + timeoday__ReadDataPart(self, fp) + struct timeoday *self; + FILE *fp; + { + /* + Read in the object from the file. + */ + char *buf; + + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + timeoday_SetFormat(self, buf); + free(buf); + + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + if (strcmp(buf,"")!= 0) { + char name[MAXPATHLEN]; + long style, size; + if (fontdesc_ExplodeFontName(buf,name,sizeof(name), &style, &size)) { + timeoday_SetFont(self,fontdesc_Create(name,style,size)); + } + } + free(buf); + + return(dataobject_NOREADERROR); + } + + + + long + timeoday__Read(self, fp, id) + struct timeoday *self; + FILE *fp; + long id; + { + /* + Read in the object from the file. + */ + char *buf, buf2[255]; + long result; + + timeoday_SetID(self, timeoday_UniqueID(self)); + + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + if (strncmp(buf,"Datastream version:",19)) + return(dataobject_BADFORMAT); + if (atoi(buf+19) != DS_VERSION) /* datastream version */ + return(dataobject_BADFORMAT); + free(buf); + + if ((result = timeoday_ReadDataPart(self, fp)) != dataobject_NOREADERROR) + return(result); + + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + sprintf(buf2, "\\enddata{%s,%ld}", class_GetTypeName(self), id); + if (strcmp(buf, buf2)) { + free(buf); + return(dataobject_MISSINGENDDATAMARKER); + } + free(buf); + + return(dataobject_NOREADERROR); + } + + + + void + timeoday__SetFont(self, f) + struct timeoday *self; + struct fontdesc *f; + { + /* + Set the font descriptor for this object. + */ + + self->myfontdesc = f; + timeoday_NotifyObservers(self,observable_OBJECTCHANGED); + } + + + + static void + WriteLine(f, l) + FILE *f; + char *l; + { + /* + Output a single line onto the data stream, quoting + back slashes and staying within line length limits. + Warning: this routine wasn't meant to handle embedded + newlines. + */ + + char buf[MAX_LINE_LENGTH]; + int i = 0; + + for (;*l != '\0'; ++l) { + if (i > (MAX_LINE_LENGTH - 5)) { + buf[i++] = '\\'; /* signal for line continuation */ + buf[i++] = '\n'; + buf[i++] = '\0'; + fputs(buf,f); + i = 0; + } /* if (i > ...) */ + switch (*l) { + case '\\': + /* if a backslash, quote it. */ + buf[i++] = '\\'; + buf[i++] = *l; + break; + default: + buf[i++] = *l; + } /* switch (*l) */ + } /* for (; *l != ... ) */ + + /* Need to empty buffer */ + if ((i > 0) && (buf[i-1]==' ')) { + /* don't allow trailing whitespace */ + buf[i++] = '\\'; + buf[i++] = '\n'; + buf[i++] = '\0'; + fputs(buf,f); + fputs("\n",f); + } else { + buf[i++] = '\n'; + buf[i++] = '\0'; + fputs(buf,f); + } + } + + + static char * + GlomStrings(s, t) + char *s, *t; + { + /* + Safely (allocs more memory) concatenates the two strings, + freeing the first. Meant to build a new string of unknown length. + */ + + char *r; + + if (r = (char *)malloc(strlen(s)+strlen(t)+1)) { + *r = '\0'; + strcpy(r,s); + free(s); + strcat(r,t); + return(r); + } else { + free(s); + return(NULL); + } + } + + + static char * + ReadLine(f) + FILE *f; + { + /* + Reads from the datastream, attempting to return a single string. + Undoes quoting and broken lines. + Warning: this routine wasn't meant to handle embedded + newlines. + Warning: possible source of memory leaks; remember to + free the returned string when finished with it! + */ + + char buf[MAX_LINE_LENGTH], /* (BUG) What if the datastream is broken? */ + buf2[MAX_LINE_LENGTH], + *result; + int i,j; + + + if (result = (char *)malloc(1)) { + *result = '\0'; + + while (fgets(buf,sizeof(buf),f)) { + for (i = 0, j = 0; buf[i] != '\0'; ++i) { + switch (buf[i]) { + case '\\': + /* Unquote backslash or splice line */ + switch (buf[++i]) { + case '\\': + /* Unquote the backslash */ + buf2[j++] = buf[i]; + break; + case '\n': + /* broke long line */ + break; + default: + /* things like \enddata come through here */ + buf2[j++] = '\\'; + buf2[j++] = buf[i]; + break; + } /* switch (buf[++i]) */ + break; + case '\n': + /* An unquoted newline means end of string */ + buf2[j++] = '\0'; + result = GlomStrings(result, buf2); + return(result); + default: + buf2[j++] = buf[i]; + break; + } /* switch (buf[i]) */ + } /* for (i = 0, ...) */ + buf2[j++] = '\0'; + result = GlomStrings(result, buf2); + } /* while (fgets...) */ + /* Should not get here... it means we went off the end + of the data stream. Ooops. */ + } /* if (result = ... ) */ + return(NULL); + } + + + static char * + EncodeFont(self) + struct timeoday *self; + { + /* + Returns a string representing the name of the font for this object. + (BUG) I shouldn't have to do this function, it should be a method + of the fontdesc object. In any case, I handle only Bold, Italic, + and fixed styles. + */ + + char *buf, type[15]; + long myfonttype, myfontsize; + char *myfontname; + + *type = '\0'; + myfontname = fontdesc_GetFontFamily(self->myfontdesc); + myfontsize = fontdesc_GetFontSize(self->myfontdesc); + myfonttype = fontdesc_GetFontStyle(self->myfontdesc); + if (myfonttype & fontdesc_Bold) strcpy(type,"b"); + if (myfonttype & fontdesc_Italic) strcpy(type,"i"); + if (myfonttype & fontdesc_Fixed) strcpy(type,"f"); + if (buf = (char *)malloc(strlen(myfontname)+25)) { + sprintf(buf,"%s%d%s", myfontname, myfontsize, type); + return (buf); + } else { + return(NULL); + } + } *** contrib/time/timeoday.ch Fri Jul 27 14:16:15 1990 --- contrib/time/timeoday.ch.NEW Wed Jun 13 17:07:09 1990 *************** *** 0 **** --- 1,38 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + #include + #include + + class timeoday: dataobject[dataobj] { + classprocedures: + InitializeClass() returns boolean; + InitializeObject(struct timeoday *self) returns boolean; + FinalizeObject(struct timeoday *self); + overrides: + Read (FILE *fp, long id) returns long; + Write (FILE *fp, long id, int level) returns long; + methods: + SetFormat(char *format); + SetFont(struct fontdesc *f); + UpdateTime(); + FormatTime(); + WriteDataPart(FILE *fp); + ReadDataPart(FILE *fp) returns long; + InitializeDefaults() returns boolean; + macromethods: + GetTod() (self->tod) + GetFont() (self->myfontdesc) + GetTime() (self->now) + GetFormat() (self->format) + GetEvent() (self->ev) + SetTime(thetime) (self->now = (thetime)) + data: + char *tod, *format; + long now; + long epoch; + struct event *ev; + struct fontdesc *myfontdesc; + }; + *** contrib/time/timeodayv.c Fri Jul 27 14:16:30 1990 --- contrib/time/timeodayv.c.NEW Wed Jun 13 17:07:11 1990 *************** *** 0 **** --- 1,273 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + + /* Defined constants and macros */ + #define FUDGEFACTOR 1.1 + + /* External Declarations */ + + /* Forward Declarations */ + + /* Global Variables */ + static struct menulist *timeodayview_menulist = NULL; + + static char *formats[] = { + "Default~1", NULL, + "H:MM AM/PM~10", "%u:%M %P", + "Month DD YYYY~11", "%o %A, %Y", + NULL, NULL}; + + + static void MenuSetFormat(self, format) + struct timeodayview *self; + char *format; + { + struct timeoday *b = (struct timeoday *) timeodayview_GetDataObject(self); + + timeoday_SetFormat(b, format); + timeoday_SetModified(b); + } + + + boolean + timeodayview__InitializeClass(c) + struct classheader *c; + { + /* + Initialize all the class data. + */ + int i; + char *menuname; + char temp[250]; + struct proctable_Entry *proc = NULL; + char menutitlefmt[200]; + char procname[200]; + + timeodayview_menulist = menulist_New(); + + sprintf(procname, "%s-set-format", "timeoday"); + proc = proctable_DefineProc(procname, MenuSetFormat, &timeodayview_classinfo, NULL, "Set the timeoday inset's format."); + + sprintf(menutitlefmt, "%s,%%s", "Time O'Day"); + + for (i=0; formats[i]; i+=2) { + sprintf(temp, menutitlefmt, formats[i]); + menuname = NewString(temp); + menulist_AddToML(timeodayview_menulist, menuname, proc, formats[i+1], 0); + } + + return(TRUE); + } + + + boolean + timeodayview__InitializeObject(c, self) + struct classheader *c; + struct timeodayview *self; + { + /* + Set up the data for each instance of the object. + */ + self->ml = menulist_DuplicateML(timeodayview_menulist, self); + + if (!(self->cursor = cursor_Create(self))) return(FALSE); + cursor_SetStandard(self->cursor, Cursor_Gunsight); + + return(TRUE); + } + + + void + timeodayview__FinalizeObject(c, self) + struct classheader *c; + struct timeodayview *self; + { + if (self->cursor) cursor_Destroy(self->cursor); + self->cursor = NULL; + if (self->ml) menulist_Destroy(self->ml); + self->ml = NULL; + return; + } + + + + static void + Redraw(self) + struct timeodayview *self; + { + /* + Redisplay this object. + */ + struct timeoday *b = (struct timeoday *) timeodayview_GetDataObject(self); + struct rectangle rect; + char *tod; + struct FontSummary *my_FontSummary; + struct fontdesc *my_fontdesc; + struct graphic *my_graphic; + long new_width, new_height; + + timeodayview_EraseVisualRect(self); + timeodayview_GetLogicalBounds(self, &rect); + tod = timeoday_GetTod(b); + my_graphic = (struct graphic *)timeodayview_GetDrawable(self); + my_fontdesc= timeoday_GetFont(b); + if (my_fontdesc) { + fontdesc_StringSize(my_fontdesc, my_graphic, timeoday_GetTod(b), &new_width, &new_height); + my_FontSummary = fontdesc_FontSummary(my_fontdesc, my_graphic); + if (my_FontSummary) new_height = my_FontSummary->maxHeight; + if ((new_width > self->last_width) || (new_height > self->last_height) + || (new_width < self->last_width/FUDGEFACTOR) || (new_height < self->last_height/FUDGEFACTOR)) { + timeodayview_WantNewSize(self,self); + } + } + if (my_FontSummary) timeodayview_MoveTo(self, rect.left + rect.width/2, rect.top + my_FontSummary->maxHeight - my_FontSummary->maxBelow); + + if (my_fontdesc) timeodayview_SetFont(self, my_fontdesc); + timeodayview_DrawString(self, tod, graphic_BETWEENLEFTANDRIGHT | graphic_ATBASELINE); + } + + + void + timeodayview__FullUpdate(self, type, left, top, width, height) + struct timeodayview *self; + enum view_UpdateType type; + long left, top, width, height; + { + /* + Do an update. + */ + if ((type == view_FullRedraw) || (type == view_LastPartialRedraw)) { + self->need_full_update = TRUE; + Redraw(self); + } + } + + + void + timeodayview__Update(self) + struct timeodayview *self; + { + Redraw(self); + } + + + struct view * + timeodayview__Hit(self, action, x, y, numclicks) + struct timeodayview *self; + long x, y; + enum view_MouseAction action; + long numclicks; + { + /* + Handle the button event. Currently, semantics are: + */ + timeodayview_WantInputFocus(self, self); + return((struct view *)self); + } + + + void + timeodayview__Print(self, file, processor, finalFormat, topLevel) + struct timeodayview *self; + FILE *file; + char *processor, *finalFormat; + boolean topLevel; + { + fprintf(file, "%s\n", timeoday_GetTod((struct timeoday *) timeodayview_GetDataObject(self))); + } + + + enum view_DSattributes + timeodayview__DesiredSize(self, width, height, pass, desired_width, desired_height) + struct timeodayview *self; + long width; + long height; + enum view_DSpass pass; + long *desired_width; + long *desired_height; + { + /* + Tell parent that this object wants to be as big as the box around its + text string. For some reason IM allows resizing of this object. (BUG) + */ + + struct fontdesc *my_fontdesc; + struct graphic *my_graphic; + struct FontSummary *my_FontSummary; + struct timeoday *b = (struct timeoday *) timeodayview_GetDataObject(self); + + my_graphic = (struct graphic *)timeodayview_GetDrawable(self); + my_fontdesc= timeoday_GetFont(b); + if (my_fontdesc) { + fontdesc_StringSize(my_fontdesc, my_graphic, timeoday_GetTod(b), desired_width, desired_height); + *desired_width *= FUDGEFACTOR; + self->last_width = *desired_width; + my_FontSummary = fontdesc_FontSummary(my_fontdesc, my_graphic); + } + if (my_FontSummary) + *desired_height = my_FontSummary->maxHeight; + self->last_height = *desired_height; + + return(view_Fixed); /* (BUG) should disable user sizing, but this doesn't */ + } + + + void + timeodayview__GetOrigin(self, width, height, originX, originY) + struct timeodayview *self; + long width, height; + long *originX, *originY; + { + /* + We want this object to sit in-line with text, not below the baseline. + Simply, we could negate the height as the originX, but then our + text would be too high. So, instead, we use the height of + our font above the baseline + */ + + struct FontSummary *my_FontSummary; + struct fontdesc *my_fontdesc; + struct graphic *my_graphic; + struct timeoday *b = (struct timeoday *) timeodayview_GetDataObject(self); + + my_graphic = (struct graphic *)timeodayview_GetDrawable(self); + my_fontdesc= timeoday_GetFont(b); + if (my_fontdesc) { + my_FontSummary = fontdesc_FontSummary(my_fontdesc, my_graphic); + } + + *originX = 0; + if (my_FontSummary) + *originY = (my_FontSummary->maxHeight) - (my_FontSummary->maxBelow) + 1; + return; + } + + + void + timeodayview__PostMenus(self, ml) + struct timeodayview *self; + struct menulist *ml; + { + /* + Enable the menus for this object. + */ + + menulist_ClearChain(self->ml); + if (ml) menulist_ChainAfterML(self->ml, ml, ml); + super_PostMenus(self, self->ml); + } + *** contrib/time/timeodayv.ch Fri Jul 27 14:16:41 1990 --- contrib/time/timeodayv.ch.NEW Wed Jun 13 17:07:13 1990 *************** *** 0 **** --- 1,31 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + #include + #include + #include + + class timeodayview[timeodayv]: view { + classprocedures: + InitializeClass() returns boolean; + InitializeObject(struct timeodayview *self) returns boolean; + FinalizeObject(struct timeodayview *self); + overrides: + FullUpdate(enum view_UpdateType type, long left, long top, long width, long height); + Update(); + Hit (enum view_MouseAction action, long x, long y, long numberOfClicks) returns struct view *; + Print(FILE *file, char *processor, char *finalFormat, boolean topLevel); + DesiredSize(long width, long height, enum view_DSpass pass, long * desired_width, long * desired_height) returns enum view_DSattributes; + GetOrigin(long width, long height, long * originX, long * originY); + PostMenus(struct menulist *ml); + macromethods: + GetMenuList() (self->ml) + SetMenuList(ml) (self->ml = (ml)) + data: + int need_full_update; + struct cursor *cursor; + struct menulist *ml; + long last_width, last_height; + }; + *** contrib/time/writestmp.c Fri Jul 27 14:16:52 1990 --- contrib/time/writestmp.c.NEW Wed Jun 13 17:07:19 1990 *************** *** 0 **** --- 1,280 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + #include + #include + #include + #include + #include + #include + #include + + /* Defined constants and macros */ + #define MAX_LINE_LENGTH 70 /* can't be less than 6 */ + #define DS_VERSION 1 /* datastream version */ + + /* External declarations */ + + /* Forward Declarations */ + static void WriteLine(); + static char *GlomStrings(), *ReadLine(), *EncodeFont(); + + /* Global variables */ + + + boolean + writestamp__InitializeClass(c) + struct classheader *c; + { + /* + Initialize all the class data. + */ + + return(TRUE); + } + + + boolean + writestamp__InitializeObject(c, self) + struct classheader *c; + struct writestamp *self; + { + /* + Inititialize the object instance data. + */ + return(writestamp_InitializeDefaults(self)); + } + + + void + writestamp__FinalizeObject(c, self) + struct classheader *c; + struct writestamp *self; + { + /* + Finalize the object instance data. + */ + return; + } + + + static void + writestamp__UpdateTime(self) + struct writestamp *self; + { + /* No Op, for writestamp. */ + + writestamp_FormatTime(self); + + return; + } + + + void + writestamp__WriteDataPart(self, fp) + struct writestamp *self; + FILE *fp; + { + /* + Write the object data out onto the datastream. + */ + char thetime[50]; + + super_WriteDataPart(self, fp); + writestamp_SetTime(self, time(0)); + writestamp_FormatTime(self); + sprintf(thetime, "%ld", writestamp_GetTime(self)); + WriteLine(fp, thetime); + } + + + long + writestamp__ReadDataPart(self, fp) + struct writestamp *self; + FILE *fp; + { + /* + Read in the object from the file. + */ + char *buf; + long ec; + + if ((ec = super_ReadDataPart(self, fp)) != dataobject_NOREADERROR) { + return(ec); + } + if ((buf = ReadLine(fp)) == NULL) + return(dataobject_PREMATUREEOF); + writestamp_SetTime(self, atol(buf)); + writestamp_FormatTime(self); + free(buf); + + return(dataobject_NOREADERROR); + } + + + static void + WriteLine(f, l) + FILE *f; + char *l; + { + /* + Output a single line onto the data stream, quoting + back slashes and staying within line length limits. + Warning: this routine wasn't meant to handle embedded + newlines. + */ + + char buf[MAX_LINE_LENGTH]; + int i = 0; + + for (;*l != '\0'; ++l) { + if (i > (MAX_LINE_LENGTH - 5)) { + buf[i++] = '\\'; /* signal for line continuation */ + buf[i++] = '\n'; + buf[i++] = '\0'; + fputs(buf,f); + i = 0; + } /* if (i > ...) */ + switch (*l) { + case '\\': + /* if a backslash, quote it. */ + buf[i++] = '\\'; + buf[i++] = *l; + break; + default: + buf[i++] = *l; + } /* switch (*l) */ + } /* for (; *l != ... ) */ + + /* Need to empty buffer */ + if ((i > 0) && (buf[i-1]==' ')) { + /* don't allow trailing whitespace */ + buf[i++] = '\\'; + buf[i++] = '\n'; + buf[i++] = '\0'; + fputs(buf,f); + fputs("\n",f); + } else { + buf[i++] = '\n'; + buf[i++] = '\0'; + fputs(buf,f); + } + } + + + static char * + GlomStrings(s, t) + char *s, *t; + { + /* + Safely (allocs more memory) concatenates the two strings, + freeing the first. Meant to build a new string of unknown length. + */ + + char *r; + + if (r = (char *)malloc(strlen(s)+strlen(t)+1)) { + *r = '\0'; + strcpy(r,s); + free(s); + strcat(r,t); + return(r); + } else { + free(s); + return(NULL); + } + } + + + static char * + ReadLine(f) + FILE *f; + { + /* + Reads from the datastream, attempting to return a single string. + Undoes quoting and broken lines. + Warning: this routine wasn't meant to handle embedded + newlines. + Warning: possible source of memory leaks; remember to + free the returned string when finished with it! + */ + + char buf[MAX_LINE_LENGTH], /* (BUG) What if the datastream is broken? */ + buf2[MAX_LINE_LENGTH], + *result; + int i,j; + + + if (result = (char *)malloc(1)) { + *result = '\0'; + + while (fgets(buf,sizeof(buf),f)) { + for (i = 0, j = 0; buf[i] != '\0'; ++i) { + switch (buf[i]) { + case '\\': + /* Unquote backslash or splice line */ + switch (buf[++i]) { + case '\\': + /* Unquote the backslash */ + buf2[j++] = buf[i]; + break; + case '\n': + /* broke long line */ + break; + default: + /* things like \enddata come through here */ + buf2[j++] = '\\'; + buf2[j++] = buf[i]; + break; + } /* switch (buf[++i]) */ + break; + case '\n': + /* An unquoted newline means end of string */ + buf2[j++] = '\0'; + result = GlomStrings(result, buf2); + return(result); + default: + buf2[j++] = buf[i]; + break; + } /* switch (buf[i]) */ + } /* for (i = 0, ...) */ + buf2[j++] = '\0'; + result = GlomStrings(result, buf2); + } /* while (fgets...) */ + /* Should not get here... it means we went off the end + of the data stream. Ooops. */ + } /* if (result = ... ) */ + return(NULL); + } + + + static char * + EncodeFont(self) + struct writestamp *self; + { + /* + Returns a string representing the name of the font for this object. + (BUG) I shouldn't have to do this function, it should be a method + of the fontdesc object. In any case, I handle only Bold, Italic, + and fixed styles. + */ + + char *buf, type[15]; + long myfonttype, myfontsize; + char *myfontname; + + *type = '\0'; + myfontname = fontdesc_GetFontFamily(writestamp_GetFont(self)); + myfontsize = fontdesc_GetFontSize(writestamp_GetFont(self)); + myfonttype = fontdesc_GetFontStyle(writestamp_GetFont(self)); + if (myfonttype & fontdesc_Bold) strcpy(type,"b"); + if (myfonttype & fontdesc_Italic) strcpy(type,"i"); + if (myfonttype & fontdesc_Fixed) strcpy(type,"f"); + if (buf = (char *)malloc(strlen(myfontname)+25)) { + sprintf(buf,"%s%d%s", myfontname, myfontsize, type); + return (buf); + } else { + return(NULL); + } + } *** contrib/time/writestmp.ch Fri Jul 27 14:17:04 1990 --- contrib/time/writestmp.ch.NEW Wed Jun 13 17:07:20 1990 *************** *** 0 **** --- 1,19 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* #include */ + #include + #include + + class writestamp[writestmp]: timeoday { + classprocedures: + InitializeClass() returns boolean; + InitializeObject(struct writestamp *self) returns boolean; + FinalizeObject(struct writestamp *self); + overrides: + WriteDataPart(FILE *fp); + ReadDataPart(FILE *fp) returns long; + UpdateTime(); + }; + *** contrib/time/writestmpv.c Fri Jul 27 14:17:15 1990 --- contrib/time/writestmpv.c.NEW Wed Jun 13 17:07:21 1990 *************** *** 0 **** --- 1,96 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + + #include + #include + #include + #include + #include + + /* Defined constants and macros */ + + /* External Declarations */ + + /* Forward Declarations */ + + /* Global Variables */ + static struct menulist *writestampview_menulist = NULL; + + static char *formats[] = { + "Default~1", NULL, + "H:MM AM/PM~10", "%u:%M %P", + "Month DD YYYY~11", "%o %A, %Y", + NULL, NULL}; + + + static void MenuSetFormat(self, format) + struct writestampview *self; + char *format; + { + struct writestamp *b = (struct writestamp *) writestampview_GetDataObject(self); + + writestamp_SetFormat(b, format); + writestamp_SetModified(b); + } + + + boolean + writestampview__InitializeClass(c) + struct classheader *c; + { + /* + Initialize all the class data. + */ + int i; + char *menuname; + char temp[250]; + struct proctable_Entry *proc = NULL; + char menutitlefmt[200]; + char procname[200]; + + writestampview_menulist = menulist_New(); + + sprintf(procname, "%s-set-format", "writestamp"); + proc = proctable_DefineProc(procname, MenuSetFormat, &writestampview_classinfo, NULL, "Set the writestamp's inset's format."); + + sprintf(menutitlefmt, "%s,%%s", "Write Stamp"); + + for (i=0; formats[i]; i+=2) { + sprintf(temp, menutitlefmt, formats[i]); + menuname = NewString(temp); + menulist_AddToML(writestampview_menulist, menuname, proc, formats[i+1], 0); + } + + return(TRUE); + } + + + boolean + writestampview__InitializeObject(c, self) + struct classheader *c; + struct writestampview *self; + { + /* + Set up the data for each instance of the object. + */ + struct menulist *ml; + + if writestampview_GetMenuList(self) menulist_Destroy(writestampview_GetMenuList(self)); + ml = menulist_DuplicateML(writestampview_menulist, self); + writestampview_SetMenuList(self, ml); + + return(TRUE); + } + + + void + writestampview__FinalizeObject(c, self) + struct classheader *c; + struct writestampview *self; + { + return; + } + + *** contrib/time/writestmpv.ch Fri Jul 27 14:17:25 1990 --- contrib/time/writestmpv.ch.NEW Wed Jun 13 17:07:23 1990 *************** *** 0 **** --- 1,15 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + #include + #include + #include + + class writestampview[writestmpv]: timeodayview[timeodayv] { + classprocedures: + InitializeClass() returns boolean; + InitializeObject(struct writestampview *self) returns boolean; + FinalizeObject(struct writestampview *self); + }; + *** contrib/time/wrtstmp.help Fri Jul 27 14:17:35 1990 --- contrib/time/wrtstmp.help.NEW Wed Jun 13 17:07:24 1990 *************** *** 0 **** --- 1,209 ---- + \begindata{text,268922804} + \textdsversion{12} + \template{help} + \chapter{Write Stamp: a date and time stamp inset + + } + \section{What writestamp is + + }\leftindent{ + writestamp is a date and time stamp inset. It is useful for write time + stamping documents. When inserted into a document it will display the last + time of a document was written. It will also indicate the last write time + when a document it printed. + + } + \section{Starting writestamp + + }\leftindent{ + To insert a writestamp inset into an \italic{ez} document, press the + \bold{Esc} key, and then the \bold{Tab} key, then type the word "writestamp" + in the prompt pane of your ez window, and press the \bold{Enter} key. You + should now see the current date inserted into your document at the text caret. + + } + \section{Warnings + + }\leftindent{ + Because writestamp is an inset, you cannot edit it as if it were text + (although it appears to be text). You can change the font in which the text + of the writestamp inset will print by formatting the text surrounding the + writestamp inset. + + } + \section{Pop-up menu meanings + + }\leftindent{ + On the "Write Stamp" menu card, there are three format options (you can add + more in your \italic{atkinit} file, see below): + + + \leftindent{\bold{Default + \ + \begindata{writestamp,268888948} + Datastream version: 1 + %o %A, %Y + andysans12 + 644164813 + \enddata{writestamp,268888948} + \view{writestampview,268888948,10,0,0} + + H:MM AM/PM + \begindata{writestamp,268951888} + Datastream version: 1 + %u:%M %P + andysans12 + 644164813 + \enddata{writestamp,268951888} + \view{writestampview,268951888,11,0,0} + + Month DD YYYY + \begindata{writestamp,268693844} + Datastream version: 1 + %o %A, %Y + andysans12 + 644164813 + \enddata{writestamp,268693844} + \view{writestampview,268693844,12,0,0}} + + } + Although the "Default" and "Month DD YYYY" selections are the same, you can + override the "Default" format via \italic{preferences} . + + + } + \section{Using writestamp + + }\leftindent{ + Generally, writestamp would be placed on a title page, or near the top of your + document. This is so that when you print a document, it will automatically + have the time "stamped" on it. This is particularly important for documents + "in-progress", or other material that needs to be dated. You cannot place the + writestamp inset into a header or footer, however (see \italic{ez-troff} for + more information on headers and footers). + + } + \section{Preferences + + }\leftindent{ + There are four preference options for writestamp: + + \leftindent{\italic{writestampdefaultformat}: string + + \leftindent{The format string to use by default (i.e. when a writestamp inset + is first created, and what the "Default" menu choice will be; "%o %A, %Y" by + default). + + }}\leftindent{\italic{writestampdefaultfontfamily}: string + + \leftindent{The font family name ("andysans" by default). + + }\italic{writestampdefaultfonttype}: integer + + \leftindent{The font face code (a bitmask, from + ANDREWDIR/include/atk/fontdesc.ch; 0 by default). + + }\italic{writestampdefaultfontsize}: integer + + \leftindent{The font size (12 by default). + + }} + }\section{Programming writestamp + + } + \leftindent{Format strings indicate what is displayed in a writestamp inset. + A format string is copied character for character except when a "%" character + is encountered. In this case, the character immediately following the "%" + character determines what is printed, according to the following chart: + + \leftindent{% insert a % sign + + n insert a new-line character + + t insert a tab character + + m month of year - 01 to 12 + + O month of year - 1 to 12 + + d day of month - 01 to 31 + + A day of month - 1 to 31 + + Z ordinal day of month - 1st to 31st + + y last 2 digits of year - 00 to 99 + + Y year - 1900 on ... + + D date as mm/dd/yy + + H hour - 00 to 23 + + u hour - 1 to 12 + + M minute - 00 to 59 + + S second - 00 to 59 + + T time as HH:MM:SS + + j day of year - 001 to 366 + + w day of week - Sunday = 0 + + W weekday - Sunday to Saturday + + a abbreviated weekday - Sun to Sat + + h abbreviated month - Jan to Dec + + o month - January to December + + r time in AM/PM notation + + P AM or PM + + } + Besides specifying the default format via preferences, you can add new menu + items to your \italic{atkinit} file like so: + + \leftindent{addmenu writestamp-set-format "Write + Stamp,\italic{myformatname}~\italic{myformatposition}" writestampview + writestampview noinherit "\italic{myformatstring}" + + + }for example: + + \leftindent{addmenu writestamp-set-format "Write Stamp,dd-Mmm-yy~21" + writestampview writestampview noinherit "%d-%h-%y" + + }} + + \section{Program Author} + + \leftindent{ + Michael McInerny, Information Technology Center (address mail to + mcinerny+writestamp@andrew.cmu.edu).} + + + \section{Related tools} + + + Select (highlight) one of the italicized names and choose "Show Help on + Selected Word" from the pop-up menu to see the help file for: + + + \leftindent{\italic{insets + + ez + + preferences + + atkinit + + clock + + timeoday + + }}\enddata{text,268922804} *** contrib/tm/tm.c Wed Apr 11 14:21:54 1990 --- contrib/tm/tm.c.NEW Wed Jun 13 17:07:35 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v 2.17 90/02/28 11:59:59 tpn Exp $ */ /* $ACIS:tm.c 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v 2.17 90/02/28 11:59:59 tpn Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v 2.20 90/06/12 14:50:00 gk5g Exp $ */ /* $ACIS:tm.c 1.4$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.c,v 2.20 90/06/12 14:50:00 gk5g Exp $"; #endif /* lint */ #include *************** *** 763,769 **** if(action==NULL){ do{ ! action=escapes[*end]; if(action!=NULL) break; end++; --- 763,769 ---- if(action==NULL){ do{ ! action=escapes[(unsigned char)*end]; if(action!=NULL) break; end++; *************** *** 930,937 **** --- 930,953 ---- } static int ON=1; + #if defined(hpux) #define ENTER_TIOCREMOTE(self) \ (self->remote || \ + ((ioctl(fileno(self->ptyFile),_IOW('t',TIOCREMOTE&0xff,int),&ON)!=-1 || \ + ioctl(fileno(self->ptyFile),_IO('t',TIOCREMOTE&0xff),ON)!=-1) && \ + (/*fprintf(stderr,"Into TIOCREMOTE mode.\n"),*/self->remote++))) + + #ifndef INCORRECTSIGNALS + static int OFF=0; + #define LEAVE_TIOCREMOTE(self) \ + (!self->remote || \ + ((ioctl(fileno(self->ptyFile),_IOW('t',TIOCREMOTE&0xff,int),&OFF)!=-1 || \ + ioctl(fileno(self->ptyFile),_IO('t',TIOCREMOTE&0xff),OFF)!=-1) && \ + (/*fprintf(stderr,"Out of TIOCREMOTE mode.\n"),*/self->remote--,TRUE))) + #endif /* INCORRECTSIGNALS */ + #else + #define ENTER_TIOCREMOTE(self) \ + (self->remote || \ ((ioctl(fileno(self->ptyFile),_IOW(t,TIOCREMOTE&0xff,int),&ON)!=-1 || \ ioctl(fileno(self->ptyFile),_IO(t,TIOCREMOTE&0xff),ON)!=-1) && \ (/*fprintf(stderr,"Into TIOCREMOTE mode.\n"),*/self->remote++))) *************** *** 944,949 **** --- 960,966 ---- ioctl(fileno(self->ptyFile),_IO(t,TIOCREMOTE&0xff),OFF)!=-1) && \ (/*fprintf(stderr,"Out of TIOCREMOTE mode.\n"),*/self->remote--,TRUE))) #endif /* INCORRECTSIGNALS */ + #endif /* defined(hpux) */ int termulator__StartProcess(self,args) struct termulator *self; *************** *** 988,994 **** --- 1005,1014 ---- } self->remote=0; + + #ifndef INCORRECTSIGNALS ENTER_TIOCREMOTE(self); + #endif /* INCORRECTSIGNALS */ ioctl(pty,FIOCLEX,0); *** contrib/tm/tm.ch Wed Nov 22 12:47:42 1989 --- contrib/tm/tm.ch.NEW Wed Jun 13 17:07:37 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/tm/RCS/tm.ch,v 2.6 89/02/20 13:04:34 ghoti Exp Locker: pgc $ */ /* $ACIS:tm.ch 1.4$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/tm/RCS/tm.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtermulator_H = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/contrib/tm/RCS/tm.ch,v 2.6 89/02/20 13:04:34 ghoti Exp Locker: pgc $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.ch,v 2.6 89/02/20 13:04:34 ghoti Exp $ */ /* $ACIS:tm.ch 1.4$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.ch,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsidtermulator_H = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/contrib/tm/RCS/tm.ch,v 2.6 89/02/20 13:04:34 ghoti Exp $"; #endif /* !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) */ /* *** contrib/wpedit/wpedita.c Wed Nov 22 12:48:14 1989 --- contrib/wpedit/wpedita.c.NEW Wed May 16 14:31:43 1990 *************** *** 3,12 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ #include #include #include - #include #include #include #include --- 3,12 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ + #include #include #include #include #include #include #include *** overhead/class/cmd/Imakefile Wed Nov 22 13:21:05 1989 --- overhead/class/cmd/Imakefile.NEW Wed Jun 13 17:10:23 1990 *************** *** 7,23 **** DependTarget() NormalObjectRule() ! ProgramTarget(doindex,doindex.o,../lib/libclass.a,) ! InstallProgram(doindex,$(DESTDIR)/bin) ProgramTarget(dofix,../machdep/machine/dofix.o,../lib/libclass.a,) - InstallProgram(dofix,$(DESTDIR)/bin) - ProgramTarget(dotest,dotest.o,../lib/libclass.a,) ! InstallProgram(dotest,$(DESTDIR)/bin) ProgramTarget(whichdo,whichdo.o,$(UTILLIB),) - InstallProgram(whichdo,$(DESTDIR)/bin) ! InstallDocs(doindex.help, ${DESTDIR}/help) --- 7,26 ---- DependTarget() NormalObjectRule() ! #ifndef _IBMR2 ProgramTarget(dofix,../machdep/machine/dofix.o,../lib/libclass.a,) ProgramTarget(dotest,dotest.o,../lib/libclass.a,) ! #endif /* _IBMR2 */ + ProgramTarget(doindex,doindex.o,../lib/libclass.a,) ProgramTarget(whichdo,whichdo.o,$(UTILLIB),) ! #ifndef _IBMR2 ! InstallProgram(dofix,$(DESTDIR)/bin) ! InstallProgram(dotest,$(DESTDIR)/bin) ! #endif /* _IBMR2 */ + InstallProgram(doindex,$(DESTDIR)/bin) + InstallProgram(whichdo,$(DESTDIR)/bin) + InstallDocs(doindex.help, ${DESTDIR}/help) *** overhead/class/cmd/doindex.c Wed Apr 11 14:21:58 1990 --- overhead/class/cmd/doindex.c.NEW Wed Jun 13 17:10:31 1990 *************** *** 4,10 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! mkindex.c - make the class system index tables */ #include /* sys/types.h sys/file.h */ --- 4,10 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ /* ! doindex.c - make the class system index tables */ #include /* sys/types.h sys/file.h */ *************** *** 69,75 **** { (void) fprintf(stderr, "%s: %s%s...program terminated!\n", ProgramName, message, param); (void) fflush(stderr); ! (void) exit(1); } --- 69,75 ---- { (void) fprintf(stderr, "%s: %s%s...program terminated!\n", ProgramName, message, param); (void) fflush(stderr); ! exit(1); } *************** *** 323,328 **** --- 323,329 ---- fprintf(stdout, "%s: indexing %s ...", ProgramName, entry->Name); fflush(stdout); + strcpy(tname,entry->Name); entrypoint = ( struct classinfo * (*)() ) doload(objfd, entry->Name, &base, &textlength, tname); close(objfd); *** overhead/class/machdep/aix_31/Imakefile Fri Jul 27 14:18:42 1990 --- overhead/class/machdep/aix_31/Imakefile.NEW Wed Jun 13 17:10:50 1990 *************** *** 0 **** --- 1,15 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + DependTarget() + + NormalObjectRule() + NormalAsmPPRule() + + all:: globals.o doload.o entry.o + + InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) + + globals.c: + ${CP} eplist.c globals.c *** overhead/class/machdep/aix_31/doload.c Fri Jul 27 14:18:59 1990 --- overhead/class/machdep/aix_31/doload.c.NEW Wed Jun 13 17:10:52 1990 *************** *** 0 **** --- 1,109 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* + * doload.c - AIX.V3 dynamic loader for class system + * Written by Zalman Stern + * Mon Mar 19 19:46:57 1990 + */ + + #include + #include + #include /* For NULL and the like. */ + #include + + extern int errno, sys_nerr; + extern char *sys_errlist[]; + + /* This should be removed, but the machine independent code declares + * doload_Extension external expecting it to be defined in the machdep + * code. I suppose one might want to set this to something other than ".do" + * (like "") to conform to some AIX convention but for now we will do it + * the way it has always been done. + */ + char doload_extension[] = ".do"; + + int doload_trace=0; /* nonzero if debugging */ + + /* doload: Load a dynamic object. + * + * Basically, this just calls the AIX dynamic loader and relies on the + * system to do the right thing. This will search for libraries in the normal + * system manner. Note that if the path parameter is not an absolute path, + * this will search for the module along $PATH. I don't think this ever + * happens though. There are too many casts here, but its a proof of + * concept. Hack it 'til it glows. + */ + char *doload(inFD, name, bp, lenP, path) /* return pointer to entry point, */ + /* or NULL if error */ + /* UNUSED */ int inFD; /* open fd for package file. */ + /* UNUSED */ char *name; /* name of package being loaded */ + char **bp; /* base address of package */ + long *lenP; /* size of text segment */ + char *path; /* Pathname of package being loaded */ + /* Path is used by the MACH loader, not this one */ + { + + char *entry; + char *dummy; + + /* In theory, one could provide the correct values for bp and len using + * the loadquery system call, but doindex is going to free the memory + * associated with a dynamic object before loading another dynamic object + * to prevent memory bloat. + * + * Therefore this routine fakes something for doindex to free. Of course + * the correct way to do this is to add a routine to the doload interface to + * unload a dynamic object. (See the commented out doload_unload below.) + * If doindex and all the doload files for other machines are ever fixed, + * this code can be eliminated. + * + * Note that the loss of correct bp and len info is not to big a deal since + * it is mostly just used for debugging which AIX handles in a much cleaner + * manner. + */ + dummy = (char *) malloc(1); + if (dummy == NULL) + return NULL; + *bp = dummy; + *lenP = 1; + + entry = (char *) load(path, 1, NULL); + if (entry == NULL){ + + char *load_errs[1024]; + int lqrc; + + if(errno > 0 && errno <= sys_nerr) + printf("Error on load syscall: '%s'\n", sys_errlist[errno]); + else + printf("Unknown error on load syscall: errno = '%d'\n", errno); + load_errs[0] = "execerror"; + load_errs[1] = path; + if (lqrc = loadquery(L_GETMESSAGES, &load_errs[2], sizeof(load_errs) - 2 * sizeof(load_errs[0])) == 0) + execvp("/etc/execerror", load_errs); + else if(errno > 0 && errno <= sys_nerr) + printf("Loadquery returned '%d': '%s'\n", lqrc, sys_errlist[errno]); + else + printf("Loadquery returned '%d', errno = '%d'\n", lqrc, errno); + } + + return entry; + } + + #if 0 + /* doload_unload: Free the resources associated with a dynamicly loaded */ + * object. + * The programmer is responsible for making sure that no pointers into the + * storage associated with the dynamic object are held. On most systems, + * this routine will simply do a "free(base);". This routine is provided + * for doindex to call. It cannot safely be used in most situations. + */ + doload_free(name, base) + char *name; + char *base; /* Not a string. */ + { + unload(name); + } + #endif *** overhead/class/machdep/aix_31/load.map Fri Jul 27 14:19:17 1990 --- overhead/class/machdep/aix_31/load.map.NEW Wed Jun 13 17:10:54 1990 *************** *** 0 **** --- 1,62 ---- + (ld): + halt 4 + (ld): + insert /lib/crt0.o + (ld): + insert testentryfp.o + (ld): + insert entrynofp.o + (ld): + insert /usr/lib/libg.a + (ld): + insert /lib/libc.a + 0706-406 IMPORT_FILE: 2042 symbols imported. + (ld): + resolve + 0706-224 WARNING: Duplicate symbol '.mcount'. + 0706-221 WARNING: Import version of '_move' replaced by local definition. + 0706-221 WARNING: Import version of '._move' replaced by local definition. + 0706-221 WARNING: Import version of 'bcopy' replaced by local definition. + 0706-221 WARNING: Import version of '.bcopy' replaced by local definition. + 0706-221 WARNING: Import version of 'memcpy' replaced by local definition. + 0706-221 WARNING: Import version of '.memcpy' replaced by local definition. + 0706-221 WARNING: Import version of 'memmove' replaced by local definition. + 0706-221 WARNING: Import version of '.memmove' replaced by local definition. + 0706-221 WARNING: Import version of '.$MOVE' replaced by local definition. + 0706-196 RESOLVE: Kept 3290 of 3690 symbols. + (ld): + comprld + 0706-180 COMPRLD: Kept 1854 of 1856 relocation entries. + (ld): + exports /usr/lib/libg.exp + 0706-410 EXPORTS: 6 symbols exported. + (ld): + entry start + 0706-472 ENTRY: Entry point set to start + (ld): + gc + 0706-188 Number of symbols garbage collected: 2648 of 3292 + (ld): + mismatch + 0706-294 No type mismatches detected. + (ld): + er full + 0706-297 No unresolved symbols detected. + (ld): + addgl /lib/glink.o + 0706-196 RESOLVE: Kept 660 of 674 symbols. + 0706-371 ADDGL: 6 symbols processed. + (ld): + origin 0x200 -1 + (ld): + pad 512 512 512 + 0706-143 The object file pad values are .text: 512 .data: 512 .loader: 512 + (ld): + save 1L testentrynofp + 0706-760 CLEAN_SAVE: section sizes = 19460+5456+28 (00004C04+00001550+0000001C hex) + 0706-762 Size of TOC: 48 (0x30 hex) + (ld): + rc + 0706-476 RC: Highest return code was 0 + (ld): + q *** overhead/class/machdep/aix_31/testentryfp.c Fri Jul 27 14:19:32 1990 --- overhead/class/machdep/aix_31/testentryfp.c.NEW Wed Jun 13 17:10:56 1990 *************** *** 0 **** --- 1,86 ---- + #ifdef __STDC__ + #define ClassEntry(n) \ + extern void ClassEntry ## n (); \ + void RealFunc ## n (double arg1) \ + { \ + printf("RealFunc%d called with %lf.\n", n, arg1); \ + } + #else + #define ClassEntry(n) \ + extern void ClassEntry/**/n (); \ + void RealFunc/**/n (arg1) \ + double arg1; \ + { \ + printf("RealFunc%d called with %lf.\n", n, arg1); \ + } + #endif /* __STDC__ */ + + #include <../common/entrydefs.h> + + #undef ClassEntry + + #ifdef __STDC__ + #define ClassEntry(n) \ + RealFunc ## n , + #else + #define ClassEntry(n) \ + RealFunc/**/n , + #endif /* __STDC__ */ + + typedef void (*fptr)(); + + fptr RealFuncs[] = { + #include <../common/entrydefs.h> + }; + + #undef ClassEntry + + #ifdef __STDC__ + #define ClassEntry(n) \ + ClassEntry ## n , + #else + #define ClassEntry(n) \ + ClassEntry/**/n , + #endif /* __STDC__ */ + + fptr Funcs[] = { + #include <../common/entrydefs.h> + }; + + Usage() + { + puts("testentry "); + exit(1); + } + + double global; + + main(argc, argv) + int argc; + char *argv[]; + { + + int index; + + if (argc != 2 || (index = atoi(argv[1])) == 0) + Usage(); + + #if 1 + global = 2.0 * index; + #endif + + Funcs[index](2.0); + exit(0); + } + + void blow(double arg1) + { + } + + fptr *class_Lookup(index, crud) + int index; + void *crud; + { + blow(3.0); + return RealFuncs; + } *** overhead/class/machdep/aix_31/doload.h Fri Jul 27 14:19:45 1990 --- overhead/class/machdep/aix_31/doload.h.NEW Wed Jun 13 17:10:58 1990 *************** *** 0 **** --- 1,90 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* + doload.h - environment for dynamic loader + + Author: John H Howard - April 9, 1987 + */ + + + + /* here is the state during a load */ + + #ifndef _IBMR2 + #ifdef hpux /* nlist is defined in /usr/lib/nlist.h... not the same! */ + #define nlist nlist_ + #endif /* hpux */ + + typedef enum doload_mode_enum { + Load, /* .. loading .do file */ + List, /* .. listing .do or .o file */ + Fix /* .. converting .o to .do file */ + } doload_mode; + + struct doload_environment { + doload_mode mode; /* operating mode */ + int fd; /* input file descriptor */ + jmp_buf errorJump; /* error exit */ + int problems; /* count of problems encountered */ + struct exec header; /* header at beginning of a.out file */ + char *text; /* text segment */ + char *data; /* data segment */ + #ifndef AIX + struct relocation_info *rtab; /* relocation table */ + struct nlist *symtab; /* symbol table */ + char *stringtab; /* string table */ + struct nlist *newsym; /* replacement symbol table */ + #else /* #ifndef AIX */ + struct reloc *rtab; /* relocation table */ + struct syment *symtab; /* symbol table */ + char *stringtab; /* string table */ + struct syment *newsym; /* replacement symbol table */ + #endif /* #ifndef AIX */ + int newsymcount; /* number of new symbols */ + #ifdef hpux + int newsymsize; /* size of new symbol table */ + struct nlist **stab_entries; /* list of pointers to symbol table entries */ + int alloced_stab_entries, /* number of slots malloced */ + filled_stab_entries; /* number of slots filled */ + #endif /* hpux */ + }; + + + + #if defined(sun) && defined(sparc) + #define relocation_info reloc_info_sparc + #define r_symbolnum r_index + #endif + + #ifndef AIX + extern void *(*doload() )(); + #else + extern char *doload(); + #endif /* AIX */ + + + #ifdef hpux + #define maxString 256 /* max size string expected in a symbol table entry */ + #define symSize(pSym) \ + (sizeof *pSym + pSym->n_length) /* struct size + string length (NO TRAILING ZERO!) */ + #define nextSym(pSym) \ + (struct nlist *)((char *)pSym + symSize(pSym)) + #define symString(pSym) \ + ((char *)pSym + sizeof *pSym) + #define stabStrCmp(str, pSym) \ + ((pSym->n_length == strlen(str)) ? \ + strncmp(symString(pSym), str, pSym->n_length) \ + : -1) + #define stabStrCpy(str, pSym) \ + { \ + bcopy(symString(pSym), str, pSym->n_length); \ + str[pSym->n_length] = '\0'; \ + } + #endif /* hpux */ + #endif /* not _IBMR2 */ + extern int doload_trace; + + extern char doload_extension[]; + *** overhead/class/machdep/aix_31/makedo.csh Fri Jul 27 14:20:00 1990 --- overhead/class/machdep/aix_31/makedo.csh.NEW Wed Jun 13 17:11:01 1990 *************** *** 0 **** --- 1,87 ---- + #!/bin/csh -f + # Script to convert normal object files into a dynamically loadable module. + + if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew + if ("$*" == "") then + echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." + echo " -b overrides /usr/andrew/bin for finding dofix, dotest" + echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" + echo " -e overrides the default entry point" + echo " -g causes .dog file to be generated for debugger use" + exit 1 + endif + set filelist + set bindir="${ANDREWDIR}/bin" + set libdir="${ANDREWDIR}/lib" + foreach file ($*) + if ($?outcoming) then + set outfile=$file + unset outcoming + continue + endif + if ($?bincoming) then + set bindir=$file + unset bincoming + continue + endif + if ($?libcoming) then + set libdir=$file + unset libcoming + continue + endif + if ($?entrypointcoming) then + set entrypoint=$file + unset entrypointcoming + continue + endif + switch ($file) + case -o: + set outcoming + breaksw + case -b: + set bincoming + breaksw + case -d: + set libcoming + breaksw + case -e: + set entrypointcoming + breaksw + case -g: + set gflag + breaksw + default: + if (! $?outfile) set outfile=$file + set filelist=($filelist $file) + endsw + end + if ($?outcoming) then + echo "makedo: missing argument to -o switch." + exit 1 + endif + if ($?bincoming) then + echo "makedo: missing argument to -b switch." + exit 1 + endif + if ($?libcoming) then + echo "makedo: missing argument to -d switch." + exit 1 + endif + if ($?entrypointcoming) then + echo "makedo: missing argument to -e switch." + exit 1 + endif + if (! $?filelist) then + echo "makedo: No object modules given." + exit 1 + endif + if (! $?entrypoint) then + set entrypoint=${outfile:r}__GetClassInfo + endif + ld -T512 -H512 -L$libdir -o ${outfile:r}.do $filelist -lclass -e $entrypoint -lc + set retcode=$status + # Testing here should be implemented. + #if (! $retcode) then + # dotest $outfile + #endif + exit($retcode) *** overhead/class/machdep/aix_31/entry.spp Fri Jul 27 14:20:11 1990 --- overhead/class/machdep/aix_31/entry.spp.NEW Wed Jun 13 17:11:03 1990 *************** *** 0 **** --- 1,277 ---- + /* + * + * ****** + * + * PLEASE NOTE: + * + * This file is designed to be run through the C preprocessor before + * being passed to the assembler. + * + * ***** + * + * This is the code that breaks a link to ClassEntry routines + * and sets it to the set of routines given by the information + * pointed to by the first parameter. That structure contains the + * information needed to locate a module and verify that the module + * is the correct version along with some other infomation about the + * module. + * + * Each ClassEntry routine must provide a way to get an index indicating + * which entry was called. Each entry point sets a register to the index + * and then branches to the main body of this code. + * + * The main body of the code then does the following: + * -- Calls the class_Lookup procedure passing in the structure + * pointed to by the first parameter. + * -- class_Lookup returns the base address of the procedure table + * for the module. + * -- Use the index provided by the ClassEntry to look up the routine. + * -- Reset the stack to the state it was in before the call to this code. + * -- Make any adjustments to the stack, registers, etc. to make the + * called routine think that it was called directly. + * -- Branch (NOT a subroutine jump) to the real routine. This may be + * done differently for some new machine. + * + * NOTE1: There are currently 150 entry points. This was an arbitrary choice + * and can be changed as appropriate. If it is changed, definitions + * in class.h must also be changed. + */ + + #if 0 + #include + #endif + + /* + * This is the AIX Rios version of the class entrypoints. + */ + + /* + * some names to make things more readable (hopefully) + */ + + #define r0 0 + #define r1 1 + #define r2 2 + #define r3 3 + #define r4 4 + #define r5 5 + #define r6 6 + #define r7 7 + #define r8 8 + #define r9 9 + #define r10 10 + #define r11 11 + #define r12 12 + #define r13 13 + #define r14 14 + #define r15 15 + #define r31 31 + + #define fr1 1 + #define fr2 2 + #define fr3 3 + #define fr4 4 + #define fr5 5 + #define fr6 6 + #define fr7 7 + #define fr8 8 + #define fr9 9 + #define fr10 10 + #define fr11 11 + #define fr12 12 + #define fr13 13 + + /* + This code consists of three parts: + + (1) Function descriptors + (2) Entry Points + (3) Common code. + + There are 150 entry points. ClassEntry0, ..., ClassEntry149. Each + entry point does exactly the same thing, but with a different index + (index = 0, ..., 149), so the entry point code simply sets r4 to the + desired index and branches to the common code. In addition, since + each entry point is references as a function pointer (called by its + address in a dispatch vector, not by its name directly), we have + to set up a function descriptor for each entry point. + */ + + .toc + + .csect ClassEntryFunctionDescriptors[DS] + .align 1 + + #ifdef __STDC__ + #define ClassEntry(n) \ + .globl ClassEntry ## n ;\ + ClassEntry ## n:\ + /* Address of ClassEntry0 entry point, address of TOC, address of Environment */ \ + .long .ClassEntry ## n , TOC[T0], 0 + #else + #define ClassEntry(n) \ + .globl ClassEntry/**/n ;\ + ClassEntry/**/n: \ + /* Address of ClassEntry0 entry point, address of TOC, address of Environment */ \ + .long .ClassEntry/**/n , TOC[T0], 0 + #endif + + #include <../common/entrydefs.h> + + #undef ClassEntry + + /* For entry ClassEntry, set up index as 2nd parm for class_Lookup + and branch to common code. */ + #ifdef __STDC__ + #define ClassEntry(n) \ + .globl .ClassEntry ## n ;\ + .ClassEntry ## n:\ + cal r12, n(0) ; /* Load index into r12 */ \ + b L000 ; /* Jump to common code. */ + #else + #define ClassEntry(n) \ + .globl .ClassEntry/**/n ;\ + .ClassEntry/**/n:\ + cal r12, n(0) ; /* Load index into r12 */ \ + b L000 ; /* Jump to common code. */ + #endif + + .csect ClassEntryEntryPoints[PR] + .align 1 + + #include <../common/entrydefs.h> + + /* If we want this code to work when calling classporcedures that take + * floating point arguments, the following must be defined. + */ + #define SAVEFPREGS + + /* The following must be defined if classentry is to be used from a shared + * library. Otherwise, it must not be defined... + */ + #define RESTORETOC + + /* + * All the entry points branch to this label. + */ + + L000: + /* Common code */ + + .extern .class_Lookup + .extern ._ptrgl + .set LinkArea, 6 /* LC requires 6 word linkage area */ + .set OutParams, 8 /* LC says must allocate 8 words for callee + * to save args. */ + .set IntArgSave, 8 /* Must save 8 incoming arguments */ + #ifdef SAVEFPREGS + /* Make sure that the rest of the numbers in the stack frame work + * out so that the FP reg save area is double word aligned. + */ + .set FPArgSave, 26 /* 14 FP arg. regs is 28 words. */ + #else + .set FPArgSave, 0 + #endif /* SAVEFPREGS */ + .set LocalSave, 1 /* Temp storage. */ + .set Pad, 1 /* Get stack frame to double word boundary. */ + .set Local, IntArgSave + FPArgSave + LocalSave + Pad + .set FrameSize, 4 * (LinkArea + OutParams + Local) + + mflr r0 /* Move Link Reg to r0 */ + /* Put return address into correct place in link area. */ + st r0,8(r1) + /* Allocate stack frame. */ + stu r1,-FrameSize(r1) + + /* Save integer argument registers */ + lil r0, IntArgSave * 4 + mtxer r0 + ai r0, r1, 4 * (LinkArea + OutParams) + stsx r3, r0, r0 + + #ifdef SAVEFPREGS + /* Save FP argument registers */ + .set FPSaveStart, 4 * (LinkArea + OutParams + IntArgSave) + stfd fr1, FPSaveStart + 0x00(r1) + stfd fr2, FPSaveStart + 0x08(r1) + stfd fr3, FPSaveStart + 0x10(r1) + stfd fr4, FPSaveStart + 0x18(r1) + stfd fr5, FPSaveStart + 0x20(r1) + stfd fr6, FPSaveStart + 0x28(r1) + stfd fr7, FPSaveStart + 0x30(r1) + stfd fr8, FPSaveStart + 0x38(r1) + stfd fr9, FPSaveStart + 0x40(r1) + stfd fr10, FPSaveStart + 0x48(r1) + stfd fr11, FPSaveStart + 0x50(r1) + stfd fr12, FPSaveStart + 0x58(r1) + stfd fr13, FPSaveStart + 0x60(r1) + #endif /* SAVEFPREGS */ + + /* Save index (put in r12 by ClassEntry code) across call. */ + st r12, FrameSize - 4 *(LocalSave)(r1) + + /* First arg (r3) is already correct from our caller. */ + /* idex (r12) is second arg (r4) */ + mr r4, r12 + bl .class_Lookup /* Call class_Lookup (args in r3 and r4) */ + cror r15,r15,r15 /* NO-OP (binder will replace with TOC + * restore instruction, if needed) */ + + /* back from class_Lookup */ + cmpi 0,r3,0 /* lookup failed? */ + beq ErrorExit /* yes, return _class_ErrorReturnValue */ + /* no, jump to the proper class routine */ + + /* non-zero value from class_Lookup is base of proc table */ + l r4, FrameSize - 4 *(LocalSave)(r1) /* Reload index */ + sli r4,r4,2 /* multiply index by 4 = offset from base */ + a r5,r4,r3 /* index off of base to correct fcn. ptr. */ + l r11,0(r5) /* r11 has descriptor addr. for .ptrgl */ + + /* Restore integer argument registers */ + lil r0, IntArgSave * 4 + mtxer r0 + ai r0, r1, 4 * (LinkArea + OutParams) + lsx r3, r0, r0 + + #ifdef SAVEFPREGS + /* Restore FP argument registers */ + lfd fr1, FPSaveStart + 0x00(r1) + lfd fr2, FPSaveStart + 0x08(r1) + lfd fr3, FPSaveStart + 0x10(r1) + lfd fr4, FPSaveStart + 0x18(r1) + lfd fr5, FPSaveStart + 0x20(r1) + lfd fr6, FPSaveStart + 0x28(r1) + lfd fr7, FPSaveStart + 0x30(r1) + lfd fr8, FPSaveStart + 0x38(r1) + lfd fr9, FPSaveStart + 0x40(r1) + lfd fr10, FPSaveStart + 0x48(r1) + lfd fr11, FPSaveStart + 0x50(r1) + lfd fr12, FPSaveStart + 0x58(r1) + lfd fr13, FPSaveStart + 0x60(r1) + #endif /* SAVEFPREGS */ + + /* get link register from Link Area */ + l r0, FrameSize+8(r1) + + ai r1, r1, FrameSize /* restore stack pointer */ + mtlr r0 /* restore link register from r0 */ + + #ifdef RESTORETOC + /* This next line added by Zalman Stern March 23, 1990 */ + l r2, 0x14(r1) /* restore correct TOC pointer for caller. */ + #endif /* RESTORETOC */ + + /* Jump to function pointer via ptrgl which expects func. ptr in + * r11 + */ + b ._ptrgl + + ErrorExit: + /* return the value in class_ErrorReturnValue */ + /* toss other parameters */ + lil r3,-1 /* get error return value */ + l r0,FrameSize+8(r1) /* get link register from Link Area */ + ai r1,r1,FrameSize /* restore stack pointer */ + mtlr r0 /* restore link register from r0 */ + brl /* Return */ *** overhead/class/machdep/aix_31/testentry.c Fri Jul 27 14:20:23 1990 --- overhead/class/machdep/aix_31/testentry.c.NEW Wed Jun 13 17:11:05 1990 *************** *** 0 **** --- 1,80 ---- + #ifdef __STDC__ + #define ClassEntry(n) \ + extern void ClassEntry ## n (); \ + void RealFunc ## n () \ + { \ + printf("RealFunc%d called.\n", n); \ + } + #else + #define ClassEntry(n) \ + extern void ClassEntry/**/n (); \ + void RealFunc/**/n () \ + { \ + printf("RealFunc%d called.\n", n); \ + } + #endif /* __STDC__ */ + + #include <../common/entrydefs.h> + + #undef ClassEntry + + #ifdef __STDC__ + #define ClassEntry(n) \ + RealFunc ## n , + #else + #define ClassEntry(n) \ + RealFunc/**/n , + #endif /* __STDC__ */ + + typedef void (*fptr)(); + + fptr RealFuncs[] = { + #include <../common/entrydefs.h> + }; + + #undef ClassEntry + + #ifdef __STDC__ + #define ClassEntry(n) \ + ClassEntry ## n , + #else + #define ClassEntry(n) \ + ClassEntry/**/n , + #endif /* __STDC__ */ + + fptr Funcs[] = { + #include <../common/entrydefs.h> + }; + + Usage() + { + puts("testentry "); + exit(1); + } + + double global; + + main(argc, argv) + int argc; + char *argv[]; + { + + int index; + + if (argc != 2 || (index = atoi(argv[1])) == 0) + Usage(); + + #if 1 + global = 2.0 * index; + #endif + + Funcs[index](); + exit(0); + } + + fptr *class_Lookup(index, crud) + int index; + void *crud; + { + return RealFuncs; + } *** overhead/class/machdep/aix_31/libclass.exp Fri Jul 27 14:20:34 1990 --- overhead/class/machdep/aix_31/libclass.exp.NEW Wed Jun 13 17:11:07 1990 *************** *** 0 **** --- 1,35 ---- + class_RoutineStruct + class_Error + class_NewObject + class_Load + class_IsLoaded + class_Lookup + class_IsType + class_IsTypeByName + class_EnterInfo + class_SetClassPath + class_PrependClassPath + class_GetEText + class_GetTextBase + class_GetTextLength + class_NewObject + class_Load + class_IsLoaded + class_Lookup + class_IsType + class_IsTypeByName + class_EnterInfo + class_SetClassPath + class_PrependClassPath + class_GetEText + class_GetTextBase + class_GetTextLength + class_Init + ReadEntry + WriteEntry + DestroyEntry + doload + doload_trace + doload_extension + RetrieveByName + RetrieveByKey *** overhead/class/machdep/aix_31/libclass.imp Fri Jul 27 14:20:45 1990 --- overhead/class/machdep/aix_31/libclass.imp.NEW Wed Jun 13 17:11:08 1990 *************** *** 0 **** --- 1,2 ---- + #! + _etext *** overhead/class/machdep/aix_i386/entry.spp Wed Nov 22 13:21:44 1989 --- overhead/class/machdep/aix_i386/entry.spp.NEW Thu May 10 16:35:28 1990 *************** *** 39,48 **** * in class.h must also be changed. */ - #include - - - /* * Data section. Only used here to get access to class_ErrorReturnValue. */ --- 39,44 ---- *** overhead/class/machdep/aix_rt/Imakefile Wed Nov 22 13:22:47 1989 --- overhead/class/machdep/aix_rt/Imakefile.NEW Thu May 10 16:35:36 1990 *************** *** 18,23 **** --- 18,32 ---- ./aixfix >,globalrefs._h $(MV) ,globalrefs._h globalrefs._h + #ifdef __HIGHC__ + entry.o: entry.spp + # hc removes spaces after preprocessing... + -$(RM) entry.o entry.s ,entry.c + $(CP) entry.spp ,entry.c + $(CC) -E -I. $(LOCALINCLUDES) $(CFLAGS) ,entry.c | sed 's/\.globl/ \.globl/; s/\.ClassEntry/ \.ClassEntry/; s/_ClassEntry/ _ClassEntry/' > ,entry.s + $(AS) -o entry.o ,entry.s + $(RM) ,entry.c ,entry.s + #endif libc.eplist: /lib/libc.a /lib/librts.a /lib/crt0.o getlist.awk $(RM) libhack.a *** overhead/class/machdep/aix_rt/aixfix.c Wed Nov 22 13:24:01 1989 --- overhead/class/machdep/aix_rt/aixfix.c.NEW Thu May 10 16:35:37 1990 *************** *** 34,40 **** (void) printf("\t.globl %s ; .text; .long %s, %s ; .data; %s: .byte ", cp, cp, Label, Label); while (*cp != 0) { ! (void) printf("'%c, ", *cp); cp++; } (void) printf("0\n"); --- 34,40 ---- (void) printf("\t.globl %s ; .text; .long %s, %s ; .data; %s: .byte ", cp, cp, Label, Label); while (*cp != 0) { ! (void) printf("%d, ", *cp); cp++; } (void) printf("0\n"); *** overhead/class/machdep/aix_rt/entry.spp Wed Nov 22 13:23:24 1989 --- overhead/class/machdep/aix_rt/entry.spp.NEW Thu May 10 16:35:39 1990 *************** *** 56,64 **** --- 56,70 ---- * declare all the entry points */ + #ifdef __HIGHC__ #define ClassEntry(n) \ + .globl/**/.ClassEntry##n ; \ + .ClassEntry##n: + #else + #define ClassEntry(n) \ .globl .ClassEntry/**/n ; \ .ClassEntry/**/n: + #endif /* __HIGHC__ */ #include <../common/entrydefs.h> *************** *** 93,126 **** .set FirstSaveReg, R14 # first register in STM .set FrameSize, 4 * (4 + 5 + (16 - FirstSaveReg)) # size of this frame ! # start of code stm FirstSaveReg, -FrameSize(R1) # prolog saving registers cal R1, -FrameSize(R1) # bump down frame pointer for needed space lr R14, R0 # save PCP in R14 by convension ! # Save incoming register parameters st R5, FrameSize-0x04(R1) st R4, FrameSize-0x08(R1) st R3, FrameSize-0x0C(R1) st R2, FrameSize-0x10(R1) ! #set up to call class_Lookup ! # 1st param (R2) already correct for class_Lookup l R3, 4(R14) # set up 2nd arg for class_Lookup (index from PCP) ! lr R4, R3 # move index to R4, it's OK to trash R4 sli R4, 3 # multiply by 8 sf R4, R14 # R4 now points to _ClassEntry0 l R4, -4(R4) # R4 now contains PCP of class_Lookup ! # call class_Lookup to get base of class_routine function array callr R4, 2 # call through R4 with 2 args ! # back from class_Lookup ci R2, 0 # lookup failed? beq ErrorExit # yes, return _class_ErrorReturnValue ! # no, jump to the proper class routine ! # non-zero value from class_Lookup is base of proc table l R3, 4(R14) # get back index sli R3, 2 # multiply index by 4 cas R3, R2, R3 # R3 now points to a pointer to the PCP of proper routine --- 99,132 ---- .set FirstSaveReg, R14 # first register in STM .set FrameSize, 4 * (4 + 5 + (16 - FirstSaveReg)) # size of this frame ! /**/ # start of code stm FirstSaveReg, -FrameSize(R1) # prolog saving registers cal R1, -FrameSize(R1) # bump down frame pointer for needed space lr R14, R0 # save PCP in R14 by convension ! /**/ # Save incoming register parameters st R5, FrameSize-0x04(R1) st R4, FrameSize-0x08(R1) st R3, FrameSize-0x0C(R1) st R2, FrameSize-0x10(R1) ! /**/ #set up to call class_Lookup ! /**/ # 1st param (R2) already correct for class_Lookup l R3, 4(R14) # set up 2nd arg for class_Lookup (index from PCP) ! lr R4, R3 # move index to R4, its OK to trash R4 sli R4, 3 # multiply by 8 sf R4, R14 # R4 now points to _ClassEntry0 l R4, -4(R4) # R4 now contains PCP of class_Lookup ! /**/ # call class_Lookup to get base of class_routine function array callr R4, 2 # call through R4 with 2 args ! /**/ # back from class_Lookup ci R2, 0 # lookup failed? beq ErrorExit # yes, return _class_ErrorReturnValue ! /**/ # no, jump to the proper class routine ! /**/ # non-zero value from class_Lookup is base of proc table l R3, 4(R14) # get back index sli R3, 2 # multiply index by 4 cas R3, R2, R3 # R3 now points to a pointer to the PCP of proper routine *************** *** 128,140 **** l R2, 0(R3) # R2 has address of code lr R0, R3 # R0 points to PCP to prepare to branch ! # Squirrel the original value of R2 away in MQ so it can ! # be restored on the way out. l R3, FrameSize-0x10(R1) # saved value of R2 mts MQ, R3 # keep it in MQ for now ! # OK, restore state and branch to proper routine. ! # The routine will return straight to the original caller. l R5, FrameSize-0x04(R1) # restore registers l R4, FrameSize-0x08(R1) l R3, FrameSize-0x0C(R1) --- 134,146 ---- l R2, 0(R3) # R2 has address of code lr R0, R3 # R0 points to PCP to prepare to branch ! /**/ # Squirrel the original value of R2 away in MQ so it can ! /**/ # be restored on the way out. l R3, FrameSize-0x10(R1) # saved value of R2 mts MQ, R3 # keep it in MQ for now ! /**/ # OK, restore state and branch to proper routine. ! /**/ # The routine will return straight to the original caller. l R5, FrameSize-0x04(R1) # restore registers l R4, FrameSize-0x08(R1) l R3, FrameSize-0x0C(R1) *************** *** 145,151 **** mfs MQ, R2 # and restore R2 on the way out ErrorExit: ! # return the value in class_ErrorReturnValue, toss other parameters l R2, _class_ErrorReturnValue lm FirstSaveReg, 0(R1) brx R15 --- 151,157 ---- mfs MQ, R2 # and restore R2 on the way out ErrorExit: ! /**/ # return the value in class_ErrorReturnValue, toss other parameters l R2, _class_ErrorReturnValue lm FirstSaveReg, 0(R1) brx R15 *************** *** 178,188 **** --- 184,202 ---- * and now come the PCPs. */ #undef ClassEntry + #ifdef __HIGHC__ #define ClassEntry(n) \ + .globl _ClassEntry##n ; \ + _ClassEntry##n: ; \ + .long L000 ; \ + .long n + #else + #define ClassEntry(n) \ .globl _ClassEntry/**/n ; \ _ClassEntry/**/n: ; \ .long L000 ; \ .long n + #endif /* __HIGHC__ */ #include <../common/entrydefs.h> *** overhead/class/machdep/dec_mips/Imakefile Wed Nov 22 13:27:36 1989 --- overhead/class/machdep/dec_mips/Imakefile.NEW Fri Jul 20 11:32:19 1990 *************** *** 36,46 **** $(MV) ,DelList._ DelList._ libcx.a: $(MIPSLIBC_G0).a DelList._ ! $(CP) $(MIPSLIBC_G0).a ,libcx.a ! $(CHMODW) ,libcx.a ! -ar d ,libcx.a `cat DelList._` ! $(RANLIB) ,libcx.a ! $(MV) ,libcx.a libcx.a ProgramTarget(dofix,dofix.o,,) InstallProgram(dofix,$(DESTDIR)/bin) --- 36,50 ---- $(MV) ,DelList._ DelList._ libcx.a: $(MIPSLIBC_G0).a DelList._ ! rm -rf new ! mkdir new ! cd new;\ ! ar x $(MIPSLIBC_G0).a;\ ! ar cq ,libcx.a *.o /lib/crt0.o;\ ! ar d ,libcx.a `cat ../DelList._`;\ ! $(RANLIB) ,libcx.a ! $(MV) new/,libcx.a libcx.a ! rm -rf new ProgramTarget(dofix,dofix.o,,) InstallProgram(dofix,$(DESTDIR)/bin) *** overhead/class/machdep/dec_mips/doload.c Tue Nov 28 15:38:42 1989 --- overhead/class/machdep/dec_mips/doload.c.NEW Fri Jul 27 12:57:15 1990 *************** *** 119,131 **** struct doload_section_description *thisDesc; safe_read(e, (char *)tempSection, (long)sizeof(*tempSection)); ! for (thisDesc = sectionDescs; thisDesc < sectionDescs + ! sizeof(sectionDescs) && strcmp(tempSection->s_name, ! thisDesc->name) != 0; thisDesc++) ! ; if (thisDesc < sectionDescs + ! sizeof(sectionDescs)) { totalSize += tempSection->s_size; if (thisDesc->read) { totalReadSize += tempSection->s_size; --- 119,130 ---- struct doload_section_description *thisDesc; safe_read(e, (char *)tempSection, (long)sizeof(*tempSection)); ! for (thisDesc = sectionDescs; thisDesc < sectionDescs + ! (sizeof(sectionDescs)/sizeof(*thisDesc)) && strcmp(tempSection->s_name, thisDesc->name) != 0; thisDesc++) ! ; if (thisDesc < sectionDescs + ! (sizeof(sectionDescs)/sizeof(*thisDesc))) { totalSize += tempSection->s_size; if (thisDesc->read) { totalReadSize += tempSection->s_size; *** overhead/class/machdep/dec_mips/getlist.awk Wed Nov 22 13:27:47 1989 --- overhead/class/machdep/dec_mips/getlist.awk.NEW Fri Jul 20 11:32:21 1990 *************** *** 118,125 **** } # write out all wanted module name and entry points ! for ( i = 0 ; i < epcount ; i++) if (want[definer[ep[i]]] == "Y") ! printf "%s %s\n", definer[ep[i]], ep[i]; } --- 118,130 ---- } # write out all wanted module name and entry points ! # Some versions of ar(1) have name length limits that result in the "o" being truncated. ! # There is a hack below that prints out the "o" if it isn't there. Ar(1) should be fixed. for ( i = 0 ; i < epcount ; i++) if (want[definer[ep[i]]] == "Y") ! if(definer[ep[i]] ~ /^*\.o$/) ! printf "%s %s\n", definer[ep[i]], ep[i]; ! else ! printf "%s%s %s\n", definer[ep[i]], "o",ep[i]; ! } *** overhead/class/machdep/hp_68k/doload.h Wed Nov 22 13:29:09 1989 --- overhead/class/machdep/hp_68k/doload.h.NEW Wed Jun 13 17:11:47 1990 *************** *** 28,37 **** struct exec header; /* header at beginning of a.out file */ char *text; /* text segment */ char *data; /* data segment */ ! struct reloc *rtab; /* relocation table */ ! struct syment *symtab; /* symbol table */ char *stringtab; /* string table */ ! struct syment *newsym; /* replacement symbol table */ int newsymcount; /* number of new symbols */ int newsymsize; /* size of new symbol table */ struct nlist **stab_entries; /* list of pointers to symbol table entries */ --- 28,37 ---- struct exec header; /* header at beginning of a.out file */ char *text; /* text segment */ char *data; /* data segment */ ! struct r_info *rtab; /* relocation table */ ! struct nlist *symtab; /* symbol table */ char *stringtab; /* string table */ ! struct nlist *newsym; /* replacement symbol table */ int newsymcount; /* number of new symbols */ int newsymsize; /* size of new symbol table */ struct nlist **stab_entries; /* list of pointers to symbol table entries */ *** overhead/class/machdep/hp_68k/getlist.awk Wed Nov 22 13:29:16 1989 --- overhead/class/machdep/hp_68k/getlist.awk.NEW Wed Jun 13 17:11:50 1990 *************** *** 14,20 **** # search output of nm and set up definers and referrers ! / [ATDBC] / { if (definer[$5] == "") definer[ep[epcount++] = $5] = $2; } --- 14,20 ---- # search output of nm and set up definers and referrers ! / [ATDBC]S? / { if (definer[$5] == "") definer[ep[epcount++] = $5] = $2; } *************** *** 54,60 **** # want[definer["_bzero"]] = "Y"; want[definer["_calloc"]] = "Y"; want[definer["_cfree"]] = "Y"; - want[definer["_errno"]] = "Y"; want[definer["_close"]] = "Y"; want[definer["_errno"]] = "Y"; want[definer["_creat"]] = "Y"; --- 54,59 ---- *************** *** 64,70 **** want[definer["_fcvt"]] = "Y"; want[definer["_sys_errlist"]] = "Y"; want[definer["_sys_nerr"]] = "Y"; - want[definer["_exit"]] = "Y"; want[definer["_fcntl"]] = "Y"; want[definer["__filbuf"]] = "Y"; want[definer["__iob"]] = "Y"; --- 63,68 ---- *************** *** 102,107 **** --- 100,123 ---- want[definer["_syscall"]] = "Y"; want[definer["_write"]] = "Y"; want[definer["_writev"]] = "Y"; + # definitions added for 7.0 **JG + want[definer["__fflush"]] = "Y"; + want[definer["__fclose"]] = "Y"; + want[definer["flag_68881"]] = "Y"; + want[definer["_setjmp"]] = "Y"; + want[definer["_longjmp"]] = "Y"; + want[definer["__setjmp"]] = "Y"; + want[definer["__longjmp"]] = "Y"; + want[definer["__environ"]] = "Y"; + want[definer["____exit"]] = "Y"; + #additional entries + want[definer["_main"]] = "Y"; + want[definer["flag_68010"]] = "Y"; + want[definer["flag_68881"]] = "Y"; + want[definer["flag_fpa"]] = "Y"; + want[definer["float_loc"]] = "Y"; + want[definer["float_soft"]] = "Y"; + want[definer["fpa_loc"]] = "Y"; # now take transitive closure of wanted modules *** overhead/class/machdep/i386_mach/Imakefile Fri Jul 27 14:22:51 1990 --- overhead/class/machdep/i386_mach/Imakefile.NEW Thu May 10 16:36:20 1990 *************** *** 0 **** --- 1,46 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + DependTarget() + + NormalObjectRule() + NormalAsmPPRule() + + all:: globals.o entry.o doload.o + + globals.o: globals.spp globalrefs._h + + globalrefs._h: libc.eplist + $(AWK) '{printf "\tglobalref(%s)\n", $$2}' libc.eplist >,globalrefs._h + $(MV) ,globalrefs._h globalrefs._h + + libc.eplist: /lib/libc.a /lib/crt0.o getlist.awk + $(RM) /tmp/libhack.a + $(AR) /tmp/libhack.a /lib/crt0.o + $(NM) -go /lib/libc.a /tmp/libhack.a | $(TR) ":()" " " | \ + $(AWK) -f getlist.awk >,libc.eplist + $(MV) ,libc.eplist libc.eplist + $(RM) /tmp/libhack.a + + InstallLibrary(libcx.a, $(DESTDIR)/lib) + InstallFileToFile(makedo.csh,$(INSTPROGFLAGS),$(DESTDIR)/bin/makedo) + + all:: libcx.a + + DelList._: libc.eplist + $(AWK) '{print $$1}' libc.eplist | $(SORT) -u > ,DelList._ + $(MV) ,DelList._ DelList._ + + libcx.a: /lib/libc.a /lib/crt0.o DelList._ + $(CP) /lib/libc.a ,libcx.a + $(CHMODW) ,libcx.a + $(AR) ,libcx.a /lib/crt0.o + -ar d ,libcx.a `cat DelList._` + $(RANLIB) ,libcx.a + $(MV) ,libcx.a libcx.a + + all:: dofix.o + + clean:: + $(RM) DelList._ libc.eplist globalrefs._h ,* libcx.a *** overhead/class/machdep/i386_mach/dofix.c Fri Jul 27 14:23:06 1990 --- overhead/class/machdep/i386_mach/dofix.c.NEW Thu May 10 16:36:21 1990 *************** *** 0 **** --- 1,308 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* + dofix.c - convert .o file into .do file + + Author: John H Howard - April 9, 1987 + */ + + + #include + #include /* sys/file.h */ + #include + #include + #include + + #include + + #include <../common/safe.h> + + /* set entry point */ + + /* + * NOTE - The RT uses entry points in the data segment, rather + * than the text segment as is usually the case. In order to + * allow this, we represent data segment entry points by adding + * the text segment size to the offset within the data segment. + */ + + FixEntryPoint(e, EntryPointName) + register struct doload_environment *e; + char *EntryPointName; + { + register struct nlist *sp; + register struct nlist *sbound; + if (EntryPointName == NULL || *EntryPointName == NULL) + return; + sp = e->symtab; + sbound = (struct nlist *)((char *)sp + e->header.a_syms); + for (; sp < sbound; sp++) { + if ( SYM_TYPE( sp ) != N_UNDF + && (IS_EXTERN_SYM( sp ) && !(sp->n_type & N_STAB)) + && strcmp( EntryPointName, + ((sp->n_un.n_strx) + ? (e->stringtab + sp->n_un.n_strx) + : "<>") ) == 0 ) + { + switch ( SYM_TYPE(sp) ) { + case N_DATA: + case N_TEXT: + e->header.a_entry = sp->n_value; + break; + default: + fprintf( stderr, + "dofix: invalid entry point relocation %x\n", SYM_TYPE(sp) ) ; + e->problems++; + } /* end of switch */ + return; + } /* end of name match */ + } /* end of loop */ + fprintf(stderr, "dofix: entry point %s undefined\n", EntryPointName); + e->problems++; + return; + } + + /* fix up one relocation table entry */ + + extern struct globaltab { + long entrypoint; /* entry point value */ + char *entryname; /* symbolic name */ + } globals[]; + extern long globalcount; + + FixRelocation(e, rp) + register struct doload_environment *e; + register struct relocation_info *rp; + { + register int i; + register int j; + + if ( IS_RP_EXTERN( rp ) ) { + register struct nlist *sp = e->symtab + rp->r_symbolnum; + char *np = ((sp->n_un.n_strx) ? ( e->stringtab + sp->n_un.n_strx ) + : "<>" ) ; + if ( SYM_TYPE(sp) == N_UNDF) { + if (sp->n_value == 0) { + for (i = globalcount; --i >= 0 ;) + if (strcmp(globals[i].entryname, np) == 0) + break; + if (i < 0) { + fprintf(stderr, "dofix: Undefined: %s\n", np); + e->problems++; + } + } + for ( j = e->newsymcount ; + --j >= 0 + && strcmp(e->stringtab + e->newsym[j].n_un.n_strx, np) != 0; ) ; + if (j < 0) { + j = e->newsymcount++; + e->newsym = (struct nlist *) + safe_realloc( e, (char *) e->newsym, + e->newsymcount * sizeof *(e->newsym)); + bcopy(sp, e->newsym + j, sizeof *sp); + } + if (sp->n_value > e->newsym[j].n_value) + e->newsym[j].n_value = sp->n_value; + rp->r_symbolnum = j; + } /* endif N_UNDF */ + else if ( SYM_TYPE(sp) != N_ABS) { + fprintf( stderr, + "dofix: Relocatable symbol value (%s = %d, type %d)\n", + np, sp->n_value, SYM_TYPE(sp) ); + e->problems++; + } + else if (sp->n_value != 0) { + fprintf( stderr, "dofix: Nonzero symbol value (%s = %d)\n", + np, sp->n_value); + e->problems++; + } + } + + return; + } + + /* write new symbol table */ + + WriteNewSym(e, outFD) + register struct doload_environment *e; + int outFD; + { + register int i; + register char *newcp; + long newstringsize; + char *newstrings = NULL; + + /* allocate new string table */ + + for (newstringsize = sizeof newstringsize, i = e->newsymcount; --i >= 0; ) + newstringsize += strlen(e->stringtab + e->newsym[i].n_un.n_strx) + 1; + if (doload_trace) + printf( " new symbol count %d, new string size %d\n", + e->newsymcount, newstringsize ) ; + newcp = newstrings = safe_malloc(e, newstringsize); + *(long *)newcp = newstringsize; + newcp += sizeof newstringsize; + + /* make a new string table */ + + for (i = 0; i < e->newsymcount; i++) { + register char *oldcp ; + register int n ; + + oldcp = e->stringtab + e->newsym[i].n_un.n_strx ; + n = strlen(oldcp) + 1; + bcopy(oldcp, newcp, n); + e->newsym[i].n_un.n_strx = newcp - newstrings; + newcp += n; + } + + /* write symbols and strings */ + + safe_write( e, outFD, (char *) e->newsym, + e->newsymcount * sizeof (struct nlist) ); + safe_write(e, outFD, newstrings, newstringsize); + + /* clean up */ + + safe_free(newstrings); + + return; + } + + /* read, fix, and write out module */ + + FixIt(inFD, outFD, EntryPointName) + int inFD; /* open fd for .o file */ + int outFD; /* open fd for .do file */ + char *EntryPointName; /* entry point name */ + { + struct doload_environment E; + register struct doload_environment *e; + unsigned long n; /* number of relocation items */ + struct relocation_info *rp; + + if (doload_trace) + printf("FixIt(%d, %d, %s)\n", inFD, outFD, EntryPointName); + + /* set up environment */ + + doload_setup(e = &E, inFD, Fix); + if (setjmp(e->errorJump)) { + doload_cleanup(e); + return; + } + + /* read module into memory */ + doload_read(e); + + /* repair relocation tables */ + rp = e->rtab; + for ( n = (e->header.a_trsize + e->header.a_drsize)/(sizeof *rp); + n > 0; + n--, rp++) { + FixRelocation(e, rp); + } + + /* get entry point */ + FixEntryPoint(e, EntryPointName); + + /* write out result */ + e->header.a_syms = e->newsymcount * sizeof(struct nlist); + safe_write(e, outFD, (char *)&(e->header), (long)sizeof e->header); + if (lseek(outFD, (long)N_TXTOFF(e->header), 0) < 0) + doload_punt(e, "seek to write text failed"); + safe_write(e, outFD, e->text, (long)(e->header.a_text + e->header.a_data)); + safe_write(e, outFD, (char *)e->rtab, + e->header.a_trsize + e->header.a_drsize); + WriteNewSym(e, outFD); + + doload_cleanup(e); + return ; + } + + static char *ComputeOutputFileName (InputFileName, extension) + char *InputFileName; + char *extension; + { + static char name[256]; + register char *p, *q; + char *ext; + + /* copy the input name and look for the last '.' */ + + for (p = InputFileName, q = name, ext = NULL; *p != '\0';) { + if (*p == '/') /* ignore period if '/' follows */ + p++, q = name, ext = NULL; + else + if ((*q++ = *p++) == '.') + ext = q - 1; + } + if (ext == NULL) + ext = q; + *ext = '\0'; + + /* overwrite the extension with new extension */ + + strncat(name, extension, 255); + if (strcmp(InputFileName, name) == 0) + strncat(name, extension, 255); + return name ; + } + + /* main program */ + + main(argc, argp) + int argc; + char **argp; + { + int infd; + int outfd; + int gotcha = 0; + char *outname; + char *EntryPointName = NULL; + + while (--argc > 0) { + if (**++argp == '-') { + switch (*++*argp) { + case 'd': + doload_trace++; + break; + case 'e': + if (*++*argp) + EntryPointName = *argp; + else { + EntryPointName = *++argp; + argc--; + } + break; + default: + fprintf(stderr, "dofix: Unknown switch -%c ignored\n", *argp); + } + } + else { + gotcha++; + outname = ComputeOutputFileName(*argp, ".do"); + infd = open(*argp, O_RDONLY, 0); + if (infd < 0) + fprintf(stderr, "dofix: File %s not found\n", *argp); + else { + outfd = open(outname, O_WRONLY+O_CREAT+O_TRUNC, 0644); + if (outfd < 0) { + fprintf(stderr, "dofix: Can not write file %s\n", outname); + perror("dofix"); + } + else { + FixIt(infd, outfd, EntryPointName); + close(outfd); + } + close(infd); + } + } + } + if (gotcha == 0) { + FixIt(0, 1, EntryPointName); + } + exit(0); + } *** overhead/class/machdep/i386_mach/entry.spp Fri Jul 27 14:23:18 1990 --- overhead/class/machdep/i386_mach/entry.spp.NEW Thu May 10 16:36:23 1990 *************** *** 0 **** --- 1,34 ---- + .globl _class_Lookup + .data + .globl _class_ErrorReturnValue + .text + .align 2 + + / Sure hope I am not responsible for saving any registers across a call! + 0: + pushl 8(%esp) / Move 1st arg over return address & index + / index is already in right place as 2nd arg to class_Lookup + call _class_Lookup / Call class_Lookup. + addl $4, %esp / Pop argument to class_Lookup. + orl %eax, %eax + jne 1f + + movl _class_ErrorReturnValue,%eax + addl $4,%esp / pop index + leave + ret + + 1: popl %edx + movl (%eax,%edx,4), %eax / Get the function pointer to jmp to from memory. + jmp *%eax / Jump indirect off of scratch register. + + + #define ClassEntry(n) \ + .align 2; \ + .globl _ClassEntry/**/n; \ + _ClassEntry/**/n: \ + pushl $n; /* Push index onto stack for later. */ \ + jmp 0b + + #include <../common/entrydefs.h> + *** overhead/class/machdep/i386_mach/globals.spp Fri Jul 27 14:23:29 1990 --- overhead/class/machdep/i386_mach/globals.spp.NEW Thu May 10 16:36:25 1990 *************** *** 0 **** --- 1,72 ---- + /* + * array of global entry points for dynamic loader + * + * Defines a table of entry points and their names + * + */ + + .text + + /* macros which actually define entry points */ + + /* globalref - direct reference to global symbol x */ + + #ifdef __STDC__ + #define globalref(x) .globl x ; \ + .set _X_, _X_+1; \ + .text; .long x,1f; .data;1: .asciz #x + #else + #define globalref(x) .globl x ; \ + .set _X_, _X_+1; \ + .text; .long x,1f; .data;1: .asciz "x" + #endif + + /* routine - reference to routine x - _x */ + + #ifdef __STDC__ + #define routine(x) globalref(_ ## x) + #else + #define routine(x) globalref(_/**/x) + #endif + + .globl _globals + .globl _globalcount + .set _X_, 0 + + _globals: /* beginning of entry point table */ + + /* from libclass */ + globalref(_main) /* hacked to allow functionality of atk/basics */ + globalref(_class_RoutineStruct) + globalref(_class_Error) + routine(class_NewObject) + routine(class_Load) + routine(class_IsLoaded) + routine(class_Lookup) + routine(class_IsType) + routine(class_IsTypeByName) + routine(class_EnterInfo) + routine(class_SetClassPath) + routine(class_PrependClassPath) + routine(class_GetEText) + routine(class_GetTextBase) + routine(class_GetTextLength) + + + /* common symbols referred to but not defined directly in libc.a */ + + globalref(_environ) /* common symbol, defined nowhere */ + globalref(_errno) /* cerror */ + /* do not delete the following line - make depends on it */ + + #include + + .text + + _globalcount: + .long _X_ + + /* special cases for missing entry points under various machine types */ + + /* end of globals.s */ + *** overhead/class/machdep/i386_mach/aixfix.h Fri Jul 27 14:23:41 1990 --- overhead/class/machdep/i386_mach/aixfix.h.NEW Thu May 10 16:36:26 1990 *************** *** 0 **** --- 1,34 ---- + /* MACROS TO HELP PORTABILITITY */ + + #ifndef AIX + #define RP_LENGTH( rp ) ( rp->r_length ) + #define IS_RP_EXTERN( rp ) ( rp->r_extern ) + #define IS_RP_PC_REL( rp ) ( rp->r_pcrel ) + #define SYM_TYPE( sp ) ( sp->n_type & N_TYPE ) + #define IS_EXTERN_SYM( sp ) ( sp->n_type & N_EXT ) + #else + #define nlist syment + #define r_address r_vaddr + #define r_symbolnum r_symndx + #define relocation_info reloc + #define N_EXT C_EXT + #define N_TYPE N_SECT + #define RP_LENGTH( rp ) ( \ + ( ( rp->r_type == 2 ) || ( rp->r_type == 3 ) ) ? 0 \ + : ( ( ( rp->r_type == 4 ) || ( rp->r_type == 5 ) ) ? 1 \ + : ( ( ( rp->r_type == 6 ) || ( rp->r_type == 7 ) \ + || ( rp->r_type == 9 ) || ( rp->r_type == 12 ) ) ? 2 \ + : ( ( rp->r_type == 8 ) ? 3 \ + : /* rp->r_type == R_ABS or R_SEG86 or R_SEG286 */ -1 ) ) ) ) + #define IS_RP_EXTERN( rp ) ( ( rp->r_symndx & S_BSS ) != S_BSS ) + #define IS_RP_PC_REL( rp ) ( \ + ( rp->r_type == 3 ) || ( rp->r_type == 5 ) \ + || ( rp->r_type == 7 ) || ( rp->r_type == 9 ) \ + || ( rp->r_type == 12 ) ) + #define SYM_TYPE( sp ) ( sp->n_sclass & N_SECT ) + #define IS_EXTERN_SYM( sp ) ( ( sp->n_sclass & N_CLASS ) == C_EXT ) + #define N_BADMAG( x ) BADMAG( x ) + #define N_TXTOFF( x ) A_TEXTPOS( x ) + #endif + + *** overhead/class/machdep/i386_mach/doload.c Fri Jul 27 14:23:51 1990 --- overhead/class/machdep/i386_mach/doload.c.NEW Thu May 10 16:36:28 1990 *************** *** 0 **** --- 1,369 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1988,1989 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* + doload.c - dynamic loader for class system + + Author: John H Howard - April 4, 1987 + */ + + #include + #include + #include + #include + + #include + #include /* sys/types.h */ + #include + + char *malloc(); + char *realloc(); + long lseek(); + + int doload_trace=0; /* nonzero if debugging */ + + #include "../common/safe.h" + + /* initialize state */ + + void doload_setup(e, inFD, mode) + struct doload_environment *e; + int inFD; + doload_mode mode; + { + e->mode = mode; + e->fd = inFD; + e->problems = 0; + e->text = NULL; + e->rtab = NULL; + e->symtab = NULL; + e->stringtab = NULL; + e->newsym = NULL; + e->newsymcount = 0; + return; + } + + /* tear down environment */ + + void doload_cleanup(e) + struct doload_environment *e; + { + if (e->problems > 0) { + e->problems = 0; + doload_punt(e, "Errors while processing"); + } + safe_free((char *)e->rtab); + safe_free((char *)e->symtab); + safe_free(e->stringtab); + safe_free((char *)e->newsym); + return ; + } + + /* read module into memory */ + + doload_read(e) + struct doload_environment *e; + { + long stringlen; /* length of string table */ + + /* read header */ + + safe_read(e, (char *)&(e->header), (long)sizeof e->header); + if (e->mode == List) + printf( "\nHEADER\n magic= %x\n text = %x\n data = %x\n\ + bss = %x\n syms = %x\n entry= %x\n trsize=%x\n drsize=%x\n", + e->header.a_magic, e->header.a_text, e->header.a_data, + e->header.a_bss, e->header.a_syms, e->header.a_entry, + e->header.a_trsize, e->header.a_drsize); + if (N_BADMAG(e->header)) + doload_punt(e, "file not in loader format"); + + /* read text plus data */ + e->text = safe_malloc( e, + (long)(e->header.a_text + e->header.a_data + e->header.a_bss)); + e->data = e->text + e->header.a_text; + safe_lseek(e, (long)N_TXTOFF(e->header), 0); + safe_read(e, e->text, (long)(e->header.a_text + e->header.a_data)); + bzero(e->data + e->header.a_data, e->header.a_bss); + + /* read relocation information */ + + if (e->header.a_trsize + e->header.a_drsize > 0) { + long rsize; /* size of relocation info */ + + rsize = e->header.a_trsize + e->header.a_drsize; + e->rtab = (struct relocation_info *)safe_malloc(e, rsize); + safe_read(e, (char *)e->rtab, rsize); + } + + /* read symbol table */ + /* Hope symbol table comes Right after data relocations !! */ + e->symtab = (struct nlist *)safe_malloc(e, (long)e->header.a_syms); + safe_read(e, (char *)e->symtab, (long)e->header.a_syms); + + /* read string table */ + /* Hope string table comes Right after symbol table !! */ + if (read(e->fd, (char *)&stringlen, sizeof stringlen) == sizeof stringlen) { + e->stringtab = safe_malloc(e, stringlen); + safe_read( e, e->stringtab + sizeof stringlen, + stringlen - sizeof stringlen); + bcopy((char *)&stringlen, e->stringtab, sizeof stringlen); + } + } + + /* read and relocate module */ + void *(* doload(inFD, name, bp, lenP, path) )() + /* or NULL if error */ + int inFD; /* open fd for package file */ + char *name; /* name of package being loaded */ + char **bp; /* base address of package */ + long *lenP; /* size of text segment */ + char *path; /* Pathname of package being loaded */ + /* Path is used by the MACH loader, not this one */ + { + struct doload_environment E; + register struct doload_environment *e; + unsigned long n; /* number of relocation items */ + struct relocation_info *rp; + + /* set up environment */ + + doload_setup(e = &E, inFD, Load); + if (setjmp(e->errorJump)) { + doload_cleanup(e); + return NULL; + } + + /* read module into memory */ + + doload_read(e); + + /* do relocation */ + + if (e->header.a_syms) + doload_preset(e); + rp = e->rtab; + for (n = (e->header.a_trsize)/(sizeof *rp); n > 0; n--, rp++) { + doload_relocate(e, e->text + rp->r_address, rp); + } + for (n = (e->header.a_drsize)/(sizeof *rp); n > 0; n--, rp++) { + doload_relocate(e, e->data + rp->r_address, rp); + } + + /* all done */ + + if (doload_trace) + printf( " %s: text = 0x%.8x data = 0x%.8x entry = 0x%.8x\n", + name, e->text, e->data, e->text + e->header.a_entry); + + if(bp!=NULL) *bp = e->text; + if(lenP!=NULL) *lenP = e->header.a_text; + + doload_cleanup(e); + + return (void *(*)()) (e->text + e->header.a_entry); + } + + extern struct globaltab { + long entrypoint; /* entry point value */ + char *entryname; /* symbolic name */ + } globals[]; + extern long globalcount; + + /* preset global symbols */ + + static char *symtypename[] = {"UNDF", "ABS ", "TEXT", "DATA", "BSS ", "????" }; + + + char *RelocType(i) + int i; + { + i = (i & N_TYPE) >> 1; + return symtypename[i <= 4 ? i : 5]; + } + + doload_preset(e) + register struct doload_environment *e; + { + register struct nlist *sp; + register struct nlist *sbound; + + sp = e->symtab; + sbound = (struct nlist *)((char *)sp + e->header.a_syms); + + for (; sp < sbound; sp++) { + char *np = ((sp->n_un.n_strx) + ? (e->stringtab + sp->n_un.n_strx) : "<>" ) ; + + if (e->mode == List) { + printf( " %.2x %.2x %.4x %.8x %s %s %s\n", + sp->n_type, sp->n_other, sp->n_desc, sp->n_value, + RelocType(sp->n_type), + ( IS_EXTERN_SYM( sp ) ? "EXT " : " "), + np ); + } + else if ( SYM_TYPE(sp) == N_UNDF) { + register int i; + + for (i = globalcount; + --i >= 0 && strcmp(globals[i].entryname, np) != 0; ) ; + if (i >= 0) + sp->n_value = globals[i].entrypoint; + else if (sp->n_value > 0) { + + unsigned long length = sp->n_value; + + sp->n_value = (unsigned long)safe_malloc(e, length); + bzero(sp->n_value, length); + } + else { + fprintf(stderr, "doload: Undefined symbol: %s\n", np); + e->problems++; + } + sp->n_type = N_ABS + N_EXT; + } /* endif N_UNDF */ + } + } + + /* compute relocation adjustment */ + + long adjust(e, tw, rp, format) + register struct doload_environment *e; + register long tw; + register struct relocation_info *rp; + char *format; + { + if (e->mode == List) + printf(" %s", format); + if (IS_RP_EXTERN( rp )) { + register struct nlist *sp = e->symtab + rp->r_symbolnum; + char *np = ((sp->n_un.n_strx) + ? (e->stringtab + sp->n_un.n_strx) : "<>"); + if (e->mode == List) { + if (tw) + (void) printf("%x+", tw); + } + if ( SYM_TYPE(sp) == N_UNDF && e->mode == Load) + doload_punt(e, + "Internal botch - should have resolved in doload_preset"); + if (e->mode == List) + (void) printf( "%s=%x<%s>", np, sp->n_value, + RelocType(sp->n_type)); + else { + tw += sp->n_value; + switch ( SYM_TYPE(sp) ) { + case N_DATA: + case N_BSS: + case N_TEXT: + tw += (long) e->text; + case N_ABS: + break; + case N_UNDF: + if (IS_EXTERN_SYM( sp )) + break; + default: + fprintf(stderr, "doload: Unknown relocation in symbol.\n"); + fprintf( stderr, " reltab: %.8x %.6x %.2x\n", + rp->r_address, rp->r_symbolnum, *((char *)rp + 7)); + fprintf( stderr, + " symtab[%.6x]: %.8x %.2x %.2x %.4x %.8x %s\n", + rp->r_symbolnum, sp->n_un.n_strx, sp->n_type, + sp->n_other, sp->n_desc, sp->n_value, np); + e->problems++; + } + } + } /* endif IS_RP_EXTERN( rp ) */ + else { + if (e->mode == List) + printf( "%x<%s>", tw, + RelocType(rp->r_symbolnum)); + switch (rp->r_symbolnum & N_TYPE) + { + case N_DATA: + case N_BSS: + case N_TEXT: + tw += (long) e->text; + break; + case N_ABS: + if ((tw & 0xf00f0000) == 0xa0080000) { + register int i = (tw >> 20) & 0xFF; + char *np = (i < globalcount) + ? globals[i].entryname : "**INDEX TOO LARGE**"; + if (e->mode == List) + printf(" >>%s<<", np); + else if (i >= globalcount) { + fprintf(stderr, "doload: special index invalid\n"); + e->problems++; + } + else { + tw = globals[i].entrypoint; + } + } + break; + default: + doload_punt(e, "unknown symbol type"); + } /* end switch */ + } /* end else */ + return tw; + } + + /* relocate one item */ + + doload_relocate(e, cp, rp) + register struct doload_environment *e; + register char *cp; + register struct relocation_info *rp; + { + register long tw; + + switch (RP_LENGTH( rp )) { + case 0: /* 1 byte */ + tw = *cp; + if (IS_RP_PC_REL( rp )) { + tw += rp->r_address; + tw = adjust(e, tw, rp, "(pcrel)"); + tw -= (long)cp; + } + else + tw = adjust(e, tw, rp, "(char)"); + if (e->mode == Load) { + if (tw < -128 || tw > 127) + doload_punt(e, "byte displacement overflow"); + *cp = tw; + } + break; + case 1: /* 2 bytes */ + tw = *(short *)cp; + if (IS_RP_PC_REL( rp )) + doload_punt(e, "pc relative short relocation"); + tw = adjust(e, tw, rp, "(short)"); + if (e->mode == Load) { + if (tw < -32768 || tw > 32767) + doload_punt(e, "short displacement overflow"); + *(short *)cp = tw; + } + break; + case 2: /* 4 bytes */ + tw = *(long *)cp; + if (IS_RP_PC_REL( rp )) { + + /* the following kludge is taken from 4.2A's ld.c */ + + tw += rp->r_address; + tw = adjust(e, tw, rp, "(pcrel)"); + tw -= (long)cp; + } /* if IS_RP_PC_REL( rp ) */ + else + { + tw = adjust(e, tw, rp, "(word)"); + } + if (e->mode == Load) { + *(long *)cp = tw; + } + break; + default: + doload_punt(e, "unknown relocation length"); + } + return ; + } *** overhead/class/machdep/i386_mach/getlist.awk Fri Jul 27 14:24:03 1990 --- overhead/class/machdep/i386_mach/getlist.awk.NEW Thu May 10 16:36:29 1990 *************** *** 0 **** --- 1,125 ---- + # awk script to list all modules and entry points from a library which are + # needed (via transitive closure) for a given list of basic entry points + + # the input to this awk script should be generated by: nm -go /lib/libc.a | tr : " " + + # data structures used here: + # + # definer[entry-point-name] = module-name + # epcount = # entry-point-name's seen so far + # ep[k] = k'th entry-point-name + # refcount[entry-point-name] = number of references by wanted modules + # referrer[entry-point-name.k] = k'th module-name with an undefined reference to this entry-point-name + # want[module-name] = "Y" if this module wanted + + # search output of nm and set up definers and referrers + + / [ATDBC] / { + if (definer[$5] == "") + definer[ep[epcount++] = $5] = $2; + } + + / U / { + referrer[$4 "." refcount[$4]++] = $2; + } + + # postprocessing + + END { + + + # Specify which entry points we definitely want. Edit this list to add entry points. + + want[definer["_class_RoutineStruct"]] = "Y"; + want[definer["_class_Error"]] = "Y"; + want[definer["_ProgramName"]] = "Y"; + # want[definer["_class_Header"]] = "Y"; + want[definer["_class_NewObject"]] = "Y"; + want[definer["_class_Load"]] = "Y"; + want[definer["_class_IsLoaded"]] = "Y"; + want[definer["_class_Lookup"]] = "Y"; + want[definer["_class_IsType"]] = "Y"; + want[definer["_class_IsTypeByName"]] = "Y"; + want[definer["_class_EnterInfo"]] = "Y"; + want[definer["_class_SetClassPath"]] = "Y"; + want[definer["_class_PrependClassPath"]] = "Y"; + want[definer["_class_GetEText"]] = "Y"; + want[definer["_environ"]] = "Y"; + want[definer["__exit"]] = "Y"; + want[definer["_abort"]] = "Y"; + want[definer["_alloca"]] = "Y"; + want[definer["_blt"]] = "Y"; + want[definer["_bcopy"]] = "Y"; + want[definer["_brk"]] = "Y"; + want[definer["_bzero"]] = "Y"; + want[definer["_calloc"]] = "Y"; + want[definer["_cfree"]] = "Y"; + want[definer["_errno"]] = "Y"; + want[definer["_close"]] = "Y"; + want[definer["_errno"]] = "Y"; + want[definer["_creat"]] = "Y"; + want[definer["__ctype_"]] = "Y"; + want[definer["__doprnt"]] = "Y"; + want[definer["_ecvt"]] = "Y"; + want[definer["_fcvt"]] = "Y"; + want[definer["_sys_errlist"]] = "Y"; + want[definer["_sys_nerr"]] = "Y"; + want[definer["_exit"]] = "Y"; + want[definer["_fcntl"]] = "Y"; + want[definer["__filbuf"]] = "Y"; + want[definer["__iob"]] = "Y"; + want[definer["__cleanup"]] = "Y"; + want[definer["__flsbuf"]] = "Y"; + want[definer["_fclose"]] = "Y"; + want[definer["_fflush"]] = "Y"; + want[definer["_fopen"]] = "Y"; + want[definer["_fprintf"]] = "Y"; + want[definer["_fread"]] = "Y"; + want[definer["_fstat"]] = "Y"; + want[definer["_fwrite"]] = "Y"; + want[definer["_gcvt"]] = "Y"; + want[definer["_getdtablesize"]] = "Y"; + want[definer["_getpagesize"]] = "Y"; + want[definer["_ioctl"]] = "Y"; + want[definer["_isatty"]] = "Y"; + want[definer["_lseek"]] = "Y"; + want[definer["_malloc"]] = "Y"; + want[definer["_modf"]] = "Y"; + want[definer["_realloc"]] = "Y"; + want[definer["_free"]] = "Y"; + want[definer["_open"]] = "Y"; + want[definer["_perror"]] = "Y"; + want[definer["_printf"]] = "Y"; + want[definer["_read"]] = "Y"; + want[definer["_sbrk"]] = "Y"; + want[definer["curbrk"]] = "Y"; + want[definer["_sigvec"]] = "Y"; + want[definer["_sprintf"]] = "Y"; + want[definer["_strlen"]] = "Y"; + want[definer["_syscall"]] = "Y"; + want[definer["_write"]] = "Y"; + want[definer["_writev"]] = "Y"; + + # now take transitive closure of wanted modules + + for (needmore = "Y"; needmore == "Y"; needmore = "N") { + for ( i = 0; i < epcount; i++) { + if (want[definer[ep[i]]] != "Y") { + want[definer[ep[i]]] = "N"; + for ( j = 0; j < refcount[ep[i]]; j++ ) { + if (want[referrer[ep[i] "." j]] == "Y") { + want[definer[ep[i]]] = "Y"; + needmore = "Y"; + break; + } + } + } + } + } + + # write out all wanted module name and entry points + + for ( i = 0 ; i < epcount ; i++) + if (want[definer[ep[i]]] == "Y") + printf "%s %s\n", definer[ep[i]], ep[i]; + } *** overhead/class/machdep/i386_mach/makedo.csh Fri Jul 27 14:24:18 1990 --- overhead/class/machdep/i386_mach/makedo.csh.NEW Thu May 10 16:36:31 1990 *************** *** 0 **** --- 1,89 ---- + #!/bin/csh -f + # Script to convert normal object files into a dynamically loadable module. + + if (! $?ANDREWDIR) setenv ANDREWDIR /usr/andrew + if ("$*" == "") then + echo "usage: makedo [-o outfile] [-b bindir] [-d libdir] [-e entrypoint] [-g] files..." + echo " -b overrides /usr/andrew/bin for finding dofix, doindex" + echo " -d overrides ${ANDREWDIR}/lib for finding libcx.a" + echo " -e overrides the default entry point" + echo " -g causes .dog file to be generated for debugger use" + exit 1 + endif + set filelist + set bindir="${ANDREWDIR}/bin" + set libdir="${ANDREWDIR}/lib" + foreach file ($*) + if ($?outcoming) then + set outfile=$file + unset outcoming + continue + endif + if ($?bincoming) then + set bindir=$file + unset bincoming + continue + endif + if ($?libcoming) then + set libdir=$file + unset libcoming + continue + endif + if ($?entrypointcoming) then + set entrypoint=$file + unset entrypointcoming + continue + endif + switch ($file) + case -o: + set outcoming + breaksw + case -b: + set bincoming + breaksw + case -d: + set libcoming + breaksw + case -e: + set entrypointcoming + breaksw + case -g: + set gflag + breaksw + default: + if (! $?outfile) set outfile=$file + set filelist=($filelist $file) + endsw + end + if ($?outcoming) then + echo "makedo: missing argument to -o switch." + exit 1 + endif + if ($?bincoming) then + echo "makedo: missing argument to -b switch." + exit 1 + endif + if ($?libcoming) then + echo "makedo: missing argument to -d switch." + exit 1 + endif + if ($?entrypointcoming) then + echo "makedo: missing argument to -e switch." + exit 1 + endif + if (! $?filelist) then + echo "makedo: No object modules given." + exit 1 + endif + if (! $?entrypoint) then + set entrypoint=_${outfile:r}__GetClassInfo + endif + ld -r -o ${outfile:r}.dog $filelist ${libdir}/libcx.a | egrep "ld:" + ${bindir}/dofix -e $entrypoint ${outfile:r}.dog + set retcode=$status + if (! $?gflag) rm ${outfile:r}.dog + if (! $retcode) then + ${bindir}/doindex ${outfile:r}.do + set retcode=$status + endif + exit($retcode) *** overhead/class/lib/Imakefile Wed Nov 22 13:32:17 1989 --- overhead/class/lib/Imakefile.NEW Wed Jun 13 17:12:19 1990 *************** *** 9,15 **** --- 9,24 ---- NormalObjectRule() NormalAsmPPRule() + #ifndef _IBMR2 LibraryTarget(libclass.a, class.o ../machdep/machine/entry.o ../machdep/machine/doload.o mapping.o classind.o ../machdep/machine/globals.o) + #else /* _IBMR2 */ + libclass.a: class.o ../machdep/machine/entry.o ../machdep/machine/doload.o mapping.o classind.o ../machdep/machine/globals.o + $(RM) $@ + ld -o shr.o class.o ../machdep/machine/entry.o ../machdep/machine/doload.o mapping.o classind.o ../machdep/machine/globals.o -bE:../machdep/machine/libclass.exp -bM:SRE -b I:../machdep/machine/libclass.imp -lc + $(AR) $@ shr.o + $(RM) shr.o + #endif /* _IBMR2 */ + InstallLibrary(libclass.a, $(DESTDIR)/lib) InstallFile(class.h, $(INSTINCFLAGS), $(DESTDIR)/include) InstallFile(mapping.h, $(INSTINCFLAGS), $(DESTDIR)/include) *** overhead/class/lib/class.c Wed Jan 17 16:39:43 1990 --- overhead/class/lib/class.c.NEW Fri Jul 20 11:32:37 1990 *************** *** 6,12 **** class.c - runtime support for class system */ ! char class_rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/class/lib/RCS/class.c,v 2.24 89/12/12 15:07:10 ghoti Exp $"; #include /* sys/types.h sys/file.h */ --- 6,12 ---- class.c - runtime support for class system */ ! char class_rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/lib/RCS/class.c,v 2.28 90/07/19 14:47:57 gk5g Exp $"; #include /* sys/types.h sys/file.h */ *************** *** 28,35 **** --- 28,43 ---- extern char *getenv(); /* %%%% */ + #if !SY_AIX12 extern int getpid(); + #endif /* SY_AIX12 */ + #ifdef _IBMR2 + extern char _etext; + #define etext _etext + #else extern char etext; + #endif /* _IBMR2 */ + extern int errno; *************** *** 263,269 **** return -1; } ! info->textbase=base; /* text segment is first */ info->textlength=textlength; /* register this class */ --- 271,277 ---- return -1; } ! info->textbase=(void*)base; /* text segment is first */ info->textlength=textlength; /* register this class */ *************** *** 502,508 **** struct pathentry * ThisPath; int PathIndex; FILE * IndexFile; ! char * buffer[MAXPATHLEN]; struct IndexEntry * ThisEntry; if (InitializeMappingPackage() != 0) { --- 510,516 ---- struct pathentry * ThisPath; int PathIndex; FILE * IndexFile; ! char buffer[MAXPATHLEN]; struct IndexEntry * ThisEntry; if (InitializeMappingPackage() != 0) { *************** *** 887,893 **** void *class_GetEText() { ! return &etext; } --- 895,901 ---- void *class_GetEText() { ! return (void*)(&etext); } *** overhead/class/lib/class.h Wed Nov 22 13:32:38 1989 --- overhead/class/lib/class.h.NEW Wed Jun 13 17:12:24 1990 *************** *** 2,8 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/class/lib/RCS/class.h,v 2.15 89/09/26 09:15:01 jhh Exp $ */ #ifndef class_DEFINED #define class_DEFINED 1 --- 2,8 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/class/lib/RCS/class.h,v 2.17 90/06/06 12:27:14 gk5g Exp $ */ #ifndef class_DEFINED #define class_DEFINED 1 *************** *** 58,70 **** /* * Please remove this once AIX has a real C compiler. %%%% * Thank, pgc. */ ! extern void free(); ! #if (defined(AIX) && !defined(i386)) #define void char #endif /* AIX */ extern char *realloc(); extern char *malloc(); extern int errno; --- 58,76 ---- /* * Please remove this once AIX has a real C compiler. %%%% * Thank, pgc. + * + * Redefine void only for cc on AIX/RT. -mrt */ ! #if defined(AIX) && !defined(i386) && !defined(__HIGHC__) #define void char #endif /* AIX */ + + #ifndef _IBMR2 + extern void free(); extern char *realloc(); extern char *malloc(); + #endif /* _IBMR2 */ + extern int errno; *** overhead/class/lib/classind.c Wed Nov 22 13:32:44 1989 --- overhead/class/lib/classind.c.NEW Thu Jul 12 14:05:07 1990 *************** *** 53,59 **** **/ struct IndexEntry * ReadEntry(fd) ! int fd; { struct IndexEntry * ThisEntry; --- 53,59 ---- **/ struct IndexEntry * ReadEntry(fd) ! FILE *fd; { struct IndexEntry * ThisEntry; *************** *** 112,118 **** boolean WriteEntry(fd, entry) ! int fd; struct IndexEntry * entry; { --- 112,118 ---- boolean WriteEntry(fd, entry) ! FILE *fd; struct IndexEntry * entry; { *** overhead/class/testing/Imakefile Wed Nov 22 13:34:06 1989 --- overhead/class/testing/Imakefile.NEW Wed Jun 20 13:31:01 1990 *************** *** 3,11 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ CLASS=../pp/class ! MAKEDO=../machdep/machine/makedo.csh LOCALINCLUDES= -I../lib -I../machdep/machine -I. ! MAKEDOFLAGS=-b ../cmd -d ../globals -d ../machdep/machine/ -g IHFILES = testobj.ih testobj2.ih NormalObjectRule() --- 3,11 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ CLASS=../pp/class ! MAKEDO=$(BASEDIR)/bin/makedo LOCALINCLUDES= -I../lib -I../machdep/machine -I. ! MAKEDOFLAGS=-b ../cmd -g IHFILES = testobj.ih testobj2.ih NormalObjectRule() *** overhead/cmenu/cmcreate.c Wed Apr 11 14:22:00 1990 --- overhead/cmenu/cmcreate.c.NEW Thu May 10 16:36:54 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v 2.8 90/02/28 13:09:11 ajp Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v 2.8 90/02/28 13:09:11 ajp Exp $"; #endif /* lint */ #include --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v 2.10 90/05/09 15:35:18 gk5g Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmcreate.c,v 2.10 90/05/09 15:35:18 gk5g Exp $"; #endif /* lint */ #include *************** *** 97,108 **** unsigned long tileOrStipple = 0; unsigned long color; int colorDisplay = FALSE; if (XGetWindowAttributes(display, window, &windowAttributes) > 0) if (windowAttributes.depth > 1) { - XColor grayColor; - grayColor.red = grayColor.green = grayColor.blue = 43256; /* 2/3 intensity gray. */ grayColor.flags = DoRed | DoGreen | DoBlue; --- 97,108 ---- unsigned long tileOrStipple = 0; unsigned long color; int colorDisplay = FALSE; + XColor grayColor, foreColor, backColor, exact; + if (XGetWindowAttributes(display, window, &windowAttributes) > 0) if (windowAttributes.depth > 1) { grayColor.red = grayColor.green = grayColor.blue = 43256; /* 2/3 intensity gray. */ grayColor.flags = DoRed | DoGreen | DoBlue; *************** *** 111,116 **** --- 111,120 ---- colorDisplay = TRUE; gcv.fill_style = FillSolid; tileOrStipple = 0; + XAllocNamedColor(display,DefaultColormap(display, DefaultScreen(display)),dp->foregroundColor, + &foreColor, &exact); + XAllocNamedColor(display,DefaultColormap(display, DefaultScreen(display)),dp->backgroundColor, + &backColor, &exact); } else gcv.fill_style = FillOpaqueStippled; *************** *** 124,130 **** if ((grayMap = XCreatePixmapFromBitmapData(display, RootWindow(display, screen), (char *) grayImage, 32, 8, BlackPixel(display, screen), WhitePixel(display, DefaultScreen(display)), 1)) == NULL) return -1; ! gcv.foreground = BlackPixel(display,screen); if (gcv.fill_style == FillTiled) { gcv.tile = grayMap; tileOrStipple = GCTile; --- 128,134 ---- if ((grayMap = XCreatePixmapFromBitmapData(display, RootWindow(display, screen), (char *) grayImage, 32, 8, BlackPixel(display, screen), WhitePixel(display, DefaultScreen(display)), 1)) == NULL) return -1; ! gcv.foreground = ( colorDisplay ? foreColor.pixel : BlackPixel(display,screen) ); if (gcv.fill_style == FillTiled) { gcv.tile = grayMap; tileOrStipple = GCTile; *************** *** 135,141 **** } } ! gcv.background = WhitePixel(display,screen); gcv.font = dp->selectionFont->fid; tempgc = XCreateGC(display, window, GCFillStyle | GCForeground | GCBackground | GCFont | tileOrStipple, &gcv); --- 139,145 ---- } } ! gcv.background = ( colorDisplay ? backColor.pixel : WhitePixel(display,screen) ); gcv.font = dp->selectionFont->fid; tempgc = XCreateGC(display, window, GCFillStyle | GCForeground | GCBackground | GCFont | tileOrStipple, &gcv); *************** *** 148,164 **** else goto error; ! gcv.foreground = WhitePixel(display, screen); ! gcv.background = BlackPixel(display, screen); if ((dp->whiteGC = XCreateGC(display, window, GCForeground | GCBackground, &gcv)) == NULL) goto error; ! gcv.foreground = BlackPixel(display, screen); ! gcv.background = WhitePixel(display, screen); gcv.font = dp->titleFont->fid; if ((dp->titleBlackGC = XCreateGC(display, window, GCForeground | GCBackground | GCFont, &gcv)) == NULL) goto error; ! gcv.font = dp->selectionFont->fid; if ((dp->blackGC = XCreateGC(display, window, GCForeground | GCBackground | GCFont, &gcv)) == NULL) goto error; --- 152,169 ---- else goto error; ! gcv.foreground = ( colorDisplay ? backColor.pixel : WhitePixel(display, screen) ); ! gcv.background = ( colorDisplay ? foreColor.pixel : BlackPixel(display, screen) ); if ((dp->whiteGC = XCreateGC(display, window, GCForeground | GCBackground, &gcv)) == NULL) goto error; ! gcv.foreground = ( colorDisplay ? foreColor.pixel : BlackPixel(display, screen) ); ! gcv.background = ( colorDisplay ? backColor.pixel : WhitePixel(display, screen) ); gcv.font = dp->titleFont->fid; if ((dp->titleBlackGC = XCreateGC(display, window, GCForeground | GCBackground | GCFont, &gcv)) == NULL) goto error; ! gcv.foreground = ( colorDisplay ? foreColor.pixel : BlackPixel(display, screen) ); ! gcv.background = ( colorDisplay ? backColor.pixel : WhitePixel(display, screen) ); gcv.font = dp->selectionFont->fid; if ((dp->blackGC = XCreateGC(display, window, GCForeground | GCBackground | GCFont, &gcv)) == NULL) goto error; *************** *** 170,176 **** goto error; ! if (!colorDisplay || (XGetDefault(display, def_env, "ColorHighlight") == NULL)) { gcv.plane_mask = BlackPixel(display, screen) ^ WhitePixel(display, screen); gcv.function = GXinvert; if ((dp->invertGC = XCreateGC(display, window, GCFunction | GCPlaneMask, &gcv)) == NULL) --- 175,181 ---- goto error; ! if (!colorDisplay) { gcv.plane_mask = BlackPixel(display, screen) ^ WhitePixel(display, screen); gcv.function = GXinvert; if ((dp->invertGC = XCreateGC(display, window, GCFunction | GCPlaneMask, &gcv)) == NULL) *************** *** 177,184 **** goto error; dp->highlightUsingGray = FALSE; } ! else ! dp->highlightUsingGray = TRUE; if ((wormIcon = XCreatePixmapFromBitmapData(display, RootWindow(display, screen), (char *) worm_bits, worm_width, worm_height, BlackPixel(display, screen), WhitePixel(display, screen), DefaultDepth(display, screen))) == NULL) goto error; --- 182,194 ---- goto error; dp->highlightUsingGray = FALSE; } ! else { ! gcv.plane_mask = foreColor.pixel ^ backColor.pixel; ! gcv.function = GXinvert; ! if ((dp->invertGC = XCreateGC(display, window, GCFunction | GCPlaneMask, &gcv)) == NULL) ! goto error; ! dp->highlightUsingGray = FALSE; ! } if ((wormIcon = XCreatePixmapFromBitmapData(display, RootWindow(display, screen), (char *) worm_bits, worm_width, worm_height, BlackPixel(display, screen), WhitePixel(display, screen), DefaultDepth(display, screen))) == NULL) goto error; *************** *** 192,200 **** error: ! if (colorDisplay) ! XFreeColors(display, DefaultColormap(display, DefaultScreen(display)), &color, 1, 0); if (dp->grayGC != NULL) XFreeGC(display, dp->grayGC); if (dp->whiteGC != NULL) --- 202,215 ---- error: ! if (colorDisplay) { ! unsigned long pixels[5]; + pixels[0] = color; + pixels[1] = foreColor.pixel; + pixels[2] = backColor.pixel; + XFreeColors(display, DefaultColormap(display, DefaultScreen(display)), pixels, 3, 0); + } if (dp->grayGC != NULL) XFreeGC(display, dp->grayGC); if (dp->whiteGC != NULL) *************** *** 256,273 **** */ rootWindow = RootWindow(dpy, DefaultScreen(dpy)); if ((def_val = XGetDefault(dpy, def_env, "UseSaveUnder")) != NULL) { dp->useSaveUnder = (*def_val != 'n'); } else dp->useSaveUnder = TRUE; - - if ((def_val = XGetDefault(dpy, def_env, "SaveBits")) != NULL) { - dp->saveBits = (*def_val != 'n'); - } - else - dp->saveBits = TRUE; - if ((def_val = XGetDefault(dpy, def_env, "ClickInterval")) != NULL) dp->clickInterval = atoi(def_val); --- 271,299 ---- */ rootWindow = RootWindow(dpy, DefaultScreen(dpy)); + if ((def_val = XGetDefault(dpy, def_env, "MenuForeground")) != NULL) { + dp->foregroundColor = (char*)malloc(strlen(def_val)+1); + strcpy(dp->foregroundColor,def_val); + } + else { + dp->foregroundColor = (char*)malloc(strlen("black")+1); + strcpy(dp->foregroundColor,"black"); + } + + if ((def_val = XGetDefault(dpy, def_env, "MenuBackground")) != NULL) { + dp->backgroundColor = (char*)malloc(strlen(def_val)+1); + strcpy(dp->backgroundColor,def_val); + } + else { + dp->backgroundColor = (char*)malloc(strlen("white")+1); + strcpy(dp->backgroundColor,"white"); + } + if ((def_val = XGetDefault(dpy, def_env, "UseSaveUnder")) != NULL) { dp->useSaveUnder = (*def_val != 'n'); } else dp->useSaveUnder = TRUE; if ((def_val = XGetDefault(dpy, def_env, "ClickInterval")) != NULL) dp->clickInterval = atoi(def_val); *** overhead/cmenu/cmenu.help Wed Apr 11 14:22:05 1990 --- overhead/cmenu/cmenu.help.NEW Tue May 15 10:52:42 1990 *************** *** 1,118 **** ! \begindata{text,269084692} \textdsversion{12} ! \template{help} ! \chapter{Cmenu: Controlling the menus for Andrew programs } \section{What cmenu is }\leftindent{ ! Cmenu or the Cambridge Menu Package controls certain aspects of the menus that ! you see when you use Andrew with cwm, the Cambridge Window Manager. You can ! customize the menus for Andrew programs by adding cmenu entries to your ! \italic{.Xdefaults} file as shown below. } ! \section{Customizing the menus for Andrew programs }\leftindent{ ! Here are some entries you can put into a .Xdefaults file in your home ! directory to change the way that Andrew menus look. The default value for ! each entry is shown. If you like the way the menus in Andrew programs look, ! there is no need to create or add cmenu entries to the .Xdefaults file. In ! fact, setting some entries to their default values in your .Xdefaults file can ! cause unexpected results, so you should only add lines to .Xdefaults if you ! want something other than the default. ! Entries that begin with "cmenu," such as those listed in this file, do not ! affect the menus posted by the Cambridge Window Manager, such as the title bar ! menus. For information about changing the title bar menus, see the ! \italic{cwm} help document. ! Note that when you change cmenu entries in your .Xdefaults file, your changes ! will not take effect until the next time you start an Andrew program. Any ! Andrew programs that you have running when you change these entries will not ! be affected by the changes. Capitalization is not important in the entries ! that you put into .Xdefaults, but punctuation is. - - \bold{\italic{cmenu.BoundingBoxWidth:} 40} - - \leftindent{Controls the width (in pixels) of the line around the menu stack. - Any positive integer can be used. If a negative number is used, the width - defaults to 0.} - - - \bold{\italic{cmenu.MenuFreeze:} 1} - - \leftindent{This setting has two effects. First, it determines whether the X - server will be "grabbed" while a menu is posted. In other words, if - cmenu.MenuFreeze is set to 1, input from the mouse (clicks, presses, etc.) - will go only to the menus while the menus are displayed. If cmenu.MenuFreeze - is set to 0, input from the mouse will go wherever the mouse cursor is while - the menus are displayed. The second effect of this setting is to determine - whether the bits behind the menus are saved when the menus are displayed. If - the value is 1, the bits are saved, which means that the application does not - have to redraw the screen when the menus disappear. If the value is 0, the - bits are not saved and the application has to re-draw the screen when the - menus disappear. The default setting of 1 means that the X server will be - "grabbed" and the bits behind the menus will be saved. - - - }\bold{\italic{cmenu.PaneSpread:} 1.25} - - \leftindent{Determines the horizontal spread of menu panes. Any value greater - than or equal to 0.0 may be used; the value must be specified as a number plus - tenths or hundreths (i.e., 1.0 is an appropriate value for cmenu.PaneSpread - but 1 is not). A value of 1.0 means that the horizontal and vertical spread - will be equivalent. A value less than 1.0 will compress the menu panes inward - and a value greater than 1.0 will expand them outward. } - - - \bold{\italic{cmenu.PaneFont:} AndySans12b} - \leftindent{Controls the font that is used for the label or title of each menu pane. Any valid X font may be used.} ! \bold{\italic{cmenu.SelectionFont:} AndySans12b} ! \leftindent{Controls the font that is used for each item on the menus. Any ! valid X font may be used.} ! \bold{\italic{cmenu.ShadowWindow:} 1} ! \leftindent{Determines whether the menu will have "shadow" windows on its ! panes. If the value is 1, "shadow" windows will appear, giving the menus a ! two-dimensional appearance. If the value is 0, "shadow" windows will not ! appear. } ! \bold{\italic{cmenu.WormHole:} 1} - \leftindent{Determines whether the menu will have a "wormhole" after an - initial selection is made. A wormhole is a black circle on the front menu. - The user moves the mouse cursor onto the black circle to repeat a previous - menu selection. If the value is 1, a wormhole will appear after an initial - selection. If the value is 0, no wormhole will appear. (Note: this - preference is not working dependably in the current release of Andrew.)} - - - \bold{\italic{cmenu.ClickInterval:} 350} - - \leftindent{Determines how long the user has to make a selection after the - menus have been displayed. If the interval between the time the menus appear - and the time the user makes a selection is greater than the ClickInterval - setting, no selection will take place. Instead, the menus will stay on the - screen until the user either makes the selection again or moves the cursor off - the menus. The value is in milliseconds. } - - - \bold{\italic{cmenu.OverlapPct: 50}} - \leftindent{Determines the percentage of overlap that is used when flipping to the previous menu card. By setting this value to 50, the user can move the mouse cursor halfway across a menu card before it flips to the previous card. --- 1,73 ---- ! \begindata{text,268707252} \textdsversion{12} ! \define{chapter ! } ! \define{section ! } ! \define{leftindent ! } ! \define{italic ! } ! \define{bold ! } ! \define{display ! } ! \define{smaller ! } ! \chapter{Cmenu: Controlling the menus for Andrew applications } \section{What cmenu is }\leftindent{ ! \display{\smaller{Cmenu is an Xlib-based menu package used by Andrew ! applications. Since it is also used by non-ATK applications, cmenu is ! customized by specifying X11 resources, rather than ATK preferences. The ! resources that affect cmenu's behavior are explained below.}} } ! \section{Customizing the menus }\leftindent{ ! Below are some entries you can use to change the way that cmenus appear. The ! default value for each entry is shown. If you like the way the menus appear, ! there is no need to create or add cmenu resource entries. In fact, setting ! some entries to their default values can cause unexpected results, so you ! should only add cmenu resource specifications if you want something other than ! the default. ! For a complete explanation of Xlib Resource Management please see Section ! 10.11 of the Xlib manual as well as Section 4.2 of the X Toolkit manual. ! \bold{\italic{TitleFont:} AndySans12b} \leftindent{Controls the font that is used for the label or title of each menu pane. Any valid X font may be used.} ! \bold{\italic{SelectionFont:} AndySans12b} ! \leftindent{Controls the font that is used for each selectable item on the ! menus. Any valid X font may be used.} ! \bold{\italic{ClickInterval:} 350} ! This attribute (in milliseconds) determines the period of time, from the onset ! of the depression of the middle mouse button, during which you may release the ! middle mouse button and still have the menus up on the screen for selection ! purposes. In other words, you can peruse the menu stack without having the ! middle mouse button depressed. To select a menu option while in this state, ! you must again depress the middle mouse button on the selection of your ! choice. There is an invisible bounding box around the menu stack which, if ! you cross while the menus are up, will force the menus to be retracted without ! a selection. ! \bold{\italic{OverlapPct: 0}} \leftindent{Determines the percentage of overlap that is used when flipping to the previous menu card. By setting this value to 50, the user can move the mouse cursor halfway across a menu card before it flips to the previous card. *************** *** 124,132 **** slightly past its left edge.} }\leftindent{ ! }\section{Related tools} Select (highlight) one of the italicized names and choose "Show Help on Selected Word" from the pop-up menu to see the help file for: --- 79,111 ---- slightly past its left edge.} }\leftindent{ ! UseSaveUnder: 1 + Determines whether or not the X server will save the bits under the menus so + that the application will not have to redraw the window when the menus are + retracted. The default value is 1. The reason this option exists is for + those displays (like the QDSS) where save unders are available, but slower + than just redrawing. + + MenuForeground: black + + Determines the color to use for the foreground when drawing the menus. The + default value for the foreground color is black. This attribute is only + consulted if the menus are being drawn on a color monitor. + + + MenuBackground: white + + Determines the color to use for the background when drawing the menus. The + default value for the background color is white. This attribute is only + consulted if the menus are being drawn on a color monitor. + + } + + \section{Related tools} + + Select (highlight) one of the italicized names and choose "Show Help on Selected Word" from the pop-up menu to see the help file for: *************** *** 133,136 **** \leftindent{ \italic{preferences ! }}\enddata{text,269084692} --- 112,121 ---- \leftindent{ \italic{preferences ! X(1) ! ! xrdb(1) ! ! XGetDefault(3X) ! ! }}\enddata{text,268707252} *** overhead/cmenu/cmintern.h Wed Apr 11 14:22:06 1990 --- overhead/cmenu/cmintern.h.NEW Thu May 10 16:36:58 1990 *************** *** 2,9 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmintern.h,v 2.5 90/02/28 13:07:26 ajp Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmintern.h,v $ */ /* Useful definitions... */ --- 2,9 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmintern.h,v 2.7 90/05/09 15:34:26 gk5g Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmintern.h,v $ */ /* Useful definitions... */ *************** *** 50,57 **** int wormWidth; int wormHeight; int useSaveUnder; - int saveBits; int overlapPct; }; #define HORIZONTALMARGIN 10 --- 50,58 ---- int wormWidth; int wormHeight; int useSaveUnder; int overlapPct; + char *foregroundColor; + char *backgroundColor; }; #define HORIZONTALMARGIN 10 *** overhead/cmenu/cmmanip.c Wed Nov 22 13:35:57 1989 --- overhead/cmenu/cmmanip.c.NEW Thu May 10 16:37:00 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/cmenu/RCS/cmmanip.c,v 2.4 89/02/10 23:09:14 ghoti Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/cmenu/RCS/cmmanip.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/cmenu/RCS/cmmanip.c,v 2.4 89/02/10 23:09:14 ghoti Exp $"; #endif /* lint */ #include --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmmanip.c,v 2.5 90/05/09 15:36:00 gk5g Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmmanip.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/cmenu/RCS/cmmanip.c,v 2.5 90/05/09 15:36:00 gk5g Exp $"; #endif /* lint */ #include *************** *** 201,206 **** --- 201,207 ---- for (thisPane = menu->panes; thisPane != NULL; thisPane = nextPane) { nextPane = thisPane->next; FreeSelections(menu, thisPane); + if(thisPane->label) free(thisPane->label); free(thisPane); } *************** *** 225,230 **** --- 226,232 ---- menu->panes = thisPane->next; FreeSelections(menu, thisPane); + if(thisPane->label) free(thisPane->label); free(thisPane); --menu->numberOfPanes; *** overhead/eli/bglisp/bglisp.c Wed Apr 11 14:22:09 1990 --- overhead/eli/bglisp/bglisp.c.NEW Fri Jul 13 11:41:09 1990 *************** *** 4,10 **** \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/bglisp/RCS/bglisp.c,v 2.5 89/02/10 23:10:41 ghoti Exp $ * * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/bglisp/RCS/bglisp.c,v $ */ --- 4,10 ---- \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/bglisp/RCS/bglisp.c,v 2.6 90/07/12 14:17:38 gk5g Exp $ * * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/bglisp/RCS/bglisp.c,v $ */ *************** *** 138,144 **** q = EliErr_ErrCode(st); fprintf(stderr, "\n*** An error occurred while allocating a result buffer: Code=%d (%s)\n*** Location: %s\n", q, EliErrStr(q), EliErr_ErrLoc(st)); if (EliErr_BadSexpP(st)) { ! printf(stderr, "*** Expression: %s\n", EliSPutSexp(EliErr_BadSexp(st))); fflush(stderr); } } --- 138,144 ---- q = EliErr_ErrCode(st); fprintf(stderr, "\n*** An error occurred while allocating a result buffer: Code=%d (%s)\n*** Location: %s\n", q, EliErrStr(q), EliErr_ErrLoc(st)); if (EliErr_BadSexpP(st)) { ! fprintf(stderr, "*** Expression: %s\n", EliSPutSexp(EliErr_BadSexp(st))); fflush(stderr); } } *** overhead/eli/bglisp/bglisp.help Wed Nov 22 13:36:29 1989 --- overhead/eli/bglisp/bglisp.help.NEW Wed Jun 13 17:13:17 1990 *************** *** 1,4 **** ! \begindata{text,269240100} \textdsversion{12} \template{help} \chapter{BGLisp --- 1,4 ---- ! \begindata{text,268905392} \textdsversion{12} \template{help} \chapter{BGLisp *************** *** 37,47 **** \section{Warnings }\leftindent{ - \bold{Note: } On all machine types, strings in your Lisp code longer than - ~1800 characters will cause Eli to core dump. However, you can construct - longer strings at runtime (with strcat, for example) if you wish. - - As mentioned above, BGLisp is a very stripped-down Lisp interpreter. Some fairly common Lisp features which are not supported are: --- 37,42 ---- *************** *** 225,228 **** eli ! }}\enddata{text,269240100} --- 220,223 ---- eli ! }}\enddata{text,268905392} *** overhead/eli/lib/elil.l Wed Nov 22 13:37:44 1989 --- overhead/eli/lib/elil.l.NEW Fri Jul 13 11:41:21 1990 *************** *** 4,11 **** #include #include ! #undef YYLMAX ! #define YYLMAX (2000) /* Arbitrary bound on yytext size */ %} WS [ \t] --- 4,10 ---- #include #include ! extern char *realloc(); %} WS [ \t] *************** *** 26,36 **** return (INTEGER); } ' return (SQUOTE); ! \"([^"\\]|{NL}|\\.)*\" { ! if (EliProcessInfo.yparsebuflen < yyleng + 1) ! EliProcessInfo.yparsebuf = (char *) realloc(EliProcessInfo.yparsebuf, ! EliProcessInfo.yparsebuflen = yyleng + 1); ! strcpy( EliProcessInfo.yparsebuf, yytext ); return (STRING); } {NONMAGIC}+ { --- 25,32 ---- return (INTEGER); } ' return (SQUOTE); ! \" { ! DoString(); return (STRING); } {NONMAGIC}+ { *************** *** 68,76 **** SOFTWARE. ******************************************************************/ ! #undef input() ! int input() /* Replaces the lex macro */ { int result; --- 64,72 ---- SOFTWARE. ******************************************************************/ ! #undef input ! static int input() /* Replaces the lex macro */ { int result; *************** *** 104,112 **** } ! #undef unput(c) ! unput(c) /* Replaces the lex macro */ int c; { switch (EliProcessInfo.u_source) --- 100,108 ---- } ! #undef unput ! static unput(c) /* Replaces the lex macro */ int c; { switch (EliProcessInfo.u_source) *************** *** 118,124 **** *yysptr++ = yytchar; break; case e_source_string: ! *(--EliProcessInfo.u_sourcestring) = (char) c; break; case e_source_file: ungetc(c, EliProcessInfo.u_inputfp); --- 114,120 ---- *yysptr++ = yytchar; break; case e_source_string: ! --EliProcessInfo.u_sourcestring; break; case e_source_file: ungetc(c, EliProcessInfo.u_inputfp); *************** *** 126,133 **** } } /* ! * $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/lib/RCS/elil.l,v 2.4 89/07/25 11:50:37 bobg Exp $ * ! * $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/lib/RCS/elil.l,v $ */ --- 122,188 ---- } } + static void AddToYParseBuf(c, grow) + int c, grow; + { + int buflen = EliProcessInfo.yparsebuflen, len; + + if (!grow) { /* Start a string from scratch */ + if (buflen >= 2) { + EliProcessInfo.yparsebuf[0] = c; + EliProcessInfo.yparsebuf[1] = '\0'; + return; + } + EliProcessInfo.yparsebuf = realloc(EliProcessInfo.yparsebuf, + EliProcessInfo.yparsebuflen = 20); + EliProcessInfo.yparsebuf[0] = c; + EliProcessInfo.yparsebuf[1] = '\0'; + return; + } + len = strlen(EliProcessInfo.yparsebuf); + if (len < (buflen - 1)) { + EliProcessInfo.yparsebuf[len] = c; + EliProcessInfo.yparsebuf[len + 1] = '\0'; + return; + } + EliProcessInfo.yparsebuf = realloc(EliProcessInfo.yparsebuf, + EliProcessInfo.yparsebuflen = + len + 20); + EliProcessInfo.yparsebuf[len] = c; + EliProcessInfo.yparsebuf[len + 1] = '\0'; + } + + static DoString() + { + int sawbslash = 0, c; + + AddToYParseBuf('"', 0); + while (1) { + c = input(); + switch (c) { + case 0: + return; + case '\\': + sawbslash = !sawbslash; + AddToYParseBuf(c, 1); + break; + case '"': + AddToYParseBuf(c, 1); + if (!sawbslash) + return; + sawbslash = 0; + break; + default: + AddToYParseBuf(c, 1); + sawbslash = 0; + break; + } + } + } + /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/elil.l,v 2.7 90/06/13 14:15:36 bobg Exp $ * ! * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/elil.l,v $ */ + *** overhead/eli/lib/prims1.c Mon Mar 12 13:17:33 1990 --- overhead/eli/lib/prims1.c.NEW Wed Jun 13 17:13:52 1990 *************** *** 4,12 **** \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/eli/lib/RCS/prims1.c,v 1.1 90/02/13 15:23:17 bobg Exp $ * ! * $Source: /afs/andrew.cmu.edu/itc/src/andrew/overhead/eli/lib/RCS/prims1.c,v $ */ #include --- 4,12 ---- \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/prims1.c,v 1.3 90/06/13 14:17:17 bobg Exp $ * ! * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/prims1.c,v $ */ #include *************** *** 236,241 **** --- 236,244 ---- "FILTER", Prim_FILTER }, { + "CATCHERR", Prim_CATCHERR + }, + { NULL, NULL } }; /* Must end this way */ *************** *** 1497,1507 **** EliError(st, ELI_ERR_BAD_ARGS, err, "ELI-PRIMITIVE [SUBSTRING (2nd arg less than zero)]", 0); return; } ! if (len < 1L) { if (!(err = eliSexp_GetNew_trace(st, EliTraceStk(st)))) return; EliSexp_SetInt(st, err, len); ! EliError(st, ELI_ERR_BAD_ARGS, err, "ELI-PRIMITIVE [SUBSTRING (3rd arg less than one)]", 0); return; } if (!(buf = EliStringOpBuf((int) (len + 1L)))) { --- 1500,1510 ---- EliError(st, ELI_ERR_BAD_ARGS, err, "ELI-PRIMITIVE [SUBSTRING (2nd arg less than zero)]", 0); return; } ! if (len < 0L) { if (!(err = eliSexp_GetNew_trace(st, EliTraceStk(st)))) return; EliSexp_SetInt(st, err, len); ! EliError(st, ELI_ERR_BAD_ARGS, err, "ELI-PRIMITIVE [SUBSTRING (3rd arg less than zero)]", 0); return; } if (!(buf = EliStringOpBuf((int) (len + 1L)))) { *************** *** 2405,2411 **** return; } free(stderrstr); ! EliSexp_SetInt(st, resultnodes[0], (int) waitstat.w_T.w_Retcode); EliSexp_SetStr(st, resultnodes[1], resultstrs[0]); EliSexp_SetStr(st, resultnodes[2], resultstrs[1]); if (!(reslist = EliAddToList(st, reslist, resultnodes[0]))) --- 2408,2416 ---- return; } free(stderrstr); ! EliSexp_SetInt(st, resultnodes[0], ! ((int) waitstat.w_T.w_Retcode) ! + (((int) waitstat.w_T.w_Coredump) << 8)); EliSexp_SetStr(st, resultnodes[1], resultstrs[0]); EliSexp_SetStr(st, resultnodes[2], resultstrs[1]); if (!(reslist = EliAddToList(st, reslist, resultnodes[0]))) *** overhead/eli/lib/prims2.c Wed Apr 11 14:22:25 1990 --- overhead/eli/lib/prims2.c.NEW Wed Jun 13 17:13:57 1990 *************** *** 4,10 **** \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/prims2.c,v 1.2 90/03/13 15:46:05 bobg Exp $ * * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/prims2.c,v $ */ --- 4,10 ---- \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/prims2.c,v 1.3 90/06/13 14:17:39 bobg Exp $ * * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lib/RCS/prims2.c,v $ */ *************** *** 12,17 **** --- 12,19 ---- #include #include + extern char *sys_errlist[]; + void Prim_SETQ(st, arglist, resbuf) EliState_t *st; EliCons_t *arglist; *************** *** 1979,1982 **** --- 1981,2057 ---- if (!(st->tracep)) st->indentTrace = 0; EliSexp_SetSym(st, resbuf, st->tracep ? EliTSym(st) : EliNilSym(st)); + } + + void Prim_CATCHERR(st, arglist, resbuf) + EliState_t *st; + EliCons_t *arglist; + EliSexp_t *resbuf; + { + EliSexp_t *val[1], *err, *badsexp; + int evalv[1], paramstat, unixerr; + EliCons_t *resultlist = NULL; + EliSexp_t *tmp; + EliStr_t *strtmp; + char *errstr, *errdesc; + + evalv[0] = 1; + paramstat = EliProcessList(st, arglist, 1, 1, + val, &err, NULL, evalv); + if ((paramstat == -1) || (paramstat == -2)) { + EliError(st, ELI_ERR_ARGLISTSIZE, err, + "ELI-PRIMITIVE [CATCHERR (checking arglist size)]", 0); + return; + } + if (paramstat == -2000) { /* Error! */ + errstr = EliErrStr(EliErr_ErrCode(st)); + errdesc = EliErr_ErrLoc(st); + unixerr = EliErr_UnixErr(st); + badsexp = EliErr_BadSexp(st); + EliClearErr(st); + if (!(tmp = EliSexp_GetNew(st))) + return; + EliSexp_SetSym(st, tmp, EliNilSym(st)); + if (!(resultlist = EliAddToList(st, NULL, tmp))) + return; + if (!(strtmp = EliStringTable_FindOrMake(st, errstr))) + return; + if (!(tmp = EliSexp_GetNew(st))) + return; + EliSexp_SetStr(st, tmp, strtmp); + if (!(resultlist = EliAddToList(st, resultlist, tmp))) + return; + if (!(strtmp = EliStringTable_FindOrMake(st, errdesc))) + return; + if (!(tmp = EliSexp_GetNew(st))) + return; + EliSexp_SetStr(st, tmp, strtmp); + if (!(resultlist = EliAddToList(st, resultlist, tmp))) + return; + if (unixerr) { + if (!(strtmp = + EliStringTable_FindOrMake(st, sys_errlist[unixerr]))) + return; + if (!(tmp = EliSexp_GetNew(st))) + return; + EliSexp_SetStr(st, tmp, strtmp); + if (!(resultlist = EliAddToList(st, resultlist, tmp))) + return; + } + if (badsexp) { + if (!(resultlist = EliAddToList(st, resultlist, + badsexp))) + return; + } + EliSexp_SetCons(st, resbuf, resultlist); + return; + } + if (!(tmp = EliSexp_GetNew(st))) + return; + EliSexp_SetSym(st, tmp, EliTSym(st)); + if (!(resultlist = EliAddToList(st, NULL, tmp))) + return; + if (!(resultlist = EliAddToList(st, resultlist, val[0]))) + return; + EliSexp_SetCons(st, resbuf, resultlist); } *** overhead/eli/lclhdrs/prmtives.h Wed Nov 22 13:38:49 1989 --- overhead/eli/lclhdrs/prmtives.h.NEW Fri Jul 13 11:41:28 1990 *************** *** 4,12 **** \* ********************************************************************** */ /* ! * $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/lclhdrs/RCS/prmtives.h,v 2.6 89/05/09 17:47:42 bobg Exp $ * ! * $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/eli/lclhdrs/RCS/prmtives.h,v $ */ #include --- 4,12 ---- \* ********************************************************************** */ /* ! * $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lclhdrs/RCS/prmtives.h,v 2.8 90/07/12 14:15:22 gk5g Exp $ * ! * $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/eli/lclhdrs/RCS/prmtives.h,v $ */ #include *************** *** 29,35 **** #define FILTERBUFSIZ 256 /* Arbitrary */ #define FILTERTIMEOUT 300 /* Real seconds before killing child */ ! extern char *getenv(), *getprofile(), *malloc(), *realloc(), *index(); extern char *AndrewDir(); /* from libutil.a */ extern void Prim_AND(); /* prmtives.c, line 1133 */ --- 29,40 ---- #define FILTERBUFSIZ 256 /* Arbitrary */ #define FILTERTIMEOUT 300 /* Real seconds before killing child */ ! extern char *getenv(), *getprofile(); ! ! #ifndef _IBMR2 ! extern char *malloc(), *realloc(); ! #endif /* _IBMR2 */ ! extern char *AndrewDir(); /* from libutil.a */ extern void Prim_AND(); /* prmtives.c, line 1133 */ *************** *** 101,103 **** --- 106,109 ---- extern void Prim_UNBIND(); /* prmtives.c, line 3270 */ extern void Prim_UNBINDFN(); /* prmtives.c, line 3240 */ extern void Prim_VERSION(); /* prmtives.c, line 3539 */ + extern void Prim_CATCHERR(); *** overhead/eli/doc/procs.doc Wed Nov 22 13:39:14 1989 --- overhead/eli/doc/procs.doc.NEW Wed Jun 13 17:14:30 1990 *************** *** 1,4 **** ! \begindata{text,270286180} \textdsversion{12} \template{help} \define{index --- 1,4 ---- ! \begindata{text,269129432} \textdsversion{12} \template{help} \define{index *************** *** 143,151 **** commentary.} } ! \begindata{bp,269444728} ! \enddata{bp,269444728} ! \view{bpv,269444728,43,0,0} \section{1.5 Integer Manipulation } --- 143,151 ---- commentary.} } ! \begindata{bp,269114464} ! \enddata{bp,269114464} ! \view{bpv,269114464,0,0,0} \section{1.5 Integer Manipulation } *************** *** 543,551 **** 1)} returns \typewriter{NIL}.} ! \begindata{bp,270394696} ! \enddata{bp,270394696} ! \view{bpv,270394696,44,0,0} \section{1.6 String Manipulation } --- 543,551 ---- 1)} returns \typewriter{NIL}.} ! \begindata{bp,269191004} ! \enddata{bp,269191004} ! \view{bpv,269191004,1,0,0} \section{1.6 String Manipulation } *************** *** 1268,1276 **** GLICKSTEIN"}.} ! \begindata{bp,269461136} ! \enddata{bp,269461136} ! \view{bpv,269461136,45,0,0} \section{1.7 List Manipulation } --- 1268,1276 ---- GLICKSTEIN"}.} ! \begindata{bp,269396532} ! \enddata{bp,269396532} ! \view{bpv,269396532,2,0,0} \section{1.7 List Manipulation } *************** *** 1847,1855 **** d e)}.} ! \begindata{bp,270291584} ! \enddata{bp,270291584} ! \view{bpv,270291584,46,0,0} \section{1.8 Symbols, Binding, and Functions } --- 1847,1855 ---- d e)}.} ! \begindata{bp,269089292} ! \enddata{bp,269089292} ! \view{bpv,269089292,3,0,0} \section{1.8 Symbols, Binding, and Functions } *************** *** 2503,2511 **** }\leftindent{ELI primitive. } ! \begindata{bp,270291540} ! \enddata{bp,270291540} ! \view{bpv,270291540,47,0,0} \section{1.9 Iteration, Application, and Conditionals } --- 2503,2511 ---- }\leftindent{ELI primitive. } ! \begindata{bp,269089248} ! \enddata{bp,269089248} ! \view{bpv,269089248,4,0,0} \section{1.9 Iteration, Application, and Conditionals } *************** *** 3113,3121 **** }\leftindent{ELI primitive. } ! \begindata{bp,270291496} ! \enddata{bp,270291496} ! \view{bpv,270291496,48,0,0} \section{1.10 Input, Output and System interface } --- 3113,3121 ---- }\leftindent{ELI primitive. } ! \begindata{bp,269089204} ! \enddata{bp,269089204} ! \view{bpv,269089204,5,0,0} \section{1.10 Input, Output and System interface } *************** *** 3123,3134 **** ! \paragraph{\index{1.10.0.1 FILTER} }______________________________________________________ \typewriter{(filter \italic{timeout stdin command arg1 arg2 ... argn}) } --- 3123,3181 ---- ! \paragraph{\index{1.10.0.1 CATCHERR} }______________________________________________________ + \typewriter{(catcherr \italic{expr}) + + } + \bold{Parameters} + + \leftindent{\italic{Expr} is any valid Lisp expression. + + } + \bold{Description} + + CATCHERR evaluates its argument. If the evaluation succeeds, CATCHERR returns + a two-element list. The first element is the symbol \typewriter{T}, and the + second is the result of evaluating \italic{expr}. If the evaluation fails, + the list returned consists of the symbol \typewriter{NIL}, followed by a + string describing the type of error that occurred during evaluation, followed + by a string describing the particular error in detail, followed optionally by + a string describing giving a description of the Unix error that occurred (if + applicable), optionally followed by the particular expression that caused the + error (if available). If normal evaluation of \italic{expr} were to signal an + error, CATCHERR provides a way to circumvent that error condition. + + \leftindent{ + }\bold{Defined In + + }\leftindent{ELI primitive. + + } + \bold{Example} + + \leftindent{\typewriter{(catcherr (read "foobarbaz"))} returns the list + \typewriter{(NIL "Bad Argument" "ELI-PRIMITIVE [READ (error opening file)]" + "No such file or directory" "foobarbaz")}. + + + \typewriter{(catcherr (+ 1 2))} returns the list \typewriter{(T 3)}. + + } + ______________________________________________________ + + + + \paragraph{\index{1.10.0.2 FILTER} + + }______________________________________________________ + + + \typewriter{(filter \italic{timeout stdin command arg1 arg2 ... argn}) } *************** *** 3152,3158 **** \italic{command} to complete (a \italic{timeout} of 0 means "wait forever"). If the timeout period expires before \italic{command} completes, an error is signalled and \italic{command} is terminated. If \italic{timeout} is not ! supplied, a default of 300 (5 minutes) is used. } \bold{Description} --- 3199,3205 ---- \italic{command} to complete (a \italic{timeout} of 0 means "wait forever"). If the timeout period expires before \italic{command} completes, an error is signalled and \italic{command} is terminated. If \italic{timeout} is not ! supplied, a default of 300 seconds (5 minutes) is used. } \bold{Description} *************** *** 3160,3166 **** \leftindent{FILTER returns a list containing the integer exit status of \italic{command}, a string containing \italic{command}'s standard output, and a string containing \italic{command}'s diagnostic output (standard error), in ! that order.} \leftindent{ }\bold{Defined In --- 3207,3214 ---- \leftindent{FILTER returns a list containing the integer exit status of \italic{command}, a string containing \italic{command}'s standard output, and a string containing \italic{command}'s diagnostic output (standard error), in ! that order. If the exit status is 256 or greater, then \italic{command} ! exited abnormally and dumped core.} \leftindent{ }\bold{Defined In *************** *** 3188,3194 **** ! \paragraph{\index{1.10.0.2 GETENV} }______________________________________________________ --- 3236,3242 ---- ! \paragraph{\index{1.10.0.3 GETENV} }______________________________________________________ *************** *** 3218,3224 **** \leftindent{\typewriter{(getenv "PATH")} returns something like \typewriter{"/usr/local/bin:/usr/andrew/bin:/usr/ucb:/usr/bin"}. Note that ! environment variables are typically all-upper-case.} ______________________________________________________ --- 3266,3272 ---- \leftindent{\typewriter{(getenv "PATH")} returns something like \typewriter{"/usr/local/bin:/usr/andrew/bin:/usr/ucb:/usr/bin"}. Note that ! environment variable names are typically all-upper-case.} ______________________________________________________ *************** *** 3225,3231 **** ! \paragraph{\index{1.10.0.3 LOAD} }______________________________________________________ --- 3273,3279 ---- ! \paragraph{\index{1.10.0.4 LOAD} }______________________________________________________ *************** *** 3305,3311 **** ! \paragraph{\index{1.10.0.4 PRINT} }______________________________________________________ --- 3353,3359 ---- ! \paragraph{\index{1.10.0.5 PRINT} }______________________________________________________ *************** *** 3334,3340 **** ! \paragraph{\index{1.10.0.5 PRINTF} }______________________________________________________ --- 3382,3388 ---- ! \paragraph{\index{1.10.0.6 PRINTF} }______________________________________________________ *************** *** 3390,3396 **** ! \paragraph{\index{1.10.0.6 PUTS} }______________________________________________________ --- 3438,3444 ---- ! \paragraph{\index{1.10.0.7 PUTS} }______________________________________________________ *************** *** 3435,3441 **** ! \paragraph{\index{1.10.0.7 READ} }______________________________________________________ --- 3483,3489 ---- ! \paragraph{\index{1.10.0.8 READ} }______________________________________________________ *************** *** 3468,3474 **** ! \paragraph{\index{1.10.0.8 SYSTEM} }______________________________________________________ --- 3516,3522 ---- ! \paragraph{\index{1.10.0.9 SYSTEM} }______________________________________________________ *************** *** 3505,3511 **** ! \paragraph{\index{1.10.0.9 TERPRI} }______________________________________________________ --- 3553,3559 ---- ! \paragraph{\index{1.10.0.10 TERPRI} }______________________________________________________ *************** *** 3530,3538 **** }\leftindent{ELI primitive. } ! \begindata{bp,269535112} ! \enddata{bp,269535112} ! \view{bpv,269535112,49,0,0} \section{1.11 Debugging } --- 3578,3586 ---- }\leftindent{ELI primitive. } ! \begindata{bp,269089160} ! \enddata{bp,269089160} ! \view{bpv,269089160,6,0,0} \section{1.11 Debugging } *************** *** 3683,3686 **** }\leftindent{ELI primitive. } ! \enddata{text,270286180} --- 3731,3734 ---- }\leftindent{ELI primitive. } ! \enddata{text,269129432} *** overhead/fonts/fonts/programs/Imakefile Wed Nov 22 13:46:12 1989 --- overhead/fonts/fonts/programs/Imakefile.NEW Fri Jul 13 13:20:49 1990 *************** *** 20,25 **** --- 20,26 ---- DeclareFont(mailft12) NSDeclareFont(shape10) DeclareFont(tri10) + DeclareFont(andyoffice12) #ifdef X11_ENV DeclareFont(xshape10) *** overhead/fonts/fonts/programs/andyoffice12.fdb Fri Jul 27 14:29:29 1990 --- overhead/fonts/fonts/programs/andyoffice12.fdb.NEW Fri Jul 13 13:21:43 1990 *************** *** 0 **** --- 1,1359 ---- + $magic 509 + $fontname andyoffice12 + $familyname andyoffice + $rotation 0 + $pointsize 12 + $Comment Copyright (c) 1984 Adobe Systems, Inc. + $Comment /adobe/fonttools/bitmaps/stdfontvec.ps HM14.bits + $Comment TOTAL BITMAP BYTES 1442 + $Comment GUIDELINES -3 0 8 11 DONE + $Comment WIDTHERR -96 -229 + $MaxNWtoOrigin 0,10 + $MaxNtoS 0,14 + $MaxWtoE 17,0 + $MaxWbase 0,0 + $MaxNewline 0,14 + $FontRepresentationType 1 BitmapIcon + $NIcons 128 + $character 32 sp + $spacing 4,0 + $character 33 ! + $box 1,11 + $origin -2,10 + $spacing 4,0 + $raster + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 0000 + 8000 + 8000 + $character 34 " + $box 3,3 + $origin -1,10 + $spacing 5,0 + $raster + A000 + A000 + A000 + $character 35 # + $box 7,10 + $origin 0,9 + $spacing 8,0 + $raster + 1400 + 1400 + 1400 + 7E00 + 2800 + 2800 + FC00 + 5000 + 5000 + 5000 + $character 36 $ + $box 7,13 + $origin 0,10 + $spacing 8,0 + $raster + 1000 + 7C00 + 9200 + 9200 + 9000 + 7C00 + 1200 + 1200 + 9200 + 9200 + 7C00 + 1000 + 1000 + $character 37 % + $box 11,11 + $origin 0,10 + $spacing 12,0 + $raster + 7080 + 8900 + 8900 + 7200 + 0200 + 0400 + 0800 + 09C0 + 1220 + 1220 + 21C0 + $character 38 & + $box 8,10 + $origin -1,9 + $spacing 10,0 + $raster + 3000 + 4800 + 4800 + 3000 + 2000 + 5100 + 8A00 + 8400 + 8A00 + 7100 + $character 39 ' + $box 2,3 + $origin -1,10 + $spacing 3,0 + $raster + C000 + 4000 + 8000 + $character 40 ( + $box 3,14 + $origin -1,10 + $spacing 5,0 + $raster + 2000 + 4000 + 4000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 4000 + 4000 + 2000 + $character 41 ) + $box 3,14 + $origin -1,10 + $spacing 5,0 + $raster + 8000 + 4000 + 4000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 4000 + 4000 + 8000 + $character 42 * + $box 5,5 + $origin -1,10 + $spacing 7,0 + $raster + 2000 + A800 + 7000 + A800 + 2000 + $character 43 + + $box 7,7 + $origin -1,7 + $spacing 9,0 + $raster + 1000 + 1000 + 1000 + FE00 + 1000 + 1000 + 1000 + $character 44 , + $box 2,4 + $origin 0,1 + $spacing 3,0 + $raster + 4000 + 4000 + 4000 + 8000 + $character 45 - + $box 5,1 + $origin -1,4 + $spacing 6,0 + $raster + F800 + $character 46 . + $box 1,2 + $origin -1,1 + $spacing 3,0 + $raster + 8000 + 8000 + $character 47 / + $box 4,11 + $origin 0,10 + $spacing 4,0 + $raster + 1000 + 1000 + 2000 + 2000 + 2000 + 4000 + 4000 + 4000 + 8000 + 8000 + 8000 + $character 48 0 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 8400 + 8400 + 8400 + 8400 + 8400 + 8400 + 7800 + $character 49 1 + $box 3,10 + $origin -2,9 + $spacing 7,0 + $raster + 2000 + E000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + $character 50 2 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 0400 + 0800 + 1000 + 2000 + 4000 + 8000 + FC00 + $character 51 3 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 0400 + 3800 + 0400 + 0400 + 8400 + 8400 + 7800 + $character 52 4 + $box 7,10 + $origin -1,9 + $spacing 8,0 + $raster + 0C00 + 1400 + 2400 + 4400 + 8400 + 8400 + FE00 + 0400 + 0400 + 0400 + $character 53 5 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + FC00 + 8000 + 8000 + F800 + 0400 + 0400 + 0400 + 8400 + 8400 + 7800 + $character 54 6 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + 7800 + 8400 + 8000 + 8000 + F800 + 8400 + 8400 + 8400 + 8400 + 7800 + $character 55 7 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + FC00 + 0400 + 0800 + 0800 + 1000 + 1000 + 2000 + 2000 + 4000 + 4000 + $character 56 8 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 8400 + 7800 + 8400 + 8400 + 8400 + 8400 + 7800 + $character 57 9 + $box 6,10 + $origin -1,9 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 8400 + 8400 + 7C00 + 0400 + 0400 + 8400 + 7800 + $character 58 : + $box 1,7 + $origin -1,7 + $spacing 3,0 + $raster + 8000 + 8000 + 0000 + 0000 + 0000 + 8000 + 8000 + $character 59 ; + $box 2,10 + $origin 0,7 + $spacing 4,0 + $raster + 4000 + 4000 + 0000 + 0000 + 0000 + 0000 + 4000 + 4000 + 4000 + 8000 + $character 60 < + $box 6,5 + $origin -1,6 + $spacing 8,0 + $raster + 0C00 + 3000 + C000 + 3000 + 0C00 + $character 61 = + $box 6,3 + $origin -2,5 + $spacing 9,0 + $raster + FC00 + 0000 + FC00 + $character 62 > + $box 6,5 + $origin -1,6 + $spacing 8,0 + $raster + C000 + 3000 + 0C00 + 3000 + C000 + $character 63 ? + $box 6,11 + $origin -1,10 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 8400 + 0800 + 1000 + 2000 + 2000 + 0000 + 2000 + 2000 + $character 64 @ + $box 17,1 + $spacing 17,0 + $raster + 00000000 + $character 65 A + $box 16,10 + $origin 0,9 + $spacing 17,0 + $raster + 3C00 + 4200 + 81F8 + 8004 + 8004 + 8004 + 8004 + 8004 + 8004 + FFFC + $character 66 B + $box 16,10 + $origin 0,9 + $spacing 17,0 + $raster + 3C00 + 4200 + 81F8 + 8004 + 9FFF + 9001 + A002 + A002 + C004 + FFFC + $character 67 C + $box 16,11 + $origin 0,10 + $spacing 17,0 + $raster + 0100 + 0280 + 0440 + 0820 + 1010 + 2008 + 1010 + 0820 + 0440 + 0280 + 0100 + $character 68 D + $box 16,11 + $origin 0,10 + $spacing 17,0 + $raster + 0FE0 + 0850 + 0848 + 0878 + 0808 + 0808 + 0808 + 0808 + 0808 + 0808 + 0FF8 + $character 69 E + $box 16,11 + $origin 0,10 + $spacing 17,0 + $raster + 0FE0 + 0850 + 0848 + 0038 + 0D88 + 1248 + 2D88 + 4108 + 8A08 + AA88 + 4D38 + $character 70 F + $box 16,11 + $origin 0,10 + $spacing 17,0 + $raster + 0FE0 + 0850 + 0848 + 0B78 + 0508 + 0A08 + 1408 + 2808 + 5008 + E808 + 4FF8 + $character 71 G + $box 16,11 + $origin 0,10 + $spacing 17,0 + $raster + 03E0 + 0FF8 + 0808 + 0FF8 + 0410 + 0550 + 0550 + 0550 + 0550 + 0410 + 07F0 + $character 72 H + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 0000 + FF80 + 8080 + 8080 + 8080 + 8080 + 8080 + 8080 + 8080 + FF80 + $character 73 I + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 0000 + FF80 + C180 + A280 + 9480 + 8880 + 9480 + A280 + C180 + FF80 + $character 74 J + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 00C0 + FDC0 + 8380 + 8300 + 8680 + 8680 + EC80 + BC80 + 9880 + FF80 + $character 75 K + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 00C0 + 01C0 + 0380 + 0300 + 0600 + 0600 + 6C00 + 3C00 + 1800 + 0800 + $character 76 L + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 0000 + C0C0 + 6180 + 3300 + 1E00 + 0C00 + 1E00 + 3300 + 6180 + C0C0 + $character 77 M + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 0000 + FF80 + FF80 + FF80 + FF80 + FF80 + FF80 + FF80 + FF80 + FF80 + $character 78 N + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 0000 + 3E00 + 7F00 + FF80 + FF80 + FF80 + FF80 + FF80 + 7F00 + 3E00 + $character 79 O + $box 10,11 + $origin -1,10 + $spacing 12,0 + $raster + 0000 + 0000 + 3E00 + 4100 + 8080 + 8080 + 8080 + 8080 + 8080 + 4100 + 3E00 + $character 80 P + $box 7,11 + $origin -1,10 + $spacing 9,0 + $raster + FC00 + 8200 + 8200 + 8200 + 8200 + FC00 + 8000 + 8000 + 8000 + 8000 + 8000 + $character 81 Q + $box 9,11 + $origin -1,10 + $spacing 11,0 + $raster + 1C00 + 6300 + 4100 + 8080 + 8080 + 8080 + 8080 + 8480 + 4300 + 6300 + 1C80 + $character 82 R + $box 7,11 + $origin -1,10 + $spacing 9,0 + $raster + FC00 + 8200 + 8200 + 8200 + 8200 + FC00 + 8400 + 8200 + 8200 + 8200 + 8200 + $character 83 S + $box 7,11 + $origin -1,10 + $spacing 9,0 + $raster + 3800 + 4400 + 8200 + 8000 + 6000 + 1800 + 0400 + 0200 + 8200 + 4400 + 3800 + $character 84 T + $box 9,11 + $origin 0,10 + $spacing 9,0 + $raster + FF80 + 0800 + 0800 + 0800 + 0800 + 0800 + 0800 + 0800 + 0800 + 0800 + 0800 + $character 85 U + $box 8,11 + $origin -1,10 + $spacing 10,0 + $raster + 8100 + 8100 + 8100 + 8100 + 8100 + 8100 + 8100 + 8100 + 8100 + 4200 + 3C00 + $character 86 V + $box 9,11 + $origin -1,10 + $spacing 11,0 + $raster + 8080 + 8080 + 4100 + 4100 + 4100 + 2200 + 2200 + 1400 + 1400 + 0800 + 0800 + $character 87 W + $box 13,11 + $origin -1,10 + $spacing 15,0 + $raster + 8208 + 8208 + 8508 + 4510 + 4510 + 4510 + 28A0 + 28A0 + 28A0 + 1040 + 1040 + $character 88 X + $box 8,11 + $origin -1,10 + $spacing 10,0 + $raster + 8100 + 4200 + 4200 + 2400 + 1800 + 1800 + 2400 + 2400 + 4200 + 8100 + 8100 + $character 89 Y + $box 9,11 + $origin 0,10 + $spacing 9,0 + $raster + 8080 + 4100 + 4100 + 2200 + 2200 + 1400 + 0800 + 0800 + 0800 + 0800 + 0800 + $character 90 Z + $box 7,11 + $origin -1,10 + $spacing 9,0 + $raster + FE00 + 0200 + 0400 + 0800 + 0800 + 1000 + 2000 + 2000 + 4000 + 8000 + FE00 + $character 91 [ + $box 3,14 + $origin -1,10 + $spacing 4,0 + $raster + E000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + E000 + $character 92 \ + $box 4,11 + $origin 0,10 + $spacing 4,0 + $raster + 8000 + 8000 + 4000 + 4000 + 4000 + 2000 + 2000 + 2000 + 1000 + 1000 + 1000 + $character 93 ] + $box 3,14 + $origin 0,10 + $spacing 4,0 + $raster + E000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + E000 + $character 94 ^ + $box 5,3 + $origin -1,10 + $spacing 7,0 + $raster + 2000 + 5000 + 8800 + $character 95 _ + $box 8,1 + $origin 0,-3 + $spacing 8,0 + $raster + FF00 + $character 96 ` + $box 2,3 + $origin 0,10 + $spacing 3,0 + $raster + 4000 + 8000 + C000 + $character 97 a + $box 7,8 + $origin -1,7 + $spacing 8,0 + $raster + 7800 + 8400 + 0400 + 7C00 + 8400 + 8400 + 8C00 + 7600 + $character 98 b + $box 6,11 + $origin -1,10 + $spacing 8,0 + $raster + 8000 + 8000 + 8000 + B800 + C400 + 8400 + 8400 + 8400 + 8400 + C400 + B800 + $character 99 c + $box 6,8 + $origin -1,7 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + 8000 + 8000 + 8000 + 8400 + 7800 + $character 100 d + $box 6,11 + $origin -1,10 + $spacing 8,0 + $raster + 0400 + 0400 + 0400 + 7400 + 8C00 + 8400 + 8400 + 8400 + 8400 + 8C00 + 7400 + $character 101 e + $box 6,8 + $origin -1,7 + $spacing 8,0 + $raster + 7800 + 8400 + 8400 + FC00 + 8000 + 8000 + 8400 + 7800 + $character 102 f + $box 4,11 + $origin 0,10 + $spacing 5,0 + $raster + 3000 + 4000 + 4000 + F000 + 4000 + 4000 + 4000 + 4000 + 4000 + 4000 + 4000 + $character 103 g + $box 6,11 + $origin -1,7 + $spacing 8,0 + $raster + 7400 + 8C00 + 8400 + 8400 + 8400 + 8400 + 8C00 + 7400 + 0400 + 8400 + 7800 + $character 104 h + $box 4,5 + $origin -1,7 + $spacing 11,0 + $raster + 0000 + F000 + 9000 + 9000 + F000 + $character 105 i + $box 1,11 + $origin -1,10 + $spacing 3,0 + $raster + 8000 + 8000 + 0000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + $character 106 j + $box 3,14 + $origin 0,10 + $spacing 4,0 + $raster + 2000 + 2000 + 0000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + 2000 + C000 + $character 107 k + $box 6,11 + $origin -1,10 + $spacing 7,0 + $raster + 8000 + 8000 + 8000 + 8800 + 9000 + A000 + C000 + A000 + 9000 + 8800 + 8400 + $character 108 l + $box 1,11 + $origin -1,10 + $spacing 3,0 + $raster + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + $character 109 m + $box 4,5 + $origin -1,7 + $spacing 11,0 + $raster + 0000 + F000 + F000 + F000 + F000 + $character 110 n + $box 4,5 + $origin -1,7 + $spacing 11,0 + $raster + 0000 + 6000 + F000 + F000 + 6000 + $character 111 o + $box 4,5 + $origin -1,7 + $spacing 11,0 + $raster + 0000 + 6000 + 9000 + 9000 + 6000 + $character 112 p + $box 6,11 + $origin -1,7 + $spacing 8,0 + $raster + B800 + C400 + 8400 + 8400 + 8400 + 8400 + C400 + B800 + 8000 + 8000 + 8000 + $character 113 q + $box 6,11 + $origin -1,7 + $spacing 8,0 + $raster + 7400 + 8C00 + 8400 + 8400 + 8400 + 8400 + 8C00 + 7400 + 0400 + 0400 + 0400 + $character 114 r + $box 4,8 + $origin -1,7 + $spacing 5,0 + $raster + B000 + C000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + $character 115 s + $box 6,8 + $origin -1,7 + $spacing 8,0 + $raster + 7800 + 8400 + 8000 + 6000 + 1800 + 0400 + 8400 + 7800 + $character 116 t + $box 4,10 + $origin 0,9 + $spacing 5,0 + $raster + 4000 + 4000 + F000 + 4000 + 4000 + 4000 + 4000 + 4000 + 4000 + 3000 + $character 117 u + $box 6,8 + $origin -1,7 + $spacing 8,0 + $raster + 8400 + 8400 + 8400 + 8400 + 8400 + 8400 + 8C00 + 7400 + $character 118 v + $box 6,8 + $origin -1,7 + $spacing 8,0 + $raster + 8400 + 8400 + 8400 + 4800 + 4800 + 4800 + 3000 + 3000 + $character 119 w + $box 9,8 + $origin 0,7 + $spacing 9,0 + $raster + 8880 + 8880 + 8880 + 4900 + 4900 + 5500 + 2200 + 2200 + $character 120 x + $box 7,8 + $origin 0,7 + $spacing 8,0 + $raster + 8200 + 4400 + 2800 + 1000 + 1000 + 2800 + 4400 + 8200 + $character 121 y + $box 7,11 + $origin 0,7 + $spacing 8,0 + $raster + 8200 + 8200 + 4400 + 4400 + 2400 + 2800 + 1800 + 1000 + 1000 + 1000 + 6000 + $character 122 z + $box 6,8 + $origin 0,7 + $spacing 7,0 + $raster + FC00 + 0400 + 0800 + 1000 + 2000 + 4000 + 8000 + FC00 + $character 123 { + $box 5,14 + $origin 0,10 + $spacing 5,0 + $raster + 1800 + 2000 + 2000 + 2000 + 2000 + 4000 + 8000 + 4000 + 2000 + 2000 + 2000 + 2000 + 2000 + 1800 + $character 124 | + $box 1,14 + $origin -1,10 + $spacing 3,0 + $raster + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + 8000 + $character 125 } + $box 5,14 + $origin 0,10 + $spacing 5,0 + $raster + C000 + 2000 + 2000 + 2000 + 2000 + 1000 + 0800 + 1000 + 2000 + 2000 + 2000 + 2000 + 2000 + C000 + $character 126 ~ + $box 6,3 + $origin -1,5 + $spacing 8,0 + $raster + 6400 + B400 + 9800 + $end *** overhead/index/index.c Wed Nov 22 13:48:45 1989 --- overhead/index/index.c.NEW Fri Jul 13 11:41:59 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/index/RCS/index.c,v 2.3 89/02/10 23:14:23 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/index/RCS/index.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/index/RCS/index.c,v 2.3 89/02/10 23:14:23 ghoti Exp $ "; #endif /* lint */ #include /* sys/types.h sys/file.h */ --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/index/RCS/index.c,v 2.4 90/07/12 14:40:43 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/index/RCS/index.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/index/RCS/index.c,v 2.4 90/07/12 14:40:43 gk5g Exp $ "; #endif /* lint */ #include /* sys/types.h sys/file.h */ *************** *** 322,328 **** strcat(tpath, "/"); sprintf(tbuffer, "H%d", ahash); strcat(tpath, tbuffer); ! return fopen(tpath, (awrite? "w+" : "r"), 0666); } /* --- 322,328 ---- strcat(tpath, "/"); sprintf(tbuffer, "H%d", ahash); strcat(tpath, tbuffer); ! return fopen(tpath, (awrite? "w+" : "r")); } /* *** overhead/mail/hdrs/mail.h Wed Jan 17 16:39:55 1990 --- overhead/mail/hdrs/mail.h.NEW Mon Jun 25 10:04:47 1990 *************** *** 8,14 **** extern char *ams_genid(); /* Generates a world-unique identifier; Boolean parameter specifies whether or not to generate a long name */ extern char *convlongto64(); /* converts a long and padding to 6 bytes base 64 */ ! extern unsigned long *conv64tolong(); /* reverses the above conversion, basically */ extern char *arpadate(); /* Returns pointer to current ASCII date string in RFC821 format */ extern char *EX_Messages[]; /* Text messages for sysexits.h */ extern int EX_Nerr; /* Number of error messages in above table */ --- 8,14 ---- extern char *ams_genid(); /* Generates a world-unique identifier; Boolean parameter specifies whether or not to generate a long name */ extern char *convlongto64(); /* converts a long and padding to 6 bytes base 64 */ ! extern unsigned long conv64tolong(); /* reverses the above conversion, basically */ extern char *arpadate(); /* Returns pointer to current ASCII date string in RFC821 format */ extern char *EX_Messages[]; /* Text messages for sysexits.h */ extern int EX_Nerr; /* Number of error messages in above table */ *** overhead/mail/lib/unscribe.c Wed Nov 22 13:51:53 1989 --- overhead/mail/lib/unscribe.c.NEW Mon Apr 23 14:02:31 1990 *************** *** 371,377 **** if (State->justify == JUSTIFY_CENTER) i = (width - len) / 2; else if (State->justify == JUSTIFY_RIGHT) i = width - len; else i = 0; /* default to JUSTIFY_LEFT */ ! while (i--) { putc(' ', fPtr); NumWritten++; } /* shove out the actual text */ if (len) { --- 371,377 ---- if (State->justify == JUSTIFY_CENTER) i = (width - len) / 2; else if (State->justify == JUSTIFY_RIGHT) i = width - len; else i = 0; /* default to JUSTIFY_LEFT */ ! while ((i--) > 0) { putc(' ', fPtr); NumWritten++; } /* shove out the actual text */ if (len) { *** overhead/mail/lib/arpadate.c Wed Nov 22 13:50:24 1989 --- overhead/mail/lib/arpadate.c.NEW Thu May 10 16:37:59 1990 *************** *** 11,17 **** char *arpadate() { ! static char time_out[] = "Mon, 03 Feb 86 10:54:23 +HHMM (MEZ AUSSS FMT 664)\n"; static char *days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", --- 11,17 ---- char *arpadate() { ! static char time_out[] = "Mon, 03 Feb 1986 10:54:23 +HHMM (MEZ AUSSS FMT 664)\n"; static char *days[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; static char *months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", *************** *** 59,69 **** else sprintf(ZoneComment, " (%s)", zone); ! sprintf(time_out, "%s, %2d %s %02d %02d:%02d:%02d %c%02d%02d%s\n", days[now->tm_wday], now->tm_mday, months[now->tm_mon], ! now->tm_year%100, now->tm_hour, now->tm_min, now->tm_sec, OffsetSign, OffsetHours, OffsetMinutes, ZoneComment); --- 59,69 ---- else sprintf(ZoneComment, " (%s)", zone); ! sprintf(time_out, "%s, %2d %s %4d %02d:%02d:%02d %c%02d%02d%s\n", days[now->tm_wday], now->tm_mday, months[now->tm_mon], ! now->tm_year + 1900, now->tm_hour, now->tm_min, now->tm_sec, OffsetSign, OffsetHours, OffsetMinutes, ZoneComment); *** overhead/mail/lib/amsauth.c Wed Jan 17 16:39:56 1990 --- overhead/mail/lib/amsauth.c.NEW Wed Jun 13 17:15:40 1990 *************** *** 7,13 **** Keep track of the current AMSHome cell. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/mail/lib/RCS/amsauth.c,v 2.13 89/12/14 13:50:20 cfe Exp $"; #include #include --- 7,13 ---- Keep track of the current AMSHome cell. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/mail/lib/RCS/amsauth.c,v 2.14 90/06/04 11:33:28 gk5g Exp $"; #include #include *************** *** 22,29 **** --- 22,31 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ static struct CellAuth *AMSHome = NULL; static int AMSHomeVal = -1; *** overhead/mail/lib/authret.c Wed Jan 17 16:39:58 1990 --- overhead/mail/lib/authret.c.NEW Wed Jun 13 17:15:42 1990 *************** *** 7,13 **** Handy functions to build authentication and return-path information. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/mail/lib/RCS/authret.c,v 2.7 89/12/12 15:09:04 ghoti Exp $"; #include #include --- 7,13 ---- Handy functions to build authentication and return-path information. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/mail/lib/RCS/authret.c,v 2.9 90/06/04 11:34:18 gk5g Exp $"; #include #include *************** *** 23,30 **** --- 23,33 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ + int GetAuthInfo(FName, pBuff) char *FName, **pBuff; *************** *** 146,152 **** main () { char *Whatever; int RC, Ix; ! char *FNs[] = {"/afs/andrew.cmu.edu/usr13/cfe", "/tmp", "/afs/.cs.cmu.edu", "/afs/not/here"}; #define numFNs (sizeof(FNs) / sizeof(FNs[0])) CheckServiceConfiguration(); printf("Testing file-relative authentication lines and return-paths.\n"); --- 149,155 ---- main () { char *Whatever; int RC, Ix; ! static char *FNs[] = {"/afs/andrew.cmu.edu/usr13/cfe", "/tmp", "/afs/.cs.cmu.edu", "/afs/not/here"}; #define numFNs (sizeof(FNs) / sizeof(FNs[0])) CheckServiceConfiguration(); printf("Testing file-relative authentication lines and return-paths.\n"); *** overhead/mail/lib/ckamsdel.c Wed Nov 22 13:50:32 1989 --- overhead/mail/lib/ckamsdel.c.NEW Wed Jun 13 17:15:46 1990 *************** *** 7,13 **** Check for AMS delivery system attributes in domains that may not even be cells. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/mail/lib/RCS/ckamsdel.c,v 2.16 89/05/22 16:17:30 cfe Exp $"; #include #include --- 7,13 ---- Check for AMS delivery system attributes in domains that may not even be cells. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/mail/lib/RCS/ckamsdel.c,v 2.17 90/06/04 11:34:23 gk5g Exp $"; #include #include *************** *** 20,27 **** --- 20,30 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ + /* Private structure to retain information about each domain asked for. */ static struct AMSConfig { *** overhead/mail/lib/dropoff.c Wed Nov 22 13:50:48 1989 --- overhead/mail/lib/dropoff.c.NEW Thu May 10 16:38:06 1990 *************** *** 631,637 **** SMVec[i+2] = tolist[i]; } SMVec[i+2] = NULL; ! fp = qopen(oldsendmail, SMVec, "w"); if (!fp) { sprintf(Dropoff_ErrMsg, "Can't qopen ``%s'': %s", oldsendmail, UnixError(errno)); close(f); --- 631,637 ---- SMVec[i+2] = tolist[i]; } SMVec[i+2] = NULL; ! fp = (FILE *) qopen(oldsendmail, SMVec, "w"); if (!fp) { sprintf(Dropoff_ErrMsg, "Can't qopen ``%s'': %s", oldsendmail, UnixError(errno)); close(f); *** overhead/mail/lib/mailconf.c Wed Jan 17 16:40:01 1990 --- overhead/mail/lib/mailconf.c.NEW Wed Jun 13 17:15:49 1990 *************** *** 20,26 **** #include ! extern char *malloc(), *index(), *rindex(); extern int errno; /* MAIL SYSTEM CONFIGURATION */ --- 20,30 ---- #include ! #ifndef _IBMR2 ! extern char *malloc(); ! #endif /* _IBMR2 */ ! ! extern char *index(), *rindex(); extern int errno; /* MAIL SYSTEM CONFIGURATION */ *** overhead/mail/lib/parseutl.c Wed Nov 22 13:51:07 1989 --- overhead/mail/lib/parseutl.c.NEW Wed Jun 13 17:15:51 1990 *************** *** 13,19 **** --- 13,21 ---- #define NIL 0 + #ifndef _IBMR2 extern char *malloc(); + #endif /* _IBMR2 */ NoStorage(proc) char *proc; *** overhead/mail/lib/scan822.c Wed Nov 22 13:51:43 1989 --- overhead/mail/lib/scan822.c.NEW Wed Jun 13 17:15:56 1990 *************** *** 7,13 **** --- 7,17 ---- #include #include /* strings.h */ #include + + #ifndef _IBMR2 extern char *malloc(), *realloc(); + #endif /* _IBMR2 */ + #include #include "mail.h" *** overhead/mail/lib/vmail.c Wed Nov 22 13:52:13 1989 --- overhead/mail/lib/vmail.c.NEW Thu May 10 16:38:09 1990 *************** *** 538,550 **** close(f); continue; case LOCK_FAILED_ERROR: return EX_CANTCREAT; ! case LOCK_FAILED_TEMP_ERROR: return EX_TEMPFAIL; default: sprintf(VM_text, "Impossible lock value for ``%s'': %d", msgfilename, value); VM_errordetail = vm_InternalError; return EX_SOFTWARE; } } --- 538,553 ---- close(f); continue; case LOCK_FAILED_ERROR: + close(f); return EX_CANTCREAT; ! case LOCK_FAILED_TEMP_ERROR: ! close(f); return EX_TEMPFAIL; default: sprintf(VM_text, "Impossible lock value for ``%s'': %d", msgfilename, value); VM_errordetail = vm_InternalError; + close(f); return EX_SOFTWARE; } } *************** *** 569,574 **** --- 572,578 ---- sprintf(VM_text, "Fdopen failed for ``%s'': %s", msgfilename, UnixError(errno)); VM_errordetail = vm_OutOfMemory; + close(f); return EX_TEMPFAIL; } *** overhead/malloc/Imakefile Wed Nov 29 18:03:20 1989 --- overhead/malloc/Imakefile.NEW Wed Jun 13 17:16:13 1990 *************** *** 1,18 **** /* ********************************************************************** *\ ! * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ DependTarget() ! DEFINES = -DWORD=$(MALLOCALIGNMENT) -DMSTATS #ifdef ANDREW_MALLOC_ENV NormalObjectRule() LibraryTarget(libmalloc.a, malloc.o plumber.o) - InstallLibrary(libmalloc.a, $(DESTDIR)/lib) LibraryTarget(libplumber.a, pmalloc.o pplumber.o) InstallLibrary(libplumber.a, $(DESTDIR)/lib) InstallFile(malloc.h, $(INSTINCFLAGS), $(DESTDIR)/include) - #endif InstallDocs(malloc.help, ${DESTDIR}/help) --- 1,32 ---- /* ********************************************************************** *\ ! * Copyright IBM Corporation 1988,1990 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ DependTarget() ! DEFINES = -DWORD=$(MALLOCALIGNMENT) -DMSTATS #ifdef ANDREW_MALLOC_ENV NormalObjectRule() + + + #if (defined(sun4) || defined(sparc)) + + NormalAsmPPRule() + LibraryTarget(libmalloc.a, malloc.o getcallr.o plumber.o) + LibraryTarget(libplumber.a, pmalloc.o getcallr.o pplumber.o) + + #else /* defined(sun4) || defined(sparc) */ + LibraryTarget(libmalloc.a, malloc.o plumber.o) LibraryTarget(libplumber.a, pmalloc.o pplumber.o) + + #endif /* defined(sun4) || defined(sparc) */ + + + InstallLibrary(libmalloc.a, $(DESTDIR)/lib) InstallLibrary(libplumber.a, $(DESTDIR)/lib) InstallFile(malloc.h, $(INSTINCFLAGS), $(DESTDIR)/include) InstallDocs(malloc.help, ${DESTDIR}/help) + #endif *** overhead/malloc/imalloc.h Wed Jan 17 16:40:06 1990 --- overhead/malloc/imalloc.h.NEW Wed Jun 13 17:16:16 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/malloc/RCS/imalloc.h,v 2.7 89/12/12 15:09:15 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/overhead/malloc/RCS/imalloc.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/malloc/RCS/imalloc.h,v 2.7 89/12/12 15:09:15 ghoti Exp $ "; #endif /* --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/imalloc.h,v 2.8 90/06/11 15:20:31 wjh Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/imalloc.h,v $ */ #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) ! static char *rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/imalloc.h,v 2.8 90/06/11 15:20:31 wjh Exp $ "; #endif /* *************** *** 63,74 **** #define clearbit(p, b) ((p)&~(b)) #define NEXTBLOCK(p) ((struct freehdr *)((INT)p+clearbits(p->Size))) #define PREVFRONT(p) ((((struct freetrlr *)(p))-1)->Front) - - #ifdef ibm032 - #define RETADDROFF (6) - #else - #define RETADDROFF (1) - #endif #ifndef IDENTIFY --- 63,68 ---- *** overhead/malloc/malloc.ci Wed Jan 17 16:40:04 1990 --- overhead/malloc/malloc.ci.NEW Fri Jul 13 11:42:19 1990 *************** *** 1,13 **** /* ********************************************************************** *\ ! * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/malloc/RCS/malloc.ci,v 2.8 89/12/12 15:09:20 ghoti Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/overhead/malloc/RCS/malloc.ci,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/malloc/RCS/malloc.ci,v 2.8 89/12/12 15:09:20 ghoti Exp $ "; #endif /* lint */ /* --- 1,13 ---- /* ********************************************************************** *\ ! * Copyright IBM Corporation 1988,1990 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/malloc.ci,v 2.11 90/06/11 15:19:40 wjh Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/malloc.ci,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/malloc.ci,v 2.11 90/06/11 15:19:40 wjh Exp $ "; #endif /* lint */ /* *************** *** 43,55 **** block of the arena segment. They also serve to guarantee that the free list will never be empty. ! */ #include ! #include "malloc.h" ! #include "imalloc.h" static char msgbuf[200]; #define ferr4(fmt, a, b, c, d) {sprintf(msgbuf, fmt, a, b, c, d); \ write(2, msgbuf, strlen(msgbuf));} --- 43,62 ---- block of the arena segment. They also serve to guarantee that the free list will never be empty. ! June 1990 ! move include of andrewos.h so bcopy is done right ! introduce GETCALLER because SPARC register conventions ! require an assembler routine */ #include ! #include ! #include ! #include ! #include ! #include + static char msgbuf[200]; #define ferr4(fmt, a, b, c, d) {sprintf(msgbuf, fmt, a, b, c, d); \ write(2, msgbuf, strlen(msgbuf));} *************** *** 278,294 **** A.RecurringM0 = 0; #ifdef IDENTIFY if (v) { - #if ( defined(vax) | defined(mips) ) - char **mpp; - #endif /* vax|mips */ - struct hdr *t = ((struct hdr *)v)-1; ! #if ( defined(vax) | defined(mips) ) ! mpp = (((char **)&nbytes) - RETADDROFF); ! t->caller = *mpp; ! #else /* vax|mips */ ! t->caller = *(((char **)&nbytes) - RETADDROFF); ! #endif /* vax|mips */ t->seqno = A.SeqNo++; } #endif /* IDENTIFY */ --- 285,292 ---- A.RecurringM0 = 0; #ifdef IDENTIFY if (v) { struct hdr *t = ((struct hdr *)v)-1; ! GETCALLER(nbytes, t->caller); t->seqno = A.SeqNo++; } #endif /* IDENTIFY */ *************** *** 355,376 **** A.InProgress --; #ifdef IDENTIFY ! #if ( defined(vax) | defined(mips) ) ! { ! register char **mpp; ! mpp = (((char **)&nbytes) - RETADDROFF); ! p->caller = *mpp; ! } ! #else /* vax|mips */ ! p->caller = *(((char **)&nbytes) - RETADDROFF); ! #endif /* vax|mips */ p->seqno = A.SeqNo++; #endif /* IDENTIFY */ if (CheckLevel >=4) { ! int *ap = (int *)&nbytes; ferr3("malloc @ 0x%lx for %d bytes returns 0x%lx\n", ! *(ap-RETADDROFF), *ap, ! ((char *)p) + sizeof(struct hdr)); } return ((char *)p) + sizeof(struct hdr); --- 353,366 ---- A.InProgress --; #ifdef IDENTIFY ! GETCALLER(nbytes, p->caller); p->seqno = A.SeqNo++; #endif /* IDENTIFY */ if (CheckLevel >=4) { ! char *retad; ! GETCALLER(nbytes, retad); ferr3("malloc @ 0x%lx for %d bytes returns 0x%lx\n", ! retad, nbytes, ((char *)p) + sizeof(struct hdr)); } return ((char *)p) + sizeof(struct hdr); *************** *** 517,527 **** register struct freehdr *f = (struct freehdr *)(((char *)ap) - sizeof(struct hdr)); register struct freehdr *t = NEXTBLOCK(f); if (CheckLevel >= 4) { ! int *app = (int *)≈ ferr3("free @ 0x%lx for block of %d bytes at 0x%lx enqueued\n", ! *(app-RETADDROFF), ! clearbits(f->Size), ! *app); } if (f < A.arenastart || t > A.arenaend) { /* (heavy) sigh. Should abort. --- 507,516 ---- register struct freehdr *f = (struct freehdr *)(((char *)ap) - sizeof(struct hdr)); register struct freehdr *t = NEXTBLOCK(f); if (CheckLevel >= 4) { ! char *retad; ! GETCALLER(ap, retad); ferr3("free @ 0x%lx for block of %d bytes at 0x%lx enqueued\n", ! retad, clearbits(f->Size), ap); } if (f < A.arenastart || t > A.arenaend) { /* (heavy) sigh. Should abort. *************** *** 555,569 **** A.QueuedToFree[A.NQueued++] = ap; #ifdef IDENTIFY ! #if ( defined(vax) | defined(mips) ) ! { ! register char **mpp; ! mpp = (((char **)&ap) - RETADDROFF); ! (ap-1)->caller = *mpp; ! } ! #else /* vax|mips */ ! (ap-1)->caller = *(((char **)&ap) - RETADDROFF); ! #endif /* vax|mips */ (ap-1)->seqno = A.SeqNo++; #endif /* IDENTIFY */ --- 544,550 ---- A.QueuedToFree[A.NQueued++] = ap; #ifdef IDENTIFY ! GETCALLER(ap, (ap-1)->caller); (ap-1)->seqno = A.SeqNo++; #endif /* IDENTIFY */ *************** *** 659,667 **** return 0; } if (CheckLevel>=4) { ! int *app = (int *)≈ ferr3 ("realloc @ 0x%lx changes size %d at 0x%lx . . .\n", ! *(app-RETADDROFF), clearbits(h->Size), ap); } {register struct hdr **fp = &A.QueuedToFree[A.NQueued-1]; for ( ; fp >= A.QueuedToFree; fp--) --- 640,649 ---- return 0; } if (CheckLevel>=4) { ! char *retad; ! GETCALLER(ap, retad); ferr3 ("realloc @ 0x%lx changes size %d at 0x%lx . . .\n", ! retad, clearbits(h->Size), ap); } {register struct hdr **fp = &A.QueuedToFree[A.NQueued-1]; for ( ; fp >= A.QueuedToFree; fp--) *************** *** 723,737 **** if (CheckLevel >= 4) ferr2 (". . . to size %d at 0x%lx\n", nbytes, ap); #ifdef IDENTIFY ! #if ( defined(vax) | defined(mips) ) ! { ! register char **mpp; ! mpp = (((char **)&ap) - RETADDROFF); ! (ap-1)->caller = *mpp; ! } ! #else /* vax|mips */ ! (ap-1)->caller = *(((char **)&ap) - RETADDROFF); ! #endif /* vax|mips */ (ap-1)->seqno = A.SeqNo++; #endif /* IDENTIFY */ return((char *)ap); --- 705,711 ---- if (CheckLevel >= 4) ferr2 (". . . to size %d at 0x%lx\n", nbytes, ap); #ifdef IDENTIFY ! GETCALLER(ap, (ap-1)->caller); (ap-1)->seqno = A.SeqNo++; #endif /* IDENTIFY */ return((char *)ap); *************** *** 1034,1047 **** } - #include /* sys/types.h sys/time.h */ - #include /* must be the right number, is the same used by 4.3 on vax and s800 */ #ifdef hp9000s300 #define RLIMIT_DATA 2 #endif /* hp9000s300 */ extern etext; #ifdef ibm032 #define StartDATA ((caddr_t) 0x10000000) #else /* ibm032 */ --- 1008,1025 ---- } /* must be the right number, is the same used by 4.3 on vax and s800 */ #ifdef hp9000s300 #define RLIMIT_DATA 2 #endif /* hp9000s300 */ + #ifndef _IBMR2 extern etext; + #else /* _IBMR2 */ + extern _etext; + #define etext _etext + #endif /* _IBMR2 */ + #ifdef ibm032 #define StartDATA ((caddr_t) 0x10000000) #else /* ibm032 */ *************** *** 1130,1136 **** return(NULL); } ! #ifdef DEBUG >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> /* malloc_debug Controls the level of error diagnosis and consistency checking --- 1108,1114 ---- return(NULL); } ! #ifdef DEBUG /* malloc_debug Controls the level of error diagnosis and consistency checking *** overhead/malloc/plumber.ci Wed Jan 17 16:40:07 1990 --- overhead/malloc/plumber.ci.NEW Wed Jun 13 17:16:22 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/malloc/RCS/plumber.ci,v 2.8 89/12/12 15:09:29 ghoti Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/overhead/malloc/RCS/plumber.ci,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/malloc/RCS/plumber.ci,v 2.8 89/12/12 15:09:29 ghoti Exp $ "; #endif /* lint */ /* --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/plumber.ci,v 2.9 90/06/11 15:18:17 wjh Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/plumber.ci,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/plumber.ci,v 2.9 90/06/11 15:18:17 wjh Exp $ "; #endif /* lint */ /* *************** *** 23,30 **** */ #include ! #include "malloc.h" ! #include "imalloc.h" #ifndef IDENTIFY void --- 23,31 ---- */ #include ! #include ! #include ! #include #ifndef IDENTIFY void *************** *** 144,155 **** return(NULL); /* Stamp pc of caller of calloc in malloc header */ ! #if ( defined(vax) | defined(mips) ) ! mpp = (((char **)&FIRSTARG)-RETADDROFF); ! (((struct hdr *)mp)-1)->caller = *mpp; ! #else /* vax | mips */ ! (((struct hdr *)mp)-1)->caller = *(((char **)&FIRSTARG)-RETADDROFF); ! #endif /* vax | mips */ q = (int *) mp; m = (num+CHARPERINT-1)/CHARPERINT; while (--m>=0) --- 145,152 ---- return(NULL); /* Stamp pc of caller of calloc in malloc header */ ! GETCALLER(num, (((struct hdr *)mp)-1)->caller); ! q = (int *) mp; m = (num+CHARPERINT-1)/CHARPERINT; while (--m>=0) *** overhead/malloc/getcallr.h Fri Jul 27 14:32:48 1990 --- overhead/malloc/getcallr.h.NEW Wed Jun 13 17:16:23 1990 *************** *** 0 **** --- 1,57 ---- + /* ********************************************************************** *\ + * Copyright IBM Corporation 1990 - All Rights Reserved * + * For full copyright information see:'andrew/config/COPYRITE' * + \* ********************************************************************** */ + /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/getcallr.h,v 1.1 90/06/11 15:19:52 wjh Exp $ */ + /* $ACIS: $ */ + /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/getcallr.h,v $ */ + + #if !defined(lint) && !defined(LOCORE) && defined(RCS_HDRS) + static char *getcallr_rcsid_h = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/malloc/RCS/getcallr.h,v 1.1 90/06/11 15:19:52 wjh Exp $ "; + #endif + + /* + getcallr.h - how to get return address + */ + + /* In routine f the statement + GETCALLER(a, x) + where a is the first parater to f and x is of type (char *) + will store in x the return address within the caller of f. + This cannot be guaranteed to always work, + so it cannot be recommended for anything other than diagnostic infomation. + */ + + + #ifndef _GETCALLR_ + #define _GETCALLR_ + + + #ifdef ibm032 + #define RETADDROFF (6) + #else + #define RETADDROFF (1) + #endif + + + #if (defined(sun4) || defined(sparc)) + + /* the sun4 requires an assembler routine to find the caller of the caller */ + + #define GETCALLER(a, x) {x = getcaller();} + + #else /* (defined(sun4) || defined(sparc)) */ + + /* the vax and mips compilers require the extra variable mpp. + other do not, but there is no great advantage in making a third case. */ + + #define GETCALLER(a, x) { \ + register char **addrloc; \ + addrloc = (((char **)&a) - RETADDROFF); \ + x = *addrloc; \ + } + + #endif /* (defined(sun4) || defined(sparc)) */ + + + #endif _GETCALLR_ *** overhead/malloc/getcallr.spp Fri Jul 27 14:32:56 1990 --- overhead/malloc/getcallr.spp.NEW Wed Jun 13 17:16:24 1990 *************** *** 0 **** --- 1,11 ---- + #if (defined(sun4) || defined(sparc)) + + #include + + .text + ENTRY(getcaller) + mov %i7, %o0 + retl + nop + + #endif *** overhead/parsec/p1.h Wed Nov 22 13:54:25 1989 --- overhead/parsec/p1.h.NEW Wed Jun 13 17:16:33 1990 *************** *** 97,103 **** } PC_ParseNodeType_t; typedef struct { ! unsigned short isChar:1, hasText:1; int val; char *text; } PC_Token_t; --- 97,103 ---- } PC_ParseNodeType_t; typedef struct { ! unsigned int isChar:1, hasText:1; int val; char *text; } PC_Token_t; *** overhead/parsec/yyhide.c Wed Nov 22 13:54:51 1989 --- overhead/parsec/yyhide.c.NEW Wed Jun 13 17:16:36 1990 *************** *** 73,79 **** static PC_Token_t *SavedTokens; extern int errno; ! extern char *malloc(), *realloc(), *index(), *rindex(), *sys_errlist[]; static void OutOfMemory(str) char *str; --- 73,84 ---- static PC_Token_t *SavedTokens; extern int errno; ! ! #ifndef _IBMR2 ! extern char *malloc(), *realloc(); ! #endif /* _IBMR2 */ ! ! extern char *index(), *rindex(), *sys_errlist[]; static void OutOfMemory(str) char *str; *** overhead/snap2/guardian/cmd/Imakefile Fri Jan 12 13:41:15 1990 --- overhead/snap2/guardian/cmd/Imakefile.NEW Thu Jul 12 14:06:36 1990 *************** *** 26,36 **** #endif /* AFS_ENV */ G_LIBSS = \ ! ${BASEDIR}/lib/libsnap.a ${G_LIBSI} G_LIBST = \ ${G_LIBSI} \ ! ${BASEDIR}/lib/libpfio.a /* ${BASEDIR}/lib/libsnapt.a ${G_LIBSI} */ --- 26,39 ---- #endif /* AFS_ENV */ G_LIBSS = \ ! ${BASEDIR}/lib/libsnap.a \ ! ${G_LIBSI} \ ! ${RESOLVLIB} G_LIBST = \ ${G_LIBSI} \ ! ${BASEDIR}/lib/libpfio.a \ ! ${RESOLVLIB} /* ${BASEDIR}/lib/libsnapt.a ${G_LIBSI} */ *** overhead/snap2/guardian/cmd/guardian.c Wed Jan 17 16:40:16 1990 --- overhead/snap2/guardian/cmd/guardian.c.NEW Thu May 10 16:38:47 1990 *************** *** 8,14 **** Written: 17 September 1985 */ ! static char GuardianVersion[] = "$Revision: 2.85 $ $Date: 89/12/21 16:39:30 $"; #define GUARDIAN_PREIX_SKIP sizeof("xRevision") extern char *AndrewDir(); extern char *malloc(); --- 8,14 ---- Written: 17 September 1985 */ ! static char GuardianVersion[] = "$Revision: 2.86 $ $Date: 90/04/24 18:12:08 $"; #define GUARDIAN_PREIX_SKIP sizeof("xRevision") extern char *AndrewDir(); extern char *malloc(); *************** *** 19,29 **** #include #include ! #ifdef AIX #include ! #else /* AIX */ #include ! #endif /* AIX */ #ifdef HAS_SYSEXITS #include --- 19,29 ---- #include #include ! #if SY_AIX221 #include ! #else /* SY_AIX221 */ #include ! #endif /* SY_AIX221 */ #ifdef HAS_SYSEXITS #include *************** *** 919,931 **** /* Initialize flags */ DebugFlags = 0; ViceAuth = AFS_AUTH_DEFAULT; ! #ifdef AIX AcceptRemoteRequests = TRUE; Verbose = FALSE; ! #else /* AIX */ AcceptRemoteRequests = FALSE; Verbose = TRUE; ! #endif /* AIX */ RunAsUser = FALSE; RebootFlag = FALSE; Permits = NIL; --- 919,931 ---- /* Initialize flags */ DebugFlags = 0; ViceAuth = AFS_AUTH_DEFAULT; ! #if SY_AIX221 AcceptRemoteRequests = TRUE; Verbose = FALSE; ! #else /* SY_AIX221 */ AcceptRemoteRequests = FALSE; Verbose = TRUE; ! #endif /* SY_AIX221 */ RunAsUser = FALSE; RebootFlag = FALSE; Permits = NIL; *************** *** 1156,1164 **** extern char *arpadate(); static char errorfile[] = "/tmp/gerrorXXXXXX"; char *to[2]; ! #ifdef AIX return; ! #else /* AIX */ /* Construct message in temporary file */ mktemp(errorfile); --- 1156,1164 ---- extern char *arpadate(); static char errorfile[] = "/tmp/gerrorXXXXXX"; char *to[2]; ! #if SY_AIX221 return; ! #else /* SY_AIX221 */ /* Construct message in temporary file */ mktemp(errorfile); *************** *** 1187,1193 **** errprintf(GuardianName, ERR_CRITICAL, NIL, NIL, "Dropoff failed: %s", Dropoff_ErrMsg); } ! #endif /* AIX */ } static ReportError(level, id, msg, arg) --- 1187,1193 ---- errprintf(GuardianName, ERR_CRITICAL, NIL, NIL, "Dropoff failed: %s", Dropoff_ErrMsg); } ! #endif /* SY_AIX221 */ } static ReportError(level, id, msg, arg) *************** *** 1317,1322 **** --- 1317,1328 ---- close(fd); } else ReportSystemError(ERR_CRITICAL, NIL, "can't open /dev/console: %s", errno); + #if SY_AIX221 + if ((fd = open("/dev/tty")) > 0) { + ioctl(fd, TIOCNOTTY, 0); + close(fd); + } + #endif } static bool GetServerRequest(fd, request) *************** *** 1689,1722 **** void log_death(st) stat_stuff_pt st; { ! DEALOG(( ! "death,%d,%d,%d,%d,%d,%d,%s,%ld,%ld,%ld,%ld,%ld,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n", ! st->pid, ! st->s_termsig, ! st->s_coredump, ! st->s_retcode, ! st->s_stopval, ! st->s_stopsig, ! st->user_name, ! st->start, ! st->usage.ru_utime.tv_sec, ! st->usage.ru_utime.tv_usec, ! st->usage.ru_stime.tv_sec, ! st->usage.ru_stime.tv_usec, ! st->usage.ru_maxrss, ! st->usage.ru_ixrss, ! st->usage.ru_idrss, ! st->usage.ru_isrss, ! st->usage.ru_minflt, ! st->usage.ru_majflt, ! st->usage.ru_nswap, ! st->usage.ru_inblock, ! st->usage.ru_oublock, ! st->usage.ru_msgsnd, ! st->usage.ru_msgrcv, ! st->usage.ru_nsignals, ! st->usage.ru_nvcsw, ! st->usage.ru_nivcsw)); } static void AServerDied(server,st) --- 1695,1701 ---- void log_death(st) stat_stuff_pt st; { ! DEALOG(("death,%d,%d,%d,%d,%d,%d,%s,%ld,%ld,%ld,%ld,%ld,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d\n",st->pid,st->s_termsig,st->s_coredump,st->s_retcode,st->s_stopval,st->s_stopsig,st->user_name,st->start,st->usage.ru_utime.tv_sec,st->usage.ru_utime.tv_usec,st->usage.ru_stime.tv_sec,st->usage.ru_stime.tv_usec,st->usage.ru_maxrss,st->usage.ru_ixrss,st->usage.ru_idrss,st->usage.ru_isrss,st->usage.ru_minflt,st->usage.ru_majflt,st->usage.ru_nswap,st->usage.ru_inblock,st->usage.ru_oublock,st->usage.ru_msgsnd,st->usage.ru_msgrcv,st->usage.ru_nsignals,st->usage.ru_nvcsw,st->usage.ru_nivcsw)); } static void AServerDied(server,st) *** overhead/snap2/pcserver/pcsprocs.c Wed Nov 22 13:59:07 1989 --- overhead/snap2/pcserver/pcsprocs.c.NEW Thu May 10 16:39:02 1990 *************** *** 42,48 **** --- 42,50 ---- extern int errno; extern int PCS_debuglevel; + #if !SY_AIX12 int getuid(); + #endif /* SY_AIX12 */ struct passwd *getpwuid (); struct passwd *getpwnam (); char *GetCurrentDir(); *** overhead/snap2/pcserver/pcsvice.c Wed Nov 22 13:59:15 1989 --- overhead/snap2/pcserver/pcsvice.c.NEW Thu May 10 16:39:05 1990 *************** *** 15,20 **** --- 15,25 ---- * */ + #if defined(AIX) && defined(i386) + #define bool_t junk_type + #include + #undef bool_t + #endif /* defined(AIX) && defined(i386) */ #include #include extern int PCS_debuglevel; *** overhead/sys/conftest.c Wed Nov 22 14:01:00 1989 --- overhead/sys/conftest.c.NEW Wed Jun 20 13:33:09 1990 *************** *** 8,17 **** */ #include - #include #include ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/sys/RCS/conftest.c,v 1.1 89/10/16 15:13:33 cfe Exp $"; /* ./conftest "$(RESOLVLIB)" */ --- 8,16 ---- */ #include #include ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/sys/RCS/conftest.c,v 1.4 90/06/14 17:47:56 gk5g Exp $"; /* ./conftest "$(RESOLVLIB)" */ *************** *** 23,29 **** Problem = 0; printf("conftest: Checking configuration for sys type ``%s'', full name ``%s''\n", SYS_NAME, OPSYSNAME); if ((SY_B4x + SY_U5x + SY_AIXx) == 0) { ! printf("conftest: This system type, %s, does not define any SY_xxx value\n"); printf(" in its system.h file.\n"); Problem = 1; } else { --- 22,28 ---- Problem = 0; printf("conftest: Checking configuration for sys type ``%s'', full name ``%s''\n", SYS_NAME, OPSYSNAME); if ((SY_B4x + SY_U5x + SY_AIXx) == 0) { ! printf("conftest: This system type, %s, does not define any SY_xxx value\n", SYS_NAME); printf(" in its system.h file.\n"); Problem = 1; } else { *************** *** 42,102 **** OneProb = 0; #ifndef SY_B42 ! printf("SY_B42 is not defined. It is turned off by defining it to have"\n); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_B42 0 #endif /* SY_B42 */ #ifndef SY_B43 ! printf("SY_B43 is not defined. It is turned off by defining it to have"\n); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_B43 0 #endif /* SY_B43 */ #ifndef SY_U51 ! printf("SY_U51 is not defined. It is turned off by defining it to have"\n); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_U51 0 #endif /* SY_U51 */ #ifndef SY_U52 ! printf("SY_U52 is not defined. It is turned off by defining it to have"\n); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_U52 0 #endif /* SY_U52 */ #ifndef SY_U53 ! printf("SY_U53 is not defined. It is turned off by defining it to have"\n); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_U53 0 #endif /* SY_U53 */ #ifndef SY_AIX11 ! printf("SY_AIX11 is not defined. It is turned off by defining it to have"\n); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_AIX11 0 #endif /* SY_AIX11 */ #ifndef SY_AIX221 ! printf("SY_AIX221 is not defined. It is turned off by defining it to have"\n); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_AIX221 0 #endif /* SY_AIX221 */ #ifndef SY_B4x ! printf("SY_B4x is not defined. It is turned off by defining it to have"\n); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_B4x 0 #endif /* SY_B4x */ #ifndef SY_U5x ! printf("SY_U5x is not defined. It is turned off by defining it to have"\n); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_U5x 0 #endif /* SY_U5x */ #ifndef SY_AIXx ! printf("SY_AIXx is not defined. It is turned off by defining it to have"\n); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_AIXx 0 --- 41,107 ---- OneProb = 0; #ifndef SY_B42 ! printf("SY_B42 is not defined. It is turned off by defining it to have\n"); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_B42 0 #endif /* SY_B42 */ #ifndef SY_B43 ! printf("SY_B43 is not defined. It is turned off by defining it to have\n"); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_B43 0 #endif /* SY_B43 */ #ifndef SY_U51 ! printf("SY_U51 is not defined. It is turned off by defining it to have\n"); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_U51 0 #endif /* SY_U51 */ #ifndef SY_U52 ! printf("SY_U52 is not defined. It is turned off by defining it to have\n"); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_U52 0 #endif /* SY_U52 */ #ifndef SY_U53 ! printf("SY_U53 is not defined. It is turned off by defining it to have\n"); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_U53 0 #endif /* SY_U53 */ #ifndef SY_AIX11 ! printf("SY_AIX11 is not defined. It is turned off by defining it to have\n"); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_AIX11 0 #endif /* SY_AIX11 */ + #ifndef SY_AIX12 + printf("SY_AIX12 is not defined. It is turned off by defining it to have\n"); + printf("a value of zero, not undefining it. It must be defined.\n"); + OneProb = 1; + #define SY_AIX12 0 + #endif /* SY_AIX12 */ #ifndef SY_AIX221 ! printf("SY_AIX221 is not defined. It is turned off by defining it to have\n"); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_AIX221 0 #endif /* SY_AIX221 */ #ifndef SY_B4x ! printf("SY_B4x is not defined. It is turned off by defining it to have\n"); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_B4x 0 #endif /* SY_B4x */ #ifndef SY_U5x ! printf("SY_U5x is not defined. It is turned off by defining it to have\n"); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_U5x 0 #endif /* SY_U5x */ #ifndef SY_AIXx ! printf("SY_AIXx is not defined. It is turned off by defining it to have\n"); printf("a value of zero, not undefining it. It must be defined.\n"); OneProb = 1; #define SY_AIXx 0 *** overhead/sys/sys.c Wed Nov 22 14:00:54 1989 --- overhead/sys/sys.c.NEW Fri Jul 20 11:34:02 1990 *************** *** 11,21 **** #include #include ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/sys/RCS/sys.c,v 2.5 89/05/12 07:58:57 ghoti Exp $"; - extern char *index(); - #define NULL (char *)0 main (argc,argv) --- 11,19 ---- #include #include ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/sys/RCS/sys.c,v 2.7 90/07/13 13:30:35 susan Exp $"; #define NULL (char *)0 main (argc,argv) *************** *** 22,28 **** int argc; char **argv; { ! char *retval=SYS_NAME, *s; while (*++argv!=NULL) if (**argv=='-' && (*argv)[1]=='c' && (*argv)[2]=='\0') { --- 20,28 ---- int argc; char **argv; { ! char *retval[1000], *s; ! ! strcpy(retval, SYS_NAME); while (*++argv!=NULL) if (**argv=='-' && (*argv)[1]=='c' && (*argv)[2]=='\0') { *** overhead/util/cmd/newbt.c Fri Jul 27 16:25:15 1990 --- overhead/util/cmd/newbt.c.NEW Mon Jul 30 13:50:09 1990 *************** *** 7,13 **** Create a new B-tree of specified desired-node size. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/cmd/RCS/newbt.c,v 2.6 89/10/23 14:08:15 cfe Exp $"; #include #include /* strings.h */ --- 7,13 ---- Create a new B-tree of specified desired-node size. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/cmd/RCS/newbt.c,v 2.8 90/07/30 13:32:44 susan Exp $"; #include #include /* strings.h */ *************** *** 20,27 **** --- 20,29 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ static int Debugging = 0; *** overhead/util/cmd/pref.c Wed Nov 22 14:01:51 1989 --- overhead/util/cmd/pref.c.NEW Fri Jul 13 11:43:00 1990 *************** *** 24,31 **** #define DIE(str) (fprintf(stderr,str),exit(-1)) #define USAGE "Usage: pref [-p programname] [-sbi] preferencename [default|value]\n" - char *index(); - boolean atob(str) char *str; { --- 24,29 ---- *** overhead/util/lib/tokunpak.c Wed Jan 17 16:40:40 1990 --- overhead/util/lib/tokunpak.c.NEW Wed Jun 13 17:18:11 1990 *************** *** 7,18 **** from datagrams and setting them as current with Venus. */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/tokunpak.c,v 2.16 89/12/15 12:09:54 cfe Exp Locker: cfe $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/tokunpak.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/tokunpak.c,v 2.16 89/12/15 12:09:54 cfe Exp Locker: cfe $"; #endif /* lint */ #include --- 7,18 ---- from datagrams and setting them as current with Venus. */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokunpak.c,v 2.18 90/06/04 11:12:03 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokunpak.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokunpak.c,v 2.18 90/06/04 11:12:03 gk5g Exp $"; #endif /* lint */ #include *************** *** 38,44 **** --- 38,46 ---- #define NIL 0 extern int errno; + #ifndef _IBMR2 extern char *malloc(), *realloc(); + #endif /* _IBMR2 */ #ifdef AFS_ENV static int IsKTC(where) *************** *** 344,352 **** int debug; {/* exported: generate the information for clients, but not the ticket bits themselves. */ ClearToken ctok; SecretToken stok; ! struct ktc_principal Srv, Cli; struct ktc_token Token; ! return(GenAuths(pWhere, pWhereLen, &Srv, &Cli, &Token, &ctok, &stok, begdP, expdP, vidP, cell, vname, primP, locP, debug)); } #else /* AFS_ENV */ { return 0; } --- 346,354 ---- int debug; {/* exported: generate the information for clients, but not the ticket bits themselves. */ ClearToken ctok; SecretToken stok; ! struct ktc_principal Srv, xCli; struct ktc_token Token; ! return(GenAuths(pWhere, pWhereLen, &Srv, &xCli, &Token, &ctok, &stok, begdP, expdP, vidP, cell, vname, primP, locP, debug)); } #else /* AFS_ENV */ { return 0; } *************** *** 365,374 **** After a successful return, ctokP and stokP will be loaded with tokens, expdP will have the expiration date, vidP and cell the authentication (where cell is of size at least MAXCELLCHARS), primP and locP the indication of whether the auth is ``primary'' and/or workstation-local. */ unsigned long int Beg; ! struct ktc_principal Serv, Cli; struct ktc_token KTok; char vname[MAXCELLCHARS+1]; ! return GenAuths(pWhere, pWhereLen, &Serv, &Cli, &KTok, ctokP, stokP, &Beg, expdP, vidP, cell, vname, primP, locP, debug); } #else /* AFS_ENV */ { return 0; } --- 367,376 ---- After a successful return, ctokP and stokP will be loaded with tokens, expdP will have the expiration date, vidP and cell the authentication (where cell is of size at least MAXCELLCHARS), primP and locP the indication of whether the auth is ``primary'' and/or workstation-local. */ unsigned long int Beg; ! struct ktc_principal Serv, xCli; struct ktc_token KTok; char vname[MAXCELLCHARS+1]; ! return GenAuths(pWhere, pWhereLen, &Serv, &xCli, &KTok, ctokP, stokP, &Beg, expdP, vidP, cell, vname, primP, locP, debug); } #else /* AFS_ENV */ { return 0; } *** overhead/util/lib/andrwdir.c Wed Nov 22 14:11:26 1989 --- overhead/util/lib/andrwdir.c.NEW Wed Jun 13 17:18:13 1990 *************** *** 7,13 **** --- 7,16 ---- #include #include + #ifndef _IBMR2 extern char *malloc(); + #endif /* _IBMR2 */ + extern char *getenv(); /* Return a string with the current value for ANDREWDIR imbedded in it. */ *** overhead/util/lib/andydir.c Wed Nov 22 14:14:17 1989 --- overhead/util/lib/andydir.c.NEW Wed Jun 13 17:18:14 1990 *************** *** 6,12 **** --- 6,15 ---- #include + #ifndef _IBMR2 extern char *malloc(); + #endif /* _IBMR2 */ + extern char *getenv(); /* Return a string with the current value for ANDYDIR imbedded in it. */ *** overhead/util/lib/btcreate.c Wed Nov 22 14:04:47 1989 --- overhead/util/lib/btcreate.c.NEW Wed Jun 13 17:18:16 1990 *************** *** 9,15 **** Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/btcreate.c,v 2.8 89/09/01 15:39:38 cfe Exp $"; #include #include --- 9,15 ---- Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/btcreate.c,v 2.9 90/06/04 11:13:16 gk5g Exp $"; #include #include *************** *** 27,34 **** --- 27,36 ---- #endif /* WHITEPAGES_ENV */ extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ static int Debugging; *** overhead/util/lib/btr.c Wed Nov 22 14:04:55 1989 --- overhead/util/lib/btr.c.NEW Fri Jul 13 11:43:25 1990 *************** *** 9,15 **** Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/btr.c,v 2.10 89/09/01 15:39:49 cfe Exp $"; #include #include --- 9,15 ---- Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/btr.c,v 2.12 90/07/12 15:06:51 gk5g Exp $"; #include #include *************** *** 28,35 **** --- 28,37 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ int br_Debugging = 0; *************** *** 47,53 **** { /* Read an unsigned short from file ``f'' in network byte order. */ unsigned short ns; ! fread(&ns, sizeof(ns), 1, f); return ((unsigned short) ntohs((short) ns)); } --- 49,55 ---- { /* Read an unsigned short from file ``f'' in network byte order. */ unsigned short ns; ! fread((char*)&ns, sizeof(ns), 1, f); return ((unsigned short) ntohs((short) ns)); } *************** *** 56,62 **** { /* Read an unsigned long from file ``f'' in network byte order. */ unsigned long nl; ! fread(&nl, sizeof(nl), 1, f); return ((unsigned long) ntohl((long) nl)); } --- 58,64 ---- { /* Read an unsigned long from file ``f'' in network byte order. */ unsigned long nl; ! fread((char*)&nl, sizeof(nl), 1, f); return ((unsigned long) ntohl((long) nl)); } *************** *** 186,192 **** (UppBd..maxIx]. */ LowBd = 0; UppBd = bF->IndexNum - 1; ! KeyLen = strlen(Key) + 1; /* read match for trailing NUL, too */ while (LowBd <= UppBd) { Mid = (LowBd + UppBd) / 2; errno = 0; --- 188,194 ---- (UppBd..maxIx]. */ LowBd = 0; UppBd = bF->IndexNum - 1; ! KeyLen = strlen((char*)Key) + 1; /* read match for trailing NUL, too */ while (LowBd <= UppBd) { Mid = (LowBd + UppBd) / 2; errno = 0; *************** *** 193,199 **** if (fseek(bF->File, bF->FileOrigin + bF->Index[Mid], 0) != 0) return (bterr_FileSystemErrorBegin + (errno==0 ? EIO : errno)); errno = 0; ! Res = fread(&DataFrag[0], 1, DFSiz, bF->File); if (Res < 0 || ferror(bF->File)) return (bterr_FileSystemErrorBegin + (errno==0 ? EIO : errno)); if (Res < 3 || DataFrag[0] != BTSeparatorByte) --- 195,201 ---- if (fseek(bF->File, bF->FileOrigin + bF->Index[Mid], 0) != 0) return (bterr_FileSystemErrorBegin + (errno==0 ? EIO : errno)); errno = 0; ! Res = fread((char*)&DataFrag[0], 1, DFSiz, bF->File); if (Res < 0 || ferror(bF->File)) return (bterr_FileSystemErrorBegin + (errno==0 ? EIO : errno)); if (Res < 3 || DataFrag[0] != BTSeparatorByte) *************** *** 205,211 **** KeyLeft = KeyLen; while (1) { ThisGo = MIN(KeyLeft, DataFragLen); ! Res = strncmp(KeyP, DataFragPtr, ThisGo); if (Res != 0) { if (Res < 0) UppBd = Mid - 1; else {LowBd = Mid + 1; LowFlags = Flags;} --- 207,213 ---- KeyLeft = KeyLen; while (1) { ThisGo = MIN(KeyLeft, DataFragLen); ! Res = strncmp((char*)KeyP, DataFragPtr, ThisGo); if (Res != 0) { if (Res < 0) UppBd = Mid - 1; else {LowBd = Mid + 1; LowFlags = Flags;} *************** *** 221,227 **** KeyP += ThisGo; /* not end of key--keep reading */ DataFragPtr = &DataFrag[0]; errno = 0; ! Res = fread(DataFragPtr, 1, DFSiz, bF->File); if (Res <= 0 || ferror(bF->File)) return (bterr_FileSystemErrorBegin + (errno==0 ? EIO : errno)); --- 223,229 ---- KeyP += ThisGo; /* not end of key--keep reading */ DataFragPtr = &DataFrag[0]; errno = 0; ! Res = fread((char*)DataFragPtr, 1, DFSiz, bF->File); if (Res <= 0 || ferror(bF->File)) return (bterr_FileSystemErrorBegin + (errno==0 ? EIO : errno)); *** overhead/util/lib/btr1.c Wed Nov 22 14:04:30 1989 --- overhead/util/lib/btr1.c.NEW Wed Jun 13 17:18:20 1990 *************** *** 9,15 **** Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/btr1.c,v 2.6 89/02/16 13:09:15 ghoti Exp $"; #include #include --- 9,15 ---- Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/btr1.c,v 2.7 90/06/04 11:13:28 gk5g Exp $"; #include #include *************** *** 28,35 **** --- 28,37 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ extern int br_Debugging; *** overhead/util/lib/btr2.c Wed Nov 22 14:04:39 1989 --- overhead/util/lib/btr2.c.NEW Wed Jun 13 17:18:23 1990 *************** *** 9,15 **** Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/btr2.c,v 2.8 89/04/04 09:45:26 cfe Exp $"; #include #include --- 9,15 ---- Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/btr2.c,v 2.9 90/06/04 11:13:33 gk5g Exp $"; #include #include *************** *** 28,35 **** --- 28,37 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ extern int br_Debugging; *** overhead/util/lib/btr3.c Wed Nov 22 14:05:00 1989 --- overhead/util/lib/btr3.c.NEW Wed Jun 13 17:18:25 1990 *************** *** 9,15 **** Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/btr3.c,v 2.6 89/02/16 13:09:24 ghoti Exp $"; #include --- 9,15 ---- Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/btr3.c,v 2.7 90/06/04 11:13:38 gk5g Exp $"; #include *************** *** 29,36 **** --- 29,38 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ extern int br_Debugging; *** overhead/util/lib/btr4.c Wed Nov 22 14:05:09 1989 --- overhead/util/lib/btr4.c.NEW Wed Jun 13 17:18:27 1990 *************** *** 10,16 **** Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/btr4.c,v 2.6 89/02/16 13:09:29 ghoti Exp $"; #include #include --- 10,16 ---- Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/btr4.c,v 2.7 90/06/04 11:13:43 gk5g Exp $"; #include #include *************** *** 29,36 **** --- 29,38 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ extern int br_Debugging; *** overhead/util/lib/btw.c Fri Jul 27 16:26:10 1990 --- overhead/util/lib/btw.c.NEW Mon Jul 30 15:13:10 1990 *************** *** 9,15 **** Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/btw.c,v 2.14 89/09/08 10:19:06 cfe Exp $"; #include #include --- 9,15 ---- Include file ``btint.h'' declares common structures for the implementation modules. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/btw.c,v 2.16 90/07/30 14:26:53 gk5g Exp $"; #include #include *************** *** 27,36 **** #endif /* WHITEPAGES_ENV */ extern int errno; ! extern char *malloc(); extern char *realloc(); ! static int Debugging = 0; static struct osi_Times CurrTime; --- 27,36 ---- #endif /* WHITEPAGES_ENV */ extern int errno; ! #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); ! #endif /* _IBMR2 */ static int Debugging = 0; static struct osi_Times CurrTime; *************** *** 181,187 **** int PermanentErrsLeft, NumFilesToTry; RootFileNameLength = strlen(RootFileName); ! NewNameSansDirs = rindex(RootFileName, "/"); if (NewNameSansDirs == NULL) RootFileNamePrefixLength = 0; else --- 181,187 ---- int PermanentErrsLeft, NumFilesToTry; RootFileNameLength = strlen(RootFileName); ! NewNameSansDirs = rindex(RootFileName, '/'); if (NewNameSansDirs == NULL) RootFileNamePrefixLength = 0; else *************** *** 221,227 **** sprintf(NewName, "%s.%s.", RootFileName, KeyPrefix); sprintf(Suffix, "%s.", KeyPrefix); /* to return to caller */ NewNameSuffix = &NewName[strlen(NewName)]; /* ptr to the null */ ! NewNameSansDirs = rindex(NewName, "/"); if (NewNameSansDirs == NULL) NewNameSansDirs = NewName; else NewNameSansDirs = &NewNameSansDirs[1]; --- 221,227 ---- sprintf(NewName, "%s.%s.", RootFileName, KeyPrefix); sprintf(Suffix, "%s.", KeyPrefix); /* to return to caller */ NewNameSuffix = &NewName[strlen(NewName)]; /* ptr to the null */ ! NewNameSansDirs = rindex(NewName, '/'); if (NewNameSansDirs == NULL) NewNameSansDirs = NewName; else NewNameSansDirs = &NewNameSansDirs[1]; *** overhead/util/lib/btwp.c Wed Nov 22 14:05:47 1989 --- overhead/util/lib/btwp.c.NEW Wed Jun 13 17:18:29 1990 *************** *** 9,15 **** For use only internally to the WP library. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/btwp.c,v 2.9 89/05/19 17:39:30 cfe Exp $"; #include #include --- 9,15 ---- For use only internally to the WP library. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/btwp.c,v 2.10 90/06/04 11:13:48 gk5g Exp $"; #include #include *************** *** 23,29 **** --- 23,31 ---- #endif /* WHITEPAGES_ENV */ int bwDebugging = 0; + #ifndef _IBMR2 extern char *malloc(), *realloc(); + #endif /* _IBMR2 */ /* IF YOU CHANGE THE FOLLOWING, CHANGE ``makeboth.c'' ALSO. */ char BTIxTags[NumBTIndices] = {KeyTagTk, KeyTagNI, KeyTagID, KeyTagN, *** overhead/util/lib/cawp.c Wed Jan 17 16:40:27 1990 --- overhead/util/lib/cawp.c.NEW Wed Jun 13 17:18:31 1990 *************** *** 7,17 **** The part of cellauth.c that needs the White Pages code. \* ************************************************************ */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/cawp.c,v 1.8 89/12/12 15:09:34 ghoti Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/cawp.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/cawp.c,v 1.8 89/12/12 15:09:34 ghoti Exp $"; #endif /* lint */ #include --- 7,17 ---- The part of cellauth.c that needs the White Pages code. \* ************************************************************ */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/cawp.c,v 1.9 90/06/04 11:13:52 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/cawp.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/cawp.c,v 1.9 90/06/04 11:13:52 gk5g Exp $"; #endif /* lint */ #include *************** *** 27,34 **** --- 27,37 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ + #ifdef AFS_ENV static int idxID = -1; *** overhead/util/lib/cellauth.c Wed Jan 17 16:40:32 1990 --- overhead/util/lib/cellauth.c.NEW Fri Jul 13 11:43:36 1990 *************** *** 7,17 **** Keep track of the current user's authentication status in different cells. \* ************************************************************ */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/cellauth.c,v 2.17 89/12/14 16:38:23 cfe Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/cellauth.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/cellauth.c,v 2.17 89/12/14 16:38:23 cfe Exp $"; #endif /* lint */ #include --- 7,17 ---- Keep track of the current user's authentication status in different cells. \* ************************************************************ */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/cellauth.c,v 2.19 90/07/12 15:09:53 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/cellauth.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/cellauth.c,v 2.19 90/07/12 15:09:53 gk5g Exp $"; #endif /* lint */ #include *************** *** 31,38 **** --- 31,40 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* IBMR2 */ #define INITIALAUTHS 5 struct CellAuth *myAuth = NULL; *************** *** 214,220 **** /* get the ticket info itself */ RC = ktc_GetToken(&serviceName, &token, sizeof(token), &clientName); if (RC) { ! fprintf("cellauth: failed to get token info for service %s.%s.%s (code %d)\n", serviceName.name, serviceName.instance, serviceName.cell, RC); return (-2); } --- 216,222 ---- /* get the ticket info itself */ RC = ktc_GetToken(&serviceName, &token, sizeof(token), &clientName); if (RC) { ! fprintf(stderr,"cellauth: failed to get token info for service %s.%s.%s (code %d)\n", serviceName.name, serviceName.instance, serviceName.cell, RC); return (-2); } *** overhead/util/lib/desym.c Wed Nov 22 14:14:36 1989 --- overhead/util/lib/desym.c.NEW Wed Jun 13 17:18:35 1990 *************** *** 3,9 **** * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/desym.c,v 1.2 89/04/19 15:56:20 cfe Exp $"; #include #include --- 3,9 ---- * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/desym.c,v 1.4 90/06/04 11:14:06 gk5g Exp $"; #include #include *************** *** 13,20 **** --- 13,22 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ int DeSymLink(inp, outp, newRoots) char *inp, *outp; int newRoots; *************** *** 30,36 **** RC = osi_readlink(outp, Buf1, sizeof(Buf1)-1); if (Next != NULL) *Next = '/'; if (RC < 0) { ! if (errno == ENXIO || errno == EINVAL) { /* not a sym link */ if (Next == NULL) break; This = Next; while (*This == '/') ++This; if (*This == '\0') break; --- 32,38 ---- RC = osi_readlink(outp, Buf1, sizeof(Buf1)-1); if (Next != NULL) *Next = '/'; if (RC < 0) { ! if (errno == ENXIO || errno == EINVAL || errno == EACCES) { /* not a sym link */ if (Next == NULL) break; This = Next; while (*This == '/') ++This; if (*This == '\0') break; *************** *** 39,44 **** --- 41,54 ---- return -1; } Buf1[RC] = '\0'; + #if SY_AIX11 || SY_AIX12 + if (!strncmp(Buf1, "", 7)) { + Buf2[0] = '\0'; + getlocal(Buf2, sizeof(Buf2)-1); + strcat(Buf2, Buf1+7); + strcpy(Buf1, Buf2); + } + #endif /* SY_AIX11 || SY_AIX12 */ if (Buf1[0] == '/') { if (!newRoots) return 0; if (Next != NULL) strcat(Buf1, Next); *** overhead/util/lib/fdplumb.c Wed Nov 22 14:06:25 1989 --- overhead/util/lib/fdplumb.c.NEW Wed Jun 13 17:18:36 1990 *************** *** 2,12 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/fdplumb.c,v 2.7 89/08/03 13:27:40 ghoti Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/fdplumb.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/fdplumb.c,v 2.7 89/08/03 13:27:40 ghoti Exp $"; #endif /* lint */ #include --- 2,12 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/fdplumb.c,v 2.8 90/06/04 11:14:10 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/fdplumb.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/fdplumb.c,v 2.8 90/06/04 11:14:10 gk5g Exp $"; #endif /* lint */ #include *************** *** 13,19 **** --- 13,21 ---- #include #include + #ifndef _IBMR2 extern char *malloc(); + #endif /* _IBMR2 */ static int HasInitializedFDPlumbing = 0; int fdplumb_LogAllFileAccesses = 0; *** overhead/util/lib/getcpw.c Wed Nov 22 14:07:40 1989 --- overhead/util/lib/getcpw.c.NEW Wed Jun 13 17:18:38 1990 *************** *** 6,12 **** getcpw.c Routines to do Vice-cell-based getpwuid and getpwnam. \* ************************************************************ */ ! static char RCSid[]="$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/getcpw.c,v 2.12 89/10/05 17:14:33 ajp Exp $"; #include #include /* syslog.h */ --- 6,12 ---- getcpw.c Routines to do Vice-cell-based getpwuid and getpwnam. \* ************************************************************ */ ! static char RCSid[]="$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/getcpw.c,v 2.13 90/06/04 11:14:17 gk5g Exp $"; #include #include /* syslog.h */ *************** *** 94,100 **** --- 94,102 ---- #if (! defined(SYSV) && ! defined(AIX)) RetP.pw_quota = 0; /* pw_quota */ #endif /* ! SYSV && ! AIX */ + #ifndef _IBMR2 RetP.pw_comment = EMPTYFIELD; /* pw_comment */ + #endif /* _IBMR2 */ Res = cwp_Read(cd, PKey, idxN, &NewPtr); /* pw_gecos */ if (Res == wperr_NoError) RetP.pw_gecos = AddStg(NewPtr); else if (Res == wperr_NoSuchField) RetP.pw_gecos = EMPTYFIELD; *** overhead/util/lib/getpty.c Wed Jan 17 16:40:57 1990 --- overhead/util/lib/getpty.c.NEW Wed Jun 13 17:18:40 1990 *************** *** 2,8 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! static char rcsid[]="$Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/getpty.c,v 1.4 89/11/16 15:06:38 tpn Exp $"; /* This module contains the routine getpty. It returns file descriptors --- 2,8 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! static char rcsid[]="$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/getpty.c,v 1.8 90/06/12 14:54:15 gk5g Exp $"; /* This module contains the routine getpty. It returns file descriptors *************** *** 32,47 **** #define MAX_PTYS 64 #endif /* HPUX */ ! #ifdef AIX #define MASTER_PTY_PREFIX "/dev/ptc" #define SLAVE_PTY_PREFIX "/dev/pts" #define MAX_PTYS 256 ! #endif /* AIX */ #ifndef MASTER_PTY_PREFIX #define MASTER_PTY_PREFIX "/dev/pty" #define SLAVE_PTY_PREFIX "/dev/tty" ! #define MAX_PTYS 64 #endif static char *GetPtyNumberString(num) --- 32,47 ---- #define MAX_PTYS 64 #endif /* HPUX */ ! #if SY_AIX221 #define MASTER_PTY_PREFIX "/dev/ptc" #define SLAVE_PTY_PREFIX "/dev/pts" #define MAX_PTYS 256 ! #endif /* SY_AIX221 */ #ifndef MASTER_PTY_PREFIX #define MASTER_PTY_PREFIX "/dev/pty" #define SLAVE_PTY_PREFIX "/dev/tty" ! #define MAX_PTYS 256 #endif static char *GetPtyNumberString(num) *************** *** 49,61 **** { static char ptyNum[10]; ! #ifdef AIX sprintf(ptyNum, "%d", num); ! #else /* AIX */ ptyNum[0] = 'p' + (num/16); ptyNum[1] = "0123456789abcdef"[num%16]; ptyNum[2] = '\0'; ! #endif /* AIX */ return ptyNum; } int GetPtyandName(masterFD, slaveFD,name,len) --- 49,61 ---- { static char ptyNum[10]; ! #if SY_AIX221 sprintf(ptyNum, "%d", num); ! #else /* SY_AIX221 */ ptyNum[0] = 'p' + (num/16); ptyNum[1] = "0123456789abcdef"[num%16]; ptyNum[2] = '\0'; ! #endif /* SY_AIX221 */ return ptyNum; } int GetPtyandName(masterFD, slaveFD,name,len) *************** *** 76,82 **** strcpy(ptcname, MASTER_PTY_PREFIX); strcat(ptcname, ptyNum); if ((master = open (ptcname, 2)) >= 0) { ! #ifdef AIX { int value; --- 76,82 ---- strcpy(ptcname, MASTER_PTY_PREFIX); strcat(ptcname, ptyNum); if ((master = open (ptcname, 2)) >= 0) { ! #if defined(AIX) && !defined(_IBMR2) { int value; *************** *** 85,91 **** continue; } } ! #endif /* AIX */ strcpy(ptyname, SLAVE_PTY_PREFIX); strcat(ptyname, ptyNum); if(name != NULL) strncpy(name,ptyname,len); --- 85,91 ---- continue; } } ! #endif /* defined(AIX) && !defined(_IBMR2) */ strcpy(ptyname, SLAVE_PTY_PREFIX); strcat(ptyname, ptyNum); if(name != NULL) strncpy(name,ptyname,len); *** overhead/util/lib/gtvpwkey.c Wed Nov 22 14:08:27 1989 --- overhead/util/lib/gtvpwkey.c.NEW Wed Jun 13 17:18:42 1990 *************** *** 6,12 **** gtvpwkey.c getvpwkey(key) is like getpwent given a WP key value, for Vice IDs. \* ************************************************************ */ ! static char RCSid[]="$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/gtvpwkey.c,v 2.8 89/09/29 21:19:28 ghoti Exp $"; #include #include /* syslog.h */ --- 6,12 ---- gtvpwkey.c getvpwkey(key) is like getpwent given a WP key value, for Vice IDs. \* ************************************************************ */ ! static char RCSid[]="$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/gtvpwkey.c,v 2.9 90/06/04 11:14:23 gk5g Exp $"; #include #include /* syslog.h */ *************** *** 116,122 **** --- 116,124 ---- #if (! defined(SYSV) && ! defined(AIX)) RetP.pw_quota = 0; /* pw_quota */ #endif /* ! SYSV && ! AIX */ + #ifndef _IBMR2 RetP.pw_comment = EMPTYFIELD; /* pw_comment */ + #endif /* _IBMR2 */ Res = wp_Read(PKey, idxN, &NewPtr); /* pw_gecos */ if (Res == wperr_NoError) RetP.pw_gecos = AddStg(NewPtr); else if (Res == wperr_NoSuchField) RetP.pw_gecos = EMPTYFIELD; *** overhead/util/lib/localdir.c Wed Nov 22 14:09:30 1989 --- overhead/util/lib/localdir.c.NEW Wed Jun 13 17:18:47 1990 *************** *** 2,20 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/localdir.c,v 2.4 89/09/12 13:34:10 cfe Exp $*/ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/localdir.c,v $*/ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/localdir.c,v 2.4 89/09/12 13:34:10 cfe Exp $"; #endif /* lint */ #include #include extern char *malloc(); ! extern char *getenv(); /* Return a string with the current value for LOCALDIR imbedded in it. */ --- 2,22 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/localdir.c,v 2.5 90/06/04 11:14:29 gk5g Exp $*/ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/localdir.c,v $*/ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/localdir.c,v 2.5 90/06/04 11:14:29 gk5g Exp $"; #endif /* lint */ #include #include + #ifndef _IBMR2 extern char *malloc(); ! #endif /* _IBMR2 */ + extern char *getenv(); /* Return a string with the current value for LOCALDIR imbedded in it. */ *** overhead/util/lib/newstr.c Wed Nov 22 14:08:56 1989 --- overhead/util/lib/newstr.c.NEW Wed Jun 13 17:18:49 1990 *************** *** 6,20 **** newstr.c -- Return a dynamically-allocated copy of a string. */ ! /* $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/newstr.c,v 2.4 89/02/10 23:26:44 ghoti Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/newstr.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/newstr.c,v 2.4 89/02/10 23:26:44 ghoti Exp $"; #endif /* lint */ #include /* strings.h */ extern char *malloc(); char *NewString(srcptr) char *srcptr; --- 6,23 ---- newstr.c -- Return a dynamically-allocated copy of a string. */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/newstr.c,v 2.5 90/06/04 11:14:33 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/newstr.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/newstr.c,v 2.5 90/06/04 11:14:33 gk5g Exp $"; #endif /* lint */ #include /* strings.h */ + + #ifndef _IBMR2 extern char *malloc(); + #endif /* _IBMR2 */ char *NewString(srcptr) char *srcptr; *** overhead/util/lib/procstuf.c Wed Nov 22 14:06:04 1989 --- overhead/util/lib/procstuf.c.NEW Fri Jul 13 11:43:39 1990 *************** *** 2,9 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/procstuf.c,v 2.5 89/02/10 23:26:56 ghoti Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/procstuf.c,v $ */ #ifndef lint static char *rcsid = "$Header: "; --- 2,9 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/procstuf.c,v 2.6 90/07/12 15:01:47 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/procstuf.c,v $ */ #ifndef lint static char *rcsid = "$Header: "; *************** *** 16,22 **** #include #endif /* hp9000s300 */ #include ! extern char *index(),*rindex(),*getenv(); #define NULL 0 #define FALSE 0 --- 16,22 ---- #include #endif /* hp9000s300 */ #include ! extern char *getenv(); #define NULL 0 #define FALSE 0 *** overhead/util/lib/profile.c Wed Nov 22 14:10:09 1989 --- overhead/util/lib/profile.c.NEW Fri Jul 13 11:43:40 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/profile.c,v 2.5 89/07/25 10:15:38 tpn Exp $ */ /* $ACIS:profile.c 1.5$ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/profile.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/profile.c,v 2.5 89/07/25 10:15:38 tpn Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/profile.c,v 2.6 90/07/12 15:02:29 gk5g Exp $ */ /* $ACIS:profile.c 1.5$ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/profile.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/profile.c,v 2.6 90/07/12 15:02:29 gk5g Exp $"; #endif /* lint */ #include *************** *** 22,28 **** #define DEFAULTPROFILES "~/preferences:~/.preferences:~/.Xdefaults" #define GLOBALPROFILE AndrewDir("/lib/global.prf") - extern char *index(); extern struct passwd *getpwuid(); static struct configurelist *profileHead = NULL; --- 22,27 ---- *** overhead/util/lib/setprof.c Wed Jan 17 16:40:37 1990 --- overhead/util/lib/setprof.c.NEW Fri Jul 13 11:43:42 1990 *************** *** 2,9 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/setprof.c,v 2.11 89/11/20 16:17:16 cfe Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/setprof.c,v $ */ #ifndef lint static char *rcsid = "$Header: "; --- 2,9 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/setprof.c,v 2.12 90/07/12 15:03:04 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/setprof.c,v $ */ #ifndef lint static char *rcsid = "$Header: "; *************** *** 42,48 **** extern char ProgramName[]; extern char *GetProfileFileName(); extern char *GetFirstProfileFileName(); - extern char *index(); #define BIGPREF 2000 --- 42,47 ---- *** overhead/util/lib/svcconf.c Wed Jan 17 16:40:35 1990 --- overhead/util/lib/svcconf.c.NEW Fri Jul 13 11:43:43 1990 *************** *** 7,17 **** Definitions for cell-based services. \* ************************************************************ */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/svcconf.c,v 2.13 89/12/14 14:48:19 cfe Exp $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/svcconf.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/svcconf.c,v 2.13 89/12/14 14:48:19 cfe Exp $"; #endif /* lint */ #include --- 7,17 ---- Definitions for cell-based services. \* ************************************************************ */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/svcconf.c,v 2.15 90/07/12 15:03:44 gk5g Exp $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/svcconf.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/svcconf.c,v 2.15 90/07/12 15:03:44 gk5g Exp $"; #endif /* lint */ #include *************** *** 24,30 **** #include #include ! extern char *malloc(), *index(); extern int errno; /* The name of a file guaranteed to be in AFS */ --- 24,33 ---- #include #include ! #ifndef _IBMR2 ! extern char *malloc(); ! #endif /* _IBMR2 */ ! extern int errno; /* The name of a file guaranteed to be in AFS */ *** overhead/util/lib/thiscell.c Wed Jan 17 16:40:42 1990 --- overhead/util/lib/thiscell.c.NEW Wed Jun 13 17:18:52 1990 *************** *** 2,13 **** * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/thiscell.c,v 2.8 89/12/14 14:48:37 cfe Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/thiscell.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/thiscell.c,v 2.8 89/12/14 14:48:37 cfe Exp $"; #endif /* lint */ #include --- 2,13 ---- * Copyright IBM Corporation 1988,1989 - All Rights Reserved * * For full copyright information see:'andrew/config/COPYRITE' * \* ********************************************************************** */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/thiscell.c,v 2.9 90/06/04 11:14:45 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/thiscell.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/thiscell.c,v 2.9 90/06/04 11:14:45 gk5g Exp $"; #endif /* lint */ #include *************** *** 29,35 **** --- 29,38 ---- #define MAXSIZE 200 + #ifndef _IBMR2 extern char *malloc(); + #endif /* _IBMR2 */ + extern int errno; /* *** overhead/util/lib/times.c Fri Jul 27 16:27:37 1990 --- overhead/util/lib/times.c.NEW Mon Jul 30 15:13:13 1990 *************** *** 11,16 **** --- 11,19 ---- #include #include + #ifndef _IBMR2 + extern char *timezone(); + #endif /* _IBMR2 */ extern int errno; *** overhead/util/lib/tokpak.c Wed Jan 17 16:40:38 1990 --- overhead/util/lib/tokpak.c.NEW Wed Jun 13 17:18:56 1990 *************** *** 6,17 **** tokpak.c -- Subroutines for getting and packing Venus tokens into datagrams. */ ! /* $Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/tokpak.c,v 2.18 89/12/18 11:52:09 cfe Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/tokpak.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/tokpak.c,v 2.18 89/12/18 11:52:09 cfe Exp $"; #endif /* lint */ #include --- 6,17 ---- tokpak.c -- Subroutines for getting and packing Venus tokens into datagrams. */ ! /* $Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokpak.c,v 2.19 90/06/04 11:14:50 gk5g Exp $ */ /* $ACIS: $ */ ! /* $Source: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokpak.c,v $ */ #ifndef lint ! static char *rcsid = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/tokpak.c,v 2.19 90/06/04 11:14:50 gk5g Exp $"; #endif /* lint */ #include *************** *** 35,41 **** --- 35,43 ---- #define NIL 0 extern int errno; + #ifndef _IBMR2 extern char *malloc(), *realloc(); + #endif /* _IBMR2 */ #ifdef AFS_ENV static int PackKTC(aserv, atok, acli, where, debug, IsPrim) *** overhead/util/lib/wpbase.c Wed Jan 17 16:40:48 1990 --- overhead/util/lib/wpbase.c.NEW Wed Jun 13 17:18:58 1990 *************** *** 8,14 **** Include file ``wp.h'' declares the procedures for clients. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/wpbase.c,v 2.12 89/11/20 12:20:04 cfe Exp $"; #include #include --- 8,14 ---- Include file ``wp.h'' declares the procedures for clients. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/wpbase.c,v 2.13 90/06/04 11:14:58 gk5g Exp $"; #include #include *************** *** 31,38 **** --- 31,40 ---- extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ int wp_Debugging = 0; *** overhead/util/lib/wpcbase.c Wed Jan 17 16:40:43 1990 --- overhead/util/lib/wpcbase.c.NEW Wed Jun 13 17:19:00 1990 *************** *** 8,14 **** Include file ``wp.h'' declares the procedures for clients. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/wpcbase.c,v 2.9 89/12/14 14:06:57 cfe Exp $"; #include #include --- 8,14 ---- Include file ``wp.h'' declares the procedures for clients. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/wpcbase.c,v 2.10 90/06/04 11:15:08 gk5g Exp $"; #include #include *************** *** 27,34 **** --- 27,36 ---- #include extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ /* Compatibility routines for non-cellular use */ struct wp_CD *ThisCellDir = NULL; *** overhead/util/lib/wpfuzz.c Wed Nov 22 14:13:12 1989 --- overhead/util/lib/wpfuzz.c.NEW Wed Jun 13 17:19:02 1990 *************** *** 10,16 **** \* ************************************************************ */ #include ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/wpfuzz.c,v 2.6 89/02/16 13:11:39 ghoti Exp $"; #include #include --- 10,16 ---- \* ************************************************************ */ #include ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/wpfuzz.c,v 2.7 90/06/04 11:15:14 gk5g Exp $"; #include #include *************** *** 24,31 **** extern int bwDebugging; extern char *malloc(), *realloc(); ! static int CmpIxVal(Loc1, Loc2) char *Loc1, *Loc2; --- 24,32 ---- extern int bwDebugging; + #ifndef _IBMR2 extern char *malloc(), *realloc(); ! #endif /* _IBMR2 */ static int CmpIxVal(Loc1, Loc2) char *Loc1, *Loc2; *** overhead/util/lib/wpgen.c Wed Nov 22 14:13:18 1989 --- overhead/util/lib/wpgen.c.NEW Wed Jun 13 17:19:04 1990 *************** *** 8,14 **** Include file ``wp.h'' declares the procedures for clients. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/wpgen.c,v 2.5 89/08/29 17:48:10 cfe Exp $"; #include #include /* sys/file.h sys/types.h sys/time.h strings.h */ --- 8,14 ---- Include file ``wp.h'' declares the procedures for clients. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/wpgen.c,v 2.6 90/06/04 11:15:20 gk5g Exp $"; #include #include /* sys/file.h sys/types.h sys/time.h strings.h */ *************** *** 24,31 **** --- 24,33 ---- #include #endif /* WHITEPAGES_ENV */ extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ /* To enumerate all the prime keys in the database, use wp_Generate(PKPtr). Give this procedure a pointer to a null Prime Key and it will allocate the first PrimeKey and return it. Give it back that PrimeKey and it will deallocate it, find the next one, and return the next one. If there's no next one, it will return wperr_NoError and yet set your pointer to NULL. *** overhead/util/lib/wpname.c Wed Jan 17 16:40:51 1990 --- overhead/util/lib/wpname.c.NEW Fri Jul 13 11:43:53 1990 *************** *** 8,14 **** Include file ``wp.h'' declares the procedures for clients. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/andrew/overhead/util/lib/RCS/wpname.c,v 2.13 89/11/20 12:21:49 cfe Exp $"; #include #include --- 8,14 ---- Include file ``wp.h'' declares the procedures for clients. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/wpname.c,v 2.15 90/07/12 15:16:54 gk5g Exp $"; #include #include *************** *** 26,33 **** --- 26,35 ---- #endif /* WHITEPAGES_ENV */ extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ extern int wp_Debugging; *************** *** 780,791 **** #if Logs Log(650, "BurstName called"); #endif /* Logs */ ! J = strlen(Probe) + 1; if (PCopyLen < J) { RetVal = w_GrowString(&PCopy, &PCopyLen, J); if (RetVal != wperr_NoError) return RetVal; } ! strcpy(PCopy, Probe); This = *NSPtr; RetVal = FreshenNamSet(&This); if (RetVal != wperr_NoError) {*NSPtr = Undef_NamSet; return RetVal;} --- 782,793 ---- #if Logs Log(650, "BurstName called"); #endif /* Logs */ ! J = strlen((char*)Probe) + 1; if (PCopyLen < J) { RetVal = w_GrowString(&PCopy, &PCopyLen, J); if (RetVal != wperr_NoError) return RetVal; } ! strcpy((char*)PCopy, Probe); This = *NSPtr; RetVal = FreshenNamSet(&This); if (RetVal != wperr_NoError) {*NSPtr = Undef_NamSet; return RetVal;} *************** *** 1195,1201 **** PI1 = &NewS->Ids[0]; PI2 = &S1->Ids[0]; for (IdIx = S1->IdCount; IdIx > 0; --IdIx) { ! strncpy(PI1, PI2, PKLEN); ++PI1; ++PI2; } NewS->IdCount = S1->IdCount; --- 1197,1203 ---- PI1 = &NewS->Ids[0]; PI2 = &S1->Ids[0]; for (IdIx = S1->IdCount; IdIx > 0; --IdIx) { ! strncpy((char*)PI1, (char*)PI2, PKLEN); ++PI1; ++PI2; } NewS->IdCount = S1->IdCount; *************** *** 1211,1217 **** PI1 = &NewS->Ids[NewS->IdCount]; PI2 = &S2->Ids[0]; for (IdIx = S2->IdCount; IdIx > 0; --IdIx) { ! strncpy(PI1, PI2, PKLEN); ++PI1; ++PI2; } NewS->IdCount = DstCount; --- 1213,1219 ---- PI1 = &NewS->Ids[NewS->IdCount]; PI2 = &S2->Ids[0]; for (IdIx = S2->IdCount; IdIx > 0; --IdIx) { ! strncpy((char*)PI1, (char*)PI2, PKLEN); ++PI1; ++PI2; } NewS->IdCount = DstCount; *** overhead/util/lib/wpstat.c Wed Nov 22 14:13:40 1989 --- overhead/util/lib/wpstat.c.NEW Wed Jun 13 17:19:11 1990 *************** *** 9,15 **** \* ************************************************************ */ #include ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/util/lib/RCS/wpstat.c,v 2.6 89/02/16 13:12:12 ghoti Exp $"; #include #include /* sys/file.h */ --- 9,15 ---- \* ************************************************************ */ #include ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/src/projects/andrew/overhead/util/lib/RCS/wpstat.c,v 2.7 90/06/04 11:15:41 gk5g Exp $"; #include #include /* sys/file.h */ *************** *** 25,32 **** --- 25,34 ---- #endif /* WHITEPAGES_ENV */ extern int errno; + #ifndef _IBMR2 extern char *malloc(); extern char *realloc(); + #endif /* _IBMR2 */ /* gives static English text interpreting an error code value */ char *wp_ErrorString(codevalue) *** overhead/wputil/fwdlist.c Wed Nov 22 14:30:44 1989 --- overhead/wputil/fwdlist.c.NEW Wed Jun 13 17:19:45 1990 *************** *** 321,327 **** int my_err; wp_ErrorCode wp_err; struct wp_cd *cd = NULL; ! wp_PrimeKey PrimeKey; if ((my_err = InitWP(&cd)) != NOERR) quit(my_err); --- 321,327 ---- int my_err; wp_ErrorCode wp_err; struct wp_cd *cd = NULL; ! wp_PrimeKey PrimeKey = NULL; if ((my_err = InitWP(&cd)) != NOERR) quit(my_err); *************** *** 328,334 **** for(my_err = NOERR, argv[1] ? (wp_err=cwp_GetUIDOnly(cd, argv[1], &PrimeKey)) ! : (wp_err = cwp_Generate(cd, &(PrimeKey=NULL,PrimeKey))); (wp_err == wperr_NoError) && (PrimeKey != NULL) && (my_err < HARDERROR); --- 328,334 ---- for(my_err = NOERR, argv[1] ? (wp_err=cwp_GetUIDOnly(cd, argv[1], &PrimeKey)) ! : (wp_err = cwp_Generate(cd, &PrimeKey)); (wp_err == wperr_NoError) && (PrimeKey != NULL) && (my_err < HARDERROR); *** overhead/wputil/fwdpoll.c Mon Dec 4 21:04:59 1989 --- overhead/wputil/fwdpoll.c.NEW Wed Jun 13 17:19:47 1990 *************** *** 342,348 **** int my_err; wp_ErrorCode wp_err; struct wp_cd *cd = NULL; ! wp_PrimeKey PrimeKey; if ((my_err = InitWP(&cd)) != NOERR) quit(my_err); --- 342,348 ---- int my_err; wp_ErrorCode wp_err; struct wp_cd *cd = NULL; ! wp_PrimeKey PrimeKey = NULL; if ((my_err = InitWP(&cd)) != NOERR) quit(my_err); *************** *** 349,355 **** for(my_err = NOERR, argv[1] ? (wp_err=cwp_GetUIDOnly(cd, argv[1], &PrimeKey)) ! : (wp_err = cwp_Generate(cd, &(PrimeKey=NULL,PrimeKey))); (wp_err == wperr_NoError) && (PrimeKey != NULL) && (my_err < HARDERROR); --- 349,355 ---- for(my_err = NOERR, argv[1] ? (wp_err=cwp_GetUIDOnly(cd, argv[1], &PrimeKey)) ! : (wp_err = cwp_Generate(cd, &PrimeKey)); (wp_err == wperr_NoError) && (PrimeKey != NULL) && (my_err < HARDERROR); *** overhead/wputil/genaccts.c Wed Nov 22 14:28:28 1989 --- overhead/wputil/genaccts.c.NEW Thu May 10 16:40:07 1990 *************** *** 7,13 **** Generate a copy of our names database for use at CS. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/andrew.cmu.edu/itc/sm/releases/X.V11R4/andrew/overhead/wputil/RCS/genaccts.c,v 5.11 89/10/11 15:55:30 cfe Exp $"; #include #include --- 7,13 ---- Generate a copy of our names database for use at CS. \* ************************************************************ */ ! static char rcsid[] = "$Header: /afs/.andrew.cmu.edu/itc/src/projects/andrew/overhead/wputil/RCS/genaccts.c,v 5.12 90/05/01 10:35:08 bobg Exp $"; #include #include *************** *** 177,186 **** } else { FwdCopy[0] = '\0'; LCappend(FwdCopy, FldVal); ! printf("%s:1:%s\n", FwdCopy, IDCopy); ! } ! while (*FldNext == ' ' || *FldNext == '\t') ++FldNext; ! if (*FldNext == '\0') FldNext = NULL; } } } --- 177,188 ---- } else { FwdCopy[0] = '\0'; LCappend(FwdCopy, FldVal); ! printf("%s:1:%s\n", FwdCopy, IDCopy); ! } ! if (FldNext != NULL) { ! while (*FldNext == ' ' || *FldNext == '\t') ++FldNext; ! if (*FldNext == '\0') FldNext = NULL; ! } } } } *** overhead/wpi/wpi.c Wed Nov 22 14:31:23 1989 --- overhead/wpi/wpi.c.NEW Fri May 11 12:58:53 1990 *************** *** 10,22 **** * * \*========================================================================*/ #include #include - #include - #include #include #include - #include #ifdef AMS_ENV #include #include --- 10,20 ---- * * \*========================================================================*/ + #include #include #include #include #include #ifdef AMS_ENV #include #include *************** *** 30,40 **** NULL,NULL }; static char *progname = NULL; /* name of program */ ! static bool_t emulate_forward = false; /* If true, act like the forward program */ ! static bool_t force_warn = false; /* If true, don't exit, but continue */ ! static bool_t changes_made = false; /* if true, some fields were modified */ ! static bool_t req_auth = false; /* if true, some authorization needed */ ! static bool_t quiet = false; /* if true, suppress messages */ static void warn(msg) --- 28,38 ---- NULL,NULL }; static char *progname = NULL; /* name of program */ ! static boolx_t emulate_forward = false; /* If true, act like the forward program */ ! static boolx_t force_warn = false; /* If true, don't exit, but continue */ ! static boolx_t changes_made = false; /* if true, some fields were modified */ ! static boolx_t req_auth = false; /* if true, some authorization needed */ ! static boolx_t quiet = false; /* if true, suppress messages */ static void warn(msg) *************** *** 257,276 **** char *argv[]; { char *arg; ! bool_t command_line_fields_used = false; WPI_entry_t entry = NULL; char *self, *username, *fieldname, *selfdomain, *mailfile, newvalue[255]; ! bool_t adminp = false; int i; /* forward emulation */ ! bool_t just_print = false; ! bool_t just_validate = false; char *old_addr = NULL; char *address = ""; /* test argv[0]:t and see if we're forward or wpi */ ! (progname = strrchr(argv[0],'/')) ? ++progname : (progname=argv[0]); if (!strcmp(progname,"forward")) emulate_forward = true; --- 255,274 ---- char *argv[]; { char *arg; ! boolx_t command_line_fields_used = false; WPI_entry_t entry = NULL; char *self, *username, *fieldname, *selfdomain, *mailfile, newvalue[255]; ! boolx_t adminp = false; int i; /* forward emulation */ ! boolx_t just_print = false; ! boolx_t just_validate = false; char *old_addr = NULL; char *address = ""; /* test argv[0]:t and see if we're forward or wpi */ ! (progname = rindex(argv[0],'/')) ? ++progname : (progname=argv[0]); if (!strcmp(progname,"forward")) emulate_forward = true; *** overhead/wpi/wpi.h Wed Nov 22 14:31:12 1989 --- overhead/wpi/wpi.h.NEW Thu May 10 16:40:16 1990 *************** *** 33,43 **** #define WPI_DS_VERSION 1 /* Data Stream version number */ ! typedef enum boolean {false = 0, true} bool_t; /* the boolean type */ typedef struct { /* the entry type */ int fieldnum; ! bool_t changed; char *fieldname, *value; } *WPI_entry_t; --- 33,43 ---- #define WPI_DS_VERSION 1 /* Data Stream version number */ ! typedef enum boolean {false = 0, true} boolx_t; /* the boolean type */ typedef struct { /* the entry type */ int fieldnum; ! boolx_t changed; char *fieldname, *value; } *WPI_entry_t; *************** *** 123,126 **** fill the array "entry" with the values of the modifiable fields (including admin fields if admin_flag is true) from the WP. */ ! extern WPI_entry_t WPI_Lookup(/* char *user, bool_t admin_flag */); --- 123,126 ---- fill the array "entry" with the values of the modifiable fields (including admin fields if admin_flag is true) from the WP. */ ! extern WPI_entry_t WPI_Lookup(/* char *user, boolx_t admin_flag */); *** overhead/wpi/wpilib.c Wed Nov 22 14:31:28 1989 --- overhead/wpi/wpilib.c.NEW Fri May 11 12:58:55 1990 *************** *** 12,27 **** * * \*========================================================================*/ #include #include #include #include - #include - #include #include #include #include - #include #ifdef AMS_ENV #include #endif /* AMS_ENV */ --- 12,25 ---- * * \*========================================================================*/ + #include #include #include #include #include #include #include #include #ifdef AMS_ENV #include #endif /* AMS_ENV */ *************** *** 335,341 **** WPI_entry_t WPI_Lookup(user, admin_flag) char *user; ! bool_t admin_flag; { static struct wp_cd *wpd = NULL; /* "sticky" fields--try to maintain */ static char *wpd_domain = NULL; /* state from call to call */ --- 333,339 ---- WPI_entry_t WPI_Lookup(user, admin_flag) char *user; ! boolx_t admin_flag; { static struct wp_cd *wpd = NULL; /* "sticky" fields--try to maintain */ static char *wpd_domain = NULL; /* state from call to call */ *** overhead/wpi/wpiupdat.c Wed Nov 22 14:31:33 1989 --- overhead/wpi/wpiupdat.c.NEW Thu May 10 16:40:21 1990 *************** *** 288,294 **** char *argv[]; { char *auth; ! bool_t admin; char buf[MAXLINELENGTH], err[2*MAXLINELENGTH], *args[MAXLINELENGTH]; /* arglist from parse */ --- 288,294 ---- char *argv[]; { char *auth; ! boolx_t admin; char buf[MAXLINELENGTH], err[2*MAXLINELENGTH], *args[MAXLINELENGTH]; /* arglist from parse */ *** overhead/pobbconf/BBD.pobb Wed Jan 17 16:41:12 1990 --- overhead/pobbconf/BBD.pobb.NEW Thu May 10 16:40:39 1990 *************** *** 336,342 **** #### SUBSCRIPTION LIST CHANGES #### %ifdef pobb_AutoPost case "sublist": ! cat ?[LOCALSEARCHPATHTEMPLATE]/.SubscriptionMap ?[EXTERNALSEARCHPATHTEMPLATE]/.SubscriptionMap ?[OFFICIALSEARCHPATHTEMPLATE]/.SubscriptionMap | sort -u >>& $$TMPLOG1 echo "\majorheading{Subscriptions that have been Removed}" >>& $$POST echo "\center{===================================}" >>& $$POST comm -23 $$OLDLIST $$TMPLOG1 >>& $$POST --- 336,346 ---- #### SUBSCRIPTION LIST CHANGES #### %ifdef pobb_AutoPost case "sublist": ! rm -f $$TMPLOG2 ! foreach foo ( `echo '?[DEFAULTSEARCHPATHTEMPLATE]' | tr ':' ' '` ?[LOCALSEARCHPATHTEMPLATE] ?[OFFICIALSEARCHPATHTEMPLATE] ?[EXTERNALSEARCHPATHTEMPLATE] ) ! if ( "$$foo" =~ */* ) cat $$foo/.SubscriptionMap >> $$TMPLOG2 ! end ! sort -u $$TMPLOG2 >>& $$TMPLOG1 echo "\majorheading{Subscriptions that have been Removed}" >>& $$POST echo "\center{===================================}" >>& $$POST comm -23 $$OLDLIST $$TMPLOG1 >>& $$POST *************** *** 345,350 **** --- 349,355 ---- echo "\center{===================================}" >>& $$POST comm -13 $$OLDLIST $$TMPLOG1 >>& $$POST mv $$TMPLOG1 $$OLDLIST + rm -f $$TMPLOG2 breaksw %endif pobb_AutoPost %ifdef pobb_NNTPIn *************** *** 694,712 **** #### REINDEX MASTER UPDATE FILES #### case "reindex": echo "Before: checking Update files:" >>& $$POST ! foreach Dir ( ?[LOCALSEARCHPATHTEMPLATE] ?[OFFICIALSEARCHPATHTEMPLATE] ?[EXTERNALSEARCHPATHTEMPLATE] ) echo "$${Dir}:" >>& $$POST ls -l $${Dir}/{.SubscriptionMap,.MS.Master/Update*} >>& $$POST end $$CUIPROG set level wizard \; set term 0 500\; take all \; quit >>& $$POST ! foreach Dir ( ?[LOCALSEARCHPATHTEMPLATE] ?[OFFICIALSEARCHPATHTEMPLATE] ?[EXTERNALSEARCHPATHTEMPLATE] ) cat $${Dir}/{.SubscriptionMap,.MS.Master/Update} > /dev/null end $$CUIPROG set level wizard \; set term 0 500\; reindex \; take all \; quit >>& $$POST echo "After: checking Update files:" >>& $$POST ! foreach Dir ( ?[LOCALSEARCHPATHTEMPLATE] ?[OFFICIALSEARCHPATHTEMPLATE] ?[EXTERNALSEARCHPATHTEMPLATE] ) echo "$${Dir}:" >>& $$POST ls -l $${Dir}/{.SubscriptionMap,.MS.Master/Update*} >>& $$POST end breaksw %endif pobb_AutoPost --- 699,723 ---- #### REINDEX MASTER UPDATE FILES #### case "reindex": echo "Before: checking Update files:" >>& $$POST ! foreach Dir ( `echo '?[DEFAULTSEARCHPATHTEMPLATE]' | tr ':' ' '` ?[LOCALSEARCHPATHTEMPLATE] ?[OFFICIALSEARCHPATHTEMPLATE] ?[EXTERNALSEARCHPATHTEMPLATE] ) ! if ( "$$Dir" =~ */* ) then echo "$${Dir}:" >>& $$POST ls -l $${Dir}/{.SubscriptionMap,.MS.Master/Update*} >>& $$POST + endif end $$CUIPROG set level wizard \; set term 0 500\; take all \; quit >>& $$POST ! foreach Dir ( `echo '?[DEFAULTSEARCHPATHTEMPLATE]' | tr ':' ' '` ?[LOCALSEARCHPATHTEMPLATE] ?[OFFICIALSEARCHPATHTEMPLATE] ?[EXTERNALSEARCHPATHTEMPLATE] ) ! if ( "$$Dir" =~ */* ) then cat $${Dir}/{.SubscriptionMap,.MS.Master/Update} > /dev/null + endif end $$CUIPROG set level wizard \; set term 0 500\; reindex \; take all \; quit >>& $$POST echo "After: checking Update files:" >>& $$POST ! foreach Dir ( `echo '?[DEFAULTSEARCHPATHTEMPLATE]' | tr ':' ' '` ?[LOCALSEARCHPATHTEMPLATE] ?[OFFICIALSEARCHPATHTEMPLATE] ?[EXTERNALSEARCHPATHTEMPLATE] ) ! if ( "$$Dir" =~ */* ) then echo "$${Dir}:" >>& $$POST ls -l $${Dir}/{.SubscriptionMap,.MS.Master/Update*} >>& $$POST + endif end breaksw %endif pobb_AutoPost *** overhead/pobbconf/config.awk.pobb Fri Feb 2 12:25:31 1990 --- overhead/pobbconf/config.awk.pobb.NEW Thu May 10 16:40:42 1990 *************** *** 82,99 **** possPOBBs = PossiblePOs; deplPOBBs = DeployedPOs; for (bb = 1; bb <= numPossibleBBs; ++bb) { ! isPO = 0; ! for (po = 1; po < numPossiblePOs; ++po) { ! if (possPO[po] == possBB[bb]) isPO = 1; } ! if (isPO == 0) possPOBBs = possPOBBs " " possBB[bb]; } for (bb = 1; bb <= numDeployedBBs; ++bb) { ! isPO = 0; ! for (po = 1; po < numDeployedPOs; ++po) { ! if (deplPO[po] == deplBB[bb]) isPO = 1; } ! if (isPO == 0) deplPOBBs = deplPOBBs " " deplBB[bb]; } %else pobb_AutoPost possPOBBs = PossiblePOs; --- 82,99 ---- possPOBBs = PossiblePOs; deplPOBBs = DeployedPOs; for (bb = 1; bb <= numPossibleBBs; ++bb) { ! isaPO = 0; ! for (po = 1; po <= numPossiblePOs; ++po) { ! if (possPO[po] == possBB[bb]) isaPO = 1; } ! if (isaPO == 0) possPOBBs = possPOBBs " " possBB[bb]; } for (bb = 1; bb <= numDeployedBBs; ++bb) { ! isaPO = 0; ! for (po = 1; po <= numDeployedPOs; ++po) { ! if (deplPO[po] == deplBB[bb]) isaPO = 1; } ! if (isaPO == 0) deplPOBBs = deplPOBBs " " deplBB[bb]; } %else pobb_AutoPost possPOBBs = PossiblePOs; *************** *** 242,265 **** # Now let's do the restart lines. %ifdef pobb_RunAMSDelivery count = 0; for (mumble = 1; mumble <= numPossiblePOs; ++mumble) { ++tIx; ct_tasks[tIx] = possPO[mumble]; if (Deployed[possPO[mumble]] != 0) { ! # Reboot deployed ones over a one-hour period starting at 3:30am. when = (count * 60) / numDeployedPOs; y = split(when, outwhen, "."); if (y > 1) when = outwhen[1]; ++count; ! minute = when + 30; ! hour = 3; if (minute >= 60) {minute -= 60; hour += 1;} cronline[tIx] = minute " " hour " * * * root ?[SomeScriptDir]/restart"; } else { # Reboot non-deployed ones every hour at 3:00am. ! hour = 3; minute = 0; ! cronline[tIx] = "0 3 * * * root ?[SomeScriptDir]/restart"; } name[tIx] = "restart"; n[tIx] = "Periodic reboot"; --- 242,269 ---- # Now let's do the restart lines. %ifdef pobb_RunAMSDelivery count = 0; + rebootHour = ?[PORebootTime] / 60; + y = split(rebootHour, outwhen, "."); + if (y > 1) rebootHour = outwhen[1]; # truncate down + rebootMinute = ?[PORebootTime] - (rebootHour * 60); for (mumble = 1; mumble <= numPossiblePOs; ++mumble) { ++tIx; ct_tasks[tIx] = possPO[mumble]; if (Deployed[possPO[mumble]] != 0) { ! # Reboot deployed ones over a one-hour period starting at PORebootTime. when = (count * 60) / numDeployedPOs; y = split(when, outwhen, "."); if (y > 1) when = outwhen[1]; ++count; ! minute = when + rebootMinute; ! hour = rebootHour; if (minute >= 60) {minute -= 60; hour += 1;} cronline[tIx] = minute " " hour " * * * root ?[SomeScriptDir]/restart"; } else { # Reboot non-deployed ones every hour at 3:00am. ! hour = rebootHour; minute = 0; ! cronline[tIx] = hour " " minute " * * * root ?[SomeScriptDir]/restart"; } name[tIx] = "restart"; n[tIx] = "Periodic reboot"; *************** *** 400,406 **** %ifdef pobb_WPUpdate ++tIx; potask[tIx] = ""; # used to run on the first PO machine: loosen that now. ! cron[tIx] = "31 18 * * * root ?[wpbuildDir]/buildwp.cron.stalled"; cost[tIx] = wpCost; name[tIx] = "wpbuild"; n[tIx] = "White Pages rebuild"; --- 404,410 ---- %ifdef pobb_WPUpdate ++tIx; potask[tIx] = ""; # used to run on the first PO machine: loosen that now. ! cron[tIx] = "31 18 * * * root ?[wpbuildDir]/buildwp.cron"; cost[tIx] = wpCost; name[tIx] = "wpbuild"; n[tIx] = "White Pages rebuild"; *************** *** 432,438 **** n[tIx] = "Retrieve list-of-lists"; %endif pobb_GetListOfLists %ifdef pobb_AutoPost ! if (numDeployedPOBBs >= 3) { ++tIx; bbtask[tIx] = deplBB[3]; bbbbd[tIx] = "msdaemon.localhigh"; --- 436,442 ---- n[tIx] = "Retrieve list-of-lists"; %endif pobb_GetListOfLists %ifdef pobb_AutoPost ! if (numDeployedBBs >= 3 && ?[count(CUILocalHighBoxes)] > 0 && ?[count(CUILocalLowBoxes)] > 0) { ++tIx; bbtask[tIx] = deplBB[3]; bbbbd[tIx] = "msdaemon.localhigh"; *************** *** 445,451 **** cost[tIx] = mslocalLowCost; name[tIx] = "ms.locallow"; n[tIx] = "Service to local low-service mailboxes"; ! } else { ++tIx; bbtask[tIx] = ""; bbbbd[tIx] = "msdaemon.local"; --- 449,455 ---- cost[tIx] = mslocalLowCost; name[tIx] = "ms.locallow"; n[tIx] = "Service to local low-service mailboxes"; ! } else if (?[count(CUILocalBoxes)] > 0) { ++tIx; bbtask[tIx] = ""; bbbbd[tIx] = "msdaemon.local"; *************** *** 453,477 **** name[tIx] = "ms.local"; n[tIx] = "Service to local mailboxes"; } %ifdef pobb_UnDigest # Group extnonetnews and undigest together if we run both. ! ++tIx; ! bbtask[tIx] = ""; ! bbbbd[tIx] = "msdaemon.extnonetnews undigest"; ! cost[tIx] = msundigestCost; ! name[tIx] = "ms.ext/undigest"; ! n[tIx] = "Service to external mailboxes and undigesting"; %else pobb_UnDigest ! ++tIx; ! bbtask[tIx] = ""; ! bbbbd[tIx] = "msdaemon.extnonetnews"; ! cost[tIx] = msextnonetnewsCost; ! name[tIx] = "ms.ext"; ! n[tIx] = "Service to external mailboxes"; %endif pobb_UnDigest %ifdef pobb_DowJonesIn ++tIx; ! if (numDeployedPOBBs >= 3) { bbtask[tIx] = deplBB[4]; } else { bbtask[tIx] = ""; --- 457,483 ---- name[tIx] = "ms.local"; n[tIx] = "Service to local mailboxes"; } + if ( ?[count(CUIExtBoxes)] > 0) { %ifdef pobb_UnDigest # Group extnonetnews and undigest together if we run both. ! ++tIx; ! bbtask[tIx] = ""; ! bbbbd[tIx] = "msdaemon.extnonetnews undigest"; ! cost[tIx] = msundigestCost; ! name[tIx] = "ms.ext/undigest"; ! n[tIx] = "Service to external mailboxes and undigesting"; %else pobb_UnDigest ! ++tIx; ! bbtask[tIx] = ""; ! bbbbd[tIx] = "msdaemon.extnonetnews"; ! cost[tIx] = msextnonetnewsCost; ! name[tIx] = "ms.ext"; ! n[tIx] = "Service to external mailboxes"; %endif pobb_UnDigest + } %ifdef pobb_DowJonesIn ++tIx; ! if (numDeployedBBs >= 4) { bbtask[tIx] = deplBB[4]; } else { bbtask[tIx] = ""; *** overhead/pobbconf/pobb-install.pobb Mon Mar 12 13:17:46 1990 --- overhead/pobbconf/pobb-install.pobb.NEW Thu May 10 16:40:47 1990 *************** *** 494,500 **** endif endif ! foreach root ( ?[LOCALSEARCHPATHTEMPLATE] ?[EXTERNALSEARCHPATHTEMPLATE] ?[OFFICIALSEARCHPATHTEMPLATE] ) if ( -d $${root}/.MS.Master ) then if ( ! -d $${root}/.MS.Master/$${machine} ) then mkdir $${root}/.MS.Master/$${machine} --- 494,501 ---- endif endif ! foreach root ( `echo '?[DEFAULTSEARCHPATHTEMPLATE]' | tr ':' ' '` ?[LOCALSEARCHPATHTEMPLATE] ?[OFFICIALSEARCHPATHTEMPLATE] ?[EXTERNALSEARCHPATHTEMPLATE] ) ! if ( "$$root" =~ */* ) then if ( -d $${root}/.MS.Master ) then if ( ! -d $${root}/.MS.Master/$${machine} ) then mkdir $${root}/.MS.Master/$${machine} *************** *** 503,508 **** --- 504,510 ---- %endif pobbenv_AFS endif endif + endif end set SAWBB=1 end *** overhead/pobbconf/pobbconf.c Fri Feb 2 12:25:29 1990 --- overhead/pobbconf/pobbconf.c.NEW Thu May 10 16:40:50 1990 *************** *** 143,148 **** --- 143,152 ---- char *CronPath = "?[POBBAndrewDir]/bin:/usr/ucb:/bin:/usr/bin:/usr/local/bin:?[POBBAndrewDir]/etc"; #if (pobb_RunMachines) char *PostmasterHome = "/afs/andrew.cmu.edu/usr0/postman"; + #if (pobb_RunAMSDelivery) + int PORebootTime = 200; /* minute of day to start reboots */ + int PODoReboot = 0; /* whether to really reboot or just restart. */ + #endif /* (pobb_RunAMSDelivery) */ #endif /* (pobb_RunMachines) */ #if (pobb_RunAMSDelivery || pobb_NNTPIn) *** overhead/pobbconf/pobbconf.h Wed Jan 17 16:41:03 1990 --- overhead/pobbconf/pobbconf.h.NEW Thu May 10 16:40:52 1990 *************** *** 225,230 **** --- 225,234 ---- extern char *CronPath; #if (pobb_RunMachines) extern char *PostmasterHome; + #if (pobb_RunAMSDelivery) + extern int PORebootTime; /* minute of day to start reboots */ + extern int PODoReboot; /* whether to really reboot or just restart. */ + #endif /* (pobb_RunAMSDelivery) */ #endif /* (pobb_RunMachines) */ #if (pobb_RunAMSDelivery || pobb_NNTPIn) *** overhead/pobbconf/pobbscpt.c Wed Jan 17 16:41:05 1990 --- overhead/pobbconf/pobbscpt.c.NEW Thu May 10 16:40:57 1990 *************** *** 635,640 **** --- 635,644 ---- #endif /* (pobb_DowJonesIn) */ {"CUIHintsSleepTime", &CUIHintsSleepTime}, #endif /* (pobb_AutoPost) */ + #if (pobb_RunAMSDelivery) + {"PORebootTime", &PORebootTime}, + {"PODoReboot", &PODoReboot}, + #endif /* (pobb_RunAMSDelivery) */ }; static int numInts = sizeof(Ints) / sizeof(Ints[0]); *** overhead/pobbconf/queueBBD.pobb Wed Jan 17 16:41:24 1990 --- overhead/pobbconf/queueBBD.pobb.NEW Thu May 10 16:40:59 1990 *************** *** 16,25 **** echo "use 'queueBBD -x' for help" exit (1) endif ! set XXX="" if ( "$$1" == "N") then %ifdef pobb_AutoPost ! set XXX="$${XXX} sublist nightstat nightpurge reindex"; %endif pobb_AutoPost %ifdef pobbenv_AFS set XXX="bbquota $${XXX}"; --- 16,29 ---- echo "use 'queueBBD -x' for help" exit (1) endif ! set XXX="XXX" if ( "$$1" == "N") then %ifdef pobb_AutoPost ! if ( ?[count(PurgingCommandsNightly)] > 0 ) then ! set XXX="$${XXX} sublist nightstat nightpurge reindex"; ! else ! set XXX="$${XXX} sublist nightstat reindex"; ! endif %endif pobb_AutoPost %ifdef pobbenv_AFS set XXX="bbquota $${XXX}"; *************** *** 42,48 **** endif if ( "$$1" == "W") then %ifdef pobb_AutoPost ! set XXX="$${XXX} weekstat weekpurge"; %endif pobb_AutoPost %ifdef pobb_TakeHelpStats set XXX="$${XXX} helpstat" --- 46,55 ---- endif if ( "$$1" == "W") then %ifdef pobb_AutoPost ! set XXX="$${XXX} weekstat"; ! if ( ?[count(PurgingCommandsWeekly)] > 0 ) then ! set XXX="$${XXX} weekpurge"; ! endif %endif pobb_AutoPost %ifdef pobb_TakeHelpStats set XXX="$${XXX} helpstat" *************** *** 50,66 **** endif if ( "$$1" == "BW") then %ifdef pobb_AutoPost ! set XXX="$${XXX} biweekpurge"; %endif pobb_AutoPost endif if ( "$$1" == "M") then %ifdef pobb_AutoPost ! set XXX="$${XXX} monthstat monthpurge" %endif pobb_AutoPost endif if ( "$$1" == "S") then %ifdef pobb_AutoPost ! set XXX="$${XXX} semi-annualstat semi-annualpurge" %endif pobb_AutoPost endif if ( "$${XXX}" != "" ) then --- 57,81 ---- endif if ( "$$1" == "BW") then %ifdef pobb_AutoPost ! if ( ?[count(PurgingCommandsBiWeekly)] > 0 ) then ! set XXX="$${XXX} biweekpurge"; ! endif %endif pobb_AutoPost endif if ( "$$1" == "M") then %ifdef pobb_AutoPost ! set XXX="$${XXX} monthstat" ! if ( ?[count(PurgingCommandsMonthly)] > 0 ) then ! set XXX="$${XXX} monthpurge" ! endif %endif pobb_AutoPost endif if ( "$$1" == "S") then %ifdef pobb_AutoPost ! set XXX="$${XXX} semi-annualstat" ! if ( ?[count(PurgingCommandsSemiAnnually)] > 0 ) then ! set XXX="$${XXX} semi-annualpurge" ! endif %endif pobb_AutoPost endif if ( "$${XXX}" != "" ) then *************** *** 135,140 **** --- 150,158 ---- - semi-annualpurge" %endif pobb_AutoPost exit (0) + + case "XXX": + breaksw default: echo "queueBBD: enqueueing $$OurArgs[1]" *** overhead/pobbconf/restart.pobb Wed Nov 22 14:36:40 1989 --- overhead/pobbconf/restart.pobb.NEW Thu May 10 16:41:01 1990 *************** *** 8,52 **** # ?[POBBRunWarning] # ?[POBBRunNotice] ! %ifdef pobb_RunMachines # For restarting oldsendmail -- reboot does it ! echo "(pid $$$$) Reboot in 10 minutes" > /dev/console sleep 60 - %ifdef pobb_RunAMSDelivery set pid = `ps ax | egrep oldsendmail | egrep -v egrep` if ($$#pid != 0) then set pid = $$pid[1] ! echo "Switching oldsendmail log; pid = $$pid" > /dev/console ! (echo "kill -IOT $$pid"; kill -IOT $$pid) > /dev/console sleep 50 # Send logs to bboard ?[SomeScriptDir]/postlog else ! echo "No oldsendmail daemon to kill" > /dev/console sleep 60 endif - %else pobb_RunAMSDelivery - sleep 60 - %endif pobb_RunAMSDelivery ! ?[SmallLocalDir]/pobb.shutdown >& /dev/null ! sleep 180 ! echo "Reboot in 5 minutes" > /dev/console ! ! sleep 240 ! echo "Reboot in 1 minute" > /dev/console ! ! sleep 60 ! sync ! echo "Rebooting..." > /dev/console ! sleep 2 ! sync ! (reboot) ! /etc/reboot ! /bin2/reboot ! ! %endif pobb_RunMachines --- 8,54 ---- # ?[POBBRunWarning] # ?[POBBRunNotice] ! %ifdef pobb_RunAMSDelivery # For restarting oldsendmail -- reboot does it ! if ( ?[PODoReboot] != 0 ) then ! set What="Reboot in 10" ! else ! set What="Sendmail log-switch in 2" ! endif ! echo "(pid $$$$) $${What} minutes" >& /dev/console sleep 60 set pid = `ps ax | egrep oldsendmail | egrep -v egrep` if ($$#pid != 0) then set pid = $$pid[1] ! echo "Switching oldsendmail log; pid = $$pid" >& /dev/console ! (echo "kill -IOT $$pid"; kill -IOT $$pid) >& /dev/console sleep 50 # Send logs to bboard ?[SomeScriptDir]/postlog else ! echo "No oldsendmail daemon to signal" >& /dev/console sleep 60 endif ! if ( ?[PODoReboot] != 0 ) then ! ?[SmallLocalDir]/pobb.shutdown >& /dev/null ! sleep 180 ! echo "Reboot in 5 minutes" >& /dev/console ! sleep 240 ! echo "Reboot in 1 minute" >& /dev/console ! sleep 60 ! sync ! sleep 10 ! sync ! echo "Rebooting..." >& /dev/console ! sleep 2 ! sync ! (reboot) ! /etc/reboot ! /bin2/reboot ! endif ! %endif pobb_RunAMSDelivery *** xmkfontd/non-andrew.fonts.alias Tue Dec 12 14:56:38 1989 --- xmkfontd/non-andrew.fonts.alias.NEW Wed Aug 1 11:20:23 1990 *************** *** 1,68 **** ! andytype10bf -adobe-courier-bold-r-normal--*-100-*-*-m-*-iso8859-1 ! andytype10bif -adobe-courier-bold-o-normal--*-100-*-*-m-*-iso8859-1 ! andytype10f -adobe-courier-medium-r-normal--*-100-*-*-m-*-iso8859-1 ! andytype10if -adobe-courier-medium-o-normal--*-100-*-*-m-*-iso8859-1 ! andytype12bf -adobe-courier-bold-r-normal--*-120-*-*-m-*-iso8859-1 ! andytype12bif -adobe-courier-bold-o-normal--*-120-*-*-m-*-iso8859-1 ! andytype12f -adobe-courier-medium-r-normal--*-120-*-*-m-*-iso8859-1 ! andytype12if -adobe-courier-medium-o-normal--*-120-*-*-m-*-iso8859-1 ! andytype14bf -adobe-courier-bold-r-normal--*-140-*-*-m-*-iso8859-1 ! andytype14bif -adobe-courier-bold-o-normal--*-140-*-*-m-*-iso8859-1 ! andytype14f -adobe-courier-medium-r-normal--*-140-*-*-m-*-iso8859-1 ! andytype14if -adobe-courier-medium-o-normal--*-140-*-*-m-*-iso8859-1 ! andytype8bf -adobe-courier-bold-r-normal--*-80-*-*-m-*-iso8859-1 ! andytype8bif -adobe-courier-bold-o-normal--*-80-*-*-m-*-iso8859-1 ! andytype8f -adobe-courier-medium-r-normal--*-80-*-*-m-*-iso8859-1 ! andytype8if -adobe-courier-medium-o-normal--*-80-*-*-m-*-iso8859-1 ! andysans10 -adobe-helvetica-medium-r-normal--*-100-*-*-p-*-iso8859-1 ! andysans10b -adobe-helvetica-bold-r-normal--*-100-*-*-p-*-iso8859-1 ! andysans10bi -adobe-helvetica-bold-o-normal--*-100-*-*-p-*-iso8859-1 ! andysans10i -adobe-helvetica-medium-o-normal--*-100-*-*-p-*-iso8859-1 ! andysans12 -adobe-helvetica-medium-r-normal--*-120-*-*-p-*-iso8859-1 ! andysans12b -adobe-helvetica-bold-r-normal--*-120-*-*-p-*-iso8859-1 ! andysans12bi -adobe-helvetica-bold-o-normal--*-120-*-*-p-*-iso8859-1 ! andysans12i -adobe-helvetica-medium-o-normal--*-120-*-*-p-*-iso8859-1 ! andysans14 -adobe-helvetica-medium-r-normal--*-140-*-*-p-*-iso8859-1 ! andysans14b -adobe-helvetica-bold-r-normal--*-140-*-*-p-*-iso8859-1 ! andysans14bi -adobe-helvetica-bold-o-normal--*-140-*-*-p-*-iso8859-1 ! andysans14i -adobe-helvetica-medium-o-normal--*-140-*-*-p-*-iso8859-1 ! andysans16 -adobe-helvetica-medium-r-normal--*-160-*-*-p-*-iso8859-1 ! andysans16b -adobe-helvetica-bold-r-normal--*-160-*-*-p-*-iso8859-1 ! andysans16bi -adobe-helvetica-bold-o-normal--*-160-*-*-p-*-iso8859-1 ! andysans16i -adobe-helvetica-medium-o-normal--*-160-*-*-p-*-iso8859-1 ! andysans22 -adobe-helvetica-medium-r-normal--*-220-*-*-p-*-iso8859-1 ! andysans22b -adobe-helvetica-bold-r-normal--*-220-*-*-p-*-iso8859-1 ! andysans22bi -adobe-helvetica-bold-o-normal--*-220-*-*-p-*-iso8859-1 ! andysans22i -adobe-helvetica-medium-o-normal--*-220-*-*-p-*-iso8859-1 ! andysans8 -adobe-helvetica-medium-r-normal--*-80-*-*-p-*-iso8859-1 ! andysans8b -adobe-helvetica-bold-r-normal--*-80-*-*-p-*-iso8859-1 ! andysans8bi -adobe-helvetica-bold-o-normal--*-80-*-*-p-*-iso8859-1 ! andysans8i -adobe-helvetica-medium-o-normal--*-80-*-*-p-*-iso8859-1 ! andy10 -adobe-times-medium-r-normal--*-100-*-*-p-*-iso8859-1 ! andy10b -adobe-times-bold-r-normal--*-100-*-*-p-*-iso8859-1 ! andy10bi -adobe-times-bold-i-normal--*-100-*-*-p-*-iso8859-1 ! andy10i -adobe-times-medium-i-normal--*-100-*-*-p-*-iso8859-1 ! andy12 -adobe-times-medium-r-normal--*-120-*-*-p-*-iso8859-1 ! andy120 -adobe-times-medium-r-normal--*-1200-*-*-p-*-iso8859-1 ! andy12b -adobe-times-bold-r-normal--*-120-*-*-p-*-iso8859-1 ! andy12bi -adobe-times-bold-i-normal--*-120-*-*-p-*-iso8859-1 ! andy12i -adobe-times-medium-i-normal--*-120-*-*-p-*-iso8859-1 ! andy14 -adobe-times-medium-r-normal--*-140-*-*-p-*-iso8859-1 ! andy14b -adobe-times-bold-r-normal--*-140-*-*-p-*-iso8859-1 ! andy14bi -adobe-times-bold-i-normal--*-140-*-*-p-*-iso8859-1 ! andy14i -adobe-times-medium-i-normal--*-140-*-*-p-*-iso8859-1 ! andy16 -adobe-times-medium-r-normal--*-160-*-*-p-*-iso8859-1 ! andy16b -adobe-times-bold-r-normal--*-160-*-*-p-*-iso8859-1 ! andy16bi -adobe-times-bold-i-normal--*-160-*-*-p-*-iso8859-1 ! andy16i -adobe-times-medium-i-normal--*-160-*-*-p-*-iso8859-1 ! andy22 -adobe-times-medium-r-normal--*-220-*-*-p-*-iso8859-1 ! andy22b -adobe-times-bold-r-normal--*-220-*-*-p-*-iso8859-1 ! andy22bi -adobe-times-bold-i-normal--*-220-*-*-p-*-iso8859-1 ! andy22i -adobe-times-medium-i-normal--*-220-*-*-p-*-iso8859-1 ! andy8 -adobe-times-medium-r-normal--*-80-*-*-p-*-iso8859-1 ! andy8b -adobe-times-bold-r-normal--*-80-*-*-p-*-iso8859-1 ! andy8bi -adobe-times-bold-i-normal--*-80-*-*-p-*-iso8859-1 ! andy8i -adobe-times-medium-i-normal--*-80-*-*-p-*-iso8859-1 andysymbol10 symbol10 andysymbol12 symbol12 andysymbol16 symbol16 --- 1,68 ---- ! andytype10bf -adobe-courier-bold-r-normal--*-120-*-*-m-*-iso8859-1 ! andytype10bif -adobe-courier-bold-o-normal--*-120-*-*-m-*-iso8859-1 ! andytype10f -adobe-courier-medium-r-normal--*-120-*-*-m-*-iso8859-1 ! andytype10if -adobe-courier-medium-o-normal--*-120-*-*-m-*-iso8859-1 ! andytype12bf -adobe-courier-bold-r-normal--*-140-*-*-m-*-iso8859-1 ! andytype12bif -adobe-courier-bold-o-normal--*-140-*-*-m-*-iso8859-1 ! andytype12f -adobe-courier-medium-r-normal--*-140-*-*-m-*-iso8859-1 ! andytype12if -adobe-courier-medium-o-normal--*-140-*-*-m-*-iso8859-1 ! andytype14bf -adobe-courier-bold-r-normal--17-120-100-100-m-100-iso8859-1 ! andytype14bif -adobe-courier-bold-o-normal--17-120-100-100-m-100-iso8859-1 ! andytype14f -adobe-courier-medium-r-normal--17-120-100-100-m-100-iso8859-1 ! andytype14if -adobe-courier-medium-o-normal--17-120-100-100-m-100-iso8859-1 ! andytype8bf -adobe-courier-bold-r-normal--*-100-*-*-m-*-iso8859-1 ! andytype8bif -adobe-courier-bold-o-normal--*-100-*-*-m-*-iso8859-1 ! andytype8f -adobe-courier-medium-r-normal--*-100-*-*-m-*-iso8859-1 ! andytype8if -adobe-courier-medium-o-normal--*-100-*-*-m-*-iso8859-1 ! andysans10 -adobe-helvetica-medium-r-normal--*-120-*-*-p-*-iso8859-1 ! andysans10b -adobe-helvetica-bold-r-normal--*-120-*-*-p-*-iso8859-1 ! andysans10bi -adobe-helvetica-bold-o-normal--*-120-*-*-p-*-iso8859-1 ! andysans10i -adobe-helvetica-medium-o-normal--*-120-*-*-p-*-iso8859-1 ! andysans12 -adobe-helvetica-medium-r-normal--*-140-*-*-p-*-iso8859-1 ! andysans12b -adobe-helvetica-bold-r-normal--*-140-*-*-p-*-iso8859-1 ! andysans12bi -adobe-helvetica-bold-o-normal--*-140-*-*-p-*-iso8859-1 ! andysans12i -adobe-helvetica-medium-o-normal--*-140-*-*-p-*-iso8859-1 ! andysans14 -adobe-helvetica-medium-r-normal--17-120-100-100-p-88-iso8859-1 ! andysans14b -adobe-helvetica-bold-r-normal--17-120-100-100-p-92-iso8859-1 ! andysans14bi -adobe-helvetica-bold-o-normal--17-120-100-100-p-92-iso8859-1 ! andysans14i -adobe-helvetica-medium-o-normal--17-120-100-100-p-88-iso8859-1 ! andysans16 -adobe-helvetica-medium-r-normal--*-180-*-*-p-*-iso8859-1 ! andysans16b -adobe-helvetica-bold-r-normal--*-180-*-*-p-*-iso8859-1 ! andysans16bi -adobe-helvetica-bold-o-normal--*-180-*-*-p-*-iso8859-1 ! andysans16i -adobe-helvetica-medium-o-normal--*-180-*-*-p-*-iso8859-1 ! andysans22 -adobe-helvetica-medium-r-normal--*-240-*-*-p-*-iso8859-1 ! andysans22b -adobe-helvetica-bold-r-normal--*-240-*-*-p-*-iso8859-1 ! andysans22bi -adobe-helvetica-bold-o-normal--*-240-*-*-p-*-iso8859-1 ! andysans22i -adobe-helvetica-medium-o-normal--*-240-*-*-p-*-iso8859-1 ! andysans8 -adobe-helvetica-medium-r-normal--*-100-*-*-p-*-iso8859-1 ! andysans8b -adobe-helvetica-bold-r-normal--*-100-*-*-p-*-iso8859-1 ! andysans8bi -adobe-helvetica-bold-o-normal--*-100-*-*-p-*-iso8859-1 ! andysans8i -adobe-helvetica-medium-o-normal--*-100-*-*-p-*-iso8859-1 ! andy10 -adobe-times-medium-r-normal--*-120-*-*-p-*-iso8859-1 ! andy10b -adobe-times-bold-r-normal--*-120-*-*-p-*-iso8859-1 ! andy10bi -adobe-times-bold-i-normal--*-120-*-*-p-*-iso8859-1 ! andy10i -adobe-times-medium-i-normal--*-120-*-*-p-*-iso8859-1 ! andy12 -adobe-times-medium-r-normal--*-140-*-*-p-*-iso8859-1 ! andy120 times120 ! andy12b -adobe-times-bold-r-normal--*-140-*-*-p-*-iso8859-1 ! andy12bi -adobe-times-bold-i-normal--*-140-*-*-p-*-iso8859-1 ! andy12i -adobe-times-medium-i-normal--*-140-*-*-p-*-iso8859-1 ! andy14 -adobe-times-medium-r-normal--17-120-100-100-p-84-iso8859-1 ! andy14b -adobe-times-bold-r-normal--17-120-100-100-p-88-iso8859-1 ! andy14bi -adobe-times-bold-i-normal--17-120-100-100-p-86-iso8859-1 ! andy14i -adobe-times-medium-i-normal--17-120-100-100-p-84-iso8859-1 ! andy16 -adobe-times-medium-r-normal--*-180-*-*-p-*-iso8859-1 ! andy16b -adobe-times-bold-r-normal--*-180-*-*-p-*-iso8859-1 ! andy16bi -adobe-times-bold-i-normal--*-180-*-*-p-*-iso8859-1 ! andy16i -adobe-times-medium-i-normal--*-180-*-*-p-*-iso8859-1 ! andy22 -adobe-times-medium-r-normal--*-240-*-*-p-*-iso8859-1 ! andy22b -adobe-times-bold-r-normal--*-240-*-*-p-*-iso8859-1 ! andy22bi -adobe-times-bold-i-normal--*-240-*-*-p-*-iso8859-1 ! andy22i -adobe-times-medium-i-normal--*-240-*-*-p-*-iso8859-1 ! andy8 -adobe-times-medium-r-normal--*-100-*-*-p-*-iso8859-1 ! andy8b -adobe-times-bold-r-normal--*-100-*-*-p-*-iso8859-1 ! andy8bi -adobe-times-bold-i-normal--*-100-*-*-p-*-iso8859-1 ! andy8i -adobe-times-medium-i-normal--*-100-*-*-p-*-iso8859-1 andysymbol10 symbol10 andysymbol12 symbol12 andysymbol16 symbol16 *** helpindex/Imakefile Wed Dec 6 10:33:11 1989 --- helpindex/Imakefile.NEW Wed Jul 18 17:14:36 1990 *************** *** 16,21 **** --- 16,24 ---- InstallFileToFile(cmu.ovrvw, $(INSTINCFLAGS), $(DESTDIR)/lib/help.overviews) InstallFileToFile(cmu.prgms, $(INSTINCFLAGS), $(DESTDIR)/lib/help.programs) + install.time:: + /afs/andrew.cmu.edu/usr0/hm99/index/installandyindex.SYS_NAME $(DESTDIR) + #else /* CMU_ENV */ InstallFileToFile(help.ovrvw, $(INSTINCFLAGS), $(DESTDIR)/lib/help.overviews) END OF ANDREW PATCH 6