[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Clipboard



Quoting Frank Naumann <fnaumann@boerde.de>:

Hello!

You mean char *scrap_rtxt(char *buf, long *len, long maxlen)?

Besides I can't get a call to scrap_rtxt to compile :

     long filelength;
     long maxlength = 65535;
     char *buf = NULL;
     char *p = NULL;
     *p = scrap_rtxt (&buf, &filelength, maxlength);

This is totally wrong anyway as you need to pass a valid buffer and not a pointer to a pointer:

long filelength;
long maxlength = 65535;
char *buf = malloc(maxlength);

if (buf)
{
	char *p = scrap_rtxt(buf, &filelength, maxlength);

	if (p)
	{
		/* found something */
	}

	free(buf);
}
else
{
	/* out of memory */
}


Regards,
Frank


C's pointer handling is utter gibberish to me, Pascal is infinitely
better. This is one of the many reasons I hate C.

I think I will stick with the read_scrap that I have written since
it handles all this internally, once I get it working.

Peter