What the heck is svsutil.hxx?

If you've ever searched through the public sample code of Windows CE, you may have noticed the headerfile svsutil.hxx being included and weird "SVSBlahBlahBlah" classes and functions being called.  SVSUtil.hxx is a set of common programming utilities that we on the WinCE CoreOS team use to avoid duplicating code.  In this header file are things like basic data structure helpers for trees/queues/hashes/lists/..., a thread pool, XML parsing and generation helpers, and more.

Unfortunately none of these helpers are documented.  The good news is that most of the code to them is implemented in the header file itself, which means that you can figure out what's going on by inspection.

Should you be copying and pasting code that is already using svsutil.hxx (or should you want to use part of it yourself), then you do have to take some extra steps.  First, you'll need to link against ceosutil.lib.  Ceosutil.lib is where the functions not inlined in svsutil.hxx are implemented.  Before actually calling any svsutil functions, you'll need to call svsutil_Initialize().  When you're done, you'll need to call svsutil_DeInitialize().  Both of these functions are "DLLMain() safe", so most people just put the calls in DllMain.

Some of the svsutil.hxx stuff is dated; parts of it were created before the OS had a decent template mechanism.  Templates are a cleaner solution for a lot of the data structure helpers.  However some of the other stuff remains extremely useful, such as the thread pool.

The SVS, contrary to popular belief, does not stand for services.  It is actually the initials of my former boss who first created the file.  I was tempted to rename the file JCSUtil when that boss left the group, but JCS doesn't map to anything that people would believe meant something legitimate :).

[Author: John Spaith]