From: "A.Appleyard" Organization: Materials Science Centre To: DJGPP AT DELORIE DOT COM Date: Fri, 24 May 1996 16:59:53 GMT Subject: how many function calls deep am I? Message-ID: int depth(){long j,i;for(i=long(&i+2),j=0;i;i=*((long*)i),j++);return j;} I wrote this short function. In djgpp (at least in version 1) it gives how many stack call levels deep you are, so that e.g. you can easily indent trace output with depth() number of spaces or `#''s at the start of each line, to keep track of function entries and exits somewhat.