Does anyone know what this is? It's in a piece of code I'm trying to debug, and I've never seen it:

typedef void FAR * socktag;

Also, could someone explain the difference between these two lines (after the typedef executes):

socktag SMTPSock;
int SMTPSock;

My questions continue to become more and more complex - sorry. How does this:

int (FAR PASCAL *pgensock_getchar) (socktag st, int wait, char FAR * ch);

compare to this:

int gensock_getchar (int st, int wait, char * ch)
{
   int retval = 0;
   connection *conn;

   conn = (connection *)st;

   if ((retval = conn->cc_getchar(wait, ch)))
      return (retval);
   else
      return (0);
}

Does anyone know what this is?

It's just a macro that's either blank or represents the compiler's keyword for a far pointer (à la Intel's 16-bit segmented memory model).

could someone explain the difference between these two lines (after the typedef executes)

One is a pointer, the other is an int? That should be obvious.

Ok, I was confused on what FAR was so I wasn't sure.

Here is a complete explanation if you're really all that interested. Applies to 16-bit MS-DOS compilers. If you want to port a 16-bit program to 32-bit compiler than just define FAR to be empty

#ifdef FAR
#undef FAR
#endif
#define FAR

You will want to do the same with NEAR

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.