HOME  NEWS  FORUM  DOWNLOAD  LINK
OpenCOBOL - an open-source COBOL compiler
Main Menu
Download
Documentation
Development
Who's Online
17 user(s) are online (4 user(s) are browsing Forum)

Members: 0
Guests: 17

more...
Powered by
SourceForge

Xoops

Creative Commons

OpenCOBOL Forum Index
   OpenCOBOL
     Patches for OpenCOBOL - SPLIT-KEYS
Register To Post

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
JoeRobbins
Posted on: 2012/10/9 15:43
Not too shy to talk
Joined: 2011/8/30
From: Nottinghamshire
Posts: 21
Patches for OpenCOBOL - SPLIT-KEYS
The patches we made to OpenCOBOL to implement COBOL SPLIT-KEYs are documented here: http://www.bawtry.net/image/bawtry/split-keys-patch.html
I believe these notes to be complete and accurate, but they were difficult to produce because we have changed much more in OpenCobol fileio.c. Our goal is to provide a complete rewrite of the fileio.c and offer this back to the community. Why? Because fileio.c:
(1) is monolithic - unnecessarily muddling the underlying logic structures.
(2) overuses (nested) conditional code inclusion (#if defined XYZ) to an extent that the code becomes opaque.
(3) fails to implement some important features and desirable alternative options.
(4) doesn't provide a clearly understood and solid platform for future enhancements.
(4) is just plain wrong in some places!
(5) doesn't match the quality of the parser/code-generator and some other modules.

This is the personal opinion of the author and shouldn't etc etc. What do others think?
human
Posted on: 2012/10/10 9:22
Webmaster
Joined: 2007/5/15
From: GERMANY
Posts: 1416
Re: Patches for OpenCOBOL - SPLIT-KEYS
Thank you for your work. From a first glance it looks really good. Do you mind to include these patches you've documented at that page into CE (a sourceforge-account is needed) on your own? Please add a patch for some test cases (at least parsing of SPLIT-KEYS, runtime would be nice, too) - that way we have a simple possibility to test these in different environments.

Concerning the rest of your "personal opinion": "the plain wrong" places should be fixed soon, please give us some details. The rest should be changed (and tested in different environments) one by one, that way we can fix changes (or roll them back if needed) more easy. What changes do you suggest for "fighting the monolith"?

human
marcellom
Posted on: 2012/11/17 9:02
Quite a regular
Joined: 2006/1/4
From: Italy
Posts: 62
Re: Patches for OpenCOBOL - SPLIT-KEYS
@all
I had some difficulties in amending files from Joe's diff results.
To make things easier to those of us who are interested, i post links to modified files.

@Joe
I've been busy on "microfocus invalid key" replacement in cobol sources. I'm near to test your patches with BDB.
please see if I reported correctly your patches.
I'll let forum know about results.

http://www.formigasoft.com/usersftp/codegen.c
http://www.formigasoft.com/usersftp/fileio.c
http://www.formigasoft.com/usersftp/fileio.h
http://www.formigasoft.com/usersftp/parser.y
http://www.formigasoft.com/usersftp/tree.c
http://www.formigasoft.com/usersftp/tree.h

Marcellom

marcellom
Posted on: 2012/11/21 10:44
Quite a regular
Joined: 2006/1/4
From: Italy
Posts: 62
Re: Patches for OpenCOBOL - SPLIT-KEYS
@all
due to html to text conversion (when downloading from bawtry)
some lines were cutted.
New versions are available using previous links.
@ Joe
if you think it would be better, you could let your amended files be available.
Marcellom
marcellom
Posted on: 2012/11/21 18:45
Quite a regular
Joined: 2006/1/4
From: Italy
Posts: 62
Re: Patches for OpenCOBOL - SPLIT-KEYS
Started testing BSC/JR patches.
I'm getting the following make errors

fileio.c:282:4: warning: 'struct indexfile' declared inside parameter list
fileio.c:282:4: warning: its scope is only this definition or declaration, which is probably not what you want
fileio.c:288:4: warning: 'struct indexfile' declared inside parameter list
fileio.c: In function 'save_status':
fileio.c:701:33: error: 'fh' undeclared (first use in this function)
fileio.c:701:33: note: each undeclared identifier is reported only once for each function it appears in
fileio.c: In function 'indexed_read_next':
fileio.c:2807:37: error: 'fh' undeclared (first use in this function)
fileio.c: At top level:
fileio.c:5726:4: warning: 'struct indexfile' declared inside parameter list
fileio.c:5722:12: error: conflicting types for 'extract_key'
fileio.c:278:12: note: previous declaration of 'extract_key' was here
fileio.c: In function 'extract_key':
fileio.c:5729:29: error: dereferencing pointer to incomplete type
fileio.c:5731:26: error: dereferencing pointer to incomplete type
fileio.c:5733:25: error: dereferencing pointer to incomplete type
fileio.c:5734:16: error: dereferencing pointer to incomplete type
fileio.c:5735:18: error: dereferencing pointer to incomplete type
fileio.c: At top level:
fileio.c:5755:4: warning: 'struct indexfile' declared inside parameter list
fileio.c:5751:12: error: conflicting types for 'keycmp'
fileio.c:284:12: note: previous declaration of 'keycmp' was here
fileio.c: In function 'keycmp':
fileio.c:5759:21: error: dereferencing pointer to incomplete type
fileio.c:5760:2: warning: passing argument 1 of 'extract_key' from incompatible pointer type
fileio.c:5722:12: note: expected 'struct indexfile *' but argument is of type 'struct indexfile *'
fileio.c:5761:34: error: dereferencing pointer to incomplete type
fileio.c:5761:42: error: dereferencing pointer to incomplete type
fileio.c: At top level:
fileio.c:278:12: warning: 'extract_key' used but never defined
fileio.c:5751:12: warning: 'keycmp' defined but not used
make[2]: *** [libcob_la-fileio.lo] Errore 1
make[2]: Leaving directory `/usr/share/ocobol/open-cobol-1.1/libcob'
make[1]: *** [all-recursive] Errore 1
make[1]: Leaving directory `/usr/share/ocobol/open-cobol-1.1'
make: *** [all] Errore 2

marcellom
JoeRobbins
Posted on: 2012/11/27 16:45
Not too shy to talk
Joined: 2011/8/30
From: Nottinghamshire
Posts: 21
Re: Patches for OpenCOBOL - SPLIT-KEYS
Just realised that email notification of new reply to posts originated by me are sent to my mail-box @ openCOBOL - not to my (remote) mailbox. So unless you log-in you don't notice what's been posted!

The problem is the patches have not been applied as intended.

The first error is because the 2 new forward method headers have been inserted too high: i.e. before struct indexfile has been declared. They need moving down to above declaration of function isretsts() around line 505. This also makes them conditionally included for C | D | VB ISAM only.

Then I think there may be a problem with line numbering: the fileio.c source lodged here has this line:

cob_error_file = f;extract_key(fh, 0, fh->recwrk, fh->savekey); 


I have no idea why extract_key() is here. The error listing above reports line 701. My notes don't suggest an edit of any line within a 100 lines of 701.

Rather than continuing through each syntax error, I'll try to submit the complete, clean, edited fileio.c here.


marcellom
Posted on: 2012/11/27 18:40
Quite a regular
Joined: 2006/1/4
From: Italy
Posts: 62
Re: Patches for OpenCOBOL - SPLIT-KEYS
Ok,
waiting for news.
Marcellom
marcellom
Posted on: 2013/2/8 8:36
Quite a regular
Joined: 2006/1/4
From: Italy
Posts: 62
Re: Patches for OpenCOBOL - SPLIT-KEYS
Hi all
a message has been posted to sourceforge list.
marcellom
Threaded | Newest First Previous Topic | Next Topic | Top

Register To Post
 
Copyright (C) 2005 The OpenCOBOL Project. All rights reserved.
Powered by Xoops2 | PHP | MySQL | Apache
ocean-net