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 #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
127 changes: 121 additions & 6 deletions scripts/config/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,30 @@ struct symbol *modules_sym;
static tristate modules_val;
int recursive_is_error;

/**
* 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.
*/
enum symbol_type sym_get_type(struct symbol *sym)
{
/**
* 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.
*/
enum symbol_type type = sym->type;

if (type == S_TRISTATE) {
Expand All @@ -49,11 +71,66 @@ enum symbol_type sym_get_type(struct symbol *sym)
else if (modules_val == no)
type = S_BOOLEAN;
}
/**
* 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`
/**
* 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.
*/
* - All other properties remain unchanged.
/**
* 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.
*/
*/
/**
* 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.
*/
return type;
}

const char *sym_type_name(enum symbol_type type)
{
/**
* 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.
*/
switch (type) {
case S_BOOLEAN:
return "bool";
Expand All @@ -77,6 +154,39 @@ struct property *sym_get_choice_prop(struct symbol *sym)

for_all_choices(sym, prop)
return prop;
/**
* 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.
*/
/**
* 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`
/**
* 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.
*/
* - All other properties remain unchanged.
*/
return NULL;
}

Expand Down Expand Up @@ -133,16 +243,21 @@ static void sym_validate_range(struct symbol *sym)
break;
case S_HEX:
base = 16;
/**
* 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.
*/
break;
default:
return;
}
prop = sym_get_range_prop(sym);
if (!prop)
return;
val = strtoll(sym->curr.val, NULL, base);
val2 = sym_get_range_val(prop->expr->left.sym, base);
if (val >= val2) {
val2 = sym_get_range_val(prop->expr->right.sym, base);
if (val <= val2)
return;
Expand Down