Constant readme changes
modified: README.md
This commit is contained in:
parent
c2f78daebb
commit
aef8476017
50
README.md
50
README.md
@ -1,18 +1,18 @@
|
|||||||
No More Secrets
|
No More Secrets
|
||||||
===============
|
===============
|
||||||
|
|
||||||
"No More Secrets" is the name I've lovingly given to the infamous "decrypting text effect" seen on
|
"No More Secrets" is the name I've lovingly given to the infamous "decrypting text" effect seen on
|
||||||
screen in the 1992 hacker movie "Sneakers". If you are unfamiliar with the effect, it can be seen
|
screen in the 1992 hacker movie Sneakers. If you are unfamiliar with the effect, it can be seen
|
||||||
at 0:35 in [this youtube video](https://www.youtube.com/watch?v=F5bAa6gFvLs).
|
at 0:35 in [this youtube video](https://www.youtube.com/watch?v=F5bAa6gFvLs).
|
||||||
|
|
||||||
This project seeks to provide tools to recreate this effect in your projects.
|
This project provides tools to recreate this effect in your projects.
|
||||||
|
|
||||||
Here is a standalone executable (provided in this project) that uses the provided tools to perform this
|
Here is a standalone executable called `nms` (provided in this project) that uses these tools to
|
||||||
effect on piped data:
|
perform this effect on piped data:
|
||||||
|
|
||||||
![Screenshot](http://i.imgur.com/ezF3xkN.gif)
|
![Screenshot](http://i.imgur.com/ezF3xkN.gif)
|
||||||
|
|
||||||
Here is another example program called "sneakers" (type `make sneakers` when installing.) that
|
Here is another example program called "sneakers" (type `make sneakers` to build) that
|
||||||
utilizes these tools to recreate, almost identically, what we see in the above movie clip.
|
utilizes these tools to recreate, almost identically, what we see in the above movie clip.
|
||||||
|
|
||||||
![Screenshot](http://www.tackboard.world/no_more_secrets.gif)
|
![Screenshot](http://www.tackboard.world/no_more_secrets.gif)
|
||||||
@ -22,9 +22,9 @@ What's Provided
|
|||||||
|
|
||||||
Two tools are provided for you to recreate this effect:
|
Two tools are provided for you to recreate this effect:
|
||||||
|
|
||||||
1. A standalone executable file named `nms` (shown above). This file accepts data from a shell pipe and displays it in a manner that is nearly identical to the effect we see in the movie.
|
1. A standalone executable file named `nms` (shown above). This program performs the "decrypting text" effect on data it receives via shell pipe.
|
||||||
|
|
||||||
2. A module and header file, written in C, that can be included in programs and used to recreate this effect in a custonized way. In fact, the standalone executable `nms` is really just an example that shows how to use this module on piped data.
|
2. A module and header file, written in C, that can be used to recreate this effect in other projects. In fact, the standalone executable `nms` is really just an example that shows how to use this module with piped data.
|
||||||
|
|
||||||
Installing the Standalone Executable
|
Installing the Standalone Executable
|
||||||
------------------------------------
|
------------------------------------
|
||||||
@ -74,7 +74,7 @@ Compile myprog.c (must include `nms.c` and `-lncurses`):
|
|||||||
gcc nms.c myprog.c -o myprog -lncurses
|
gcc nms.c myprog.c -o myprog -lncurses
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Module Details
|
#### How-To
|
||||||
|
|
||||||
Copy these two files to your project:
|
Copy these two files to your project:
|
||||||
|
|
||||||
@ -85,22 +85,17 @@ nms.c
|
|||||||
Include `nms.h` in your program file:
|
Include `nms.h` in your program file:
|
||||||
|
|
||||||
```
|
```
|
||||||
#include <nms.h>
|
#include "nms.h"
|
||||||
```
|
```
|
||||||
You only need to call one function from inside your program to create this effect. It is defined as
|
Next you will need to declare and initialize the structure that needs to be passed to nms_exec();
|
||||||
such:
|
|
||||||
```
|
|
||||||
char nms_exec(NmsArgs *);
|
|
||||||
```
|
|
||||||
This function only takes one argument: a pointer to a structure that contains arguments for
|
|
||||||
nms_exec(). So next, declare the structure (substitute 'args' with whatever name you desire):
|
|
||||||
```
|
```
|
||||||
NmsArgs args = INIT_NMSARGS;
|
NmsArgs args = INIT_NMSARGS;
|
||||||
```
|
```
|
||||||
INIT_NMSARGS substitutes a default set of values for all 5 structure members. As you see in the
|
INIT_NMSARGS is a defined name that sets a default set of values for all of the structure members. It
|
||||||
synopsis above, only the member that contains the text is needed. The others can be left with
|
is recommended that you use it. If you don't, you will have to manually assign a value to each
|
||||||
their default setting, and are only useful if the text you are "decrypting" reveals a menu from
|
structure member.
|
||||||
which the user must choose an option. here is the structure definition:
|
|
||||||
|
Here is how the structre is defined:
|
||||||
```
|
```
|
||||||
typedef struct {
|
typedef struct {
|
||||||
char *src;
|
char *src;
|
||||||
@ -110,14 +105,23 @@ typedef struct {
|
|||||||
bool show_cursor;
|
bool show_cursor;
|
||||||
} NmsArgs;
|
} NmsArgs;
|
||||||
```
|
```
|
||||||
* `char *src` - Pointer to the string of character to perform the effect on.
|
* `char *src` - Pointer to the string of characters on which to perform the effect.
|
||||||
|
|
||||||
Useful for displaying menus only:
|
Useful for displaying menus only:
|
||||||
|
|
||||||
* `char *return_opts` - String pointer containg only the character options that the user must choose from. For example, if you are showing six menu options, this string might be "123456". The user will have to choose one of these characters before execution is handed back to the calling function. Note that the character selected is returned by `nms_exec()`;
|
* `char *return_opts` - String pointer containg only the character options that the user must choose from once the src characters are revealed. For example, if you are showing a menu with six options, this string might be "123456". The user will have to choose one of these characters before execution is handed back to the calling function. Note that the character selected is returned by `nms_exec()`;
|
||||||
* `int input_cursor_x` and `int input_cursor_y` - If your menu has a specific location that you'd like to place the cursor for user input, use these to set the x and y screen corrdinates for the position.
|
* `int input_cursor_x` and `int input_cursor_y` - If your menu has a specific location that you'd like to place the cursor for user input, use these to set the x and y screen corrdinates for the position.
|
||||||
* `bool show_cursor` - Set to `true` if you want the cursor to be visible during the text decryption effect. It is set to `false` by default.
|
* `bool show_cursor` - Set to `true` if you want the cursor to be visible during the text decryption effect. It is set to `false` by default.
|
||||||
|
|
||||||
|
Assign values to the structure members as needed. Then simply pass a pointer to the structure to the
|
||||||
|
nms_exec() function:
|
||||||
|
```
|
||||||
|
nms_exec(&args);
|
||||||
|
```
|
||||||
|
Note that nms_exec() prompts the user to press a key to start the "decrypting text" effect, and again
|
||||||
|
once the text has been fully revealed. The key that is pressed at the second prompt is returned to the
|
||||||
|
calling function so that it can be used as input after displaying a menu.
|
||||||
|
|
||||||
#### Compiling
|
#### Compiling
|
||||||
|
|
||||||
Add `nms.c` to your source file list, and link the ncurses library `-lncurses` when compiling:
|
Add `nms.c` to your source file list, and link the ncurses library `-lncurses` when compiling:
|
||||||
|
Loading…
Reference in New Issue
Block a user