I have used homebrew to get gnucobol working on the M series macs.
Changes to socket samples.
I should mention that I use gnucobol from "brew" and the default C compiler to build my toolchain.
Can confirm it works on M1.
The example from https://gnucobol.sourceforge.io/faq/index.html "4.1.245 FUNCTION-ID" I for some reason thought I had seen it elsewhere too.
I was able to get my example code working, with the changes you suggested.
I'd like to know if the current example in the gnucobol programmers guide works works for anyone else, as its not working for me at the moment.
I now have the trivial example working, I had to explicitly call out that the parameter being passed was 'by value'. From: procedure division USING VAL_FROM_C. To: procedure division USING BY VALUE VAL_FROM_C. Same tests on libcurl/more complex version did not yield results, but I will continue to investigate.
I now have the trivial example working, I had to explicitly call out that the parameter being passed was 'by value'. procedure division USING VAL_FROM_C. procedure division USING BY VALUE VAL_FROM_C. Same tests on libcurl/more complex version did not yield results, but I will continue to investigate.
Ah, glad you got it sorted.
I have a simple call working ( https://github.com/wmealing/example-cobol-c-callback/tree/no-args ) with no args. However I get a similar issue when on a callback ( https://sourceforge.net/p/gnucobol/discussion/help/thread/59b885a2dd/ ) We may not have the same issue, but it might be related.
I've modified the trivial example and it seems to have the same behavior. See https://github.com/wmealing/example-cobol-c-callback.git now.
Example run: % ./ca Starting.. CALLBACK HANDLE IS: 0x0000000000404844 MEMORY ADDRESS:0x0000000000408370 MEMORY SIZE: +0016777216 Running total: +0000000001 CHECKPOINT 1. CHECKPOINT 2. attempt to reference invalid memory address (signal)
So - your basic example does work as expected, but the more complex isn't, right? Correct. Note - the code uploaded there seems to set a callback function that doesn't exist at all ?!? Unless i'm misunderstanding how callbacks works, it sets the callback to https://github.com/wmealing/ca/blob/main/src/curl-write-callback.cbl I will see checkpoint 1 and 2. The compute element on line 45 fails.
I do have a basic example working, where I wrote my own callback ( https://github.com/wmealing/example-cobol-c-callback ) but I'd figure i'd ask before commiting too much time to debugging this if I'm doing something obviously wrong.
Hello again, I'm trying to use libcurl to fetch a page, I've setup my current configuration here: https://github.com/wmealing/ca/tree/main It is based on the libcurl demo from the gnucobol docs. Should be able to build it with "make" , assuming you have gnucobol-devel, make and libcurl installed. I'm having a problem with libcurl's callback from libcurl into the cobol CURLOPT_WRITEFUNCTION 'function when accessing the parameters. All the parameters passed to curl-writeback seem to be causing an "attempt...
Can confirm, this solved the problem.
Ah, thanks. I'll try that.
$ cobc simple.cbl -lcurl /var/folders/tk/dqq2xt2x61v01mqlsz2wdr3h0000gn/T//cob77198_0.c:144:5: error: use of undeclared identifier 'temptr' temptr = ((void ()(void))call_curl_easy_init.funcptr) (); ^ /var/folders/tk/dqq2xt2x61v01mqlsz2wdr3h0000gn/T//cob77198_0.c:147:19: error: use of undeclared identifier 'temptr' memcpy (b_8, &temptr, 8); ^ My cobol skills are basic at best, i've attached the source of simple.cbl and the generated c file. I had expected this to throw an error in how I've written...
I am not the creator, but I have come across a YT link to a cobol programming example writing in SDL2 with cobol. Might be good for people interested in the area. Check it out here: https://www.youtube.com/watch?v=8-kazxQBolM
Gday, I'm struggling to find a book or site on the topic of "good terminal (TUI) application design", I'm not really tied to language or application specifics, if a resource does exist on this please let me know as so far my searches have not been fruitful. Thanks in advance. -- Wade Mealing
As a general rule for fedora packages, lodge your bugs in the bugzilla component, and you'll get a response.
I submitted a possible fix, this issue was tracked here https://bugzilla.redhat.com/show_bug.cgi?id=2124748
Just to be clear, I am not the writer of the blog post, its simply just two areas that I'm interested in. Good hints though :)
Gday, Just thought i'd share a nice write up that I have found , regarding a now fixed flaw using fuzzing techniques. https://remyhax.xyz/posts/bggp3-cob/ This is a delicious intersection of two of my worlds, security and now cobol :) -- Wade Mealing
See also is now: https://sourceforge.net/p/gnucobol/discussion/cobol/thread/9f2e846cbe/#c608/0545