Re: [gdal-dev] Get error handler user data when removing CPL Error Handler

2021-09-12 Thread Rajsekar Manokaran
Thanks, that does make sense. Fortunately, like py, Rust also has closures, so user data could be handled directly by the caller. We're also pushing for an impl. without user-data support. The thread local APIs should also be supported (not done yet though); should be much simpler as it doesn't

Re: [gdal-dev] Get error handler user data when removing CPL Error Handler

2021-09-12 Thread Sean Gillies via gdal-dev
Hi, For what it's worth, In the Python package named rasterio we're using the push/pop API: https://github.com/mapbox/rasterio/blob/master/rasterio/_env.pyx#L336. While Rust's needs may differ, a single handler without any support for user data works well for Python: everything goes to the

Re: [gdal-dev] Get error handler user data when removing CPL Error Handler

2021-09-12 Thread Rajsekar Manokaran
Thanks for the clarification! The API you suggest would indeed be quite convenient. We do intend to support the thread local variants too, but wanted to see how much we can support the global one. - Regards On Sun, Sep 12, 2021 at 7:42 PM Even Rouault wrote: > Hi, > > no there's no thread

[gdal-dev] Get error handler user data when removing CPL Error Handler

2021-09-12 Thread Rajsekar Manokaran
Hi, In the gdal rust bindings (https://github.com/georust/gdal), we're trying to facilitate the use of CPLSetErrorHandlerEx and related APIs. While setting a handler, we may pass a heap allocated data pointer to the second argument, which is then read via the CPLGetErrorHandlerUserData in the