ftp.nice.ch/pub/next/developer/languages/lisp/AKCL.1.599.s.tar.gz#/akcl-1-599/V/c/format.c

This is format.c in view mode; [Download] [Up]

Changes file for /usr/local/src/kcl/./c/format.c
Created on Tue Jul  9 07:14:34 1991
Usage \n@s[Original text\n@s|Replacement Text\n@s]
See the file rascal.ics.utexas.edu:/usr2/ftp/merge.c
for a program to merge change files.  Anything not between
"\n@s[" and  "\n@s]" is a simply a comment.
This file was constructed using emacs and  merge.el
Enhancements Copyright (c) W. Schelter All rights reserved.
   by (Bill Schelter)  wfs@carl.ma.utexas.edu 


****Change:(orig (12 12 c))
@s[*/

#include "include.h"


@s|*/

#include "include.h"
#include <varargs.h>

@s]


****Change:(orig (28 37 c))
@s[#define	fmt_old		object old_fmt_stream; \
			int old_ctl_origin; \
			int old_ctl_index; \
			int old_ctl_end; \

@s,			object old_fmt_string

@s|#define	fmt_old		VOL object old_fmt_stream; \
			VOL int old_ctl_origin; \
			VOL int old_ctl_index; \
			VOL int old_ctl_end; \
			object * VOL old_fmt_base; \
			VOL int old_fmt_index; \
			VOL int old_fmt_end; \
			int  * VOL old_fmt_jmp_buf; \
			VOL int old_fmt_indents; \
			VOL object old_fmt_string

@s]


****Change:(orig (209 209 a))
@s[				fmt_param[n].fmt_param_value = x->ch.ch_code;

@s|				fmt_param[n].fmt_param_value = x->ch.ch_code;
                        } else if (x == Cnil) {
                                 fmt_param[n].fmt_param_type = NULL;				

@s]


****Change:(orig (352 352 a))
@s[		fmt_semicolon(colon, atsign);
		break;

	default:

@s|		fmt_semicolon(colon, atsign);
		break;

	default:
   {object user_fmt=getf(siVindent_formatted_output->s.s_plist,make_fixnum(c),Cnil);
    
    if (user_fmt!=Cnil)
     {object *oldbase=vs_base;
      object *oldtop=vs_top;
      vs_base=vs_top;
      vs_push(fmt_advance());
      vs_push(fmt_stream);
      vs_push(make_fixnum(colon));
      vs_push(make_fixnum(atsign));
      if (type_of(user_fmt)==t_symbol) user_fmt=symbol_function(user_fmt);
      funcall(user_fmt);
      vs_base=oldbase; vs_top=oldtop; break;}}

@s]


****Change:(orig (1588 1589 c))
@s[{
	object x;
	int i, j;

@s|{
	VOL object x;
	VOL int i, j;

@s]


****Change:(orig (1743 1744 c))
@s[fmt_iteration(colon, atsign)
{
	int n;
	int i, j;

@s|fmt_iteration(colon, atsign)
{
	int i,n;
	VOL int j;

@s]


****Change:(orig (1747 1747 c))
@s[	bool colon_close = FALSE;
	object l, l0;

@s|	bool colon_close = FALSE;
	object l;
	VOL object l0;

@s]


****Change:(orig (1868 1868 c))
@s[	int i, j, k, l, m, n, j0, l0;

@s|	VOL int i,j,n,j0;
	int k,l,m,l0;

@s]


****Change:(orig (1870 1870 c))
@s[	int up_colon;
	int special = 0;

@s|	int up_colon;
	VOL int special = 0;

@s]


****Change:(orig (1946 1946 c))
@s[	for (i = special;  i < n;  i++) {
		if (i > 0 || colon)

@s|	for (i = special;  i < n;  i++) {
		if (m > 0 && (i > 0 || colon))

@s]


****Change:(orig (1997 1999 c))
@s[Lformat()
{
	object x = OBJNULL;

@s|object 
LVformat(strm, control, va_alist)
     object strm;
     object control;
     va_dcl
{       va_list ap; 
        VOL int nargs= VFUN_NARGS;
	VOL object x = OBJNULL;

@s]


****Change:(orig (2003 2004 c))
@s[
	if (vs_top - vs_base < 2)

@s|	nargs=nargs-2;
	if (nargs < 0)

@s]


****Change:(orig (2006 2012 c))
@s[	if (vs_base[0] == Cnil) {
		vs_base[0] = make_string_output_stream(64);
		x = vs_base[0]->sm.sm_object0;
	} else if (vs_base[0] == Ct)

@s,	else if (type_of(vs_base[0]) == t_string) {
		x = vs_base[0];

@s|	if (strm == Cnil) {
		strm = make_string_output_stream(64);
		x = strm->sm.sm_object0;
	} else if (strm == Ct)
		strm = symbol_value(Vstandard_output);
	else if (type_of(strm) == t_string) {
		x = strm;

@s]


****Change:(orig (2015 2016 c))
@s[		vs_base[0] = make_string_output_stream(0);
		vs_base[0]->sm.sm_object0 = x;

@s|		strm = make_string_output_stream(0);
		strm->sm.sm_object0 = x;

@s]


****Change:(orig (2018 2019 c))
@s[		check_type_stream(&vs_base[0]);
	check_type_string(&vs_base[1]);

@s|		check_type_stream(&strm);
	check_type_string(&control);

@s]


****Change:(orig (2026 2026 c))
@s[	fmt_base = vs_base + 2;

@s|	
	va_start(ap);
	{object *l;
	 COERCE_VA_LIST(l,ap,nargs);
	fmt_base = l;

@s]


****Change:(orig (2028 2028 c))
@s[	fmt_end = vs_top - vs_base - 2;

@s|	fmt_end = nargs;

@s]


****Change:(orig (2031 2031 c))
@s[		fmt_indents = file_column(vs_base[0]);

@s|		fmt_indents = file_column(strm);

@s]


****Change:(orig (2034 2034 c))
@s[	fmt_string = vs_base[1];

@s|	fmt_string = control;

@s]


****Change:(orig (2046 2052 c))
@s[	format(vs_base[0], 0, vs_base[1]->st.st_fillp);
	flush_stream(vs_base[0]);
	vs_base = vs_top;
	if (x != OBJNULL)

@s,		vs_push(x);
	else
		vs_push(Cnil);

@s|	format(strm, 0, control->st.st_fillp);
	flush_stream(strm);
       }
	va_end(ap);

@s]


****Change:(orig (2060 2060 a))
@s[		unwind(nlj_fr, nlj_tag);
	}

@s|		unwind(nlj_fr, nlj_tag);
	}
	return (x ==0 ? Cnil : x);  

@s]


****Change:(orig (2062 2062 a))
@s[}


@s|}

object c_apply_n();

void
Lformat()
{object *b=vs_base;
 VFUN_NARGS = vs_top-vs_base;
 b[0]= c_apply_n(LVformat,vs_top-vs_base,vs_base);
 vs_top=((vs_base=b)+1);
}

@s]

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.