Unicob*>-<* *> Author: Brian Tiffin *> Dedicated to the public domain *> *> Date started: October 2016 *> Modified: 2016-12-30/02:01-0500 *>+<* *> Unicon interfacing with COBOL identification division. program-id. unicob. *> tectonics: cobc -m -fimplicit-init unicob.cob *> In Unicon: unicob := loadfunc("./unicob.so", "unicob") environment division. configuration section. repository. function all intrinsic. data division. working-storage section. 01 actual usage binary-long. 01 arguments based. 05 args occurs 1 to 10 times depending on actual. 10 dword usage binary-double unsigned. 10 vword usage binary-double. linkage section. 01 argc usage binary-long. 01 argv usage pointer. procedure division using by value argc, argv. sample-main. display argc, ", ", argv *> if there is a null argv, report program malfunction if argv equal null then move 500 to return-code goback end-if *> argc needs one extra allocation to account for zeroth add 1 to argc giving actual set address of arguments to argv *> Let's see some integers perform varying tally from 1 by 1 until tally > actual display dword(tally), ", ", vword(tally) end-perform *> initial trickery to get a result to Unicon move dword(2) to dword(1) compute vword(1) = vword(2) * 6 *> the "C" function returns 0 on success move 0 to return-code goback. end program unicob.