Commit Graph

167 Commits

Author SHA1 Message Date
Brian Barto 56df5f3de5 Dynamically allocation memory for the display buffer based on column count.
modified:   src/sneakers.c
2018-06-13 18:58:24 -04:00
Brian Barto 40f7d1a080 Support the esc key for aborting the sneakers menu.
modified:   src/sneakers.c
2018-06-13 14:06:24 -04:00
Brian Barto 65ded7d75b Replace inSize with 'i' and use a standard for loop to handle incrementing.
modified:   src/nms.c
2017-09-20 09:15:04 -04:00
Brian Barto 40da2058b4 Check the return value of realloc() for error
modified:   src/nms.c
2017-09-20 09:03:45 -04:00
Brian Barto 30bd00f949 Set initial capacity to 50 chars.
modified:   src/nms.c
2017-09-20 09:00:38 -04:00
Brian Barto 39c02de520 getchar() must be assigned to an int to handle EOF properly.
modified:   src/nmstermio.c
2017-09-20 08:35:08 -04:00
Brian Barto 733503ce3a Fix some indetation issues and add brackets.
modified:   src/nmseffect.c
2017-04-22 14:46:12 -04:00
liv b70e70e3dd Add option to mask single blank spaces 2017-04-11 10:51:56 +01:00
Brian Barto e1fccfce94 Add comment for MinGW support code
modified:   src/nmstermio.c
2017-03-21 09:40:15 -04:00
Trinh Hoang Anh 9ebc9a7d76 Add support for MinGW on Windows 2017-03-19 16:21:27 +08:00
Brian Barto 9cd1d1e8d3 Increment version number for bug fix.
modified:   README.md
	modified:   src/nms.c
2017-03-08 17:25:08 -05:00
Brian Barto ff5fbbd7c7 Clear output from nmstermio_get_cursor_row()
modified:   src/nmseffect.c
2017-03-08 16:19:47 -05:00
Brian Barto c181e1f5fe Update version number for new release. Ensure it matches output for nms -v
modified:   README.md
	modified:   src/nms.c
2017-02-19 13:29:28 -05:00
Brian Barto 8dfd02cd1c Change license header to GPL
modified:   src/nms.c
	modified:   src/nmscharset.c
	modified:   src/nmscharset.h
	modified:   src/nmseffect.c
	modified:   src/nmseffect.h
	modified:   src/nmstermio.c
	modified:   src/nmstermio.h
	modified:   src/nmstermio_ncurses.c
	modified:   src/sneakers.c
2017-02-17 13:24:11 -05:00
Brian Barto db39bde01d Another typo fix
modified:   src/nmseffect.c
2017-01-27 10:32:53 -05:00
Brian Barto 10e2046092 Typo fix
modified:   src/nmseffect.c
2017-01-27 10:30:58 -05:00
Brian Barto 4b79262cf2 Document the nmstermio modules
modified:   src/nmstermio.c
	modified:   src/nmstermio_ncurses.c
2017-01-20 14:35:00 -05:00
Brian Barto 08957b766c Document nmscharset module
modified:   src/nmscharset.c
2017-01-20 13:47:34 -05:00
Brian Barto a0d80ddb19 Update documentation for nmseffect module
modified:   src/nmseffect.c
2017-01-20 10:46:33 -05:00
Brian Barto 0b44f64468 Update documentation for nmseffect library
modified:   src/nmseffect.c
2017-01-19 15:15:24 -05:00
Brian Barto ea6983113f Don't need to print output from nmseffect_exec()
modified:   src/nms.c
2017-01-19 14:51:21 -05:00
Brian Barto 272e780adf Make module for character set to allow easy substitution with different set.
modified:   Makefile
	new file:   src/nmscharset.c
	new file:   src/nmscharset.h
	modified:   src/nmseffect.c
2017-01-19 12:08:20 -05:00
Brian Barto 8a09f36cee Rename nmsterm modules to nmstermio, and update function names to align with new module name
modified:   Makefile
	modified:   src/nmseffect.c
	deleted:    src/nmsterm.h
	renamed:    src/nmsterm.c -> src/nmstermio.c
	new file:   src/nmstermio.h
	renamed:    src/nmsterm_ncurses.c -> src/nmstermio_ncurses.c
	modified:   src/sneakers.c
2017-01-19 11:42:29 -05:00
Brian Barto bd5614363f Change function name to nmseffect_set_returnopts()
modified:   src/nmseffect.c
	modified:   src/nmseffect.h
	modified:   src/sneakers.c
2017-01-19 11:25:24 -05:00
Brian Barto 4edd0d51da Change function name to nmseffect_set_autodecrypt()
modified:   src/nms.c
	modified:   src/nmseffect.c
	modified:   src/nmseffect.h
2017-01-19 11:20:53 -05:00
Brian Barto 5fd104afee Change file names and update function names (to align with file name changes)
modified:   Makefile
	renamed:    src/main.c -> src/nms.c
	deleted:    src/nms.h
	renamed:    src/nms.c -> src/nmseffect.c
	new file:   src/nmseffect.h
	modified:   src/sneakers.c
2017-01-19 11:17:40 -05:00
Brian Barto a2a6b28df1 Use nmsterm_get_clearscr() such that we no longer need to return cursor row position from the init function.
modified:   src/nms.c
	modified:   src/nmsterm.c
	modified:   src/nmsterm.h
	modified:   src/nmsterm_ncurses.c
2017-01-18 19:31:59 -05:00
Brian Barto 089a089bc4 Move static vars foregroundColor and clearScr to nmsterm implementations. Make setters and getters as necessary.
modified:   src/main.c
	modified:   src/nms.c
	modified:   src/nms.h
	modified:   src/nmsterm.c
	modified:   src/nmsterm.h
	modified:   src/nmsterm_ncurses.c
	modified:   src/sneakers.c
2017-01-18 19:19:33 -05:00
Brian Barto b4fd33a43b Create an abstraction layer between terminal and main nms code so we can substitute ncurses functions without duplicating code.
modified:   Makefile
	deleted:    src/nms-ncurses.c
	modified:   src/nms.c
	new file:   src/nmsterm.c
	new file:   src/nmsterm.h
	new file:   src/nmsterm_ncurses.c
	modified:   src/sneakers.c
2017-01-18 18:51:10 -05:00
Brian Barto 4ec37fc46e Remove commented code
modified:   src/nms-ncurses.c
2017-01-18 15:07:50 -05:00
Brian Barto cffbd272d7 Make ncurses implementation for sneakers
modified:   Makefile
	modified:   src/nms-ncurses.c
2017-01-18 00:14:21 -05:00
Brian Barto e42155973a ncurses implementation
modified:   Makefile
	new file:   src/nms-ncurses.c
2017-01-17 22:00:24 -05:00
Brian Barto b1a0db59ae The -c option doesn't require an argument (bug fix)
modified:   src/main.c
2017-01-17 21:54:13 -05:00
Brian Barto 1c65c9a218 Renamed the files
modified:   Makefile
	modified:   README.md
	renamed:    src/nms.c -> src/main.c
	renamed:    src/libnms.c -> src/nms.c
	renamed:    src/libnms.h -> src/nms.h
	modified:   src/sneakers.c
2017-01-16 16:28:12 -05:00
Brian Barto 4d7706c907 Add support for returnOpts without clearing the screen
modified:   src/libnms.c
2017-01-15 14:26:19 -05:00
Brian Barto e7ec1e9b9a Change main.c file name to nms.c
modified:   Makefile
	renamed:    src/main.c -> src/nms.c
2017-01-13 15:58:05 -05:00
Brian Barto 848f3d613e Remove nms files (no longer needed)
deleted:    nms.c
	deleted:    nms.h
2017-01-13 15:22:34 -05:00
Brian Barto 15d033a93c Add clear-screen functionality
modified:   README.md
	modified:   src/main.c
2017-01-12 16:38:24 -05:00
Brian Barto da514019de Initial update with code from libnms
modified:   Makefile
	new file:   src/libnms.c
	new file:   src/libnms.h
	modified:   src/main.c
	modified:   src/sneakers.c
2017-01-08 17:22:03 -05:00
Brian Barto b95317c382 Fixing some indent issues
modified:   src/main.c
2016-09-18 19:03:18 -04:00
Brian Barto 0af55b446a Updated version number for new release
modified:   src/main.c
2016-07-14 08:48:22 -04:00
Brian Barto eab9e52438 Small syntax change
modified:   src/nms.h
2016-05-20 10:33:26 -04:00
Brian Barto e07eddaee2 Updating version number for -v switch
modified:   src/main.c
2016-05-19 10:19:51 -04:00
Brian Barto c3d8df2a66 Support for east asian characters that take two terminal spaces.
modified:   src/nms.c
	modified:   src/sneakers.c
2016-05-12 22:33:03 -04:00
Brian Barto 26c2507189 Fix for bug where first overflow line was getting overwritten.
modified:   src/nms.c
2016-05-12 17:27:10 -04:00
Brian Barto 5b1cf2c362 Fixed an issue with wrapping text incorrectly
modified:   src/nms.c
2016-05-12 17:15:19 -04:00
Brian Barto 2e47b10a82 Bug fix for seg fault when displaying extra rows beyond terminal capacity
modified:   src/nms.c
2016-05-12 16:17:39 -04:00
Brian Barto 9d7ac87af3 Bug fix for UTF-8 character support on ubuntu. Needed to link to the ncursesw library.
modified:   Makefile
	modified:   README.md
	modified:   src/nms.c
2016-05-12 15:06:35 -04:00
Brian Barto e6ccc65d19 Disabling the CP437 character support because it does not display correctly on some versions of
ncurses. Hopefully will have a fix soon.

	modified:   src/nms.c
2016-05-12 14:32:07 -04:00
Brian Barto db52fbe346 Rudimentary support for UTF-8 character input. Note that east asian wide characters are not
supported yet. Support for those should follow soon.

	modified:   src/nms.c
2016-05-11 19:21:46 -04:00
Brian Barto a783af8d7f Performance tweak. The jumble loop smoother now.
modified:   src/nms.c
2016-05-11 16:55:19 -04:00
Brian Barto f1adafb03d Added character set CP437. This now uses the characters we actually see in the movie.
modified:   src/nms.c
2016-05-10 20:34:33 -04:00
Brian Barto 9ab70d1948 Small refactor of the forground color code
modified:   README.md
	modified:   src/main.c
	modified:   src/nms.c
	modified:   src/nms.h
2016-05-03 10:30:11 -04:00
Brian Barto eef49d2ce6 Merge branch 'feature/colour' of https://github.com/anthonysterling/no-more-secrets into anthonysterling-feature/colour 2016-05-03 09:44:41 -04:00
Anthony Sterling 469a24b85d Added the `-f` flag to change the foreground color
The `-f` flag enabling the selection of the following colors:-

- white
- yellow
- black
- magenta
- blue
- green
- red

By default the foreground is blue, as per the current implementation.
2016-05-02 20:03:10 +01:00
Brian Barto c043388bad Incorporated geometric size expansion for input array to reduce the amount of memory reallocations.
modified:   src/main.c
2016-05-02 13:56:35 -04:00
Brian Barto e988dac87c Added -v command line option to print version number
modified:   src/main.c
2016-05-01 17:19:27 -04:00
Brian Barto ed5e9f689f Support for the '-a' command line option to auto-start the decryption effect
modified:   README.md
	modified:   src/main.c
	modified:   src/nms.c
	modified:   src/nms.h
2016-05-01 17:09:38 -04:00
Brian Barto 9a7a77c2b7 Merge pull request #10 from maxwellgerber/master
More Makefile stuff
2016-04-29 11:26:24 -04:00
Brian Barto b34fc9bf11 Fix for issue #6:
"Segfaults when input is piped from non-existant program"

	modified:   src/nms.c
2016-04-28 15:59:00 -04:00
Brian Barto d110aedb85 Updating/Clarifying some code comments
modified:   src/nms.c
2016-04-28 15:34:41 -04:00
mrundle 12e08849fd minor Makefile cleanup and introduced gcc warnings 2016-04-28 04:51:47 +00:00
Brian Barto 6b375c47a9 Minor code tweak to use TAB_SIZE instead of integer constant
modified:   src/nms.c
2016-04-27 11:26:18 -04:00
Brian Barto e06aa4ebf5 Initializing character pointer to NULL
modified:   src/main.c
2016-04-27 11:01:41 -04:00
Brian Barto 908c535277 Endlessly documenting...
modified:   README.md
	modified:   src/nms.h
2016-04-25 17:40:09 -04:00
Brian Barto 05e9b68f0e More documentation updates
modified:   README.md
	modified:   src/nms.h
2016-04-25 17:18:43 -04:00
Brian Barto 125cf82b42 Added beep when user chooses an invalid selection (when selections are enabled)
modified:   src/nms.c
2016-04-20 18:33:51 -04:00
Brian Barto 53f3835195 Added option to show cursor during "type" and "jumble" loops.
modified:   src/main.c
	modified:   src/nms.c
	modified:   src/nms.h
2016-04-20 18:16:19 -04:00
Brian Barto 36cf124a0d Changed nmsexec() to nms_exec()
modified:   src/main.c
	modified:   src/nms.c
	modified:   src/nms.h
	modified:   src/sneakers.c
2016-04-20 17:55:07 -04:00
Brian Barto 9f1ec97e3f Added cursor position options
modified:   src/nms.c
	modified:   src/nms.h
	modified:   src/sneakers.c
2016-04-20 17:51:36 -04:00
Brian Barto 227b5a7344 Changed my typedef name to proper camel case
modified:   src/main.c
	modified:   src/nms.c
	modified:   src/nms.h
	modified:   src/sneakers.c
2016-04-20 17:24:11 -04:00
Brian Barto 9959d6f98f Changes nmsexec() to accept a structure containing it's multiple arguments. This made
more sense than passing a growing list of arguments.

	modified:   src/main.c
	modified:   src/nms.c
	modified:   src/nms.h
	modified:   src/sneakers.c
2016-04-20 17:08:35 -04:00
Brian Barto f91d5601c4 Added "returnOptions" parameter that limits which keys will continue execution
once the src text is revealed.

	modified:   src/main.c
	modified:   src/nms.c
	modified:   src/nms.h
	modified:   src/sneakers.c
2016-04-20 14:52:37 -04:00
Brian Barto 1782f6d248 Flushing input prior to getch()
modified:   src/nms.c
2016-04-20 12:39:39 -04:00
Brian Barto 0f5db67cac Added default case to nmsexec() return value
modified:   src/sneakers.c
2016-04-20 12:27:33 -04:00
Brian Barto dd50839dae Returning the character that the user pressed after the reveal.
modified:   src/nms.c
	modified:   src/nms.h
	modified:   src/sneakers.c
2016-04-20 12:23:37 -04:00
Brian Barto 17348f7c85 Defining some constants to replace variables that should have never been.
modified:   src/nms.c
2016-04-19 18:57:29 -04:00
Brian Barto b97d1cbc4a Bump up the type speed a touch
modified:   src/nms.c
2016-04-19 18:36:29 -04:00
Brian Barto e223b46bfc Typo fix
modified:   src/sneakers.c
2016-04-19 18:27:51 -04:00
Brian Barto 99d1fc318e Some typo fixes
modified:   src/sneakers.c
2016-04-19 18:24:48 -04:00
Brian Barto 7bfe0b9ff5 Commiting an example use case that mimicks the movie scene in sneakers. 2016-04-19 18:18:02 -04:00
Brian Barto 164d487349 Quick bug fix for my last commit
modified:   src/nms.c
2016-04-19 15:05:21 -04:00
Brian Barto 39390b673c Had to reopen stdin to get keyboard input back when piped data is used
modified:   src/nms.c
2016-04-19 13:46:58 -04:00
Brian Barto ed59cb1070 Removing a line I don't need anymnore due to previous commit.
modified:   src/nms.c
2016-04-18 18:45:34 -04:00
Brian Barto 103e164106 Decided I didn't need the nmsprintf() function. Instead teh main program should
build the character array however it pleases and pass it in to nmsexec().

	modified:   src/main.c
	modified:   src/nms.c
	modified:   src/nms.h
2016-04-18 18:39:56 -04:00
Brian Barto 4ccde16721 No need to loop to increase buffer size when snprintf() tells me exactly how much space I need.
modified:   src/nms.c
2016-04-18 14:51:16 -04:00
Brian Barto 9b5471838a Forgot to free() my malloc'd character array
modified:   src/nms.c
2016-04-18 14:38:02 -04:00
Brian Barto 385cacab05 Follow up to previous commit.
modified:   src/nms.c
2016-04-18 14:35:25 -04:00
Brian Barto 1b6ba0bf7f Used snprintf to dynamically grow print buffer size as needed.
modified:   src/nms.c
2016-04-18 14:27:41 -04:00
Brian Barto 6da3bbdce5 Restructured the application file a bit.
modified:   Makefile
	renamed:    src/nms.c -> src/main.c
	copied:     src/nms.h -> src/nms.c
	modified:   src/nms.h
2016-04-18 12:00:57 -04:00
Brian Barto 3f0c272f44 nmsprintBuffer doesn't need to be a global.
modified:   src/nms.h
2016-04-15 17:39:58 -04:00
Brian Barto 00dd424e9b Making global vars static
modified:   src/nms.h
2016-04-15 17:30:55 -04:00
Brian Barto e2ab6966a7 Updated the handling of "overflow" data
modified:   nms.h
2016-04-15 15:14:06 -04:00
Brian Barto 61f05b0307 Some needed commenting
modified:   src/nms.h
2016-04-15 14:28:06 -04:00
Brian Barto 4ecd5fcfb3 Changed up the Makefile a bit to make it simpler. Also changed it's location
and added a bin dir.

	new file:   Makefile
	renamed:    src/obj/.gitignore -> bin/.gitignore
	new file:   obj/.gitignore
	deleted:    src/Makefile
2016-04-15 14:02:09 -04:00
Brian Barto a82d55717a Integrated ncurses color functions to replace my raw escape characters I used for color.
modified:   src/nms.h
2016-04-14 16:25:16 -04:00
Brian Barto 46fc803fe7 Initial curses integration
modified:   src/Makefile
	modified:   src/nms.h
2016-04-14 16:18:42 -04:00
Brian Barto ece2551814 Couple OCD changes
modified:   nms.h
2016-04-14 15:48:27 -04:00
Brian Barto 0567e7f3b6 Updated Makefile to include the new header file
modified:   src/Makefile
	modified:   src/obj/.gitignore
2016-04-12 17:15:38 -04:00
Brian Barto 3f2b28a352 Placed all of the logic in to a header file so that it can be included
inside other applications.

	modified:   src/nms.c
	copied:     src/nms.c -> src/nms.h
2016-04-12 16:18:53 -04:00