title: What are some "good" ways to use longjmp/setjmp for C error handling?
body: <p>I have to use C for one project and I am thinking of using <code>longjmp/setjmp</code> for error handling as I think it will be much easier to handle error in one central place than return codes. I would appreciate if there are some leads on how to do this.</p>
  
  <p>I am particularly concerned with resource cleanup being correctly done if any such error occurs. </p>
  
  <p>Also how do I handle errors that result in multi-threaded programs using them?</p>
  
  <p>Even better, is there some C library that already exists for error/exception handling?</p>