Bug 124393

Summary: [patch] getdata: verbose error descriptions
Product: [Applications] kst Reporter: D. V. Wiebe <dvw>
Component: generalAssignee: George Staikos <staikos>
Status: RESOLVED FIXED    
Severity: wishlist CC: kst
Priority: NOR    
Version: 1.x   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Getdata verbose error patch

Description D. V. Wiebe 2006-03-28 01:52:26 UTC
Version:           1.3.0_devel (using KDE KDE 3.5.1)
Installed from:    Compiled From Sources
Compiler:          gcc (GCC) 3.4.6 
OS:                Linux

The accompanying patch adds a public function, 

char* GetDataErrorString(char* buffer, size_t buflen)

which provides an expanded error description over and above what GD_ERROR_CODES[] gives us for the last encountered getdata error.  It provides line numbers and file names for format file syntax errors, field names for lookup errors, and various useful ancilliary data for other error types.

It also adds an internal function, SetGetDataError, which is now used to set all error return codes.

Current users of getdata (including kst) should be unaffected by this patch: the behaviour of all other public getdata functions is unchanged.
Comment 1 D. V. Wiebe 2006-03-28 01:53:10 UTC
Created attachment 15328 [details]
Getdata verbose error patch
Comment 2 George Staikos 2006-03-28 02:13:32 UTC
Thanks Don.
Comment 3 George Staikos 2006-03-28 02:53:37 UTC
SVN commit 523386 by staikos:

Commit Don's patch with an ISO C compliance fix
FEATURE: 124393


 M  +296 -107  getdata.c   [POSSIBLY UNSAFE: scanf]
 M  +16 -1     getdata.h