Why isn't 3ds-curl not working?

Post Reply
KironDevCoder

How to get content of webpage

Post by KironDevCoder » Mon Jul 08, 2019 9:28 pm

How do I do this? I know the buffer in https://github.com/devkitPro/3ds-exampl ... twork/http has the content, but how do I convert it to char* or anything else that can be printed on screen?

WinterMute
Site Admin
Posts: 1404
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: How to get content of webpage

Post by WinterMute » Tue Jul 09, 2019 12:18 am

Firstly welcome to the forum & thanks for signing up and asking your question here.

You mentioned on the libcrtu issue that you're fairly new to C so I'm going to suggest that you do some reading. The online guide that's most recommended is Beej's Guide to C Programming although personally I prefer physical books for reference material.

To answer your question more directly though, converting the u8 buffer is really just as simple as casting to a char * i.e.

Code: Select all

char *mycharbuf = (char*) buf
If you're looking at parsing lines from this buffer (if for instance it's an html page) then you might want to look into fmemopen & fgets. It's difficult to offer concrete advice without more detail on what it is you wnat to achieve though.
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

KironDevCoder

Re: How to get content of webpage

Post by KironDevCoder » Tue Jul 09, 2019 8:26 am

It doesn't really work for me, it runs fine, but it won't print the content on the screen. Also

Code: Select all

char *mycharbuf = (char* buf)
didn't work so I changed it to

Code: Select all

char *mycharbuf = (char*) buf
but that shouldn't change it, right?
Attachments
ROMFree3DS.zip
The source code
(188.41 KiB) Downloaded 104 times
Capture.PNG
What I see
(35.91 KiB) Not downloaded yet

WinterMute
Site Admin
Posts: 1404
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: Why isn't 3ds-curl not working?

Post by WinterMute » Wed Jul 17, 2019 1:22 am

Sorry. We don't support piracy.
Help keep devkitPro toolchains free, Donate today

devkitPro IRC support
Personal Blog

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests