Overriding standard library functions

Find and share HowTos to various installations / configurations!
Search

Post Reply
3 posts • Page 1 of 1
nmnogueira
Posts: 123
Joined: Thu May 05, 2011 12:59 pm

Overriding standard library functions

Post by nmnogueira »

Hi,

I have the need to override some functions in standard libraries, namely aes.ctl, ac.ctl and pt.ctl. I usually do this by modifying the libs and copying them to the project directory, but this is not really useful, as I always run into issues when patching or upgrading the project (as the standards libs are updated and the version I am using needs to be manually updated as well).

What is the best practice to modify functions in standard libs?

User avatar
hpuchegger
Posts: 86
Joined: Fri Oct 08, 2021 10:38 am

Re: Overriding standard library functions

Post by hpuchegger »

You could implement your custom functions in a hook file as needed if hooks are available:
https://www.winccoa.com/documentation/W ... ib-12.html

Otherwise you would need to overparameterize the file you want to change.

Br, Herbert

gschijndel
Posts: 373
Joined: Tue Jan 15, 2019 3:12 pm

Re: Overriding standard library functions

Post by gschijndel »

  • Try to avoid modifying standard files by using hook functions
  • Minimize the number of changes in the standard files, for example by adding hook functions. Due to the required maintenance effort it might be more efficient to use an own implementation.
  • Add a comment block at the top of the file explaining why the file has been modified and which keyword marks the changes
  • Mark each changes with your keyword, also indicate the end of multiple modified lines

Post Reply
3 posts • Page 1 of 1