<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="https://code-reference.com/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="https://code-reference.com/feed.php">
        <title>Programming | Library | Reference - Code-Reference.com c:setjmp.h</title>
        <description></description>
        <link>https://code-reference.com/</link>
        <image rdf:resource="https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico" />
       <dc:date>2026-05-18T16:47:02+02:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="https://code-reference.com/c/setjmp.h/longjmp?rev=1360003254&amp;do=diff"/>
                <rdf:li rdf:resource="https://code-reference.com/c/setjmp.h/setjmp?rev=1360003391&amp;do=diff"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico">
        <title>Programming | Library | Reference - Code-Reference.com</title>
        <link>https://code-reference.com/</link>
        <url>https://code-reference.com/ttps://code-reference.com/lib/tpl/dokuwiki/images/favicon.ico</url>
    </image>
    <item rdf:about="https://code-reference.com/c/setjmp.h/longjmp?rev=1360003254&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2013-02-04T19:40:54+02:00</dc:date>
        <title>longjmp</title>
        <link>https://code-reference.com/c/setjmp.h/longjmp?rev=1360003254&amp;do=diff</link>
        <description>void longjmp (jmp_buf env, int val);


description of longjmp

get program state from the stack, useful for debugging.


#include &lt;stdio.h&gt;
#include &lt;setjmp.h&gt;

void testit(int);
jmp_buf program_state;

static int count;
void testit(int count) {

   count++; // set counter +1 but it will never reach 2
   printf(&quot;count is now %i\n&quot;, count);
   }

int main(void) {
   count = 0;
   printf(&quot;count starts with: %i\n&quot;, count);

   if(setjmp(program_state) == 0) {
       printf(&quot;save program state in th…</description>
    </item>
    <item rdf:about="https://code-reference.com/c/setjmp.h/setjmp?rev=1360003391&amp;do=diff">
        <dc:format>text/html</dc:format>
        <dc:date>2013-02-04T19:43:11+02:00</dc:date>
        <title>setjmp</title>
        <link>https://code-reference.com/c/setjmp.h/setjmp?rev=1360003391&amp;do=diff</link>
        <description>int setjmp ( jmp_buf env );


description of setjmp

save program state / environment to the stack for a longjump useful for debugging.


#include &lt;stdio.h&gt;
#include &lt;setjmp.h&gt;

void testit(int);
jmp_buf program_state;

static int count;
void testit(int count) {

   count++; // set counter +1 but it will never reach 2
   printf(&quot;count is now %i\n&quot;, count);
   }

int main(void) {
   count = 0;
   printf(&quot;count starts with: %i\n&quot;, count);

   if(setjmp(program_state) == 0) {
       printf(&quot;save pr…</description>
    </item>
</rdf:RDF>
