Mercurial > sdl-ios-xcode
annotate README.CVS @ 1078:e2ef6b7001fd
Patch from Antonio SJ Musumeci:
"
This code with SDL-1.2.8 and CVS:
#include <stdio.h>
#include <stdlib.h>
#include <SDL.h>
int
main(int argc, char** argv)
{
char alphabet[26] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
char buffer_file[27] = {0};
char buffer_mem[27] = {0};
int rv_file;
int rv_mem;
FILE* file_ptr;
SDL_RWops* rwop_file;
SDL_RWops* rwop_mem;
file_ptr = fopen("./blah", "w");
fwrite(alphabet, 1, sizeof(alphabet), file_ptr);
fclose(file_ptr);
rwop_mem = SDL_RWFromMem(alphabet, sizeof(alphabet));
rwop_file = SDL_RWFromFile("./blah", "r");
rv_mem = SDL_RWread(rwop_mem , buffer_mem, 5, 6);
rv_file = SDL_RWread(rwop_file, buffer_file, 5, 6);
printf("From File: %d %s\n"
"From Mem: %d %s\n",
rv_file,
buffer_file,
rv_mem,
buffer_mem);
printf("Seek end of File: %d\n"
"Seek end of Mem: %d\n",
SDL_RWseek(rwop_file, 0, SEEK_END),
SDL_RWseek(rwop_mem , 0, SEEK_END));
SDL_RWclose(rwop_file);
SDL_RWclose(rwop_mem);
return 0;
}
Produces this output:
From File: 5 ABCDEFGHIJKLMNOPQRSTUVWXYZ
From Mem: 5 ABCDEFGHIJKLMNOPQRSTUVWXY
Seek end of File: 26
Seek end of Mem: 26
"
--ryan.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Fri, 24 Jun 2005 12:48:38 +0000 |
parents | ec659230eaac |
children | dc219ba4cf45 |
rev | line source |
---|---|
0 | 1 |
2 The latest development version of SDL is available via CVS: | |
3 | |
895
ec659230eaac
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
172
diff
changeset
|
4 cvs -d :pserver:guest@libsdl.org:/home/sdlweb/libsdl.org/cvs login |
172
37e3ca9254c7
Date: Sat, 8 Sep 2001 04:42:23 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
5 # No password, so just hit enter when prompted for a password |
895
ec659230eaac
*** empty log message ***
Sam Lantinga <slouken@libsdl.org>
parents:
172
diff
changeset
|
6 cvs -d :pserver:guest@libsdl.org:/home/sdlweb/libsdl.org/cvs checkout SDL |
0 | 7 |
8 When you check a fresh copy of SDL out of CVS, you need to generate | |
9 the files used by make by running the "autogen.sh" script, which will | |
10 run aclocal, automake, autoconf and then run configure. | |
11 | |
172
37e3ca9254c7
Date: Sat, 8 Sep 2001 04:42:23 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
12 There is a web interface to cvs at http://www.libsdl.org/cgi/cvsweb.cgi |
0 | 13 |