Example for self-defined struct in api file

Hello,

I’m relatively new to programming with legato, but i’m trying to define a struct in my own custom api file and running into a lot issues. (been a while since I used C also) So far, I have defined the struct and got my program to compile, but main issues is when trying to access the contents of the struct when I pass from App A to App B, I get errors when trying to print content in App B. (exact issue: dereferencing pointer to incomplete type ‘struct remoteCtrl_voiceRequestRef’

According to documentation, best practice for a large structure is to do the following:

When structured data is passed over an API call, the entire structure is passed every time. For smaller structures this overhead can be minimal. For larger objects it’s better to return a reference to the object using the REFERENCE type and use accessor functions to get the properties of the object.

Where does one define the accessor functions and where would the actual c-code reside? I don’t think it would be inside the main c-file of app B because that is where the print functions are failing. Any example or guidance would be appreciated!

Is it same issue as this one?

Are you using REFERENCE ?
Better attach your full source code here.