Fwd: Re: MemPool.c's

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Mon, 22 Apr 2002 00:04:43 +0200

this belongs here..

---------- Forwarded Message ----------

Subject: Re: MemPool.c's
Date: Sun, 21 Apr 2002 18:28:15 +0400 (MSD)
From: "Evgeny V.Kotsuba" <evgen@laser.nictl.msk.su>
To: hno@marasystems.com

Hi,
I am back from busines trip/

16-Apr-2002 21:25 you wrote:
HN> You might want to look at the native NT port. It already has the
HN> separation
HN> of socket and file handles.

HN> http://devel.squid-cache.org/projects.html#nt

HN> And why C++? Squid is written in C for C compilers, and you are
 quite C++ has more strict syntax and doesn't permit some stupid
 errors. I use C++ even for pure C programms, just rename all *.c to
 *.cpp. Moreover, Squid is really partly object-oriented
(read&write methods, classes, call-back functions, etc.)

HN> likely to run into quite many problems if compiling it as C++
 due to HN> differences in
HN> type casting, promoting etc. The variable names and types
 colliding with HN> C++ reserved keywords are only a minor problem
 and can easily be solved with HN> a search/replace.
The fact is that all difference with pure renaming *.c to *.cpp and
 using C++ compiler is precis using of C type casting and changing
 variables names from C++ reserverd words.

HN> Just curious, but how do you now deal with the difference in file
 and HN> socket filedescriptors, and their possible numeric overlap?

HN> (too lazy to dig into the nt branch to find out..)

I change SQUID's fde structure to class and use class read/write
 functions instead of unix's read/write, etc. For every fd I remember
 its type - file, socket or pipe/
Also greate problem was unix errno - the os/2 uses sock_errno for
 sockets errors, errors constants are also slightly different.

SY,
EK

--
Evgeny Kotsuba,
IPS&R Laser Center RAS,
Shatura
http://www.laser.ru
-------------------------------------------------------
Received on Sun Apr 21 2002 - 16:06:15 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:15:17 MST