home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************/
- /* Copyright 1988, 1989 by Chuck Musciano and Harris Corporation */
- /* */
- /* Permission to use, copy, modify, and distribute this software */
- /* and its documentation for any purpose and without fee is */
- /* hereby granted, provided that the above copyright notice */
- /* appear in all copies and that both that copyright notice and */
- /* this permission notice appear in supporting documentation, and */
- /* that the name of Chuck Musciano and Harris Corporation not be */
- /* used in advertising or publicity pertaining to distribution */
- /* of the software without specific, written prior permission. */
- /* Chuck Musciano and Harris Corporation make no representations */
- /* about the suitability of this software for any purpose. It is */
- /* provided "as is" without express or implied warranty. This */
- /* software may not be sold without the prior explicit permission */
- /* of Harris Corporation. */
- /************************************************************************/
-
- #include <stdio.h>
-
- #include <suntool/sunview.h>
- #include <suntool/panel.h>
-
- #include "contool.h"
- #include "entry.h"
-
- EXPORT f_ptr clipboard;
- EXPORT int cb_size = 0;
-
- /************************************************************************/
- EXPORT clear_clipboard()
-
- { int i;
- f_ptr f;
-
- if (cb_size > 0) {
- for (i = 0, f = clipboard; i < cb_size; i++, f++) {
- free(f->start);
- if (f->end)
- free(f->end);
- }
- free(clipboard);
- cb_size = 0;
- }
- }
-
- /************************************************************************/
- EXPORT add_to_clipboard(e)
-
- register e_ptr e;
-
- { register f_ptr f;
-
- if (cb_size == 0)
- f = clipboard = (f_ptr) malloc(sizeof(f_rec));
- else {
- clipboard = (f_ptr) realloc(clipboard, sizeof(f_rec) * (cb_size + 1));
- f = clipboard + cb_size;
- }
- f->beep = (int) panel_get(e->beep, PANEL_VALUE);
- f->flash = (int) panel_get(e->flash, PANEL_VALUE);
- f->open = (int) panel_get(e->open, PANEL_VALUE);
- f->save = (int) panel_get(e->save, PANEL_VALUE);
- f->stamp = (int) panel_get(e->stamp, PANEL_VALUE);
- f->start = strsave(panel_get(e->start, PANEL_VALUE));
- if (panel_get(e->lines, PANEL_VALUE))
- f->end = strsave(panel_get(e->end, PANEL_VALUE));
- else
- f->end = NULL;
- cb_size++;
- }
-