wok rev 4539

Add: sc (spreadsheet calculator)
author Paul Issott <paul@slitaz.org>
date Tue Dec 01 19:23:18 2009 +0000 (2009-12-01)
parents 69f6139a17d9
children 3054d8440c5c
files sc/receipt sc/stuff/7.16.patch
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/sc/receipt	Tue Dec 01 19:23:18 2009 +0000
     1.3 @@ -0,0 +1,31 @@
     1.4 +# SliTaz package receipt.
     1.5 +
     1.6 +PACKAGE="sc"
     1.7 +VERSION="7.16"
     1.8 +CATEGORY="office"
     1.9 +SHORT_DESC="Spreadsheet calculator."
    1.10 +MAINTAINER="paul@slitaz.org"
    1.11 +DEPENDS="ncurses"
    1.12 +BUILD_DEPENDS="ncurses-dev bison m4"
    1.13 +TARBALL="$PACKAGE-$VERSION.tar.gz"
    1.14 +WEB_SITE="http://www.ibiblio.org/pub/Linux/apps/financial/spreadsheet/"
    1.15 +WGET_URL="http://www.ibiblio.org/pub/Linux/apps/financial/spreadsheet/$TARBALL"
    1.16 +
    1.17 +# Rules to configure and make the package.
    1.18 +compile_rules()
    1.19 +{
    1.20 +	cd $src
    1.21 +	patch -p1 < ../stuff/7.16.patch || exit 1
    1.22 +	make
    1.23 +}
    1.24 +
    1.25 +# Rules to gen a SliTaz package suitable for Tazpkg.
    1.26 +genpkg_rules()
    1.27 +{
    1.28 +	mkdir -p $fs/usr/bin
    1.29 +
    1.30 +	for i in sc psc scqref; do
    1.31 +	cp -a $src/$i $fs/usr/bin
    1.32 +	done
    1.33 +}
    1.34 +
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/sc/stuff/7.16.patch	Tue Dec 01 19:23:18 2009 +0000
     2.3 @@ -0,0 +1,497 @@
     2.4 +--- sc-7.16.orig/sc.h
     2.5 ++++ sc-7.16/sc.h
     2.6 +@@ -612,6 +612,9 @@
     2.7 + extern	int rowlimit;
     2.8 + extern	int collimit;
     2.9 + 
    2.10 ++void yankr(struct ent *v1, struct ent *v2);
    2.11 ++
    2.12 ++
    2.13 + #if BSD42 || SYSIII
    2.14 + 
    2.15 + #ifndef cbreak
    2.16 +--- sc-7.16.orig/cmds.c
    2.17 ++++ sc-7.16/cmds.c
    2.18 +@@ -478,7 +478,7 @@
    2.19 +     int i, qtmp;
    2.20 +     char buf[50];
    2.21 +     struct frange *fr;
    2.22 +-    struct ent *obuf;
    2.23 ++    struct ent *obuf=0;
    2.24 + 
    2.25 +     if ((fr = find_frange(currow, curcol)))
    2.26 + 	rs = fr->or_right->row - currow + 1;
    2.27 +@@ -535,7 +535,7 @@
    2.28 +     int cs = maxcol - curcol + 1;
    2.29 +     int i, qtmp;
    2.30 +     char buf[50];
    2.31 +-    struct ent *obuf;
    2.32 ++    struct ent *obuf=0;
    2.33 + 
    2.34 +     if (cs - arg < 0) {
    2.35 +     	cs = cs > 0 ? cs : 0;
    2.36 +@@ -810,7 +810,7 @@
    2.37 + 
    2.38 +     if (to_insert == 'r') {
    2.39 + 	insertrow(numrows, 0);
    2.40 +-	if (fr = find_frange(currow, curcol))
    2.41 ++	if ((fr = find_frange(currow, curcol)))
    2.42 + 	    deltac = fr->or_left->col - mincol;
    2.43 + 	else {
    2.44 + 	    for (i = 0; i < numrows; i++)
    2.45 +@@ -2279,7 +2279,7 @@
    2.46 + 	ret->e.r.right.vp = lookat(newrow, newcol);
    2.47 + 	ret->e.r.right.vf = e->e.r.right.vf;
    2.48 +     } else {
    2.49 +-	struct enode *temprange;
    2.50 ++	struct enode *temprange=0;
    2.51 + 
    2.52 + 	if (freeenodes) {
    2.53 + 	    ret = freeenodes;
    2.54 +@@ -2337,8 +2337,7 @@
    2.55 + 		break;
    2.56 + 	    case 'f':
    2.57 + 	    case 'F':
    2.58 +-		if (range && ret->op == 'F' ||
    2.59 +-			!range && ret->op == 'f')
    2.60 ++		if ((range && ret->op == 'F') || (!range && ret->op == 'f'))
    2.61 + 		    Rdelta = Cdelta = 0;
    2.62 + 		ret->e.o.left = copye(e->e.o.left, Rdelta, Cdelta,
    2.63 + 			r1, c1, r2, c2, transpose);
    2.64 +@@ -2798,7 +2797,7 @@
    2.65 + write_cells(register FILE *f, int r0, int c0, int rn, int cn, int dr, int dc)
    2.66 + {
    2.67 +     register struct ent **pp;
    2.68 +-    int r, c, rs, cs, mf;
    2.69 ++    int r, c, rs=0, cs=0, mf;
    2.70 +     char *dpointptr;
    2.71 + 
    2.72 +     mf = modflg;
    2.73 +@@ -2861,12 +2860,12 @@
    2.74 + 	if ((plugin = findplugin(p+1, 'w')) != NULL) {
    2.75 + 	    if (!plugin_exists(plugin, strlen(plugin), save + 1)) {
    2.76 + 		error("plugin not found");
    2.77 +-		return;
    2.78 ++		return -1;
    2.79 + 	    }
    2.80 + 	    *save = '|';
    2.81 + 	    if ((strlen(save) + strlen(fname) + 20) > PATHLEN) {
    2.82 + 		error("Path too long");
    2.83 +-		return;
    2.84 ++		return -1;
    2.85 + 	    }
    2.86 + 	    sprintf(save + strlen(save), " %s%d:", coltoa(c0), r0);
    2.87 + 	    sprintf(save + strlen(save), "%s%d \"%s\"", coltoa(cn), rn, fname);
    2.88 +@@ -2883,13 +2882,14 @@
    2.89 +     }
    2.90 + #endif /* VMS */
    2.91 + 
    2.92 +-    if (*fname == '\0')
    2.93 ++    if (*fname == '\0'){
    2.94 + 	if (isatty(STDOUT_FILENO) || *curfile != '\0')
    2.95 + 	    fname = curfile;
    2.96 + 	else {
    2.97 + 	    write_fd(stdout, r0, c0, rn, cn);
    2.98 + 	    return (0);
    2.99 + 	}
   2.100 ++    }
   2.101 + 
   2.102 + #ifdef MSDOS
   2.103 +     namelen = 12;
   2.104 +@@ -2981,12 +2981,12 @@
   2.105 + 	if ((plugin = findplugin(p+1, 'r')) != NULL) {
   2.106 + 	    if (!(plugin_exists(plugin, strlen(plugin), save + 1))) {
   2.107 + 		error("plugin not found");
   2.108 +-		return;
   2.109 ++		return -1;
   2.110 + 	    }
   2.111 + 	    *save = '|';
   2.112 + 	    if ((strlen(save) + strlen(fname) + 2) > PATHLEN) {
   2.113 + 		error("Path too long");
   2.114 +-		return;
   2.115 ++		return -1;
   2.116 + 	    }
   2.117 + 	    sprintf(save + strlen(save), " \"%s\"", fname);
   2.118 + 	    eraseflg = 0;
   2.119 +--- sc-7.16.orig/abbrev.c
   2.120 ++++ sc-7.16/abbrev.c
   2.121 +@@ -19,10 +19,15 @@
   2.122 + #include <stdio.h>
   2.123 + #include <stdlib.h>
   2.124 + #include <ctype.h>
   2.125 ++#include <curses.h>
   2.126 ++#include <unistd.h>
   2.127 + #include "sc.h"
   2.128 + 
   2.129 + static	struct abbrev *abbr_base;
   2.130 + 
   2.131 ++int are_abbrevs(void);
   2.132 ++
   2.133 ++
   2.134 + void
   2.135 + add_abbr(char *string)
   2.136 + {
   2.137 +@@ -87,7 +92,7 @@
   2.138 + 	    }
   2.139 +     }
   2.140 +     
   2.141 +-    if (expansion == NULL)
   2.142 ++    if (expansion == NULL){
   2.143 + 	if ((a = find_abbr(string, strlen(string), &prev))) {
   2.144 + 	    error("abbrev \"%s %s\"", a->abbr, a->exp);
   2.145 + 	    return;
   2.146 +@@ -95,6 +100,7 @@
   2.147 + 	    error("abreviation \"%s\" doesn't exist", string);
   2.148 + 	    return;
   2.149 + 	}
   2.150 ++    }
   2.151 +  
   2.152 +     if (find_abbr(string, strlen(string), &prev))
   2.153 + 	del_abbr(string);
   2.154 +@@ -122,7 +128,7 @@
   2.155 + del_abbr(char *abbrev)
   2.156 + {
   2.157 +     struct abbrev *a;
   2.158 +-    struct abbrev **prev;
   2.159 ++    struct abbrev **prev=0;
   2.160 + 
   2.161 +     if (!(a = find_abbr(abbrev, strlen(abbrev), prev))) 
   2.162 + 	return;
   2.163 +--- sc-7.16.orig/range.c
   2.164 ++++ sc-7.16/range.c
   2.165 +@@ -18,6 +18,8 @@
   2.166 + 
   2.167 + #include <stdio.h>
   2.168 + #include <ctype.h>
   2.169 ++#include <unistd.h>
   2.170 ++#include <curses.h>
   2.171 + #include "sc.h"
   2.172 + 
   2.173 + static	struct range *rng_base;
   2.174 +--- sc-7.16.orig/vi.c
   2.175 ++++ sc-7.16/vi.c
   2.176 +@@ -17,6 +17,8 @@
   2.177 + #include <curses.h>
   2.178 + #include <ctype.h>
   2.179 + #include <stdlib.h>
   2.180 ++#include <unistd.h>
   2.181 ++#include <sys/wait.h>
   2.182 + #include "sc.h"
   2.183 + 
   2.184 + #if defined(REGCOMP)
   2.185 +@@ -40,7 +42,7 @@
   2.186 + 
   2.187 + #define istext(a) (isalnum(a) || ((a) == '_'))
   2.188 + 
   2.189 +-#define bool	int
   2.190 ++/*#define bool	int*/
   2.191 + #define true	1
   2.192 + #define false	0
   2.193 + 
   2.194 +@@ -667,8 +669,10 @@
   2.195 +     static struct range *nextmatch;
   2.196 +     int len;
   2.197 + 
   2.198 +-    if (linelim > 0 && isalnum(line[linelim-1]) || line[linelim-1] == '_' ||
   2.199 +-	    (completethis && line[linelim-1] == ' ')) {
   2.200 ++    if ((linelim > 0 && isalnum(line[linelim-1])) || 
   2.201 ++    	line[linelim-1] == '_' ||
   2.202 ++	(completethis && line[linelim-1] == ' ')) {
   2.203 ++
   2.204 + 	if (!completethis) {
   2.205 + 	    for (completethis = line + linelim - 1; isalnum(*completethis) ||
   2.206 + 		    *completethis == '_'; completethis--) /* */;
   2.207 +@@ -715,7 +719,7 @@
   2.208 + showdr()
   2.209 + {
   2.210 +     int			minsr, minsc, maxsr, maxsc;
   2.211 +-    char		*p;
   2.212 ++    /*char		*p;*/
   2.213 +     char		r[12];
   2.214 +     struct frange	*fr = find_frange(currow, curcol);
   2.215 + 
   2.216 +@@ -1566,7 +1570,7 @@
   2.217 + search_again(bool reverse)
   2.218 + {
   2.219 +     int prev_match;
   2.220 +-    int found_it;
   2.221 ++    int found_it=0;
   2.222 + #if !defined(REGCOMP) && !defined(RE_COMP) && !defined(REGCMP)
   2.223 +     char *look_here;
   2.224 +     int do_next;
   2.225 +@@ -1777,7 +1781,7 @@
   2.226 + static void
   2.227 + match_paren()
   2.228 + {
   2.229 +-    register int i;
   2.230 ++    /*register int i;*/
   2.231 +     int nest = 1;
   2.232 +     int tmp = linelim;
   2.233 + 
   2.234 +--- sc-7.16.orig/vmtbl.c
   2.235 ++++ sc-7.16/vmtbl.c
   2.236 +@@ -16,6 +16,7 @@
   2.237 + # include <curses.h>
   2.238 + #endif /* PSC */
   2.239 + 
   2.240 ++#include <unistd.h>
   2.241 + #include "sc.h"
   2.242 + 
   2.243 + /*
   2.244 +--- sc-7.16.orig/Makefile
   2.245 ++++ sc-7.16/Makefile
   2.246 +@@ -32,7 +32,7 @@
   2.247 + 
   2.248 + # This is where the library file (tutorial) goes.
   2.249 + #LIBDIR=/usr/local/share/$(name) # reno
   2.250 +-LIBDIR=${prefix}/lib/$(name)
   2.251 ++LIBDIR=${prefix}/share/doc/$(name)
   2.252 + LIBRARY=-DLIBDIR=\"${LIBDIR}\"
   2.253 + 
   2.254 + # Set SIMPLE for lex.c if you don't want arrow keys or lex.c blows up
   2.255 +--- sc-7.16.orig/color.c
   2.256 ++++ sc-7.16/color.c
   2.257 +@@ -19,6 +19,7 @@
   2.258 + 
   2.259 + #include <curses.h>
   2.260 + #include <ctype.h>
   2.261 ++#include <unistd.h>
   2.262 + #include "sc.h"
   2.263 + 
   2.264 + /* a linked list of free [struct ent]'s, uses .next as the pointer */
   2.265 +--- sc-7.16.orig/frame.c
   2.266 ++++ sc-7.16/frame.c
   2.267 +@@ -18,6 +18,9 @@
   2.268 + 
   2.269 + #include <stdio.h>
   2.270 + #include <ctype.h>
   2.271 ++#include <stdlib.h>
   2.272 ++#include <curses.h>
   2.273 ++#include <unistd.h>
   2.274 + #include "sc.h"
   2.275 + 
   2.276 + static struct frange *frame_base;
   2.277 +--- sc-7.16.orig/sc.c
   2.278 ++++ sc-7.16/sc.c
   2.279 +@@ -212,7 +212,7 @@
   2.280 + 
   2.281 +     if (dbidx < 0)
   2.282 + 	return;
   2.283 +-    if (p = delbuf[dbidx]) {
   2.284 ++    if ((p = delbuf[dbidx])) {
   2.285 + 	scxfree(delbuffmt[dbidx]);
   2.286 + 	delbuffmt[dbidx] = NULL;
   2.287 +     }
   2.288 +@@ -845,7 +845,7 @@
   2.289 + 			    break;
   2.290 + 			case 'C':
   2.291 + 			    color = !color;
   2.292 +-			    if (has_colors())
   2.293 ++			    if (has_colors()){
   2.294 + 				if (color) {
   2.295 + 				    attron(COLOR_PAIR(1));
   2.296 + 				    bkgd(COLOR_PAIR(1) | ' ');
   2.297 +@@ -853,6 +853,7 @@
   2.298 + 				    attron(COLOR_PAIR(0));
   2.299 + 				    bkgd(COLOR_PAIR(0) | ' ');
   2.300 + 				}
   2.301 ++			    }
   2.302 + 			    error("Color %sabled.", color ? "en" : "dis");
   2.303 + 			    break;
   2.304 + 			case 'N':
   2.305 +--- sc-7.16.orig/sort.c
   2.306 ++++ sc-7.16/sort.c
   2.307 +@@ -19,6 +19,8 @@
   2.308 + #include <stdio.h>
   2.309 + #include <ctype.h>
   2.310 + #include <stdlib.h>
   2.311 ++#include <unistd.h>
   2.312 ++#include <curses.h>
   2.313 + #include "sc.h"
   2.314 + 
   2.315 + int compare(const void *row1, const void *row2);
   2.316 +--- sc-7.16.orig/xmalloc.c
   2.317 ++++ sc-7.16/xmalloc.c
   2.318 +@@ -4,11 +4,12 @@
   2.319 +  */
   2.320 + 
   2.321 + #include <curses.h>
   2.322 ++#include <stdlib.h>
   2.323 + #include "sc.h"
   2.324 + 
   2.325 +-extern char	*malloc();
   2.326 ++/* extern char	*malloc();
   2.327 + extern char	*realloc();
   2.328 +-extern void	free();
   2.329 ++extern void	free(); */
   2.330 + void		fatal();
   2.331 + 
   2.332 + #ifdef SYSV3
   2.333 +--- sc-7.16.orig/screen.c
   2.334 ++++ sc-7.16/screen.c
   2.335 +@@ -234,11 +234,12 @@
   2.336 + 	    i = stcol;
   2.337 + 	    lcols = 0;
   2.338 + 	    col = rescol + frcols;
   2.339 +-	    if (fr && stcol >= fr->or_left->col)
   2.340 ++	    if (fr && stcol >= fr->or_left->col){
   2.341 + 		if (stcol < fr->ir_left->col)
   2.342 + 		    i = fr->or_left->col;
   2.343 + 		else
   2.344 + 		    col += flcols;
   2.345 ++	    }
   2.346 + 	    for (; (col + fwidth[i] < cols-1 || col_hidden[i] || i < curcol) &&
   2.347 + 		    i < maxcols; i++) {
   2.348 + 		lcols++;
   2.349 +@@ -328,11 +329,12 @@
   2.350 + 	    i = stcol;
   2.351 + 	    lcols = 0;
   2.352 + 	    col = rescol + frcols;
   2.353 +-	    if (fr && stcol >= fr->or_left->col)
   2.354 ++	    if (fr && stcol >= fr->or_left->col){
   2.355 + 		if (stcol < fr->ir_left->col)
   2.356 + 		    i = fr->or_left->col;
   2.357 + 		else
   2.358 + 		    col += flcols;
   2.359 ++	    }
   2.360 + 	    for (; (col + fwidth[i] < cols-1 || col_hidden[i] || i < curcol) &&
   2.361 + 		    i < maxcols; i++) {
   2.362 + 		lcols++;
   2.363 +@@ -377,11 +379,12 @@
   2.364 + 	    i = strow;
   2.365 + 	    rows = 0;
   2.366 + 	    row = RESROW + fbrows;
   2.367 +-	    if (fr && strow >= fr->or_left->row)
   2.368 ++	    if (fr && strow >= fr->or_left->row){
   2.369 + 		if (strow < fr->ir_left->row)
   2.370 + 		    i = fr->or_left->row;
   2.371 + 		else
   2.372 + 		    row += ftrows;
   2.373 ++	    }
   2.374 + 	    for (; (row < lines || row_hidden[i] || i < currow) && i < maxrows;
   2.375 + 		    i++) {
   2.376 + 		rows++;
   2.377 +@@ -460,11 +463,12 @@
   2.378 + 	    i = strow;
   2.379 + 	    rows = 0;
   2.380 + 	    row = RESROW + fbrows;
   2.381 +-	    if (fr && strow >= fr->or_left->row)
   2.382 ++	    if (fr && strow >= fr->or_left->row){
   2.383 + 		if (strow < fr->ir_left->row)
   2.384 + 		    i = fr->or_left->row;
   2.385 + 		else
   2.386 + 		    row += ftrows;
   2.387 ++	    }
   2.388 + 	    for (; (row < lines || row_hidden[i] || i < currow) && i < maxrows;
   2.389 + 		    i++) {
   2.390 + 		rows++;
   2.391 +--- sc-7.16.orig/lex.c
   2.392 ++++ sc-7.16/lex.c
   2.393 +@@ -34,6 +34,8 @@
   2.394 + #include <signal.h>
   2.395 + #include <setjmp.h>
   2.396 + #include <ctype.h>
   2.397 ++#include <unistd.h>
   2.398 ++#include <math.h>
   2.399 + #include "sc.h"
   2.400 + 
   2.401 + #ifdef NONOTIMEOUT
   2.402 +@@ -107,7 +109,7 @@
   2.403 + yylex()
   2.404 + {
   2.405 +     char *p = line + linelim;
   2.406 +-    int ret;
   2.407 ++    int ret=0;
   2.408 +     static int isfunc = 0;
   2.409 +     static bool isgoto = 0;
   2.410 +     static bool colstate = 0;
   2.411 +@@ -326,7 +328,7 @@
   2.412 + 	strcpy((char *)path, HomeDir);
   2.413 + 	strcat((char *)path, "/.sc/plugins/");
   2.414 + 	strncat((char *)path, name, len);
   2.415 +-	if (fp = fopen((char *)path, "r")) {
   2.416 ++	if ((fp = fopen((char *)path, "r"))) {
   2.417 + 	    fclose(fp);
   2.418 + 	    return 1;
   2.419 + 	}
   2.420 +@@ -334,7 +336,7 @@
   2.421 +     strcpy((char *)path, LIBDIR);
   2.422 +     strcat((char *)path, "/plugins/");
   2.423 +     strncat((char *)path, name, len);
   2.424 +-    if (fp = fopen((char *)path, "r")) {
   2.425 ++    if ((fp = fopen((char *)path, "r"))) {
   2.426 + 	fclose(fp);
   2.427 + 	return 1;
   2.428 +     }
   2.429 +--- sc-7.16.orig/interp.c
   2.430 ++++ sc-7.16/interp.c
   2.431 +@@ -1572,12 +1572,12 @@
   2.432 + copy(struct ent *dv1, struct ent *dv2, struct ent *v1, struct ent *v2)
   2.433 + {
   2.434 +     struct ent *p;
   2.435 +-    struct ent *n;
   2.436 ++/*    struct ent *n;*/
   2.437 +     static int minsr = -1, minsc = -1;
   2.438 +     static int maxsr = -1, maxsc = -1;
   2.439 +     int mindr, mindc;
   2.440 +     int maxdr, maxdc;
   2.441 +-    int vr, vc;
   2.442 ++/*    int vr, vc;*/
   2.443 +     int r, c;
   2.444 +     int deltar, deltac;
   2.445 + 
   2.446 +@@ -2066,7 +2066,7 @@
   2.447 + 		    *line = '\0';
   2.448 + 	    }
   2.449 + 	}
   2.450 +-	if (!col_hidden[c])
   2.451 ++	if (!col_hidden[c]){
   2.452 + 	    if (gs.g_type == G_STR) {
   2.453 + 		if (p && p->label
   2.454 + #if defined(REGCOMP)
   2.455 +@@ -2099,6 +2099,7 @@
   2.456 + #endif
   2.457 + #endif
   2.458 + 		    break;
   2.459 ++	}
   2.460 + 	if (r == endr && c == endc) {
   2.461 + 	    error("String not found");
   2.462 + #if defined(REGCOMP)
   2.463 +@@ -2471,13 +2472,11 @@
   2.464 + int
   2.465 + constant(register struct enode *e)
   2.466 + {
   2.467 +-    return (
   2.468 +-	 e == NULL
   2.469 ++    return e == NULL
   2.470 + 	 || e->op == O_CONST
   2.471 + 	 || e->op == O_SCONST
   2.472 +-	 || e->op == 'm' && constant(e->e.o.left)
   2.473 +-	 || (
   2.474 +-	     e->op != O_VAR
   2.475 ++	 || (e->op == 'm' && constant(e->e.o.left))
   2.476 ++	 || (e->op != O_VAR
   2.477 + 	     && !(e->op & REDUCE)
   2.478 + 	     && constant(e->e.o.left)
   2.479 + 	     && constant(e->e.o.right)
   2.480 +@@ -2491,9 +2490,7 @@
   2.481 + 	     && e->op != LASTCOL
   2.482 + 	     && e->op != NUMITER
   2.483 + 	     && e->op != FILENAME
   2.484 +-             && optimize
   2.485 +-	)
   2.486 +-    );
   2.487 ++             && optimize );
   2.488 + }
   2.489 + 
   2.490 + void
   2.491 +--- sc-7.16.orig/help.c
   2.492 ++++ sc-7.16/help.c
   2.493 +@@ -11,6 +11,7 @@
   2.494 + char	*revision = "$Revision: 7.16 $";
   2.495 + #else
   2.496 + #include <curses.h>
   2.497 ++#include <unistd.h>
   2.498 + #include "sc.h"
   2.499 + #endif /* QREF */
   2.500 +