关于开发便携式C套件的书籍 [英] Books on developing portable C suites

查看:65
本文介绍了关于开发便携式C套件的书籍的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




有人可以推荐一本书,教我如何使用
方法进行C编程,以便代码模块化,编译

适用于不同的环境(例如Unix的变体和

Windows),将是健壮的等等。


例如,我正在开发一个BSD套接字套件,我想在各种Unix下运行
,包括Zaurus版本的
Linux,并在Windows下运行部分版本。我的想法是

以某种方式将系统调用作为库,但不掩盖主要代码的熟悉程度。


我希望能够独立运行

模块(例如将文本转换为文件

SNMP OID到ASN.1编码),但也使用相同的代码

在其他模块中。理想的解决方案是某种动态链接,如果足够快的话。它也应该不是很难配置的b $ b。问题出现了如何找到

组件模块 - env var?,path ?,找到主模块?




除此之外,还有更多需求。我不需要预订

如何使用printf,指针等等。有数百个。我需要一些东西来超越编码,然后在C中构建完整的

系统。


希望有人可以提供帮助。

谢谢,

詹姆斯

Hi,

Can someone recommend a book that will teach me how to
approach C programming so that code is modularised, will compile
for different environments (such as variations of Unix and
Windows), will be robust etc.

As an example, I am developing a BSD Sockets suite which I want
to run under various Unixes, including the Zaurus version of
Linux, and also run parts of it under Windows. My thought is to
have the system calls as libraries somehow but without obscuring
the familiarity of the main code.

I want to be able to run
modules stand-alone (such as the module which converts a text
SNMP OID to ASN.1 encoding) but also use the same code from
within other modules. The ideal solution would be some sort of
dynamic linking, if it is fast enough. It also should be not
cumbersome to configure. Questions arise such as how do I locate
component modules - env var?, path?, locate with main module?
etc.

There''s more to the need than that above. I don''t need book on
how to use printf, pointers etc. There are hundreds of them. I
need something to go beyond coding and on to building complete
systems in C.

Hope someone can help.
Thanks,
James

推荐答案

2003年8月2日星期六12:22:08 + 0100,詹姆斯哈里斯 < no.email.please>

写道:
On Sat, 2 Aug 2003 12:22:08 +0100, "James Harris" <no.email.please>
wrote:


有人可以推荐一本会教我如何接近C编程,以便代码模块化,将针对不同的环境(例如Unix和Windows的变体)进行编译,将是健壮的等等。
< snip>
Hi,

Can someone recommend a book that will teach me how to
approach C programming so that code is modularised, will compile
for different environments (such as variations of Unix and
Windows), will be robust etc.
<snip>




搜索Title =" Portable C"在亚马逊上取得了以下成果;

可能会通过一点点挖掘找到更多,而且更有针对性。

也许在谷歌搜索。


Portable C(Prentice Hall软件系列)

作者:Henry Rabinowitz,Chaim Schaap(贡献者)

绝版 - 限量供货


便携式C和Unix系统编程(Prentice-Hall软件系列)

由JE Laping,JE Lapin

绝版 - 限量供货

便携式C软件

作者:Mark R. Horton

绝版 - 限量供货


开发C语言便携式系统调用库/书籍和磁盘

由Matt Weisfeld

绝版 - 有限的可用性

信息技术 - 便携式操作系统接口(Posix):

系统应用程序接口(Api)(C语言)
IEEE的B $ b(平装 - 1997年1月)


系统解决方案Portab C和C ++中的能力:你的写作指南

真正的便携式应用程序/书籍和磁盘

作者John L. Bradberry,John E. Swanke

绝版 - 限量供货


便携式C

(平装书 - 1990年2月)

特别订单,未作出任何作者



A search for Title="Portable C" on amazon yielded the following;
probably can find more with a little digging and some more targeted
searches perhaps on Google.

Portable C (Prentice Hall Software Series)
by Henry Rabinowitz, Chaim Schaap (Contributor)
Out of Print--Limited Availability

Portable C and Unix System Programming (Prentice-Hall Software Series)
by J.E. Laping, J. E. Lapin
Out of Print--Limited Availability
Portable C Software
by Mark R. Horton
Out of Print--Limited Availability

Developing C Language Portable System Call Libraries/Book and Disk
by Matt Weisfeld
Out of Print--Limited Availability

Information Technology-Portable Operating System Interface (Posix):
System Application Program Interface (Api) (C Language)
by IEEE (Paperback - January 1997)

Solutions to Systems Portability in C and C++: Your Guide to Writing
Truly Portable Applications/Book and Disk
by John L. Bradberry, John E. Swanke
Out of Print--Limited Availability

Portable C
(Paperback - February 1990)
Special Order, no author given




" James Harris" < no.email.please>在留言中写道

新闻:3f ********************* @ lovejoy.zen.co.uk ...

"James Harris" <no.email.please> wrote in message
news:3f*********************@lovejoy.zen.co.uk...


有人可以推荐一本能教会我如何处理C编程的书,以便代码模块化,可以针对不同的环境进行编译(例如: Unix和
Windows的变体,将是健壮的等等。

作为一个例子,我正在开发一个BSD套接字套件,我希望
在各种Unix下运行,包括Zaurus版本的Linux,也在Windows下运行它的部分内容。我的想法是以某种方式将系统调用作为库,但不要掩盖主代码的熟悉程度。

我希望能够运行
模块支架-alone(例如将文本
SNMP OID转换为ASN.1编码的模块),但在其他模块中也使用相同的代码。理想的解决方案是某种动态链接,如果它足够快的话。它也应该不是很麻烦的配置。问题出现了,例如我如何找到组件模块 - env var ?, path ?,与主模块定位?

需要的不仅仅是以上。我不需要预订
如何使用printf,指针等。有数百个。我需要一些东西来超越编码以及在C中构建完整的系统。

希望有人可以提供帮助。
谢谢,
詹姆斯
Hi,

Can someone recommend a book that will teach me how to
approach C programming so that code is modularised, will compile
for different environments (such as variations of Unix and
Windows), will be robust etc.

As an example, I am developing a BSD Sockets suite which I want
to run under various Unixes, including the Zaurus version of
Linux, and also run parts of it under Windows. My thought is to
have the system calls as libraries somehow but without obscuring
the familiarity of the main code.

I want to be able to run
modules stand-alone (such as the module which converts a text
SNMP OID to ASN.1 encoding) but also use the same code from
within other modules. The ideal solution would be some sort of
dynamic linking, if it is fast enough. It also should be not
cumbersome to configure. Questions arise such as how do I locate
component modules - env var?, path?, locate with main module?
etc.

There''s more to the need than that above. I don''t need book on
how to use printf, pointers etc. There are hundreds of them. I
need something to go beyond coding and on to building complete
systems in C.

Hope someone can help.
Thanks,
James




嗨詹姆斯,

不幸的是,编程100%的便携式代码将你绑定到

ISO / IEC标准说,它不包括对互联网套接字的支持。

我不认为购买关于这个主题的书(如果有的话)是值得的
$ b $它。你只需要一些指针和大量文档。我建议你

购买标准的副本(只有



Hi James,
Unfortunately, programming 100% portable code ties you down to what the
ISO/IEC standard says, which does not include support for internet sockets.
I do not think buying a book on the topic (if there are any) is well-worth
it. You just need a few pointers, and lots of documentation. I suggest you
purchase a copy of the standard (only


18美元的PDF格式,见
www.iso.org 。)这将给你*什么*是便携式的,什么不是。


对于您使用的非标准库,例如Internet套接字,您可以使用#ifdef方式构建代码,以便在没有任何修改的情况下进行编译在所有平台上,如下:


#ifdef _WIN32

#include< winsock2.h>

#else

#include< net / socket.h> / *不知道unix'的标题是什么,

但它们不一样* /

#endif

其次,您可以使用宏来隐藏特定于系统的函数调用和

其他东西。


这听起来可能很多工作,但完全有可能在公平的时间内完成。

如果您需要有关同一主题的更具体问题的帮助,请不要不要害羞

再次向小组询问。您还可以参考便携式库的'source

代码,了解他们是如何做到的。
18 USD in PDF format, see
www.iso.org.) That will give you *what* is portable and what not.

For the non-standard libraries you use such as Internet sockets, you can
build your code in such a #ifdef manner that it will compile without any
modification on all platforms, as follows:

#ifdef _WIN32
#include <winsock2.h>
#else
#include <net/socket.h> /* have no idea what the headers are for unix''s,
but they aren''t the same */
#endif

Secondly, you can use macros to hide the system-specific function calls and
other stuff too.

This may sound like a lot of work, but it''s totally possible to do in a fair
amount of time.
If you need help on more specific questions on the same topic, don''t be shy
to ask again to the group. You can also refer to portable libraries'' source
code to see how they do it.


这篇关于关于开发便携式C套件的书籍的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆