LINUX CÖÐÓÃdefine¶¨Òå¿É±ä²ÎÊýµÄºê
Ò»°ãÔÚµ÷ÊÔ´òÓ¡DebugÐÅÏ¢µÄʱºò, ÐèÒª¿É±ä²ÎÊýµÄºê. ´ÓC99¿ªÊ¼¿ÉÒÔʹ±àÒëÆ÷±ê×¼Ö§³Ö¿É±ä²ÎÊýºê(variadic macros), ÁíÍâGCCÒ²Ö§³Ö¿É±ä²ÎÊýºê, µ«ÊÇÁ½ÖÖÔÚϸ½ÚÉÏ¿ÉÄÜ´æÔÚÇø±ð.
1. __VA_ARGS__
__VA_ARGS__ ½« "..." ´«µÝ¸øºê . Èç
#define debug(format, ...) fprintf(stderr, format, __VA_ARGS__)
2. GCCµÄ¸´ÔÓºê
GCCʹÓÃÒ»ÖÖ²»Í¬µÄÓï·¨,´Ó¶ø¿ÉÒÔ¸ø¿É±ä²ÎÊýÒ»¸öÃû×Ö,ÈçͬÆäËü²ÎÊýÒ»Ñù.
#define debug(format, args...) fprintf (stderr, format, args)
ÕâºÍµÚÒ»ÌõµÄºêÀý×ÓÊÇÍêÈ«Ò»ÑùµÄ,µ«ÊÇÕâôд¿É¶ÁÐÔ¸üÇ¿²¢ÇÒ¸üÈÝÒ×½øÐÐÃèÊö.
3. ##__VA_ARGS__
ÉÏÃæÁ½¸ö¶¨ÒåµÄºê,Èç¹û³öÏÖ debug("A Message")µÄʱºò,ÓÉÓÚºêÕ¹¿ªºóÓиö¶àÓàµÄ¶ººÅ,ËùÒÔ½«µ¼Ö±àÒë´íÎó.
ΪÁ˽â¾öÕâ¸öÎÊÌâ,CPP ʹÓÃÒ»¸öÌØÊâµÄ"##"²Ù×÷,¸ñʽÈçÏÂ:
#define debug(format, ...) fprintf (stderr, format, ## __VA_ARGS__)
ÕâÀï,Èç¹û¿É±ä²ÎÊý±»ºöÂÔ»òΪ¿Õ,"##"²Ù×÷½«Ê¹Ô¤´¦ÀíÆ÷(preprocessor)È¥³ýµôËüÇ°ÃæµÄÄǸö¶ººÅ.
Ïà¹ØÎĵµ£º
Ò»¡¢ÒªÇó£º
1¡¢Äܹ»ÏÔʾ³öMakefileµÄ×ÜÊý
2¡¢ÄÜÏÔʾһ¼¶Ä¿Â¼ÏµÄMakefile×ÜÊý¡¢MakefileÁÐ±í¼°ÆäMakefileµÄÄÚÈÝ
3¡¢Äܽ«ÉÏÊöÄÚÈÝдÈëÏàÓ¦µÄÎļþ
¶þ¡¢ÊµÀý
rm -rf ~/Desktop/linux_Makefile/*
for i in `find . -maxdepth 1 -type d`
#½ö½öÊǵ±Ç°Ä¿Â¼£¬ËùÒÔÇ뽫±¾½Å±¾·ÅÔÚlinuxÔ´ÂëĿ¼ÏÂÖ´ÐС£
do
e ......
ÒÔÇ°ÒѾ½Ó´¥WindowsϵÄSocket±à³Ì£¬×î½üÒ²³¢ÊÔ×ÅÔÙlinuxÏÂʹÓÃSocket±à³Ì£¬ÏÂÃæÊÇÔÚÍøÉÏÕÒµÄÀý×Ó(ÒѾ²âÊÔ¹ý)
tcp_server.c:
#include <stdio.h>
#include <sys/socket.h>
#include <unistd.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <stdlib.h>
# ......
1. ·þÎñÆ÷nfsµÄÅäÖÃ
2. ¿Í»§¶ËnfsµÄÅäÖÃ
3. ʹÓÃnfs
3.1 ×÷Ϊ¹²ÏíÎļþϵͳmount
3.2 ×÷Ϊ¸ùÎļþϵͳmount
4.±¸ ×¢
nfsÊÇNetwork File System£¬»ùÓÚRPC(Remote Procedure Call ProtocolÔ¶³Ì¹ý³Ìµ ......
--ÕâÀïËùÓеÄperl¼¼ÊõÎÊÌⶼÊÇÎÒƽ³£´¦ÀíÊý¾ÝµÄʱºòÒªÓõ½µÄ£¬¿ÉÄܲ»ÊǺÜÇ¿µÄ³ÌÐò£¬µ«ÊÇÏ£ÍûÄܺÍÈÈ°®perlµÄͬ־£¬Ò»Æð·ÖÏí...
ÔںܶàÇé¿öÏ£¬ÎÒÃÇÐèÒª´ÓÔ¶´¦·þÎñÆ÷ÉÏÏÂÔص±Ìì»òÕß×òÌìÉú³ÉµÄÈÕÖ¾Îļþ£¬À´²é¿´Ò»Ð©ÎÒÃÇÐèÒªµÄ¶«Î÷»òÕß±¸·Ý¡£
Èç¹û²ÉÓÃÁËftp£¬ÄÇôÎÒÃÇ ......