Pseudotypes Relation to C Types

Bare metal programming in PureBasic, for experienced users
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Pseudotypes Relation to C Types

Post by Inner »

How do these Pseudo Types relate to their C Types?

p-ascii,p-utf8,p-bstr,p-unicode,p-variant

Or am I missing the point?
DarkDragon
Addict
Addict
Posts: 2228
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: Pseudotypes Relation to C Types

Post by DarkDragon »

Inner wrote: Sat Feb 03, 2024 4:28 am How do these Pseudo Types relate to their C Types?

p-ascii,p-utf8,p-bstr,p-unicode,p-variant

Or am I missing the point?
They're all pointers to either ascii, utf-8, bstr, unicode or variant data. It depends on what you want to do with them in C.

All would be fine as void*
p-ascii is usually but not always unsigned char* or uint8_t*
p-utf8 is usually but not always also unsigned char* or uint8_t*, but you have to interpret it as utf-8
p-unicode is usually but not always unsigned short* or wchar_t* or uint16_t* as UCS2.

The other two are COM related.
bye,
Daniel
infratec
Always Here
Always Here
Posts: 6866
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Pseudotypes Relation to C Types

Post by infratec »

They are used to automatically convert a PB unicode string to the required string format.
It is not a new type of variable.

But you are the expert I'm only always here :wink:
User avatar
Inner
PureBasic Expert
PureBasic Expert
Posts: 714
Joined: Fri Apr 25, 2003 4:47 pm
Location: New Zealand

Re: Pseudotypes Relation to C Types

Post by Inner »

infratec wrote: Sun Feb 04, 2024 4:53 pm They are used to automatically convert a PB unicode string to the required string format.
It is not a new type of variable.

But you are the expert I'm only always here :wink:
:o :lol: :lol: :lol: I seriously wouldn't put any stock in that title at all, and I'd hardly call myself an expert, town dunce maybe..

I've just been using it for 21 years! which makes Pure Basic the longest lived language in my life bar none.
Post Reply