*) 2003-08-01 (2.0.0-beta7 - 2.0.0-rc1) - added dvorakng package *) 2003-07-30 (2.0.0-beta7 - 2.0.0-rc1) - added socket package - updated cksum for services file - added tetradraw package git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@982 c5f82cb5-29bc-0310-9cd0-bff59a50e3bcrocklinux
@ -0,0 +1,37 @@ |
|||||
|
diff -Nur socket-1.2p1/Makefile socket-1.2p1.new/Makefile
|
||||
|
--- socket-1.2p1/Makefile 1999-09-19 12:48:45.000000000 +0200
|
||||
|
+++ socket-1.2p1.new/Makefile 2003-07-30 18:59:07.000000000 +0200
|
||||
|
@@ -32,7 +32,7 @@
|
||||
|
### socket.1 in /usr/local/man/man1/socket.1 |
||||
|
### Make sure the target directories exist before doing a "make install". |
||||
|
|
||||
|
-INSTALLBASE = /usr/local
|
||||
|
+INSTALLBASE = $(prefix)
|
||||
|
INSTALLBINPATH = $(INSTALLBASE)/bin |
||||
|
INSTALLBINMODE = 755 |
||||
|
INSTALLMANPATH = $(INSTALLBASE)/man |
||||
|
@@ -46,10 +46,10 @@
|
||||
|
### system: |
||||
|
|
||||
|
### 4.4 BSD (tested on FreeBSD, but probably works for other BSDs) |
||||
|
-SWITCHES = -DHAS_POSIX_SIGS -DHAS_SYS_SIGLIST -DHAS_SYS_ERRLIST
|
||||
|
+#SWITCHES = -DHAS_POSIX_SIGS -DHAS_SYS_SIGLIST -DHAS_SYS_ERRLIST
|
||||
|
|
||||
|
### Linux |
||||
|
-#SWITCHES = -DHAS_POSIX_SIGS -DHAS_SYS_SIGLIST -DHAS_SYS_ERRLIST
|
||||
|
+SWITCHES = -DHAS_SYS_SIGLIST -DHAS_SYS_ERRLIST
|
||||
|
|
||||
|
### Solaris 2.6 and 7 with gcc |
||||
|
#SWITCHES = -DHAS_POSIX_SIGS -DHAS_SYS_SIGLIST -DHAS_SYS_ERRLIST \ |
||||
|
diff -Nur socket-1.2p1/socketp.c socket-1.2p1.new/socketp.c
|
||||
|
--- socket-1.2p1/socketp.c 1999-09-19 13:00:30.000000000 +0200
|
||||
|
+++ socket-1.2p1.new/socketp.c 2003-07-30 18:14:15.000000000 +0200
|
||||
|
@@ -105,7 +105,7 @@
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
- sa.sin_port = htons((u_short) port) ;
|
||||
|
+ sa.sin_port = htons((u_int16_t) port) ;
|
||||
|
|
||||
|
if ((s = socket(sa.sin_family, SOCK_STREAM, 0)) < 0) { /* get socket */ |
||||
|
return -1 ; |
||||
@ -0,0 +1,44 @@ |
|||||
|
|
||||
|
[COPY] --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
[COPY] |
||||
|
[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
[COPY] Please add additional copyright information _after_ the line containing |
||||
|
[COPY] the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
[COPY] the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
[COPY] |
||||
|
[COPY] ROCK Linux: rock-src/package/esden/socket/socket.desc |
||||
|
[COPY] ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf |
||||
|
[COPY] |
||||
|
[COPY] This program is free software; you can redistribute it and/or modify |
||||
|
[COPY] it under the terms of the GNU General Public License as published by |
||||
|
[COPY] the Free Software Foundation; either version 2 of the License, or |
||||
|
[COPY] (at your option) any later version. A copy of the GNU General Public |
||||
|
[COPY] License can be found at Documentation/COPYING. |
||||
|
[COPY] |
||||
|
[COPY] Many people helped and are helping developing ROCK Linux. Please |
||||
|
[COPY] have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
[COPY] file for details. |
||||
|
[COPY] |
||||
|
[COPY] --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
|
||||
|
[I] Program to access TCP sockets at shell level. |
||||
|
|
||||
|
[T] Socket(1) implements an interface to TCP sockets at shell level. Client and |
||||
|
[T] server sockets can be used from shell scripts or interactively. Socket can |
||||
|
[T] also run a program with stdin, stdout, and stderr connected to the socket |
||||
|
[T] connection. |
||||
|
|
||||
|
[U] http://www.jnickelsen.de/socket/socket-1.2.html |
||||
|
|
||||
|
[A] Juergen Nickelsen <jnickelsen@acm.org> |
||||
|
[M] Piotr Esden-Tempski <esden@rocklinux.org> |
||||
|
|
||||
|
[C] extra/network |
||||
|
|
||||
|
[L] BSD |
||||
|
[S] Stable |
||||
|
[V] 1.2p1 |
||||
|
[P] X -----5---9 800.000 |
||||
|
|
||||
|
[D] 1870858562 socket-1.2p1.tar.gz ftp://ftp.fu-berlin.de/pub/unix/network/socket/ |
||||
|
|
||||
@ -0,0 +1,42 @@ |
|||||
|
|
||||
|
[COPY] --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
||||
|
[COPY] |
||||
|
[COPY] This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
||||
|
[COPY] Please add additional copyright information _after_ the line containing |
||||
|
[COPY] the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
||||
|
[COPY] the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
||||
|
[COPY] |
||||
|
[COPY] ROCK Linux: rock-src/package/esden/tetradraw/tetradraw.desc |
||||
|
[COPY] ROCK Linux is Copyright (C) 1998 - 2003 Clifford Wolf |
||||
|
[COPY] |
||||
|
[COPY] This program is free software; you can redistribute it and/or modify |
||||
|
[COPY] it under the terms of the GNU General Public License as published by |
||||
|
[COPY] the Free Software Foundation; either version 2 of the License, or |
||||
|
[COPY] (at your option) any later version. A copy of the GNU General Public |
||||
|
[COPY] License can be found at Documentation/COPYING. |
||||
|
[COPY] |
||||
|
[COPY] Many people helped and are helping developing ROCK Linux. Please |
||||
|
[COPY] have a look at http://www.rocklinux.org/ and the Documentation/TEAM |
||||
|
[COPY] file for details. |
||||
|
[COPY] |
||||
|
[COPY] --- ROCK-COPYRIGHT-NOTE-END --- |
||||
|
|
||||
|
[I] Ansi ascii art editor. |
||||
|
|
||||
|
[T] This is the ansi ascii art editor the most rocklinux issues were created |
||||
|
[T] in. |
||||
|
|
||||
|
[U] http://tetradraw.sourceforge.net/ |
||||
|
|
||||
|
[A] John McCutchan <ttb@tentacle.dhs.org> |
||||
|
[M] Piotr Esden-Tempski <esden@rocklinux.org> |
||||
|
|
||||
|
[C] extra/editor |
||||
|
|
||||
|
[L] GPL |
||||
|
[S] Stable |
||||
|
[V] 2.0.2 |
||||
|
[P] X -----5---9 800.000 |
||||
|
|
||||
|
[D] 2579636902 tetradraw-2.0.2.tar.gz http://belnet.dl.sourceforge.net/sourceforge/tetradraw/ |
||||
|
|
||||
@ -0,0 +1,351 @@ |
|||||
|
diff -Naur src/art/hrm src/art/hrm
|
||||
|
--- ./src/art/hrm Thu Jan 1 01:00:00 1970
|
||||
|
+++ ./src/art/hrm Mon Jan 28 01:20:21 2002
|
||||
|
@@ -0,0 +1,3 @@
|
||||
|
+chtype ansi[1][80] = {
|
||||
|
+{ 2097766,617,620,613,32,2097780,633,624,613,32,1576,609,1577,32,2097761,622,627,617,32,1576,617,1577,32,609,627,611,2097769,617,32,1576,611,1577,32,2097763,32,616,613,609,612,613,626,32,1576,628,1577,32,2097780,616,32,611,32,616,613,609,612,613,626,32,1576,610,1577,32,2097762,617,622,609,626,633,32,32,32,32,32,32,32,32,32,32,32,32,},
|
||||
|
+};
|
||||
|
diff -Naur src/art/statusbar.h src/art/statusbar.h
|
||||
|
--- ./src/art/statusbar.h Wed Apr 18 20:40:32 2001
|
||||
|
+++ ./src/art/statusbar.h Mon Jan 28 04:11:56 2002
|
||||
|
@@ -1,13 +1,14 @@
|
||||
|
-chtype ansi_sb[11][80] = {
|
||||
|
+chtype ansi_sb[12][80] = {
|
||||
|
{ 808,800,800,812,800,800,800,800,809,800,800,2099049,859,800,800,800,861,800,99,76,82,32,2099043,2099059,859,800,800,861,1568,817,2099005,32,818,2099005,32,819,2099005,32,820,2099005,32,821,2099005,32,822,2099005,32,823,2099005,32,824,2099005,32,825,2099005,32,816,2099005,32,32,32,2099035,800,800,800,800,800,800,800,800,800,2099037,800,808,800,812,800,809,32,32,}, |
||||
|
{ 2097762,620,623,611,619,544,1576,611,1577,544,2097763,623,624,633,544,1576,621,1577,544,2097773,623,630,613,544,1576,613,1577,544,2097765,626,609,627,613,544,1576,614,1577,544,2097766,617,620,620,544,1576,626,1577,544,2097778,613,624,620,609,611,613,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,}, |
||||
|
{ 2097762,620,623,611,619,2097696,2097776,609,627,628,613,32,1576,627,1577,1568,2097779,628,609,621,624,1568,1576,632,1577,1568,614,620,617,624,544,2097784,1568,1576,633,1577,1568,614,620,617,624,544,2097785,1568,1576,626,1577,1568,2097778,609,617,627,613,544,1576,620,1577,544,2097772,623,631,613,626,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,}, |
||||
|
{ 2097762,620,623,611,619,544,2097766,617,620,620,544,1576,614,1577,1568,2097766,623,626,613,615,626,623,629,622,612,544,1576,610,1577,544,2097762,609,611,619,615,626,623,629,622,612,544,1576,611,1577,544,2097763,616,609,626,609,611,628,613,626,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,}, |
||||
|
{ 2097762,620,623,611,619,544,2097778,613,624,620,609,611,613,544,1576,614,1577,544,2097766,623,626,613,615,626,623,629,622,612,544,1576,610,1577,544,2097762,609,611,619,615,626,623,629,622,612,544,1576,611,1577,544,2097763,616,609,626,609,611,628,613,626,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,}, |
||||
|
-{ 2097766,617,620,613,544,2097780,633,624,613,544,1576,609,1577,544,2097761,622,627,617,544,1576,617,1577,544,609,627,611,2097769,617,544,1576,611,1577,544,2097763,544,616,613,609,612,613,626,32,1576,610,1577,32,2097762,617,622,609,626,633,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,},
|
||||
|
+{ 2097766,617,620,613,32,2097780,633,624,613,32,1576,609,1577,32,2097761,622,627,617,32,1576,617,1577,32,609,627,611,2097769,617,32,1576,611,1577,32,2097763,32,616,613,609,612,613,626,32,1576,628,1577,32,2097780,616,32,611,32,616,613,609,612,613,626,32,1576,610,1577,32,2097762,617,622,609,626,633,32,32,32,32,32,32,32,32,32,32,32,32,},/*the save line*/
|
||||
|
{ 2097763,620,613,609,626,544,2097779,611,626,613,613,622,544,1576,633,1577,544,2097785,613,627,544,1576,622,1577,544,2097774,623,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,}, |
||||
|
{ 2097779,609,630,613,544,2097779,609,629,611,613,544,1576,633,1577,544,2097785,613,627,544,1576,622,1577,544,2097774,623,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,}, |
||||
|
{ 2097779,609,629,611,613,544,2097761,629,628,616,623,626,1577,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,}, |
||||
|
{ 2097779,609,629,611,613,544,2097767,626,623,629,624,1577,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,}, |
||||
|
{ 2097779,609,629,611,613,544,2097780,617,628,620,613,1577,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,}, |
||||
|
+{ 2097764,613,614,617,622,617,628,617,623,622,544,2097774,609,621,613,1577,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,}, /*th c format something*/
|
||||
|
}; |
||||
|
diff -Naur src/art/test src/art/test
|
||||
|
--- ./src/art/test Thu Jan 1 01:00:00 1970
|
||||
|
+++ ./src/art/test Mon Jan 28 01:14:37 2002
|
||||
|
@@ -0,0 +1,5 @@
|
||||
|
+[0m[1;32mf[0;32mile[37m [1;32mt[0;32mype[37m [36m([32ma[36m)[37m [1;32ma[0;32mnsi[37m [36m([32mi[36m)[37m [32masc[1mi[0;32mi[37m [36m([32mc[36m)[37m [1;32mc[0;37m [32mheader[37m [36m([32mt[36m)[37m [1;32mt[0;32mh[37m [32mc[37m [32mheader[37m [36m([32mb[36m)[37m [1;32mb[0;32minary[37m
|
||||
|
+[A[79C
|
||||
|
+
|
||||
|
+[A[79C
|
||||
|
+[0m
|
||||
|
\ No newline at end of file |
||||
|
diff -Naur src/editor.h src/editor.h
|
||||
|
--- ./src/editor.h Wed Apr 18 20:40:32 2001
|
||||
|
+++ ./src/editor.h Tue Jan 29 07:01:29 2002
|
||||
|
@@ -118,6 +118,7 @@
|
||||
|
|
||||
|
canvas *erase_display(canvas *); |
||||
|
void erase_line(canvas *); |
||||
|
+void r_erase_line(canvas *);
|
||||
|
|
||||
|
void line_add(canvas *, int); |
||||
|
void line_delete(canvas *, int); |
||||
|
diff -Naur src/interface.c src/interface.c
|
||||
|
--- ./src/interface.c Wed Apr 18 20:40:32 2001
|
||||
|
+++ ./src/interface.c Tue Jan 29 20:31:58 2002
|
||||
|
@@ -1453,6 +1453,10 @@
|
||||
|
case 'B': |
||||
|
return 4; |
||||
|
break; |
||||
|
+ case 't':
|
||||
|
+ case 'T':
|
||||
|
+ return 5;
|
||||
|
+ break;
|
||||
|
} |
||||
|
} |
||||
|
return 0; |
||||
|
@@ -1489,6 +1493,65 @@
|
||||
|
} |
||||
|
} |
||||
|
return 0; |
||||
|
+}
|
||||
|
+
|
||||
|
+int savei_defname(char *defname){
|
||||
|
+ int x = 0;
|
||||
|
+ character ch = 0;
|
||||
|
+ int offset = 24;
|
||||
|
+ int done = 0;
|
||||
|
+ int i_offset = 0;
|
||||
|
+
|
||||
|
+ if(options.sb_top) offset = 0;
|
||||
|
+
|
||||
|
+ done = 0;
|
||||
|
+ i_offset = 0;
|
||||
|
+
|
||||
|
+ for(x = 0; x < 80; x++)
|
||||
|
+ mvaddch(offset, x, ansi_sb[SB_THC_DEFNAME][x]);
|
||||
|
+
|
||||
|
+ for(x = 0; x < 20; x++)
|
||||
|
+ defname[x] = '\0';
|
||||
|
+
|
||||
|
+ for(x = 0; x < 20; x++)
|
||||
|
+ mvaddch(offset, 19 + x, ' ');
|
||||
|
+
|
||||
|
+ mvaddstr(offset, 19, defname);
|
||||
|
+
|
||||
|
+ refresh();
|
||||
|
+
|
||||
|
+ while(!done) {
|
||||
|
+ ch = n_getch();
|
||||
|
+ ch=toupper(ch);
|
||||
|
+ switch(ch) {
|
||||
|
+ case KEY_BACKSPACE:
|
||||
|
+ defname[i_offset] = '\0';
|
||||
|
+ if(i_offset > 0) i_offset--;
|
||||
|
+ defname[i_offset] = '\0';
|
||||
|
+ break;
|
||||
|
+ case 13:
|
||||
|
+ done = 1;
|
||||
|
+ break;
|
||||
|
+ case '_':
|
||||
|
+ case '-':
|
||||
|
+ if(isprint(ch)) {
|
||||
|
+ defname[i_offset] = ch;
|
||||
|
+ if((i_offset+1) < 20) i_offset++;
|
||||
|
+ }
|
||||
|
+ break;
|
||||
|
+ default:
|
||||
|
+ if(isalnum(ch)) {
|
||||
|
+ defname[i_offset] = ch;
|
||||
|
+ if((i_offset+1) < 20) i_offset++;
|
||||
|
+ }
|
||||
|
+ break;
|
||||
|
+ }
|
||||
|
+ for(x = 0; x < 20; x++)
|
||||
|
+ mvaddch(offset, 19 + x, ' ');
|
||||
|
+ mvaddstr(offset, 19, defname);
|
||||
|
+ refresh();
|
||||
|
+ }
|
||||
|
+ return 1;
|
||||
|
} |
||||
|
|
||||
|
/* this function gets the sauce information from the user */ |
||||
|
diff -Naur src/interface.h src/interface.h
|
||||
|
--- ./src/interface.h Wed Apr 18 20:40:32 2001
|
||||
|
+++ ./src/interface.h Tue Jan 29 07:12:04 2002
|
||||
|
@@ -12,6 +12,7 @@
|
||||
|
#define SB_SAUCE_AUTHOR 8 |
||||
|
#define SB_SAUCE_GROUP 9 |
||||
|
#define SB_SAUCE_TITLE 10 |
||||
|
+#define SB_THC_DEFNAME 11
|
||||
|
|
||||
|
#define BLOCK_SELECT 0 |
||||
|
#define BLOCK_PASTE 1 |
||||
|
@@ -25,6 +26,7 @@
|
||||
|
void draw_editor(canvas *); |
||||
|
void draw_statusbar(canvas *); |
||||
|
void draw_page(canvas *); |
||||
|
+void draw_tv_sbar(canvas *);
|
||||
|
void show_page(canvas *); |
||||
|
|
||||
|
void draw_block(canvas *, int, int, int, int); |
||||
|
@@ -41,10 +43,12 @@
|
||||
|
} t_filerecord; |
||||
|
|
||||
|
char *file_select(); |
||||
|
+char *tv_file_select(int);
|
||||
|
|
||||
|
int savei_filetype(); |
||||
|
int savei_clearscreen(); |
||||
|
int savei_sauce(char *, char *, char *); |
||||
|
+int savei_defname(char* defname);
|
||||
|
int is_transparent(character ); |
||||
|
|
||||
|
void multidraw_interface(); |
||||
|
diff -Naur src/keys.h src/keys.h
|
||||
|
--- ./src/keys.h Wed Apr 18 20:40:32 2001
|
||||
|
+++ ./src/keys.h Tue Jan 29 21:16:21 2002
|
||||
|
@@ -1,8 +1,31 @@
|
||||
|
#ifndef _KEYS_H |
||||
|
#define _KEYS_H |
||||
|
|
||||
|
+#define NEW_KEYCODES
|
||||
|
+
|
||||
|
#define TD_KEY_REDRAW 12 |
||||
|
|
||||
|
+#ifdef NEW_KEYCODES
|
||||
|
+#define TD_KEY_HOME KEY_HOME
|
||||
|
+#define TD_KEY_INSERT KEY_IC
|
||||
|
+#define TD_KEY_DEL KEY_DC
|
||||
|
+#define TD_KEY_END KEY_END
|
||||
|
+#define TD_KEY_PAGEUP KEY_PPAGE
|
||||
|
+#define TD_KEY_PAGEDOWN KEY_NPAGE
|
||||
|
+
|
||||
|
+#define TD_KEY_F1 KEY_F(1)
|
||||
|
+#define TD_KEY_F2 KEY_F(2)
|
||||
|
+#define TD_KEY_F3 KEY_F(3)
|
||||
|
+#define TD_KEY_F4 KEY_F(4)
|
||||
|
+#define TD_KEY_F5 KEY_F(5)
|
||||
|
+#define TD_KEY_F6 KEY_F(6)
|
||||
|
+#define TD_KEY_F7 KEY_F(7)
|
||||
|
+#define TD_KEY_F8 KEY_F(8)
|
||||
|
+#define TD_KEY_F9 KEY_F(9)
|
||||
|
+#define TD_KEY_F10 KEY_F(10)
|
||||
|
+#define TD_KEY_F11 KEY_F(11)
|
||||
|
+#define TD_KEY_F12 KEY_F(12)
|
||||
|
+#else
|
||||
|
#define TD_KEY_HOME 701 |
||||
|
#define TD_KEY_INSERT 702 |
||||
|
#define TD_KEY_DEL 703 |
||||
|
@@ -22,6 +45,7 @@
|
||||
|
#define TD_KEY_F10 716 |
||||
|
#define TD_KEY_F11 717 |
||||
|
#define TD_KEY_F12 718 |
||||
|
+#endif
|
||||
|
|
||||
|
#define TD_KEY_BLOCK 719 |
||||
|
|
||||
|
diff -Naur src/multidraw.c src/multidraw.c
|
||||
|
--- ./src/multidraw.c Wed Apr 18 20:40:32 2001
|
||||
|
+++ ./src/multidraw.c Tue Jan 29 06:58:45 2002
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
|
||||
|
|
||||
|
|
||||
|
-
|
||||
|
+#define _GNU_SOURCE
|
||||
|
#include <stdio.h> |
||||
|
#include <sys/types.h> |
||||
|
#include <sys/socket.h> |
||||
|
diff -Naur src/options_io.h src/options_io.h
|
||||
|
--- ./src/options_io.h Wed Apr 18 20:40:32 2001
|
||||
|
+++ ./src/options_io.h Tue Jan 29 07:15:51 2002
|
||||
|
@@ -1,5 +1,6 @@
|
||||
|
#ifndef __OPTIONS_IO |
||||
|
#define __OPTIONS_IO |
||||
|
|
||||
|
+void load_options(void);
|
||||
|
void save_options(void); |
||||
|
#endif |
||||
|
diff -Naur src/save.c src/save.c
|
||||
|
--- ./src/save.c Wed Apr 18 20:40:32 2001
|
||||
|
+++ ./src/save.c Tue Jan 29 20:17:45 2002
|
||||
|
@@ -20,6 +20,7 @@
|
||||
|
|
||||
|
#include <stdio.h> |
||||
|
#include <ncurses.h> |
||||
|
+#include <stdlib.h>
|
||||
|
|
||||
|
#include "internal.h" |
||||
|
#include "types.h" |
||||
|
@@ -92,6 +93,8 @@
|
||||
|
save_c(page, fd); |
||||
|
} else if (ftype == 4) { |
||||
|
save_bin(page, fd); |
||||
|
+ } else if (ftype == 5) {
|
||||
|
+ save_t(page, fd);
|
||||
|
} |
||||
|
fclose(fd); |
||||
|
page->modified = 0; |
||||
|
@@ -247,6 +250,77 @@
|
||||
|
fprintf(fd, "%ld,", page->buffer[y][x]); |
||||
|
|
||||
|
fprintf(fd, "},\n"); |
||||
|
+ }
|
||||
|
+ fprintf(fd, "};\n");
|
||||
|
+ return 0;
|
||||
|
+}
|
||||
|
+
|
||||
|
+int cycle_color(int color)
|
||||
|
+{
|
||||
|
+ switch(color){
|
||||
|
+ case 1:
|
||||
|
+ color=4;
|
||||
|
+ break;
|
||||
|
+ case 4:
|
||||
|
+ color=1;
|
||||
|
+ break;
|
||||
|
+ case 3:
|
||||
|
+ color=6;
|
||||
|
+ break;
|
||||
|
+ case 6:
|
||||
|
+ color=3;
|
||||
|
+ break;
|
||||
|
+ }
|
||||
|
+ return(color);
|
||||
|
+}
|
||||
|
+
|
||||
|
+/* this function saves the file format as a C header in TheDraw format */
|
||||
|
+int save_t(canvas *page, FILE *fd) {
|
||||
|
+ int y = 0;
|
||||
|
+ int x = 0;
|
||||
|
+ char *defname;
|
||||
|
+ colour fg = COLOUR_WHITE;
|
||||
|
+ colour bg = COLOUR_BLACK;
|
||||
|
+
|
||||
|
+ flag bold = FALSE;
|
||||
|
+
|
||||
|
+ flag blink = FALSE;
|
||||
|
+
|
||||
|
+ unsigned int attr;
|
||||
|
+
|
||||
|
+
|
||||
|
+ if(!page) return 1;
|
||||
|
+
|
||||
|
+ if(!fd) return 1;
|
||||
|
+
|
||||
|
+ defname = malloc(20);
|
||||
|
+ savei_defname(defname);
|
||||
|
+
|
||||
|
+ fprintf(fd, "/* TetraDraw C Screen Image. */\n");
|
||||
|
+ fprintf(fd, "#define %s_WIDTH 80\n", defname);
|
||||
|
+ fprintf(fd, "#define %s_DEPTH %d\n", defname, HY(page)+1);
|
||||
|
+ fprintf(fd, "#define %s_LENGTH %d\n", defname, (HY(page)+1)*160);
|
||||
|
+ fprintf(fd, "unsigned char %s[] = {\n", defname);
|
||||
|
+ for(y = 0; y <= HY(page); y++) {
|
||||
|
+ for(x = 0; x < 80; x++){
|
||||
|
+ tear_attrib(page->buffer[y][x], &fg, &bg, &bold, &blink);
|
||||
|
+ fg=cycle_color(fg);
|
||||
|
+ bg=cycle_color(bg);
|
||||
|
+ attr=bg << 4;
|
||||
|
+ attr+=fg;
|
||||
|
+ if(bold){
|
||||
|
+ attr+=8;
|
||||
|
+ }
|
||||
|
+ if(blink){
|
||||
|
+ attr+=128;
|
||||
|
+ }
|
||||
|
+ fprintf(fd, "'%c',", (char)page->buffer[y][x]);
|
||||
|
+ fprintf(fd, "0x%.2X,", attr);
|
||||
|
+ if((y*80+x+1)%6==0){
|
||||
|
+ fprintf(fd, "\n");
|
||||
|
+ }
|
||||
|
+ }
|
||||
|
+
|
||||
|
} |
||||
|
fprintf(fd, "};\n"); |
||||
|
return 0; |
||||
|
diff -Naur src/save.h src/save.h
|
||||
|
--- ./src/save.h Wed Apr 18 20:40:32 2001
|
||||
|
+++ ./src/save.h Tue Jan 29 07:21:50 2002
|
||||
|
@@ -3,8 +3,10 @@
|
||||
|
|
||||
|
int save_ansi(canvas *, FILE *); |
||||
|
int save_c(canvas *, FILE *); |
||||
|
+int save_t(canvas *, FILE *);
|
||||
|
int save_ascii(canvas *, FILE *); |
||||
|
int save_bin(canvas *, FILE *); |
||||
|
+int cycle_color(int);
|
||||
|
int save_cls(FILE *); |
||||
|
void save_file(canvas *); |
||||
|
|
||||
|
diff -Naur src/tetraview.c src/tetraview.c
|
||||
|
--- ./src/tetraview.c Sun Jul 29 20:40:50 2001
|
||||
|
+++ ./src/tetraview.c Tue Jan 29 07:16:39 2002
|
||||
|
@@ -34,6 +34,10 @@
|
||||
|
#include "tetraview.h" |
||||
|
#include "highascii.h" |
||||
|
|
||||
|
+#include "interface.h"
|
||||
|
+#include "network.h"
|
||||
|
+#include "options_io.h"
|
||||
|
+
|
||||
|
coordinate td_maxx = 0; |
||||
|
coordinate td_maxy = 0; |
||||
|
|
||||