This file contains hidden or 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
| CC = gcc | |
| CLIBS = `pkg-config libxml-2.0 --cflags --libs` | |
| xpath: xpath_example.c | |
| $(CC) xpath_example.c -o xpath_example.bin $(CLIBS) | |
| clean: | |
| rm -f *.o *.bin |
This file contains hidden or 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
| CC = gcc | |
| CLIBS = `pkg-config libxml-2.0 --cflags --libs` | |
| parse_xml: parse_xml.c | |
| $(CC) -g -O0 parse_xml.c -o parse_xml.bin $(CLIBS) | |
| clean: | |
| rm -f *.o *.bin |
This file contains hidden or 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
| CC = gcc | |
| CLIBS = `pkg-config libxml-2.0 --cflags --libs` | |
| add_keyword: add_keyword_example.c | |
| $(CC) add_keyword_example.c -o add_keyword_example.bin $(CLIBS) | |
| clean: | |
| rm -f *.o *.bin |
This file contains hidden or 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
| CC = gcc | |
| CLIBS = `pkg-config libxml-2.0 --cflags --libs` | |
| add_attr: add_attribute_example.c | |
| $(CC) add_attribute_example.c -o add_attribute_example.bin $(CLIBS) | |
| clean: | |
| rm -f *.o *.bin |
This file contains hidden or 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
| CC = gcc | |
| CLIBS = `pkg-config libxml-2.0 --cflags --libs` | |
| retrieve_attribute_value: retrieve_attribute_value_example.c | |
| $(CC) retrieve_attribute_value_example.c -o retrieve_attribute_value_example.bin $(CLIBS) | |
| clean: | |
| rm -f *.o *.bin |
This file contains hidden or 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
| #prototype: Prototype.vala main.vala | |
| # valac -C Prototype.vala main.vala | |
| main: main.c Prototype.c | |
| gcc main.c Prototype.c -o main.bin `pkg-config glib-2.0 gtk+-2.0 --cflags --libs` |
This file contains hidden or 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
| #include <archive.h> | |
| #include <archive_entry.h> | |
| int main() { | |
| struct archive* a; | |
| struct archive_entry* entry; | |
| int r; | |
| a = archive_read_new(); | |
| archive_read_support_filter_all( a ); |
This file contains hidden or 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
| #include <stdio.h> | |
| extern char **environ; | |
| void main() | |
| { | |
| for (char **env = environ; *env; ++env) | |
| printf("%s\n", *env); | |
| } |
This file contains hidden or 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
| #include <stdlib.h> | |
| #include <stdio.h> | |
| int main( int argc, char **argv, char **envp ) { | |
| char **env; | |
| for( env = envp; *env; env++ ) | |
| printf( "%s\n", *env ); |
This file contains hidden or 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
| #include <stdlib.h> //getenv, atoi | |
| #include <stdio.h> //printf | |
| int main() { | |
| char* reps_text = getenv("reps"); | |
| int reps = reps_text ? atoi( reps_text ) : 10; | |
| char* msg = getenv( "msg" ); | |
| if (!msg) msg = "Hello."; |