/**-- simple FORTH-screenfile editor Copyright (C) Tektronix, Inc. 1998 - 2000. All rights reserved. @see GNU LGPL @author Tektronix CTE @(#) %derived_by: guidod % @version %version: bln_mpt1!5.22 % (%date_modified: Mon Apr 08 20:17:44 2002 %) @description This is a simple fullscreen FORTH block editor. will be missing in most builds */ /* @{ */ #if defined(__version_control__) && defined(__GNUC__)static char* id __attribute__((unused)) = "@(#) $Id: %full_filespec: edit-ext.c~bln_mpt1!5.22:csrc:bln_12xx!1 % $" #endif #define _P4_SOURCE 1 #include <pfe/pfe-base.h> #include <pfe/def-xtra.h> #include <stdlib.h> #include <stdarg.h> #include <string.h> #include <ctype.h> #include <time.h> #include <signal.h> #include <pfe/option-ext.h> #include <pfe/def-words.h> #include <pfe/block-ext.h> #include <pfe/term-sub.h> #include <pfe/lined.h> #include <pfe/logging.h> #include <pfe/_nonansi.h> #include <pfe/_missing.h> #define ED (*(struct edit*)(PFE.p[slot])); static int slot = 0 ; typedef char line[64] ; typedef line blck[16] ;
/*
|
/* |
static void edit_init (struct edit* set)
|
FCode_RT (p4_edit_forget)
|
FCode (p4_edit_init)
|
/* |
static int scr_changed (void)
|
static int block_empty (char *p)
|
static int scr_empty (int n)
|
static void scr_copy (int dst, int src)
|
static void truncate_file (void)
|
static void stamp_screen (void)
|
static void writebuf (void)
|
static void readbuf (int n)
|
static void changescr (int n)
|
/* |
static int getckey (void)
|
static void c_printf (char const * fmt,...)
|
static void type_line (char *p, int n)
|
/* |
struct helpline
|
static struct helpline primary_help[] =
|
static struct helpline ctl_k_help[] =
|
static struct helpline ctl_o_help[] =
|
static struct helpline ctl_q_help[] =
|
static void show_help (int row, int col, int n, struct helpline *h)
|
static void show_bottom_help (int n, struct helpline *h)
|
/* |
static int coleol (int row)
|
static char * ptreol (int row)
|
static void show_line (int i, int col)
|
static void show_all_lines (int from)
|
static void show_screen (void)
|
static void show_status (void)
|
static void show_snr (void)
|
static void show_options (void)
|
static void show_line_stack (void)
|
static void show_frame (void)
|
static void show_all (void)
|
static void show_ctl (char c)
|
static int prompt_for (char const * prompt, struct lined *l, char *dflt)
|
static int yesno (char const * prompt)
|
static void word_from_cursor (char *p, int n)
|
/* |
static void insertc (char c)
|
static void deletec (void)
|
static void insertl (int row)
|
static void deletel (int row)
|
static void clear_endl (void)
|
static void strip_blanks (char **p, int *n)
|
static int append_line (char *ln)
|
static void split_line (void)
|
static void join_line (void)
|
static void deletew (void)
|
static void inserts (void)
|
static int deletes (void)
|
/* |
static void fwd_word (void)
|
static void back_word (void)
|
/* |
static int push_to_linestk (char *p, int n)
|
static int pushln (int row)
|
static int popln (char *to)
|
void push_del_line (void)
|
void push_line (void)
|
void pop_spread_line (void)
|
void pop_line (void)
|
void push_line_end (void)
|
void pop_line_end (void)
|
/* |
static int search_string (int prompt)
|
static int replace_string (int prompt)
|
/* |
static void show_sub_help (int sig)
|
unsigned int alarm (unsigned int sec)
|
static void submenu (char key, int n, struct helpline *h)
|
static void do_ctlK (void)
|
static void do_ctlO (void)
|
static void do_ctlQ (void)
|
static int do_key (char c) /*
|
static void free_bufs (void)
|
static int p4_alloc_bufs (int ls, int bs)
|
/* |
static void ed_on_stop (void)
|
static void ed_on_continue (void)
|
static void ed_on_winchg (void)
|
void p4_edit (int n, int r, int c)
|
/**
|
/**
|
/**
|
P4_LISTWORDS (edit) =
|
/* |
/* |