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` | |
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` | |
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` | |
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
#include <stdio.h> | |
#include <stdint.h> | |
#include <inttypes.h> | |
/* | |
* See also : http://class.ece.iastate.edu/arun/CprE281_F05/ieee754/ie5.html | |
*/ | |
union FloatingPointSinglePrecisionIEEE754 { | |
struct { |
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> | |
/* | |
* See also : http://class.ece.iastate.edu/arun/CprE281_F05/ieee754/ie5.html | |
*/ | |
union FloatingPointIEEE754 { | |
struct { | |
unsigned int mantissa : 23; | |
unsigned int exponent : 8; | |
unsigned int sign : 1; |
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> | |
struct Bitfield { | |
int a:4; | |
unsigned int b:4; | |
} bit; | |
struct Boolean { | |
unsigned int a:1; | |
} boolean; |
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> | |
#include <stdint.h> | |
int main() { | |
union | |
{ | |
uint8_t c[4]; |
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> | |
#include <stdbool.h> | |
struct A { | |
bool a:1; | |
bool b:1; | |
bool c:1; | |
bool d:1; | |
}; |
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 <gtk/gtk.h> | |
#include <cairo.h> | |
static gboolean | |
on_draw_event( GtkWidget* widget, | |
cairo_t *cr, | |
gpointer user_data ) { | |
cairo_set_source_rgb( cr, 0.3, 0.5, 0.8 ); | |
cairo_rectangle( cr, 100, 100, 50, 50 ); |