Compare commits

..

8 Commits

Author SHA1 Message Date
3922669351 Updated header files 2022-10-24 07:55:38 -05:00
139f694f2d Updated Install Script 2022-10-24 07:55:26 -05:00
d3321b2a43 Updated Makefile 2022-10-23 16:36:40 -05:00
f570032908 Updated README todo 2022-10-23 16:25:49 -05:00
431b6e9bca Updated install script 2022-10-23 16:24:47 -05:00
f7f59469c2 Set env. var. for PDcurses SDL 2022-10-23 16:24:11 -05:00
9efbc49985 Updated header files 2022-10-23 16:23:29 -05:00
8b6957da01 Add pdcurses support to Makefile 2022-10-23 16:22:51 -05:00
6 changed files with 56 additions and 16 deletions

View File

@@ -1,6 +1,17 @@
program3-4: program3-4.c texted.c fileman.c
sed -i 's/"pdcurses\/curses.h"/<ncurses.h>/g' texted.h
sed -i 's/"pdcurses\/curses.h"/<ncurses.h>/g' fileman.h
sed -i 's/for (int i=0,a=0;i<numCharsToPrint-1;i++,a++)/for (int i=0,a=0;i<numCharsToPrint;i++,a++)/g' program3-4.c
gcc program3-4.c texted.c fileman.c -o program3-4 -lncursest
.PHONY: full
.PHONY: full pdcurses
full:
./installfull.sh
make
pdcurses:
make program3-4-pdcurses
program3-4-pdcurses: program3-4.c texted.c fileman.c
sed -i 's/<ncurses.h>/"pdcurses\/curses.h"/g' texted.h
sed -i 's/<ncurses.h>/"pdcurses\/curses.h"/g' fileman.h
sed -i 's/for (int i=0,a=0;i<numCharsToPrint;i++,a++)/for (int i=0,a=0;i<numCharsToPrint-1;i++,a++)/g' program3-4.c
gcc -g program3-4.c texted.c fileman.c -o program3-4-pdcurses pdcurses/sdl2/pdcurses.a -L/usr/lib -lSDL2

View File

@@ -7,7 +7,7 @@ The following steps are used to compile the version of ncurses that this program
- Grab the ncurses source code from [here](https://invisible-mirror.net/archives/ncurses/ncurses-6.3.tar.gz)
- Run the configure script (for ncurses) with the `--with-pthread --with-shared` options.
- Run `make` and `make install` to compile and install the library.
-TODO - Update install script to fetch and compile pdcurses source code.

View File

@@ -1,6 +1,6 @@
#ifndef FILEMAN_H_
#define FILEMAN_H_
#include <curses.h>
#include <ncurses.h>
#include <sys/stat.h>
#include <string.h>
#include <dirent.h>

View File

@@ -1,19 +1,44 @@
#!/bin/bash
FILE=/lib/libncursest.so
WORK_DIR="${PWD}"
CORES="$(nproc)"
CURSES_URL="https://invisible-mirror.net/archives/ncurses/current/ncurses.tar.gz"
if test -f "$FILE"; then
echo "$FILE exists; skipping ncurses compile."
else
echo "$FILE does not exist, fetching and compiling ncurses source code now..."
work_dir="${PWD}"
cores="$(nproc)"
curses_url="https://invisible-mirror.net/archives/ncurses/current/ncurses.tar.gz"
#if test -f "$FILE"; then
# echo "$FILE exists; skipping ncurses compile."
#else
# echo "$FILE does not exist, fetching and compiling ncurses source code now..."
mkdir ncurses
wget -q -O- "${CURSES_URL}" | tar -xz -C ncurses
echo "Fetched ncurses source code from ${CURSES_URL}..."
cd ncurses/*/
wget -q -O- "${curses_url}" | tar -xz -C ncurses
echo "Fetched ncurses source code from ${curses_url}..."
cd ncurses/*/ || exit
echo "Runnning configure script..."
./configure --with-pthread --with-shared > /dev/null
echo "Running make..."
make -j"${CORES}" > /dev/null
fi
make -j"${cores}" > /dev/null
cd lib || exit
FILE=libncursest.so.?.?
#fi
if ls /lib/${FILE} 1> /dev/null 2>&1 ; then
echo "You have a version of ncurses that was identical to the one that was compiled."
echo " Quitting..."
exit
else
echo "You have a different version of ncurses than the one that was just compiled."
read -p "Would you like to install the new version? [y/N] " userchoice
if [ "$userchoice" = "Y" ]; then
echo "The program will now attempt to install the new version of ncurses (the one that was just compiled). In order to do this, the sudo password is required."
echo "Installing the new version of ncurses..."
sudo make install
echo "The new version has been installed. The program will now quit."
echo "Quitting..."
exit
else
echo "You chose to not install the new ncurses version. This program will now quit."
echo "Quitting..."
exit
fi
fi

View File

@@ -32,6 +32,10 @@ This is an ncurses tool allows you to browse your files and view/edit them in th
int main(int argc,char** argv) {
putenv("PDC_COLS=1000");
putenv("PDC_LINES=1000");
int xLen,yLen,mainX,mainY; //values for the x-length and y-length of stdscr (i.e. the terminal window), and the 'main window' inside it.
int fileCountNum; //Number of files in a given directory
int highlighted=0; //Index of the highlighted file

View File

@@ -1,6 +1,6 @@
#ifndef TEXTED_H_
#define TEXTED_H_
#include <curses.h>
#include <ncurses.h>
#include <string.h>
#include <stdlib.h>