Changeset 1048
- Timestamp:
- Sep 17, 2006, 2:44:18 PM (16 years ago)
- Location:
- libcaca/trunk
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
libcaca/trunk/caca/driver_vga.c
r1006 r1048 134 134 } 135 135 136 static int vga_get_event(caca_display_t *dp, caca_event -t *ev)136 static int vga_get_event(caca_display_t *dp, caca_event_t *ev) 137 137 { 138 138 /* FIXME */ -
libcaca/trunk/common.h
r865 r1048 18 18 */ 19 19 20 #if defined(HAVE_INTTYPES_H) 20 #if defined(HAVE_INTTYPES_H) && !defined(__KERNEL__) 21 21 # include <inttypes.h> 22 22 #else … … 70 70 #endif 71 71 72 #if defined(__KERNEL__) 73 #undef HAVE_ERRNO_H 74 #endif -
libcaca/trunk/configure.ac
r1021 r1048 210 210 ac_cv_my_have_vga="yes" 211 211 CPPFLAGS="${CPPFLAGS} -I. -D__KERNEL__ -nostdinc -include kernel/kernel.h" 212 CFLAGS="${CFLAGS} -fno-builtin -O2 -Wall "212 CFLAGS="${CFLAGS} -fno-builtin -O2 -Wall -I../kernel/" 213 213 CCASFLAGS="${CCASFLAGS} -I." 214 LDFLAGS="${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,100000 "214 LDFLAGS="${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,100000 " 215 215 AC_DEFINE(USE_VGA, 1, Define to 1 to activate the VGA backend driver) 216 216 CACA_DRIVERS="${CACA_DRIVERS} vga" … … 225 225 AC_MSG_RESULT([${CACA_DRIVERS}]) 226 226 fi 227 227 228 228 229 AC_SUBST(MATH_LIBS) -
libcaca/trunk/cucul/buffer.c
r896 r1048 63 63 * if an error occurred. 64 64 */ 65 #if !defined(__KERNEL__) 65 66 cucul_buffer_t *cucul_load_file(char const *file) 66 67 { … … 99 100 return buf; 100 101 } 101 102 #endif 102 103 /** \brief Get the buffer size. 103 104 * -
libcaca/trunk/cucul/cucul.c
r1022 r1048 99 99 if(ret < 0) 100 100 { 101 #if defined(HAVE_ERRNO_H) 101 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__) 102 102 int saved_errno = errno; 103 103 #endif … … 105 105 free(cv->allchars); 106 106 free(cv); 107 #if defined(HAVE_ERRNO_H) 107 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__) 108 108 errno = saved_errno; 109 109 #endif … … 117 117 118 118 nomem: 119 #if defined(HAVE_ERRNO_H) 119 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__) 120 120 errno = ENOMEM; 121 121 #endif … … 153 153 if(cv->refcount) 154 154 { 155 #if defined(HAVE_ERRNO_H) 155 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__) 156 156 errno = EBUSY; 157 157 #endif … … 247 247 if(cv->refcount) 248 248 { 249 #if defined(HAVE_ERRNO_H) 249 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__) 250 250 errno = EBUSY; 251 251 #endif … … 317 317 if(!cv->allchars[f] || !cv->allattr[f]) 318 318 { 319 #if defined(HAVE_ERRNO_H) 319 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__) 320 320 errno = ENOMEM; 321 321 #endif … … 406 406 if(!cv->allchars[f] || !cv->allattr[f]) 407 407 { 408 #if defined(HAVE_ERRNO_H) 408 #if defined(HAVE_ERRNO_H) && !defined(__KERNEL__) 409 409 errno = ENOMEM; 410 410 #endif -
libcaca/trunk/kernel/kernel.c
r944 r1048 30 30 #define LOWER(x) (IS_UPPER(x)?(x-('a'-'A')):x) 31 31 32 /* Our default seed for random number generator */ 33 static int seed = 0x68743284; 34 32 35 /* Our memory mapping */ 33 36 static uint32_t *freemem = (uint32_t*) 0x00200000; … … 95 98 } 96 99 100 int getpid(void) 101 { 102 return 0x1337; 103 } 104 105 void srand(unsigned int s) 106 { 107 seed = rand(); 108 } 109 110 int time(void *dummy) 111 { 112 return rand(); 113 } 114 97 115 int rand(void) 98 116 { 99 static int seed = 0x68743284;100 117 seed = (seed * 0x7f32ba17) ^ 0xf893a735; 101 118 return seed % RAND_MAX; … … 158 175 } 159 176 177 int memcmp(const char *s1, const char *s2, size_t n) 178 { 179 while(n) { 180 if(*s1 != *s2) return *s1-*s2; 181 *s1++; 182 *s2++; 183 n--; 184 } 185 return 0; 186 } 187 188 160 189 /* stdarg.h functions */ 161 190 int vsnprintf(char *str, size_t size, const char *format, va_list ap) … … 182 211 /* FIXME */ 183 212 return NULL; 213 } 214 215 size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream) 216 { 217 return 0; 184 218 } 185 219 … … 299 333 } 300 334 335 336 /* XXX FIXME Converts only from little endian to big endian (x86) */ 337 unsigned int htonl(unsigned int hostlong) 338 { 339 return ((hostlong&0xFFFF0000)>>16)|((hostlong&0x0000FFFFFF)<<16); 340 } 341 342 /* XXX FIXME Converts only from little endian to big endian (x86) */ 343 unsigned short htons(unsigned short hostlong) 344 { 345 return ((hostlong&0xFF00)>>8)|((hostlong&0x00FF)<<8); 346 } 347 348 349 301 350 #endif /* __KERNEL__ */ -
libcaca/trunk/kernel/kernel.h
r769 r1048 18 18 */ 19 19 20 #ifndef __KERNEL_H_ 21 #define __KERNEL_H_ 20 22 /* Various defines */ 21 23 #define NULL ((void *)0) … … 45 47 /* Various typedefs -- some are x86-specific */ 46 48 #define CUSTOM_INTTYPES 47 typedef unsigned char uint8_t;48 typedef unsigned short uint16_t;49 typedef unsigned long int uint32_t;50 typedef long int intptr_t;51 typedef long unsigned int uintptr_t;52 53 49 typedef unsigned int size_t; 54 50 … … 82 78 int abs(int j); 83 79 void exit(int status); 80 void srand(unsigned int s); 81 int stdint; 82 int stdout; 83 int stderr; 84 84 85 85 /* string.h functions */ … … 88 88 size_t strlen(const char *s); 89 89 int strcasecmp(const char *s1, const char *s2); 90 90 int memcmp(const char *s1, const char *s2, size_t n); 91 91 /* stdarg.h functions */ 92 92 typedef void * va_list; … … 99 99 int feof(FILE *stream); 100 100 char *fgets(char *s, int size, FILE *stream); 101 size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); 101 102 int fclose(FILE *fp); 102 103 int printf(const char *format, ...); … … 106 107 /* unistd.h functions */ 107 108 void usleep(unsigned long usec); 109 int getpid(void); 110 108 111 109 112 /* time.h functions */ 110 113 int gettimeofday(struct timeval *tv, struct timezone *tz); 114 int time(void *); 111 115 112 116 /* math.h functions */ … … 115 119 double sqrt(double x); 116 120 121 /* arpa/inet.h functions */ 122 unsigned int htonl(unsigned int hostlong); 123 unsigned short htons(unsigned short hostlong); 124 125 #endif /* __KERNEL_H_ */ -
libcaca/trunk/src/Makefile.am
r1023 r1048 47 47 fcntl_programs = 48 48 endif 49 -
libcaca/trunk/src/cacadraw.c
r945 r1048 15 15 #include "common.h" 16 16 17 #include <stdio.h> 18 #include <string.h> 19 #include <stdlib.h> 17 #if !defined(__KERNEL__) 18 # include <stdio.h> 19 # include <string.h> 20 # include <stdlib.h> 21 #endif 20 22 21 23 #include "cucul.h" -
libcaca/trunk/src/cacaplay.c
r896 r1048 15 15 #include "common.h" 16 16 17 #include <stdio.h> 18 #include <stdlib.h> 17 #if !defined(__KERNEL__) 18 #include <stdio.h> 19 #include <stdlib.h> 20 #endif 19 21 20 22 #include "cucul.h" -
libcaca/trunk/src/cacaview.c
r859 r1048 15 15 #include "common.h" 16 16 17 #if !defined(__KERNEL__) 17 18 #include <stdio.h> 18 19 #include <string.h> 19 20 #include <stdlib.h> 21 #endif 20 22 21 23 #if defined(HAVE_SLEEP) -
libcaca/trunk/src/common-image.c
r859 r1048 15 15 #include "common.h" 16 16 17 #include <stdio.h> 18 #include <string.h> 19 #include <stdlib.h> 17 #if !defined(__KERNEL__) 18 # include <stdio.h> 19 # include <string.h> 20 # include <stdlib.h> 21 #endif 20 22 21 23 #if defined(HAVE_IMLIB2_H) 22 24 # include <Imlib2.h> 23 25 #else 24 # include <stdio.h> 26 # if !defined(__KERNEL__) 27 # include <stdio.h> 28 # endif 25 29 #endif 26 30 -
libcaca/trunk/src/img2irc.c
r859 r1048 15 15 #include "common.h" 16 16 17 #include <stdio.h> 17 #if !defined(__KERNEL__) 18 # include <stdio.h> 18 19 #include <string.h> 19 20 #include <stdlib.h> 21 # endif 20 22 21 23 #include "cucul.h" -
libcaca/trunk/test/demo.c
r964 r1048 14 14 #include "config.h" 15 15 #include "common.h" 16 17 # include <math.h>18 # include <string.h>19 # include <stdio.h>20 16 #if !defined(__KERNEL__) 17 # include <math.h> 18 # include <string.h> 19 # include <stdio.h> 20 #endif 21 21 #include "caca.h" 22 22 -
libcaca/trunk/test/demo0.c
r1019 r1048 24 24 #include "config.h" 25 25 26 #include <math.h> 27 #include <string.h> 28 #include <stdio.h> 26 #if !defined(__KERNEL__) 27 # include <math.h> 28 # include <string.h> 29 # include <stdio.h> 30 #endif 29 31 30 32 #include "caca0.h" -
libcaca/trunk/test/dithering.c
r859 r1048 15 15 #include "common.h" 16 16 17 #include <stdio.h> 17 #if !defined(__KERNEL__) 18 # include <stdio.h> 19 #endif 18 20 19 21 #include "cucul.h" … … 36 38 char density[] = " ',+:;o&%w$W@#"; 37 39 38 int main( void)40 int main(int argc, char *argv[]) 39 41 { 40 42 cucul_canvas_t *cv; -
libcaca/trunk/test/event.c
r898 r1048 14 14 #include "config.h" 15 15 #include "common.h" 16 17 #include <stdio.h> 18 #include <string.h> 19 #include <stdlib.h> 16 #if !defined(__KERNEL__) 17 # include <stdio.h> 18 # include <string.h> 19 # include <stdlib.h> 20 #endif 20 21 21 22 #include "cucul.h" -
libcaca/trunk/test/export.c
r1012 r1048 15 15 #include "common.h" 16 16 17 #if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 17 #if !defined(__KERNEL__) 18 # if defined(HAVE_INTTYPES_H) 19 # include <inttypes.h> 20 # endif 21 # include <stdio.h> 22 # include <stdlib.h> 23 # include <string.h> 19 24 #endif 20 21 #include <stdio.h>22 #include <stdlib.h>23 #include <string.h>24 25 25 26 #include "cucul.h" -
libcaca/trunk/test/font.c
r942 r1048 15 15 #include "common.h" 16 16 17 #if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 17 #if !defined(__KERNEL__) 18 # if defined(HAVE_INTTYPES_H) 19 # include <inttypes.h> 20 # endif 21 22 # if defined(HAVE_ENDIAN_H) 23 # include <endian.h> 24 # endif 25 26 # include <stdio.h> 27 # include <stdlib.h> 28 # include <string.h> 19 29 #endif 20 21 #if defined(HAVE_ENDIAN_H)22 # include <endian.h>23 #endif24 25 #include <stdio.h>26 #include <stdlib.h>27 #include <string.h>28 30 29 31 #include "cucul.h" -
libcaca/trunk/test/font2tga.c
r959 r1048 15 15 #include "common.h" 16 16 17 #if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 17 #if !defined(__KERNEL__) 18 # if defined(HAVE_INTTYPES_H) 19 # include <inttypes.h> 20 # endif 21 # include <stdio.h> 22 # include <stdlib.h> 19 23 #endif 20 21 #include <stdio.h>22 #include <stdlib.h>23 24 24 25 #include "cucul.h" -
libcaca/trunk/test/frames.c
r964 r1048 14 14 #include "config.h" 15 15 #include "common.h" 16 #if !defined(__KERNEL__) 17 # if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 19 # endif 16 20 17 #if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 21 # include <stdio.h> 19 22 #endif 20 21 #include <stdio.h>22 23 23 #include "cucul.h" 24 24 #include "caca.h" 25 25 26 int main( void)26 int main(int argc, char *argv[]) 27 27 { 28 28 cucul_canvas_t *cv; -
libcaca/trunk/test/gamma.c
r1031 r1048 15 15 #include "common.h" 16 16 17 #if defined(HAVE_INTTYPES_H)18 # include <inttypes.h>19 #endif20 21 17 #if !defined(__KERNEL__) 18 # if defined(HAVE_INTTYPES_H) 19 # include <inttypes.h> 20 # endif 22 21 # include <stdio.h> 23 22 # include <math.h> … … 29 28 uint32_t buffer[256 * 4]; 30 29 31 int main( void)30 int main(int argc, char *argv[]) 32 31 { 33 32 caca_event_t ev; -
libcaca/trunk/test/hsv.c
r858 r1048 15 15 #include "common.h" 16 16 17 #if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 17 #if !defined(__KERNEL__) 18 # if defined(HAVE_INTTYPES_H) 19 # include <inttypes.h> 20 # endif 21 # include <stdio.h> 19 22 #endif 20 21 #include <stdio.h>22 23 23 24 #include "cucul.h" … … 26 27 uint32_t buffer[256*256]; 27 28 28 int main( void)29 int main(int argc, char *argv[]) 29 30 { 30 31 cucul_canvas_t *cv; -
libcaca/trunk/test/import.c
r903 r1048 15 15 #include "common.h" 16 16 17 #if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 17 18 #if !defined(__KERNEL__) 19 # if defined(HAVE_INTTYPES_H) 20 # include <inttypes.h> 21 # endif 22 # include <stdio.h> 23 # include <stdlib.h> 19 24 #endif 20 25 21 #include <stdio.h>22 #include <stdlib.h>23 26 24 27 #include "cucul.h" -
libcaca/trunk/test/input.c
r980 r1048 15 15 #include "common.h" 16 16 17 #if defined(HAVE_INTTYPES_H) 17 #if !defined(__KERNEL__) 18 # if defined(HAVE_INTTYPES_H) 18 19 # include <inttypes.h> 20 # endif 21 # include <string.h> 19 22 #endif 20 21 #include <string.h>22 23 23 24 #include "cucul.h" … … 33 34 } textentry; 34 35 35 int main( void)36 int main(int argc, char *argv[]) 36 37 { 37 38 textentry entries[TEXT_ENTRIES]; -
libcaca/trunk/test/spritedit.c
r859 r1048 14 14 #include "config.h" 15 15 #include "common.h" 16 17 # include <stdio.h>18 16 #if !defined(__KERNEL__) 17 # include <stdio.h> 18 #endif 19 19 #include "cucul.h" 20 20 #include "caca.h" -
libcaca/trunk/test/text.c
r942 r1048 14 14 #include "config.h" 15 15 #include "common.h" 16 17 #if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 16 #if !defined(__KERNEL__) 17 # if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 19 # endif 20 # include <stdio.h> 21 # include <string.h> 19 22 #endif 20 21 #include <stdio.h>22 #include <string.h>23 24 23 #include "cucul.h" 25 24 … … 32 31 " `----' \n" 33 32 34 int main( void)33 int main(int argc, char *argv[]) 35 34 { 36 35 cucul_canvas_t *cv; -
libcaca/trunk/test/transform.c
r858 r1048 14 14 #include "config.h" 15 15 #include "common.h" 16 17 #if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 16 #if !defined(__KERNEL__) 17 # if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 19 # endif 20 # include <stdio.h> 19 21 #endif 20 21 #include <stdio.h>22 22 23 23 #include "cucul.h" … … 45 45 }; 46 46 47 int main( void)47 int main(int argc, char *argv[]) 48 48 { 49 49 cucul_canvas_t *cv, *normal, *flip, *flop, *rotate; -
libcaca/trunk/test/truecolor.c
r858 r1048 15 15 #include "common.h" 16 16 17 #if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 17 #if !defined(__KERNEL__) 18 # if defined(HAVE_INTTYPES_H) 19 # include <inttypes.h> 20 # endif 21 # include <stdio.h> 19 22 #endif 20 21 #include <stdio.h>22 23 23 24 #include "cucul.h" 24 25 #include "caca.h" 25 26 26 int main( void)27 int main(int argc, char *argv[]) 27 28 { 28 29 cucul_canvas_t *cv; -
libcaca/trunk/test/unicode.c
r858 r1048 15 15 #include "common.h" 16 16 17 #if defined(HAVE_INTTYPES_H) 18 # include <inttypes.h> 17 #if !defined(__KERNEL__) 18 # if defined(HAVE_INTTYPES_H) 19 # include <inttypes.h> 20 # endif 21 # include <stdio.h> 19 22 #endif 20 21 #include <stdio.h>22 23 23 24 #include "cucul.h" 24 25 #include "caca.h" 25 26 26 int main( void)27 int main(int argc, char *argv[]) 27 28 { 28 29 cucul_canvas_t *cv; -
libcaca/trunk/tools/optipal.c
r859 r1048 15 15 #include "common.h" 16 16 17 #include <stdio.h> 17 #if !defined(__KERNEL__) 18 # include <stdio.h> 19 #endif 18 20 19 21 #include "cucul.h" /* Only necessary for CUCUL_* macros */ … … 45 47 while(0); 46 48 47 int main( void)49 int main(int argc, char *argv[]) 48 50 { 49 51 int i;
Note: See TracChangeset
for help on using the changeset viewer.