C-Menu 0.2.9
A User Interface Toolkit
Loading...
Searching...
No Matches
fields.c File Reference

Field Edit and Entry for C-Menu Form. More...

#include <common.h>
#include <monetary.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdio.h>
#include <string.h>
#include <termios.h>
#include <unistd.h>
Include dependency graph for fields.c:

Go to the source code of this file.

Functions

bool is_valid_date (int yyyy, int mm, int dd)
 Check if a given date is valid, including leap years.
bool is_valid_time (int hh, int mm, int ss)
 Check if a given time is valid.
int form_fmt_field (Form *form, char *s)
 Format field according to its format type.
void numeric (char *d, char *s)
 Extract numeric characters from source string to destination string.
void right_justify (char *s, int fl)
 Right justify string by removing trailing spaces and adding leadingspaces.
void left_justify (char *s)
 Left justify string by removing leading spaces.
int field_editor (Form *form)
 Accept input for a field.
int form_display_field (Form *form)
 Display current field.
int form_display_field_n (Form *form, int n)
 Display field n.
int form_display_field_brackets (Form *form)
 Display brackets around current field if set.
int form_validate_field (Form *form)
 Validate current field based on flags.
void mk_filler (char *s, int fl)
 Create filler string for field.

Variables

char ff_tbl [][26]

Detailed Description

Field Edit and Entry for C-Menu Form.

Author
Bill Waller Copyright (c) 2025 MIT License billx.nosp@m.wall.nosp@m.er@gm.nosp@m.ail..nosp@m.com
Date
2026-02-09

Definition in file fields.c.

Variable Documentation

◆ ff_tbl

char ff_tbl[][26]
Initial value:
= {"string", "decimal_int", "hex_int", "float", "double",
"currency", "yyyymmdd", "hhmmss", "apr", ""}

ff_tbl - a table of field format strings used in the Form description file to identify field data types the index of the field format in this table corresponds to the FieldFormat enum values, e.g. ff_tbl[FF_STRING] = "string", ff_tbl[F_DECIMAL_INT] = "decimal_int", etc. a table of field format strings used in the Form description file to identify field data types, e.g. "string", "decimal_int", "hex_int", etc. The index of the field format in this table corresponds to the FieldFormat enum values, e.g. ff_tbl[FF_STRING] = "string", ff_tbl[FF_DECIMAL_INT] = "decimal_int", etc. This table is used for parsing the form description file and determining the field formats for each field in the form.

Definition at line 40 of file fields.c.

40 {"string", "decimal_int", "hex_int", "float", "double",
41 "currency", "yyyymmdd", "hhmmss", "apr", ""};

Referenced by form_parse_desc().