749N/A/*
749N/A* $XConsortium: AsciiSrcP.h,v 1.6 89/10/05 13:17:39 kit Exp $
749N/A*/
749N/A
749N/A
749N/A/***********************************************************
749N/ACopyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
749N/Aand the Massachusetts Institute of Technology, Cambridge, Massachusetts.
749N/A
749N/A All Rights Reserved
749N/A
749N/APermission to use, copy, modify, and distribute this software and its
749N/Adocumentation for any purpose and without fee is hereby granted,
749N/Aprovided that the above copyright notice appear in all copies and that
749N/Aboth that copyright notice and this permission notice appear in
749N/Asupporting documentation, and that the names of Digital or MIT not be
749N/Aused in advertising or publicity pertaining to distribution of the
749N/Asoftware without specific, written prior permission.
749N/A
749N/ADIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
749N/AALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
749N/ADIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
749N/AANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
749N/AWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
749N/AARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
749N/ASOFTWARE.
749N/A
749N/A******************************************************************/
749N/A
749N/A/*
749N/A * AsciiSrcP.h - Private Header for Ascii Text Source.
749N/A *
749N/A * This is the private header file for the Ascii Text Source.
749N/A * It is intended to be used with the Text widget, the simplest way to use
749N/A * this text source is to use the AsciiText Object.
749N/A *
749N/A * Date: June 29, 1989
749N/A *
749N/A * By: Chris D. Peterson
749N/A * MIT X Consortium
749N/A * kit@expo.lcs.mit.edu
749N/A */
749N/A
749N/A/*
749N/A * TextSrcP.h - Private definitions for AsciiSrc object
749N/A *
749N/A */
749N/A
749N/A#ifndef _XawAsciiSrcP_h
749N/A#define _XawAsciiSrcP_h
749N/A
749N/A#include <./Xaw3_1AsciiSrc.h>
749N/A#include <./Xaw3_1TextSrcP.h>
749N/A
749N/A/************************************************************
749N/A *
749N/A * Private declarations.
749N/A *
749N/A ************************************************************/
749N/A
749N/A#define TMPSIZ 32 /* bytes to allocate for tmpnam */
749N/A
749N/A#define MAGIC_VALUE ((XawTextPosition) -1) /* Magic value. */
749N/A
749N/A#define streq(a, b) ( strcmp((a), (b)) == 0 )
749N/A
749N/Atypedef struct _Piece { /* Piece of the text file of BUFSIZ allocated
749N/A characters. */
749N/A char * text; /* The text in this buffer. */
749N/A XawTextPosition used; /* The number of characters of this buffer
749N/A that have been used. */
749N/A struct _Piece *prev, *next; /* linked list pointers. */
749N/A} Piece;
749N/A
749N/A/************************************************************
749N/A *
749N/A * New fields for the AsciiSrc object class record.
749N/A *
749N/A ************************************************************/
749N/A
749N/Atypedef struct _AsciiSrcClassPart { char foo; } AsciiSrcClassPart;
749N/A
749N/A/* Full class record declaration */
749N/Atypedef struct _AsciiSrcClassRec {
749N/A ObjectClassPart object_class;
749N/A TextSrcClassPart text_src_class;
749N/A AsciiSrcClassPart ascii_src_class;
749N/A} AsciiSrcClassRec;
749N/A
749N/Aextern AsciiSrcClassRec asciiSrcClassRec;
749N/A
749N/A/* New fields for the AsciiSrc object record */
749N/A
749N/Atypedef struct _AsciiSrcPart {
749N/A
749N/A /* Resources. */
749N/A
749N/A char *string; /* either the string, or the
749N/A file name, depending upon the type. */
749N/A XawAsciiType type; /* either string or disk. */
749N/A XawTextPosition piece_size; /* Size of text buffer for each piece. */
749N/A Boolean data_compression; /* compress to minimum memory automatically
749N/A on save? */
749N/A XtCallbackList callback; /* A callback list to call when the source is
749N/A changed. */
749N/A Boolean use_string_in_place; /* Use the string passed in place. */
749N/A int ascii_length; /* length field for ascii string emulation. */
749N/A
749N/A#ifdef ASCII_DISK
749N/A String filename; /* name of file for Compatability. */
749N/A#endif /* ASCII_DISK */
749N/A
749N/A/* Private data. */
749N/A
749N/A Boolean is_tempfile; /* Is this a temporary file? */
749N/A Boolean changes; /* Has this file been edited? */
749N/A Boolean allocated_string; /* Have I allocated the
749N/A string in ascii_src->string? */
749N/A XawTextPosition length; /* length of file */
749N/A Piece * first_piece; /* first piece of the text. */
749N/A} AsciiSrcPart;
749N/A
749N/A/****************************************************************
749N/A *
749N/A * Full instance record declaration
749N/A *
749N/A ****************************************************************/
749N/A
749N/Atypedef struct _AsciiSrcRec {
749N/A ObjectPart object;
749N/A TextSrcPart text_src;
749N/A AsciiSrcPart ascii_src;
749N/A} AsciiSrcRec;
749N/A
749N/A#endif /* _XawAsciiSrcP_h --- Don't add anything after this line. */