Got network working!!! But can't do fwrite :( January 24, 2009 02:23PM | Registered: 15 years ago Posts: 405 |
fopen("fat://google.txt", "w"); //File not created so set to w to create new file
fwrite(file, "fat://google.txt"); //file contains the content of google.com
struct block file = downloadfile("http://www.google.com/");
Re: Got network working!!! But can't do fwrite :( January 24, 2009 05:50PM | Registered: 15 years ago Posts: 276 |
Re: Got network working!!! But can't do fwrite :( January 24, 2009 07:15PM | Registered: 15 years ago Posts: 405 |
[http] [DOMAIN] PATH)
Re: Got network working!!! But can't do fwrite :( January 24, 2009 07:18PM | Admin Registered: 16 years ago Posts: 5,132 |
Re: Got network working!!! But can't do fwrite :( January 24, 2009 08:06PM | Registered: 15 years ago Posts: 405 |
printf("Wii Browse Develepment Version 1\n"); printf("Waiting for network to initialize..."); s32 ip; while ((ip = net_init()) == -EAGAIN) { printf("."); usleep(100000); } printf("\n"); if(ip < 0) { printf("Error while initialising, error is %i\n", ip); } char myIP[16]; if (if_config(myIP, NULL, NULL, true) < 0) { printf("Error reading IP address, exiting"); exit(0); } printf("Network initialised.\n"); printf("IP: %s\n\n", myIP); printf("Let's Browse!"); usleep(1000 * 1000 * 1); //1 sec printf("Attempting to download HTML file from [www.google.com]\n"); struct block file = downloadfile("http://www.google.com/"); printf("If domaind could not be resolved, connection ended :(\n Else the download completed successfully and youu should wait for me to do something new!\n"); FILE * file_ptr; file_ptr = fopen("fat://google.txt", "w"); fwrite(file.data,1,sizeof(file.data), file_ptr);
struct block file; file.data = malloc(filesize); file.size = filesize; if(file.data == NULL) { printf("No more memory to copy file from HTTP response\n"); free(response.data); return emptyblock; } memcpy(file.data, filestart, filesize); //Dispose of the original response free(response.data); return file;
Re: Got network working!!! But can't do fwrite :( January 24, 2009 08:13PM | Registered: 15 years ago Posts: 703 |
Re: Got network working!!! But can't do fwrite :( January 25, 2009 01:59AM | Registered: 15 years ago Posts: 58 |
Re: Got network working!!! But can't do fwrite :( January 25, 2009 11:12AM | Registered: 15 years ago Posts: 405 |
Re: Got network working!!! But can't do fwrite :( January 25, 2009 12:38PM | Registered: 15 years ago Posts: 276 |
Quote
file_ptr = fopen("fat://google.txt", "w");
fwrite(file.data,1,sizeof(file.data), file_ptr);
Re: Got network working!!! But can't do fwrite :( January 25, 2009 01:10PM | Registered: 15 years ago Posts: 405 |
Re: Got network working!!! But can't do fwrite :( January 25, 2009 01:16PM | Registered: 15 years ago Posts: 58 |
Re: Got network working!!! But can't do fwrite :( January 25, 2009 05:20PM | Registered: 15 years ago Posts: 405 |
Quote
mavakadachi
SteelSLasher: whats the app for? depending what you need you can do things in a very simple or very complex way.
html render? are you trying to write a browser? what do you need the 'html render' to do? i hope its just text and displaying jpgs + simple alignment (no br == fail)
Re: Got network working!!! But can't do fwrite :( January 26, 2009 02:16AM | Registered: 15 years ago Posts: 703 |
Re: Got network working!!! But can't do fwrite :( January 26, 2009 02:47AM | Registered: 15 years ago Posts: 58 |
Re: Got network working!!! But can't do fwrite :( January 26, 2009 12:11PM | Registered: 15 years ago Posts: 405 |
Re: Got network working!!! But can't do fwrite :( January 28, 2009 05:33AM | Registered: 15 years ago Posts: 31 |
Re: Got network working!!! But can't do fwrite :( January 30, 2009 07:45PM | Registered: 15 years ago Posts: 405 |
Re: Got network working!!! But can't do fwrite :( January 31, 2009 08:10AM | Registered: 15 years ago Posts: 58 |
Re: Got network working!!! But can't do fwrite :( January 31, 2009 02:57PM | Registered: 15 years ago Posts: 405 |
Quote
mavakadachi
port antlr !?! dont you generate c(++) code with antlr and just use it in your project?
Why do you need to use these? i thought you only needed to DL the html page+images and do a simple render on screen?
Re: Got network working!!! But can't do fwrite :( February 02, 2009 02:21PM | Registered: 15 years ago Posts: 58 |
Quote
SteelSLasherQuote
mavakadachi
port antlr !?! dont you generate c(++) code with antlr and just use it in your project?
Why do you need to use these? i thought you only needed to DL the html page+images and do a simple render on screen?
Really? I should look that up since ANTLR has no support for C++ and i thought it was a library?