Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
105 commits
Select commit Hold shift + click to select a range
6569bd3
Update apos docs and code comments.
Lightning11wins Jun 26, 2025
e378338
Improve code readability without affecting functionality.
Lightning11wins Jun 26, 2025
30394df
Store adj weights for later CSS use.
Lightning11wins Jun 26, 2025
592b3f1
Add a helpful error value when attempting to write widget properties …
Lightning11wins Jun 26, 2025
436da37
Implement rendering doubles as widget properties.
Lightning11wins Jun 26, 2025
74d5f5f
Render the new adjustment weight doubles as widget properties for deb…
Lightning11wins Jun 26, 2025
bcc5987
Reformat CSS.
Lightning11wins Jun 27, 2025
15b466f
Make design responsive by replacing px with %.
Lightning11wins Jun 27, 2025
eaeeb5a
Reformat CSS for autolayout.
Lightning11wins Jun 27, 2025
9e45033
Improve debugging.
Lightning11wins Jul 1, 2025
b6daf94
Add flexibility to autoscaling, using macros to make it more readable.
Lightning11wins Jul 1, 2025
dbb1bbc
Replace magic values for fl_x and fl_y with macros.
Lightning11wins Jul 1, 2025
9b72f5f
Improve code documentation and readability.
Lightning11wins Jul 3, 2025
019319d
Fix flexibility a little, but it's still broken.
Lightning11wins Jul 3, 2025
36b5b0a
Attempt to add responsiveness to widgets (doesn't quite work): autola…
Lightning11wins Jul 3, 2025
dcbed96
Build testing apps.
Lightning11wins Jul 3, 2025
4c0bad9
Sample pages appear to work now.
Lightning11wins Jul 23, 2025
5f168ee
Working, server-side code.
Lightning11wins Jul 30, 2025
fad38e5
Merge branch 'master' into apos_autoscale
Lightning11wins Jan 8, 2026
65ff720
Improve apos.c & add design support.
Lightning11wins Feb 6, 2026
a48cdc6
Improve error handling.
Lightning11wins Feb 6, 2026
799c20d
Fix the qprintf() % bug.
Lightning11wins Feb 6, 2026
00d6366
Improve naming conventions and dev experience.
Lightning11wins Feb 7, 2026
f414f1d
Update testing apps.
Lightning11wins Feb 7, 2026
20a73e7
Add tools to ht_geom_dom1html.
Lightning11wins Feb 7, 2026
cac40f6
Add tools for widget development and debugging.
Lightning11wins Feb 7, 2026
49c8627
Add a warning when using the pane resize action, which breaks respons…
Lightning11wins Feb 7, 2026
ceb3f47
Make the point action responsive.
Lightning11wins Feb 7, 2026
27557f8
Make the autolayout widget responsive.
Lightning11wins Feb 7, 2026
376d366
Make the tab widget responsive.
Lightning11wins Feb 7, 2026
183a6d0
Make the clock widget responsive.
Lightning11wins Feb 9, 2026
ca22b79
Debug and clean up the component widget.
Lightning11wins Feb 9, 2026
e41793c
Make the scrollpane widget responsive.
Lightning11wins Feb 9, 2026
ba98a23
Make the button widget responsive.
Lightning11wins Feb 9, 2026
f00a31e
Make the chart widget responsive.
Lightning11wins Feb 9, 2026
2ea6a4b
Make the HTML widget responsive.
Lightning11wins Feb 9, 2026
f0123b4
Make checkbox widget responsive.
Lightning11wins Feb 9, 2026
f22c191
Update docs.
Lightning11wins Feb 9, 2026
092256a
Add new content for testing.
Lightning11wins Feb 9, 2026
05fb301
Fix a bug in the textbutton widget that broke responsiveness.
Lightning11wins Feb 9, 2026
507c479
Make datetime widget responsive.
Lightning11wins Feb 9, 2026
8ead43e
Make dropdown widget responsive.
Lightning11wins Feb 9, 2026
2daaa42
Make editbox widget responsive.
Lightning11wins Feb 9, 2026
ef6e06c
Make formstatus widget responsive.
Lightning11wins Feb 9, 2026
c38a685
Make imagebutton widget responsive.
Lightning11wins Feb 9, 2026
572e7c7
Make menu widget responsive.
Lightning11wins Feb 9, 2026
4255d41
Make objcanvas widget responsive (sort of).
Lightning11wins Feb 9, 2026
78d5db3
Make radiobutton pannel widget responsive.
Lightning11wins Feb 9, 2026
d458570
Remove unnecessary width from htdrv_treeview.js.
Lightning11wins Feb 9, 2026
2440875
Make window widget responsive.
Lightning11wins Feb 9, 2026
693e579
Make active areas responsive.
Lightning11wins Feb 9, 2026
43d037f
Cleanup unused comments.
Lightning11wins Feb 9, 2026
1fa07b7
Add error messages to the image widget.
Lightning11wins Feb 9, 2026
1fb4f4f
Make table widget back end code responsive.
Lightning11wins Feb 9, 2026
3cc60da
Make table widget front end code responsive (I think).
Lightning11wins Feb 9, 2026
d7aa3e3
Improve button layout on radio button panel widgets.
Lightning11wins Feb 11, 2026
b3326d2
Clean up some JS for the radio button panel widget.
Lightning11wins Feb 11, 2026
84b9f8e
Add Easter Eggs for code reviewers to find.
Lightning11wins Feb 11, 2026
ceffc9c
Fix a bug in htdrv_radiobutton.js.
Lightning11wins Feb 11, 2026
796af80
Tweak size of selection area in htdrv_radiobutton.js.
Lightning11wins Feb 11, 2026
6144ea3
Fix some inconsistent style issues with generated HTML & CSS.
Lightning11wins Feb 11, 2026
36757a5
Clean up focus box styles.
Lightning11wins Feb 12, 2026
0ed4d7a
Add fallback options to the default font value.
Lightning11wins Feb 12, 2026
aaf6fa0
Fix tab widget bugs.
Lightning11wins Feb 12, 2026
85bd5e9
Clean up widget/label.
Lightning11wins Feb 16, 2026
0ab0dd1
Clean up widget/tab.
Lightning11wins Feb 16, 2026
d9bfa43
Fix some validation warnings in generated HTML.
Lightning11wins Feb 16, 2026
be4aa00
Improve scrollpane code.
Lightning11wins Feb 16, 2026
ae91f32
Improve startup.js.
Lightning11wins Feb 16, 2026
81c99e4
Fix inconsistent JS generation style.
Lightning11wins Feb 16, 2026
c6d7904
Disable clipping CSS by default.
Lightning11wins Feb 19, 2026
e1d1e5f
Bug fixes and cleanup.
Lightning11wins Feb 19, 2026
4a2c10b
Improve pre-page serverside HTML generation.
Lightning11wins Feb 19, 2026
5906511
Improve point action code.
Lightning11wins Feb 20, 2026
29fe999
Improve selection/hover area code.
Lightning11wins Feb 20, 2026
1a853ee
Improve consistency of ResizeObserver-based code.
Lightning11wins Feb 20, 2026
f587d3f
Improve readability of the resize listener in htdrv_window.js.
Lightning11wins Feb 20, 2026
618fac4
Fix a bug that caused hover boxes to not display (caused by disabling…
Lightning11wins Feb 20, 2026
cd061f1
Clean up pg_mkbox() because I want to be able to read it.
Lightning11wins Feb 20, 2026
9acf080
Clean up parent width & height functions.
Lightning11wins Feb 20, 2026
e0a2c78
Remove a comment referring to the qprintf() % bug, patched many commi…
Lightning11wins Feb 20, 2026
8fa288f
Improve code readability.
Lightning11wins Feb 20, 2026
3d61b85
Add support for sending new client-side datatypes.
Lightning11wins Feb 23, 2026
9a61a82
Fix a bug that caused boxes to be drawn incorrectly.
Lightning11wins Feb 23, 2026
5d3dc30
Update the pg_area() doc comment after realizing it had external docu…
Lightning11wins Feb 23, 2026
6ae4117
Fix a bug that made window widget title bars appear broken.
Lightning11wins Feb 23, 2026
68660e3
Fix area bugs.
Lightning11wins Feb 23, 2026
a375642
Fix dynamic components being offset twice.
Lightning11wins Feb 24, 2026
03373c2
Update testing apps.
Lightning11wins Feb 24, 2026
a805f42
Clean up code.
Lightning11wins Feb 24, 2026
41abf40
Fix a major regression that broke datetime dropdown rendering (introd…
Lightning11wins Feb 24, 2026
07df9ac
Fix a regression that caused hovers for many widgets to render incorr…
Lightning11wins Feb 24, 2026
0fca33f
Add or update cursor styles to indicate clickable areas.
Lightning11wins Feb 24, 2026
86d76f2
Fix a bug that caused table scrollbar to sometimes not resize properly.
Lightning11wins Feb 25, 2026
87269bf
Add an error when attempting to get relative values on an invalid layer.
Lightning11wins Feb 25, 2026
0980840
Replace the deprecated __defineGetter__() function with modern altern…
Lightning11wins Feb 25, 2026
e72ccad
Remove fast_setRelativeX/Y() functions because they weren't notably f…
Lightning11wins Feb 25, 2026
1113bac
Improve warnings when using actions that break responsive design.
Lightning11wins Feb 25, 2026
0d316a7
Clean up from review.
Lightning11wins Feb 25, 2026
8eefae9
Fix moveTo() passing incorrect parameter to setResponsiveY().
Lightning11wins Feb 25, 2026
e609cb4
Remove a completed todo.
Lightning11wins Feb 26, 2026
aa1a5a9
Add dups branch dependency changes (revert after dups branch is merged).
Lightning11wins Feb 26, 2026
ab3822a
Merge branch 'master' into apos_autoscale9
Lightning11wins Feb 26, 2026
55bb659
Fix minor window issues.
Lightning11wins Mar 3, 2026
2d91ca3
Add detail to docs for refresh_interval property on osrc widgets.
Lightning11wins Mar 3, 2026
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
50 changes: 39 additions & 11 deletions centrallix-doc/Widgets/widgets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ checkbox_test "widget/page"

<action name="Open">Opens the window. If the parameter IsModal is set to 1, then the window becomes modal (only the window's contents are accessible to the user until the window is closed). If the parameter NoClose is set to 1, then the close button in the upper right corner of the window becomes inactive and the window will only close via the Close, SetVisibility, and ToggleVisibility actions.</action>

<action name="Point">Makes the window relocate to a side using a triangle (pop over).</action>
<action name="Point">Creates a triangular pointer on the edge of the window to point at a given (X,Y) coordinate.</action>

<action name="Popup">Opens a window like a pop-up.</action>

Expand Down Expand Up @@ -2323,7 +2323,7 @@ MyButton "widget/imagebutton"

<property name="point_fgcolor" type="string">The color (named or #numeric) of the text in the label when the user hovers the mouse over the label.</property>

<property name="style" type="string">(e.g. bold).</property>
<property name="style" type="string">'bold' for bold text, 'italic' for italic text.</property>

<property name="text" type="string">The text that the label is to display.</property>

Expand Down Expand Up @@ -2575,7 +2575,7 @@ myMenu "widget/menu"

<property name="receive_updates" type="yes/no">** This feature currently disabled in Centrallix 0.9.1 ** Default "no". If set to "yes", the objectsource will ask the server to send it updates on any changes that occur on the server side (i.e., if the changes were made by another objectsource or by another user, they would be automatically refreshed into this objectsource in near real-time).</property>

<property name="refresh_interval" type="integer">The time between the data refreshing, if set to 0 it does not automatically refresh.</property>
<property name="refresh_interval" type="integer">The time in milliseconds between the data refreshing, if set to 0 it does not automatically refresh.</property>

<property name="replicasize" type="integer">Represents the number of records to store in its replica. This value should be larger than the maximum number of records that will be displayed at any one time. At times, Centrallix may increase the number of records cached on the client beyond this number.</property>

Expand Down Expand Up @@ -2818,13 +2818,17 @@ osrc1 "widget/osrc"

<actions>

<action name="Alert">Sends an alert widget.</action>
<action name="Alert">Sends an alert widget. Set the 'Message' to specify a text string that should appear in the alert.</action>

<action name="Close">Closes the page.</action>

<action name="Launch">Starts a new app in a new window.</action>

<action name="Log">Logs data to the console (using console.log()), for testing and debugging. Set the 'Message' to specify a text string that should appear in the log. Might be useful for logging Easter Egg #8.</action>

<action name="LoadPage">Loads the page.</action>

<action name="ReloadPage">Reloads the page in the user's browser. Note: This event forces a reload, even if the original content could be loaded without one.</action>

</actions>

Expand Down Expand Up @@ -3087,7 +3091,9 @@ my_cmp "widget/component-decl"
<property name="bgcolor" type="string" subtype="color">A color, RGB or named, for the panel background. If neither bgcolor nor background transparent.</property>

<property name="height" type="integer">Height, in pixels, of the panel.</property>


<property name="spacing" type="integer">The maximum height (in pixels) of space allowed between radio buttons on the panel (default: 10px).</property>

<property name="outline_background" type="string" subtype="color">An image to be used for the rectangular border drawn around the radio buttons.</property>

<property name="textcolor" type="string" subtype="color">The color, RGB or named, of the text within the panel. Default: "black".</property>
Expand Down Expand Up @@ -3390,21 +3396,31 @@ $Version=2$

<actions>

<action name="ScrollTo">Scrolls to a specific location determined by the scroll bar.</action>
<action name="ScrollTo">Scrolls to a specific location determined by the scroll bar. Specify the 'Percent' attribute to indicate how far to scroll in decimal representation (so 1.00 is 100%, aka. the bottom of the page). Specify 'Offset' how many pixels the content should be offset from the top (specify 100 to scroll the first 100 px of content off the top of the scroll pane). Specify 'RangeStart' and 'RangeEnd' to scroll to within the pixel range (using the same units as offset). Keep in mind that this action will trigger a scroll event to occur.</action>

</actions>

<events>


<event name="Scroll">This event occurs any time the user scrolls the scroll pane. This includes scrolling by clicking the scroll buttons, clicking on the scroll bar, dragging the scroll thumb, turning the scroll wheel, or when the ScrollTo action is used. This event does not occur when the scroll pane moves because the contained content changed in length, or when the scroll pane is forced to scroll because the available visible area was resized. This event will never occur if the content within the scroll pane is shorter than the available visible area because then the content cannot be scrolled.
This event provides the :Percent attribute, a number from 0 to 100 (the same as the ScrollTo action above) representing the percentage that the user has now scrolled down the page as of the event occuring. This event also provides :Change, representing how much the user's scroll location has changed in the same unit as above (although this value will be negative if the user scrolled up).</event>

<event name="Click">This event occurs when the user moves the mouse pointer while it is over the widget. The event will repeatedly fire each time the pointer moves.</event>

<event name="Wheel">This event occurs when the user moves the scroll wheel while it is over the widget (or content inside the widget). The event will repeatedly fire each time the pointer moves.</event>

<event name="MouseDown">This event occurs when the user presses the mouse button on the widget. This differs from the 'Click' event in that the user must actually press and release the mouse button on the widget for a Click event to fire, whereas simply pressing the mouse button down will cause the MouseDown event to fire.</event>

<event name="MouseMove">This event occurs when the user moves the mouse pointer while it is over the widget. The event will repeatedly fire each time the pointer moves.</event>
<event name="MouseMove">This event occurs when the user moves the mouse pointer while it is over the widget (or content inside the widget). The event will repeatedly fire each time the pointer moves.</event>

<event name="MouseOut">This event occurs when the user moves the mouse pointer off of the widget.</event>

<event name="MouseOver">This event occurs when the user first moves the mouse pointer over the widget. It will not occur again until the user moves the mouse off of the widget and then back over it again.</event>

<event name="MouseUp">This event occurs when the user releases the mouse button on the widget.</event>

Note: The Click, Wheel, MouseDown, and MouseUp events provide several pieces of useful information, including :shiftKey, :ctrlKey, :altKey, and :metaKey, which are 1 if the respective key is held down and 0 otherwise. These events also provide :button, a number representing the button number that the user used to execute the event (which appears to always be 0 for wheel).

</events>

Expand Down Expand Up @@ -3467,7 +3483,7 @@ MyScrollPane "widget/scrollpane"

<p>The tab pages are containers, and as such, controls of various kinds, including other tab controls, can be placed inside the tab pages.</p>

<p>Tab pages are added to a tab control by including widgets of type "widget/tabpage" within the "widget/tab" widget in the structure file that defines the application. Any controls to appear inside a particular tab page should be placed inside their respective "widget/tabpage" widgets in the structure file.Only widgets of type "widget/tabpage" should be placed inside a "widget/tab", with the exception of nonvisuals such as connectors.</p>
<p>Tab pages are added to a tab control by including widgets of type "widget/tabpage" within the "widget/tab" widget in the structure file that defines the application. Any controls to appear inside a particular tab page should be placed inside their respective "widget/tabpage" widgets in the structure file.Only widgets of type "widget/tabpage" should be placed inside a "widget/tab", except nonvisuals such as connectors.</p>

<p>Tab pages also have a 'visible' property which allows them to be hidden and revealed. This is used if the type is set to dynamic, but can be used manually as well.</p>

Expand Down Expand Up @@ -3502,6 +3518,8 @@ MyScrollPane "widget/scrollpane"
<property name="tab_location" type="string">The location of the tabs: "top" (default), "bottom", "left", "right", or "none".</property>

<property name="tab_width" type="integer">The width of the tabs in pixels. This is optional for tab_locations of "top", "bottom", and "none".</property>

<property name="tab_height" type="integer">The height of the tabs in pixels. This is optional for all tab_locations. Defaults to 24px.</property>

<property name="textcolor" type="string" subtype="color">The color of the text to be used on the tabs to identify them.</property>

Expand All @@ -3511,7 +3529,15 @@ MyScrollPane "widget/scrollpane"

<property name="x" type="integer">X-coordinate of the upper left corner of the tab control, relative to the container.</property>

<property name="y" type="integer">Y-coordinate of the upper left corner of the control, relative to its container.</property>
<property name="rendering" type="string">'client-side' or 'server-side'. This property is intended for developers (although it can give a very small performance boost). A value of "server-side" turns off JS rendering on the client. This does not work for dynamic width tabs (aka. top or bottom tabs with no 'tab_width' property). Defaults to "client-side". </property>

<property name="select_translate_along" type="integer">The amount to translate a selected tab along the side of the tab control. Defaults to 0px.</property>

<property name="select_translate_out" type="integer">The amount to translate a selected tab out and away from the side of the tab control. Defaults to 2px.</property>

<property name="select_translate_x" type="integer">The amount to translate a selected tab in the x direction. If set, overrides the value derived from select_translate_along and/or select_translate_out.</property>

<property name="select_translate_y" type="integer">The amount to translate a selected tab in the y direction. If set, overrides the value derived from select_translate_along and/or select_translate_out.</property>

</properties>

Expand Down Expand Up @@ -3595,9 +3621,9 @@ myTabControl "widget/tab"

<overview>

<p>A table widget is used to display data in a tabular format. It consists of a header row with column labels, followed by any number of rows containing data.The header may have a different color or image scheme than the rows, and the rows may or may not be configured to alternate between two colors or background images.</p>
<p>A table widget is used to display data in a tabular format. It consists of a header row with column labels, followed by any number of rows containing data. The header may have a different color or image scheme than the rows, and the rows may or may not be configured to alternate between two colors or background images.</p>

<span class='__TEXT__'>Table widgets come in three different flavors: static, dynamicpage, and dynamicrow.Static table widgets are built on the server and write their data directly into the container in which they reside, which is usually a scrollpane widget. Dynamicpage table widgets load their data once they initialize on the client, by activating a query through an ObjectSource nonvisual widget.Dynamicpage table widgets do not support modification, but can be reloaded through an ObjectSource at will.Dynamicrow table widgets, on the other hand, display each row as an individual layer, and thus are modifiable on the client. Dynamicrow table widgets also load their contents through an ObjectSource widget query.As of the time of writing of this document, only <i>static</i> mode and <i>dynamicrow</i> mode were supported.</span>
<span class='__TEXT__'>Table widgets come in three different flavors: static, dynamicpage, and dynamicrow. Static table widgets are built on the server and write their data directly into the container in which they reside, which is usually a scrollpane widget. Dynamicpage table widgets load their data once they initialize on the client, by activating a query through an ObjectSource nonvisual widget. Dynamicpage table widgets do not support modification, but can be reloaded through an ObjectSource at will. Dynamicrow table widgets, on the other hand, display each row as an individual layer, and thus are modifiable on the client. Dynamicrow table widgets also load their contents through an ObjectSource widget query. As of the time of writing of this document, only <i>static</i> mode and <i>dynamicrow</i> mode were supported.</span>

<p>Table widgets allow the selection (keyboard, mouse, and data focus) of individual rows.</p>

Expand All @@ -3622,6 +3648,8 @@ myTabControl "widget/tab"
<property name="cellvspacing" type="integer">The vertical spacing between cells in the table, in pixels. Default is 1.</property>

<property name="colsep" type="integer">The width of the column separation lines in pixels. Default is 1.</property>

<property name="colsep_mode" type="string">Either 'full' or 'header'. Default is 'full'.</property>

<property name="data_mode" type="string">Either "rows" (default) or "properties". In "properties" mode, the table displays one row per attribute, and so only displays the current record in the objectsource. In "rows" mode, the table displays one row per record in the objectsource.</property>

Expand Down
8 changes: 4 additions & 4 deletions centrallix-lib/include/datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ typedef union _DT
unsigned int Second:6;
unsigned int Minute:6;
unsigned int Hour:5;
unsigned int Day:5;
unsigned int Month:4;
unsigned int Year:12;
unsigned int Day:5; /* 1-based */
unsigned int Month:4; /* 0-based */
unsigned int Year:12; /* 1900-based: so 2002 is 102. */
}
Part;
long long Value;
long long Value; /* NOT seconds since the epoch! */
}
DateTime, *pDateTime;

Expand Down
9 changes: 9 additions & 0 deletions centrallix-lib/include/qprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@

#include <stdarg.h>

/*** A function to grow a string buffer.
***
*** @param str The string buffer being grown.
*** @param size A pointer to the current size of the string buffer.
*** @param offset An offset up to which data must be preserved.
*** @param args Arguments for growing the buffer.
*** @param req The requested size.
***/
// typedef int (*qpf_grow_fn_t)(char** str, size_t* size, size_t offset, void* args, size_t req);
typedef int (*qpf_grow_fn_t)(char**, size_t*, size_t, void*, size_t);

typedef struct _QPS
Expand Down
33 changes: 32 additions & 1 deletion centrallix-lib/include/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,36 @@ extern "C" {
}
#endif

#endif /* UTILITY_H */
/** TODO: ISRAEL - Remove these after the dups branch is merged. **/

/*** @brief Returns the smaller of two values.
***
*** @param a The first value.
*** @param b The second value.
*** @return The smaller of the two values.
***
*** @note This macro uses GCC extensions to ensure type safety.
***/
#define min(a, b) \
({ \
__typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
(_a < _b) ? _a : _b; \
})

/*** @brief Returns the larger of two values.
***
*** @param a The first value.
*** @param b The second value.
*** @return The larger of the two values.
***
*** @note This macro uses GCC extensions to ensure type safety.
***/
#define max(a, b) \
({ \
__typeof__ (a) _a = (a); \
__typeof__ (b) _b = (b); \
(_a > _b) ? _a : _b; \
})

#endif /* UTILITY_H */
11 changes: 7 additions & 4 deletions centrallix-lib/src/cxsec.c
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,22 @@ cxsecVerifySymbol_n(const char* sym, size_t n)
** significant security risks in the event of a locale mismatch!!
**/
if (n <= 0 || (*sym != '_' && (*sym < 'A' || *sym > 'Z') && (*sym < 'a' || *sym > 'z')))
return -1;
goto err;
n--;

/** Next chars may be 1) end of string, 2) digits, 3) alpha, or 4) underscore **/
sym++;
while(n)
{
if (*sym != '_' && (*sym < 'A' || *sym > 'Z') && (*sym < 'a' || *sym > 'z') && (*sym < '0' || *sym > '9'))
return -1;
goto err;
sym++;
n--;
}

return 0;
}
return 0;

err:
fprintf(stderr, "WARNING: '%s' (of length %lu) is not a valid symbol!\n", sym, n);
return -1;
}
22 changes: 20 additions & 2 deletions centrallix-lib/src/qprintf.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,14 @@ qpf_internal_Translate(pQPSession s, const char* srcbuf, size_t srcsize, char**
*** change out from under this function to a new buffer if a realloc is
*** done by the grow_fn function. Do not store pointers to 'str'. Go
*** solely by offsets.
***
*** NULL, &(s->Tmpbuf), &(s->TmpbufSize), htr_internal_GrowFn, (void*)s, fmt, va
*** @param s Optional session struct.
*** @param str Pointer to a string buffer where data will be written.
*** @param size Pointer to the current size of the string buffer.
*** @param grow_fn A function to grow the string buffer.
*** @param format The format of data which should be written.
*** @param ap The arguments list to fulfill the provided format.
***/
int
qpfPrintf_va_internal(pQPSession s, char** str, size_t* size, qpf_grow_fn_t grow_fn, void* grow_arg, const char* format, va_list ap)
Expand Down Expand Up @@ -975,6 +983,12 @@ qpfPrintf_va_internal(pQPSession s, char** str, size_t* size, qpf_grow_fn_t grow
/** Simple specifiers **/
if (__builtin_expect(format[0] == '%', 0))
{
if (ignore)
{
format++;
continue;
}

if (__builtin_expect(!nogrow, 1) && (__builtin_expect(cpoffset+2 <= *size, 1) || (grow_fn(str, size, cpoffset, grow_arg, cpoffset+2))))
(*str)[cpoffset++] = '%';
else
Expand All @@ -987,6 +1001,12 @@ qpfPrintf_va_internal(pQPSession s, char** str, size_t* size, qpf_grow_fn_t grow
}
else if (__builtin_expect(format[0] == '&',0))
{
if (ignore)
{
format++;
continue;
}

if (__builtin_expect(!nogrow, 1) && (__builtin_expect(cpoffset+2 <= *size, 1) || (grow_fn(str, size, cpoffset, grow_arg, cpoffset+2))))
(*str)[cpoffset++] = '&';
else
Expand Down Expand Up @@ -1448,5 +1468,3 @@ qpfRegisterExt(char* ext_spec, int (*ext_fn)(), int is_source)

return;
}


2 changes: 1 addition & 1 deletion centrallix-os/apps/nav/default.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ default "widget/template"
{
bgcolor="#e0e0e0";
linkcolor="#0000ff";
font_name = "Arial";
font_name = "Arial, Helvetica, sans-serif";
font_size = 12;
icon = "/favicon.ico";
}
Expand Down
Loading