-
Notifications
You must be signed in to change notification settings - Fork 82
Plan9 port to Bill-Gray fork #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
ec6f557
Plan9 port to Bill-Gray fork
staalmannen 13de789
a few fixes based on feedback from @GitMensch. Still need to test-com…
staalmannen 907a714
Fix compilation of pdcurses and demos for BillGray fork
staalmannen 6e42115
remove remaining libcurses.a
staalmannen 5961ab5
merge pdcplan9 with pdcutil as per request
staalmannen b4980f5
remove useless reference to libcurses.a location as per request
staalmannen 68d2099
forgot to remove an experimental CFLAG
staalmannen 7ba97ea
Merge remote-tracking branch 'win32a/master' into Plan9-bg
staalmannen 1b0634c
Merge remote-tracking branch 'origin/Plan9-bg' into Plan9-bg
staalmannen e1b8fad
speed demo builds, whcar.h had to be disabled. Useless?
staalmannen ab46743
merge with origin
staalmannen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| PDCurses for Plan9 | ||
| ================== | ||
|
|
||
| This directory contains PDCurses source code files specific to Plan9. | ||
|
|
||
|
|
||
| Building | ||
| -------- | ||
|
|
||
| - cd to the plan9 sub directory | ||
|
|
||
| - Build it: | ||
|
|
||
| mk | ||
| mk install | ||
|
|
||
| - Optionally, you can cross compile by setting the variable $objtype, | ||
| for example: | ||
|
|
||
| objtype=amd64 mk | ||
|
|
||
| Distribution Status | ||
| ------------------- | ||
|
|
||
| Copyright (c) 2007 Federico G. Benavento | ||
|
|
||
| Permission is hereby granted, free of charge, to any person obtaining | ||
| a copy of this software and associated documentation files (the | ||
| "Software"), to deal in the Software without restriction, including | ||
| without limitation the rights to use, copy, modify, merge, publish, | ||
| distribute, sublicense, and/or sell copies of the Software, and to | ||
| permit persons to whom the Software is furnished to do so, subject to | ||
| the following conditions: | ||
|
|
||
| The above copyright notice and this permission notice shall be | ||
| included in all copies or substantial portions of the Software. | ||
|
|
||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
|
||
| Federico G. Benavento | ||
| January 2008 | ||
| benavento@gmail.com | ||
|
|
||
|
|
||
| Acknowledgements | ||
| ---------------- | ||
|
|
||
| Federico G. Benavento made the original port to PDCurses 3.0 | ||
|
|
||
| Jens Staal updated it | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- curses.h 2020-06-29 15:03:16.675718137 +0200 | ||
| +++ curses.h.ape 2020-06-29 19:09:31.624238344 +0200 | ||
| @@ -5,6 +5,8 @@ | ||
| #ifndef __PDCURSES__ | ||
| #define __PDCURSES__ 1 | ||
|
|
||
| +#pragma lib "/$M/lib/ape/libcurses.a" | ||
| + | ||
| /*man-start************************************************************** | ||
|
|
||
| Define before inclusion (only those needed): | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| </$objtype/mkfile | ||
|
|
||
| LIB=libcurses.a | ||
|
|
||
| OFILES=\ | ||
| # pdcurses \ | ||
| addch.$O\ | ||
| addchstr.$O\ | ||
| addstr.$O\ | ||
| attr.$O\ | ||
| beep.$O\ | ||
| bkgd.$O\ | ||
| border.$O\ | ||
| clear.$O\ | ||
| color.$O\ | ||
| debug.$O\ | ||
| delch.$O\ | ||
| deleteln.$O\ | ||
| getch.$O\ | ||
| getstr.$O\ | ||
| getyx.$O\ | ||
| inch.$O\ | ||
| inchstr.$O\ | ||
| initscr.$O\ | ||
| inopts.$O\ | ||
| insch.$O\ | ||
| insstr.$O\ | ||
| instr.$O\ | ||
| kernel.$O\ | ||
| keyname.$O\ | ||
| mouse.$O\ | ||
| move.$O\ | ||
| outopts.$O\ | ||
| overlay.$O\ | ||
| pad.$O\ | ||
| panel.$O\ | ||
| printw.$O\ | ||
| refresh.$O\ | ||
| scanw.$O\ | ||
| scr_dump.$O\ | ||
| scroll.$O\ | ||
| slk.$O\ | ||
| termattr.$O\ | ||
| touch.$O\ | ||
| util.$O\ | ||
| window.$O\ | ||
| # plan9 \ | ||
| pdcclip.$O\ | ||
| pdcdisp.$O\ | ||
| pdcgetsc.$O\ | ||
| pdckbd.$O\ | ||
| pdcscrn.$O\ | ||
| pdcsetsc.$O\ | ||
| pdcutil.$O | ||
|
|
||
| HFILES=\ | ||
| /sys/include/ape/curses.h\ | ||
| /sys/include/ape/panel.h\ | ||
|
|
||
| UPDATE=\ | ||
GitMensch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| mkfile\ | ||
| $HFILES\ | ||
| ${OFILES:%.$O=%.c}\ | ||
| ${LIB:/$objtype/%=/386/%}\ | ||
|
|
||
| </sys/src/cmd/mksyslib | ||
|
|
||
| CC=pcc | ||
| LD=pcc | ||
| CFLAGS= -c -I. -I.. -D_POSIX_SOURCE -D_BSD_EXTENSION -D_C99_SNPRINTF_EXTENSION \ | ||
| -DHAVE_VSNPRINTF | ||
|
|
||
| %.$O: ../pdcurses/%.c | ||
| $CC $CFLAGS ../pdcurses/$stem.c | ||
|
|
||
| %.$O: %.c | ||
| $CC $CFLAGS $stem.c | ||
|
|
||
|
|
||
| install:V: | ||
| cp libcurses.a /$objtype/lib/ape/libcurses.a | ||
| cp ../curses.h /sys/include/ape/curses.h | ||
| ape/patch /sys/include/ape/curses.h <header.patch | ||
| cp ../panel.h /sys/include/ape/panel.h | ||
|
|
||
| demos:V: | ||
| @{ | ||
| mk -f mkfile_demo all | ||
| } | ||
|
|
||
| clean:V: | ||
| @{ | ||
| mk -f mkfile_demo clean | ||
| } | ||
| rm -f *.[$OS] | ||
|
|
||
| nuke:V: | ||
| rm -f $LIB | ||
| rm -f /$objtype/lib/ape/libcurses.a | ||
| rm -f $HFILES | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| APE=/sys/src/ape | ||
| <$APE/config | ||
|
|
||
| TARG=\ | ||
| firework\ | ||
| newtest\ | ||
| ozdemo\ | ||
| picsview\ | ||
| ptest\ | ||
| rain\ | ||
| speed\ | ||
| testcurs\ | ||
| tuidemo\ | ||
| worm\ | ||
| xmas\ | ||
|
|
||
| HFILES=\ | ||
| /sys/include/ape/curses.h\ | ||
| /sys/include/ape/panel.h\ | ||
|
|
||
| UPDATE=\ | ||
| mkfile\ | ||
| $HFILES\ | ||
| ${OFILES:%.$O=%.c}\ | ||
| /$objtype/ape/lib/libcurses.a | ||
|
|
||
| </sys/src/cmd/mkmany | ||
|
|
||
| CFLAGS= -c -D_POSIX_SOURCE -D_BSD_EXTENSION -D_SUSV2_SOURCE -DPlan9 | ||
|
|
||
| %.$O: ../demos/%.c | ||
| $CC $CFLAGS ../demos/$stem.c | ||
|
|
||
| $O.tuidemo:V: tui.$O tuidemo.$O | ||
| $LD -o $target $prereq | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| #include <stdlib.h> | ||
| #include <string.h> | ||
| #include <curspriv.h> | ||
| #include "pdcplan9.h" | ||
|
|
||
|
|
||
| static char *clip = NULL; | ||
|
|
||
| int PDC_getclipboard(char **sp, long *np) | ||
| { | ||
| long n; | ||
|
|
||
| PDC_LOG(("PDC_getclipboard() - called\n")); | ||
| if (!clip) | ||
| return PDC_CLIP_EMPTY; | ||
|
|
||
| n = strlen(clip); | ||
| if ((*sp = malloc(n + 1)) == NULL) | ||
| return PDC_CLIP_MEMORY_ERROR; | ||
|
|
||
| memmove(*sp, clip, n); | ||
| *np = n; | ||
|
|
||
| return PDC_CLIP_SUCCESS; | ||
| } | ||
|
|
||
|
|
||
| int PDC_setclipboard(const char *s, long n) | ||
| { | ||
| PDC_LOG(("PDC_setclipboard() - called\n")); | ||
| if (clip) | ||
| { | ||
| free(clip); | ||
| clip = NULL; | ||
| } | ||
| if (s) | ||
| { | ||
| if ((clip = malloc(n + 1)) == NULL) | ||
| return PDC_CLIP_MEMORY_ERROR; | ||
| memmove(clip, s, n); | ||
| clip[n] = 0; | ||
| } | ||
|
|
||
| return PDC_CLIP_SUCCESS; | ||
| } | ||
|
|
||
|
|
||
| int PDC_freeclipboard(char *s) | ||
| { | ||
| PDC_LOG(("PDC_freeclipboard() - called\n")); | ||
| free(s); | ||
|
|
||
| return PDC_CLIP_SUCCESS; | ||
| } | ||
|
|
||
|
|
||
| int PDC_clearclipboard(void) | ||
| { | ||
| PDC_LOG(("PDC_clearclipboard() - called\n")); | ||
| if (clip) | ||
| { | ||
| free(clip); | ||
| clip = NULL; | ||
| } | ||
|
|
||
| return PDC_CLIP_SUCCESS; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| #include <curspriv.h> | ||
| #include "pdcplan9.h" | ||
|
|
||
| #ifdef CHTYPE_LONG | ||
| # define A(x) ((chtype)x | A_ALTCHARSET) | ||
| chtype acs_map[128] = { | ||
| A(0), A(1), A(2), A(3), A(4), A(5), A(6), A(7), A(8), A(9), | ||
| A(10), A(11), A(12), A(13), A(14), A(15), A(16), A(17), A(18), | ||
| A(19), A(20), A(21), A(22), A(23), A(24), A(25), A(26), A(27), | ||
| A(28), A(29), A(30), A(31), ' ', '!', '"', '#', '$', '%', '&', | ||
| '\'', '(', ')', '*', | ||
|
|
||
| 0x2192, 0x2190, 0x2191, 0x2193, | ||
|
|
||
| '/', | ||
|
|
||
| 0x2588, | ||
|
|
||
| '1', '2', '3', '4', '5', '6', '7', '8', '9', ':', ';', '<', '=', | ||
| '>', '?', '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', | ||
| 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', | ||
| 'X', 'Y', 'Z', '[', '\\', ']', '^', '_', | ||
|
|
||
| 0x25c6, 0x2592, | ||
|
|
||
| 'b', 'c', 'd', 'e', | ||
|
|
||
| 0x00ba, 0x00b1, 0x0023, 0x0023, 0x2518, 0x2510, 0x250c, 0x2514, | ||
| 0x253c, 'o', | ||
| 'p', 0x2500, 'r', 's', 0x2524, 0x251c, 0x2534, 0x252c, 0x2502, | ||
| 0x2264, 0x2265, 0x03c0, 0x2260, 0x00a3, 0x2022, | ||
|
|
||
| A(127) | ||
| }; | ||
|
|
||
| # undef A | ||
| #endif | ||
|
|
||
|
|
||
| void PDC_gotoyx(int y, int x) | ||
| { | ||
| chtype *ch; | ||
|
|
||
| PDC_LOG(("PDC_gotoyx() - called: y %d x %d\n", y, x)); | ||
| p9setcur(SP->cursrow, SP->curscol, y, x, SP->visibility); | ||
| } | ||
|
|
||
|
|
||
| void PDC_transform_line(int y, int x, int len, const chtype * srcp) | ||
| { | ||
| int i; | ||
|
|
||
| PDC_LOG(("PDC_transform_line() - called: line %d\n", lineno)); | ||
| for (i = 0; i < len; i++) | ||
| { | ||
| p9putc(y, x + i, srcp[i]); | ||
| } | ||
| } | ||
|
|
||
| void PDC_doupdate(void) | ||
| { | ||
| p9napms(1); | ||
| } | ||
|
|
||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.