void newtCheckboxTreeSetCurrent(newtComponent co, void * data) {
struct CheckboxTree * ct = co->data;
int * path;
- int i, j, itemsAfter;
+ int i, j;
struct items * treeTop, * item;
path = newtCheckboxTreeFindItem(co, data);
VERSION=$(awk '/^%define version/ {print $3}' $srcdir/newt.spec)
-VERSION=0.51.2
-SONAME=0.51
+VERSION=0.52.0
+SONAME=0.52
AC_SUBST(VERSION)
AC_SUBST(SONAME)
AC_PROG_CC
}
int inputBox(const char * text, int height, int width, poptContext optCon,
- int flags, char ** result) {
+ int flags, const char ** result) {
newtComponent form, entry, okay, cancel, answer, tb;
- char * val;
+ const char * val;
int rc = DLG_OKAY;
int top;
}
int listBox(const char * text, int height, int width, poptContext optCon,
- int flags, char ** result) {
+ int flags, const char ** result) {
newtComponent form, okay, tb, answer, listBox;
newtComponent cancel = NULL;
const char * arg;
}
int checkList(const char * text, int height, int width, poptContext optCon,
- int useRadio, int flags, char *** selections) {
+ int useRadio, int flags, const char *** selections) {
newtComponent form, okay, tb, subform, answer;
newtComponent sb = NULL, cancel = NULL;
const char * arg;
int messageBox(const char * text, int height, int width, int type, int flags);
int checkList(const char * text, int height, int width, poptContext optCon,
- int useRadio, int flags, char *** selections);
+ int useRadio, int flags, const char *** selections);
int listBox(const char * text, int height, int width, poptContext optCon,
- int flags, char ** result);
+ int flags, const char ** result);
int inputBox(const char * text, int height, int width, poptContext optCon,
- int flags, char ** result);
+ int flags, const char ** result);
int gauge(const char * text, int height, int width, poptContext optCon, int fd,
int flags);
void useFullButtons(int state);
struct entry {
int flags;
char * buf;
- char ** resultPtr;
+ const char ** resultPtr;
int bufAlloced;
int bufUsed; /* amount of the buffer that's been used */
int cursorPosition; /* cursor *in the string* on on screen */
} ;
newtComponent newtEntry(int left, int top, const char * initialValue, int width,
- char ** resultPtr, int flags) {
+ const char ** resultPtr, int flags) {
newtComponent co;
struct entry * en;
newtComponent newtFormGetCurrent(newtComponent co) {
struct form * form = co->data;
+ if (form->currComp == -1) return 0;
return form->elements[form->currComp].co;
}
er.result = ER_IGNORED;
if (!form->numComps) return er;
- subco = form->elements[form->currComp].co;
+ if (form->currComp == -1) return er;
switch (ev.when) {
case EV_EARLY:
typedef int (*newtEntryFilter)(newtComponent entry, void * data, int ch,
int cursor);
newtComponent newtEntry(int left, int top, const char * initialValue, int width,
- char ** resultPtr, int flags);
+ const char ** resultPtr, int flags);
void newtEntrySet(newtComponent co, const char * value, int cursorAtEnd);
void newtEntrySetFilter(newtComponent co, newtEntryFilter filter, void * data);
char * newtEntryGetValue(newtComponent co);
struct newtWinEntry {
char * text;
- char ** value; /* may be initialized to set default */
+ const char ** value; /* may be initialized to set default */
int flags;
};
Summary: A development library for text mode user interfaces.
Name: newt
-%define version 0.51.2
+%define version 0.52.0
Version: %{version}
Release: 1
License: LGPL
# gpm support seems to smash the stack w/ we use help in anaconda??
#./configure --with-gpm-support
%configure
-make %{?_smp_mflags} all shared
+make %{?_smp_mflags} all
chmod 0644 peanuts.py popcorn.py
%install
%{_libdir}/libnewt.so
%changelog
+* Fri Jan 3 2003 Adrian Havill <havill@redhat.com> 0.52.0-1
+- cleaned up const qualifiers in interfaces
+- leave the symbols in the libs (#60400)
+- fixed grammar in tutorial (#63496)
+- removed fifty button limit (#59027)
+- error checking (curcomp exists) for formEvent, newtFormGetCurrent (#59027)
+
* Tue Dec 17 2002 Matt Wilson <msw@redhat.com> 0.51.2-1
- fixed wstrlen() it was calculating wcwidth(first wide char in
string) * strlen(str) instead of the actual width of the whole
&isHidden, &isPassword, &isScrolled, &returnExit)) return NULL;
widget = snackWidgetNew ();
- widget->co = newtEntry(-1, -1, initial, width, (char **) &widget->apointer,
+ widget->co = newtEntry(-1, -1, initial, width,
+ (const char **) &widget->apointer,
(isHidden ? NEWT_FLAG_HIDDEN : 0) |
(isPassword ? NEWT_FLAG_PASSWORD : 0) |
(returnExit ? NEWT_FLAG_RETURNEXIT : 0) |
newtComponent f, chklist, e1;
struct callbackInfo cbis[3];
char results[10];
- char * enr2, * enr3, * scaleVal;
+ const char * enr2, * enr3, *scaleVal;
void ** selectedList;
int i, numsel;
char buf[20];
b1 = newtButton(3, 1, "Exit");
b2 = newtButton(18, 1, "Update");
r1 = newtRadiobutton(20, 10, "Choice 1", 0, NULL);
- r2 = newtRadiobutton(20, 11, "Chc 2", 1, r1);
+ r2 = newtRadiobutton(20, 11, "Choice 2", 1, r1);
r3 = newtRadiobutton(20, 12, "Choice 3", 0, r2);
rsf = newtForm(NULL, NULL, 0);
newtFormAddComponents(rsf, r1, r2, r3, NULL);
char * flowedText;
int textWidth, textHeight, rc;
char * menuContents[] = { "One", "Two", "Three", "Four", "Five", NULL };
- char * entries[10];
+ const char * entries[10];
struct newtWinEntry autoEntries[] = {
{ "An entry", entries + 0, 0 },
{ "Another entry", entries + 1, 0 },
newtComponent button;
newtComponent form;
newtComponent answer;
- void ** result, **ptr;
+ const void **result, **ptr;
int numselected, i, j;
int * list;
text = end;
if (*text) text++;
} else {
- char *spcptr = NULL;
+ const char *spcptr = NULL;
int spc =0,w2, x;
chptr = text;
int flags = 0;
int defaultNo = 0;
int separateOutput = 0;
- char * result;
- char ** selections, ** next;
+ const char * result;
+ const char ** selections, ** next;
char * title = NULL;
char * backtitle = NULL;
struct poptOption optionsTable[] = {
return 0;
}
-/* only supports up to 50 buttons -- shucks! */
int newtWinMenu(char * title, char * text, int suggestedWidth, int flexDown,
int flexUp, int maxListHeight, char ** items, int * listItem,
char * button1, ...) {
newtComponent textbox, listbox, result, form;
va_list args;
- newtComponent buttons[50];
+ newtComponent *buttons = NULL;
newtGrid grid, buttonBar;
- int numButtons;
+ size_t totalButtons = 0, numButtons = 0;
int i, rc;
int needScroll;
char * buttonName;
newtListboxSetCurrent(listbox, *listItem);
- buttonName = button1, numButtons = 0;
va_start(args, button1);
- while (buttonName) {
- buttons[numButtons] = newtButton(-1, -1, buttonName);
- numButtons++;
- buttonName = va_arg(args, char *);
- }
+ for (buttonName = button1; buttonName; buttonName = va_arg(args, char *))
+ ++totalButtons;
+ va_end(args);
- va_end(args);
+ buttons = (newtComponent *)alloca(sizeof(newtComponent*)*(totalButtons));
+ va_start(args, button1);
+ for (buttonName = button1; buttonName; buttonName = va_arg(args, char *))
+ buttons[numButtons++] = newtButton(-1, -1, buttonName);
+ va_end(args);
buttonBar = newtCreateGrid(numButtons, 1);
for (i = 0; i < numButtons; i++) {
return rc;
}
-/* only supports up to 50 buttons and entries -- shucks! */
int newtWinEntries(char * title, char * text, int suggestedWidth, int flexDown,
int flexUp, int dataWidth,
struct newtWinEntry * items, char * button1, ...) {
- newtComponent buttons[50], result, form, textw;
+ newtComponent *buttons, result, form, textw;
newtGrid grid, buttonBar, subgrid;
int numItems;
int rc, i;
- int numButtons;
+ size_t numButtons = 0, totalButtons = 0;
char * buttonName;
va_list args;
for (numItems = 0; items[numItems].text; numItems++);
- buttonName = button1, numButtons = 0;
+ buttonName = button1;
va_start(args, button1);
- while (buttonName) {
- buttons[numButtons] = newtButton(-1, -1, buttonName);
- numButtons++;
- buttonName = va_arg(args, char *);
- }
-
- va_end(args);
+ for (buttonName = button1; buttonName; buttonName = va_arg(args, char *))
+ ++totalButtons;
+ va_end(args);
+
+ buttons = (newtComponent *)alloca(sizeof(newtComponent*)*(totalButtons));
+ va_start(args, button1);
+ for (buttonName = button1; buttonName; buttonName = va_arg(args, char *))
+ buttons[numButtons++] = newtButton(-1, -1, buttonName);
+ va_end(args);
buttonBar = newtCreateGrid(numButtons, 1);
for (i = 0; i < numButtons; i++) {