Implementation Manual


BACK | INDEX | NEXT

Interface


Cypher Cypher Team Data file
full_ascii() return void

Option Menu Function
intro_exit() return void

Helper callback used upon loading of program. Shows start window.
update_window() return void

Update window
shift_cb( Fl_Widget *w ) return void

fill_alph( Fl_Widget *w ) return void

clear_alph( Fl_Widget *w ) return void

Disregard any ASCII range setting; clear all table entries.
change_mode(int new_mode) return void

Hides and shows buttons and windows depending on the new decryption mode. Also creates or delete data objects as appropriate when shifting modes.
shift_tools() return void

Shows shift counter and does updates
transpose_tools( Fl_Widget *w ) return void

open_notes_cb( Fl_Widget *w ) return void

v_cipher_cb( Fl_Widget *w ) return void

norm_tools_cb( Fl_Widget *w ) return void

v_space( Fl_Widget *w ) return void

cur_v_key( Fl_Widget *w ) return void

init_matrix () return void

Transposition Startup

Edit Includes all definitions that manipulate the decryption window including undo/redo.
word_wrap() return void

Procedure taking no arguments, that either wraps the text or unwraps the text depending on its state. The wrap inside the cipher working space text window makes sure the words either are jam packed or that no splitting of words occur.
lock(Fl_Widget *w, long int but_num) return void

Procedure taking a widget and a button number, that locks the contents of the button of that number. With these contents locked the user is unable to change the contents.
Locking Function

alpha_lock_cb(Fl_Widget *w, long int but_num) return void
Exchange Helper Function

change_alph_cb(Fl_Widget *w, long int but_num) return void

Helper callback function to exchange one element of the cypher alphabet. Shows exchange window.
Locking Function

update_lock() return void

Updates locked boxes.
dictionary_cb() return void

Procedure taking no arguments, that looks up the current highlighted word in the cipher working space text.
Exchange Helper Function

inner_exchange(Fl_Widget *w, long int but_num) return void

Helper callback function to exchange one element of the cypher alphabet. Shows exchange window from inside the window.
Exchange Helper Function

exch_close_cb() return void

Helper callback function that hides the exchange window on a cancel.
Exchange Helper Function

exchange_cb() return void Helper callback function that exchanges character variables.
Exchange Helper Function

exch_cancel_cb() return void

Helper callback function that hides the exchange window on a cancel.
add_space_cb() return void

Helper callback function that adds a space in the current exchange index.
delete_space_cb() return void

Helper callback function that adds a space in the current exchange index.
undo_cb() return void

This procedure does the following: Takes no arguments, undoes the last change made to the cipher text, plain text, or cipher key and also redoes an undo, meaning something that had been undone is now redone.

FileMenu File to be included at the appropriate mark in Cypher.C
new_file_cb() return void

new_file() - callback used for 'New' in menu
open_file_cb() return void

open_file() - callback used for 'Open' in menu

Uses load_file() to do open.
close_file_cb() return void

close_file() - callback used for 'Close' in menu
save_cb() return void

save() - callback used for 'Save' in menu

Uses save_as() if filename doesn't exist. Calls save_file() to do the work.
save_as_cb() return void

save_as() - callback used for 'Save_as' in menu && when save() has no filename

Calls save_file() to do the work.
quit_cb() return void

quit() - callback used for 'Quit' in menu

Requests save if changed is true, hides window.
cut_cb() return void

Function to be used in New File window.
copy_cb() return void

Function to be used in New File window.
paste_cb() return void

Function to be used in New File window.
File Helper

Functions
start_new() return void

Procedure taking no arguments, that takes information in the current file window and places it into the Cipher working enviroment, the cihper window.
no_new_file() return void

Procedure taking no arguments, that disregards the information in the current file window and closes it. Nothing is placed into the Cipher working enviroment, the cipher window.
check_save() return int

Helper file function that checks to see if the file has been saved before a quit.
set_changed(int c) return void

Helper function that sets the changed variable.
load_file(char *newfile) retun void

Helper function that does the meat of work for opening a file. Loads information from file into the main window.
save_file(char *newfile) return void

Helper function that does the meat of work for saving a file. Writes information from the windows into a file format.

Help Menu Help menu for interface class
bg_info() return void

glossary() return void

Procedure taking no arguments, that displays the glossary window, allowing use of it.
about() return void

Procedure taking no arguments, that displays the start window, the window that credits and gives information about Cipher.
find_cb() return void

This callback function asks for a search string using the fl_input() convenience function and then calls the find_again_cb() function to find the string.
find_again_cb() return void

This function will find the next occurrence of the search string. If the search string is blank then we want to pop up the search dialog.


StatMenu Implementation of callback functions from View menu and all windows and functions brought about by it.
Fl_Menu_Item statmenulist[]

Statistical Analysis Window Menubar Declarations for frequency, histogram, and elements.
show_stats( int type ) return void

Procedure taking an integer representing either single, double, or triple analysis respectively. The procedure displays the specified analysis to a window.
single_freq() return void

Procedure taking no arguments, that calls into play various other subprograms as to get the single character frequencies on the current file and display them.
digram_freq() return void

Procedure taking no arguments, that calls into play various other subprograms as to get the double character frequencies on the current file and display them.
trigram_freq() return void

Procedure taking no arguments, that calls into play various other subprograms as to get the triple character frequencies on the current file and display them.
view_ten_freq() return void

Displays 10, single histogram
Displays 10, double histogram
Displays 10, triple histogram
view_twenty_freq() return void

Displays 20, single histogram
Displays 20, double histogram
Displays 20, triple histogram
view_thirty_freq() return void

Displays 30, single histogram
Displays 30, double histogram
Displays 30, triple histogram
view_all_freq() return void

Display all, single histogram
Display all, double histogram
Display all, triple histogram
single_histogram() return void

Displays 10, single histogram
Displays 20, single histogram
Displays 30, single histogram
Displays All, single histogram
display_freq(int num_freq, int type) return void

Procedure taking the amount of frequencies to be displayed and the type of either single, double, or triple characters. The procedure gathers and makes the frequencies of the type and specified amount be displayed in a window.
stat_exch() return void

Exchanges values in plain text according to frequencies
close_stat() return void

Procedure taking no arguments, that closes the stat window.
stat_on_top() return void

stat_on_top2() return void

stat_swap_cb() return void

Procedure taking no arguments, that within the current stat window takes the frequency arranged cipher characters and places them into their closest counter partner in the plain text characters, which are also arranged according to frequency. Thus the cipher key is filled partially or fully, but may or may not be correct.