-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Abhinav Singh <[email protected]>
- Loading branch information
1 parent
8875267
commit 5b12687
Showing
8 changed files
with
90 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#include "../include/node.h" | ||
#include "../include/seriliaze.h" | ||
|
||
|
||
#include<stdio.h> | ||
|
||
|
||
void funcA1(){ | ||
childSpan(__PRETTY_FUNCTION__); | ||
pop(); | ||
} | ||
|
||
void funcA2(){ | ||
childSpan(__PRETTY_FUNCTION__); | ||
pop(); | ||
} | ||
|
||
void funcA(){ | ||
childSpan(__PRETTY_FUNCTION__); | ||
funcA1(); | ||
funcA2(); | ||
pop(); | ||
} | ||
|
||
void funcB1(){ | ||
childSpan(__PRETTY_FUNCTION__); | ||
pop(); | ||
} | ||
|
||
void funcB2(){ | ||
childSpan(__PRETTY_FUNCTION__); | ||
pop(); | ||
} | ||
|
||
void funcB(){ | ||
childSpan(__PRETTY_FUNCTION__); | ||
funcB1(); | ||
funcB2(); | ||
pop(); | ||
} | ||
|
||
int main(){ | ||
newSpan(__PRETTY_FUNCTION__); | ||
funcA(); | ||
funcB(); | ||
pop(); | ||
|
||
serialize(root); | ||
printf("%s\n",getStream()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,13 @@ | ||
|
||
#ifndef _SERIALIZE_ | ||
#define _SERIALIZE_ | ||
|
||
#include "node.h" | ||
#include "string.h" | ||
#include <stdlib.h> | ||
#include <stdio.h> | ||
|
||
void serialize(node*); | ||
char* getStream(); | ||
char* getStream(); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ void pop(){ | |
return; | ||
stack* hld = top->prev; | ||
free(top); | ||
hld->next = NULL; | ||
if(hld) | ||
hld->next = NULL; | ||
top=hld; | ||
} |