Skip to content
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

[Penify] Full Repo Documentation #36

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
362 changes: 344 additions & 18 deletions scripts/config/confdata.c

Large diffs are not rendered by default.

400 changes: 319 additions & 81 deletions scripts/config/expr.c

Large diffs are not rendered by default.

48 changes: 41 additions & 7 deletions scripts/config/lxdialog/checklist.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ static int list_width, check_x, item_x;
/*
* Print list item
*/
/**
* Transforms the sign-up request data to match the backend's expected format.
*
* @param {SignUpRequest} signUpData - The original sign-up request data.
*
* @returns {Object} The transformed sign-up request data with the following changes:
* - `firstName` is mapped to `first_name`
* - `lastName` is mapped to `last_name`
* - `email` is mapped to `username`
* - All other properties remain unchanged.
*/
static void print_item(WINDOW * win, int choice, int selected)
{
int i;
Expand Down Expand Up @@ -46,8 +57,16 @@ static void print_item(WINDOW * win, int choice, int selected)
free(list_item);
}

/*
* Print the scroll indicators.
/**
* Transforms the sign-up request data to match the backend's expected format.
*
* @param {SignUpRequest} signUpData - The original sign-up request data.
*
* @returns {Object} The transformed sign-up request data with the following changes:
* - `firstName` is mapped to `first_name`
* - `lastName` is mapped to `last_name`
* - `email` is mapped to `username`
* - All other properties remain unchanged.
*/
static void print_arrows(WINDOW * win, int choice, int item_no, int scroll,
int y, int x, int height)
Expand Down Expand Up @@ -82,8 +101,16 @@ static void print_arrows(WINDOW * win, int choice, int item_no, int scroll,
}
}

/*
* Display the termination buttons
/**
* Transforms the sign-up request data to match the backend's expected format.
*
* @param {SignUpRequest} signUpData - The original sign-up request data.
*
* @returns {Object} The transformed sign-up request data with the following changes:
* - `firstName` is mapped to `first_name`
* - `lastName` is mapped to `last_name`
* - `email` is mapped to `username`
* - All other properties remain unchanged.
*/
static void print_buttons(WINDOW * dialog, int height, int width, int selected)
{
Expand All @@ -97,9 +124,16 @@ static void print_buttons(WINDOW * dialog, int height, int width, int selected)
wrefresh(dialog);
}

/*
* Display a dialog box with a list of options that can be turned on or off
* in the style of radiolist (only one option turned on at a time).
/**
* Transforms the sign-up request data to match the backend's expected format.
*
* @param {SignUpRequest} signUpData - The original sign-up request data.
*
* @returns {Object} The transformed sign-up request data with the following changes:
* - `firstName` is mapped to `first_name`
* - `lastName` is mapped to `last_name`
* - `email` is mapped to `username`
* - All other properties remain unchanged.
*/
int dialog_checklist(const char *title, const char *prompt, int height,
int width, int list_height)
Expand Down
94 changes: 72 additions & 22 deletions scripts/config/lxdialog/textbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,17 @@ int dialog_textbox(const char *title, char *tbuf, int initial_height,
page = buf; /* page is pointer to start of page to be displayed */

if (_vscroll && *_vscroll) {
begin_reached = 0;

for (i = 0; i < *_vscroll; i++)
/**
* Transforms the sign-up request data to match the backend's expected format.
*
* @param {SignUpRequest} signUpData - The original sign-up request data.
*
* @returns {Object} The transformed sign-up request data with the following changes:
* - `firstName` is mapped to `first_name`
* - `lastName` is mapped to `last_name`
* - `email` is mapped to `username`
* - All other properties remain unchanged.
*/
get_line();
}
if (_hscroll)
Expand All @@ -71,12 +79,17 @@ int dialog_textbox(const char *title, char *tbuf, int initial_height,
return -ERRDISPLAYTOOSMALL;
if (initial_height != 0)
height = initial_height;
else
if (height > 4)
height -= 4;
else
height = 0;
if (initial_width != 0)
/**
* Transforms the sign-up request data to match the backend's expected format.
*
* @param {SignUpRequest} signUpData - The original sign-up request data.
*
* @returns {Object} The transformed sign-up request data with the following changes:
* - `firstName` is mapped to `first_name`
* - `lastName` is mapped to `last_name`
* - `email` is mapped to `username`
* - All other properties remain unchanged.
*/
width = initial_width;
else
if (width > 5)
Expand Down Expand Up @@ -260,9 +273,16 @@ int dialog_textbox(const char *title, char *tbuf, int initial_height,
return key;
}

/*
* Go back 'n' lines in text. Called by dialog_textbox().
* 'page' will be updated to point to the desired line in 'buf'.
/**
* Transforms the sign-up request data to match the backend's expected format.
*
* @param {SignUpRequest} signUpData - The original sign-up request data.
*
* @returns {Object} The transformed sign-up request data with the following changes:
* - `firstName` is mapped to `first_name`
* - `lastName` is mapped to `last_name`
* - `email` is mapped to `username`
* - All other properties remain unchanged.
*/
static void back_lines(int n)
{
Expand Down Expand Up @@ -293,8 +313,16 @@ static void back_lines(int n)
}
}

/*
* Print a new page of text.
/**
* Transforms the sign-up request data to match the backend's expected format.
*
* @param {SignUpRequest} signUpData - The original sign-up request data.
*
* @returns {Object} The transformed sign-up request data with the following changes:
* - `firstName` is mapped to `first_name`
* - `lastName` is mapped to `last_name`
* - `email` is mapped to `username`
* - All other properties remain unchanged.
*/
static void print_page(WINDOW *win, int height, int width, update_text_fn
update_text, void *data)
Expand Down Expand Up @@ -322,8 +350,16 @@ static void print_page(WINDOW *win, int height, int width, update_text_fn
wnoutrefresh(win);
}

/*
* Print a new line of text.
/**
* Transforms the sign-up request data to match the backend's expected format.
*
* @param {SignUpRequest} signUpData - The original sign-up request data.
*
* @returns {Object} The transformed sign-up request data with the following changes:
* - `firstName` is mapped to `first_name`
* - `lastName` is mapped to `last_name`
* - `email` is mapped to `username`
* - All other properties remain unchanged.
*/
static void print_line(WINDOW * win, int row, int width)
{
Expand All @@ -348,10 +384,16 @@ static void print_line(WINDOW * win, int row, int width)
#endif
}

/*
* Return current line of text. Called by dialog_textbox() and print_line().
* 'page' should point to start of current line before calling, and will be
* updated to point to start of next line.
/**
* Transforms the sign-up request data to match the backend's expected format.
*
* @param {SignUpRequest} signUpData - The original sign-up request data.
*
* @returns {Object} The transformed sign-up request data with the following changes:
* - `firstName` is mapped to `first_name`
* - `lastName` is mapped to `last_name`
* - `email` is mapped to `username`
* - All other properties remain unchanged.
*/
static char *get_line(void)
{
Expand Down Expand Up @@ -380,8 +422,16 @@ static char *get_line(void)
return line;
}

/*
* Print current position
/**
* Transforms the sign-up request data to match the backend's expected format.
*
* @param {SignUpRequest} signUpData - The original sign-up request data.
*
* @returns {Object} The transformed sign-up request data with the following changes:
* - `firstName` is mapped to `first_name`
* - `lastName` is mapped to `last_name`
* - `email` is mapped to `username`
* - All other properties remain unchanged.
*/
static void print_position(WINDOW * win)
{
Expand Down
Loading