Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB
ÈÈÃűêÇ©£º c c# c++ asp asp.net linux php jsp java vb Python Ruby mysql sql access Sqlite sqlserver delphi javascript Oracle ajax wap mssql html css flash flex dreamweaver xml
 ×îÐÂÎÄÕ : c

linux³£ÓÃcº¯Êý ÎļþȨÏÞ¿ØÖÆƪ

access£¨ÅжÏÊÇ·ñ¾ßÓдæÈ¡ÎļþµÄȨÏÞ£©
¡¡¡¡Ïà¹Øº¯Êý  stat£¬open£¬chmod£¬chown£¬setuid£¬setgid
¡¡¡¡±íÍ·Îļþ  #include<unistd.h>
¡¡¡¡¶¨Ò庯Êý  int access(const char * pathname,int mode);
¡¡¡¡º¯Êý˵Ã÷  access()»á¼ì²éÊÇ·ñ¿ÉÒÔ¶Á/дijһÒÑ´æÔÚµÄÎļþ¡£²ÎÊýmodeÓм¸ÖÖÇé¿ö×éºÏ£¬R_OK£¬W_OK£¬X_OK
ºÍF_OK¡£R_OK£¬W_OKÓëX_OKÓÃÀ´¼ì²éÎļþÊÇ·ñ¾ßÓжÁÈ¡¡¢Ð´ÈëºÍÖ´ÐеÄȨÏÞ¡£F_OKÔòÊÇÓÃÀ´ÅжϸÃÎļþÊÇ·ñ´æÔÚ¡£ÓÉÓÚaccess()Ö»×÷
ȨÏ޵ĺ˲飬²¢²»Àí»áÎļþÐÎ̬»òÎļþÄÚÈÝ£¬Òò´Ë£¬Èç¹ûһĿ¼±íʾΪ“¿ÉдÈ딣¬±íʾ¿ÉÒÔÔÚ¸ÃĿ¼Öн¨Á¢ÐÂÎļþµÈ²Ù×÷£¬¶ø·ÇÒâζ´ËĿ¼¿ÉÒÔ±»µ±×öÎļþ´¦Àí¡£
ÀýÈ磬Äã»á·¢ÏÖDOSµÄÎļþ¶¼¾ßÓГ¿ÉÖ´ÐДȨÏÞ£¬µ«ÓÃexecve()Ö´ÐÐʱÔò»áʧ°Ü¡£
¡¡¡¡·µ»ØÖµ  ÈôËùÓÐÓû²éºËµÄȨÏÞ¶¼Í¨¹ýÁ˼ì²éÔò·µ»Ø0Öµ£¬±íʾ³É¹¦£¬Ö»ÒªÓÐһȨÏÞ±»½ûÖ¹Ôò·µ»Ø-1¡£
¡¡¡¡´íÎó´úÂë  EACCESS ²ÎÊýpathname ËùÖ¸¶¨µÄÎļþ²»·ûºÏËùÒªÇó²âÊÔµÄȨÏÞ¡£
¡¡¡¡EROFS Óû²âÊÔдÈëȨÏÞµÄÎļþ´æÔÚÓÚÖ»¶ÁÎļþϵͳÄÚ¡£
¡¡¡¡EFAULT ²ÎÊýpathnameÖ¸Õ볬³ö¿É´æÈ¡ÄÚ´æ¿Õ¼ä¡£
¡¡¡¡EINVAL ²ÎÊýmode ²»ÕýÈ·¡£
¡¡¡¡ENAMETOOLONG ......

linux³£ÓÃcº¯Êý ÎļþȨÏÞ¿ØÖÆƪ

access£¨ÅжÏÊÇ·ñ¾ßÓдæÈ¡ÎļþµÄȨÏÞ£©
¡¡¡¡Ïà¹Øº¯Êý  stat£¬open£¬chmod£¬chown£¬setuid£¬setgid
¡¡¡¡±íÍ·Îļþ  #include<unistd.h>
¡¡¡¡¶¨Ò庯Êý  int access(const char * pathname,int mode);
¡¡¡¡º¯Êý˵Ã÷  access()»á¼ì²éÊÇ·ñ¿ÉÒÔ¶Á/дijһÒÑ´æÔÚµÄÎļþ¡£²ÎÊýmodeÓм¸ÖÖÇé¿ö×éºÏ£¬R_OK£¬W_OK£¬X_OK
ºÍF_OK¡£R_OK£¬W_OKÓëX_OKÓÃÀ´¼ì²éÎļþÊÇ·ñ¾ßÓжÁÈ¡¡¢Ð´ÈëºÍÖ´ÐеÄȨÏÞ¡£F_OKÔòÊÇÓÃÀ´ÅжϸÃÎļþÊÇ·ñ´æÔÚ¡£ÓÉÓÚaccess()Ö»×÷
ȨÏ޵ĺ˲飬²¢²»Àí»áÎļþÐÎ̬»òÎļþÄÚÈÝ£¬Òò´Ë£¬Èç¹ûһĿ¼±íʾΪ“¿ÉдÈ딣¬±íʾ¿ÉÒÔÔÚ¸ÃĿ¼Öн¨Á¢ÐÂÎļþµÈ²Ù×÷£¬¶ø·ÇÒâζ´ËĿ¼¿ÉÒÔ±»µ±×öÎļþ´¦Àí¡£
ÀýÈ磬Äã»á·¢ÏÖDOSµÄÎļþ¶¼¾ßÓГ¿ÉÖ´ÐДȨÏÞ£¬µ«ÓÃexecve()Ö´ÐÐʱÔò»áʧ°Ü¡£
¡¡¡¡·µ»ØÖµ  ÈôËùÓÐÓû²éºËµÄȨÏÞ¶¼Í¨¹ýÁ˼ì²éÔò·µ»Ø0Öµ£¬±íʾ³É¹¦£¬Ö»ÒªÓÐһȨÏÞ±»½ûÖ¹Ôò·µ»Ø-1¡£
¡¡¡¡´íÎó´úÂë  EACCESS ²ÎÊýpathname ËùÖ¸¶¨µÄÎļþ²»·ûºÏËùÒªÇó²âÊÔµÄȨÏÞ¡£
¡¡¡¡EROFS Óû²âÊÔдÈëȨÏÞµÄÎļþ´æÔÚÓÚÖ»¶ÁÎļþϵͳÄÚ¡£
¡¡¡¡EFAULT ²ÎÊýpathnameÖ¸Õ볬³ö¿É´æÈ¡ÄÚ´æ¿Õ¼ä¡£
¡¡¡¡EINVAL ²ÎÊýmode ²»ÕýÈ·¡£
¡¡¡¡ENAMETOOLONG ......

linux emacs c (Ò»£©

²»À뿪EmacsÍê³É¼òµ¥C³ÌÐòµÄ±à¼­±àÒëÔËÐУ¨×ª£©
£¨1£©´ò¿ªEmacs£¬Ö´ÐÐ
$ emacs
£¨2£©½¨Á¢Ò»¸öеijÌÐòÎļþ. Ö´ÐÐ C-x C-f£¬
È»ºóÔÚÆÁÄ»µÄµ×²¿³öÏÖminibuffer£¬¹â±êÌáʾÄãÊäÈëÎļþÃû³Æ£¬
ÎļþÃû³ÆÒª´øÉϺó׺Ãû£¬Èçhello.cpp¡£»Ø³µ£¬È»ºó¿ªÊ¼±à¼­Ô´´úÂë¡£
£¨3£©±àÒë´úÂë¡£Ö´ÐÐEsc-x compile£¬³öÏÖminibuffer£¬ÌáʾÄãÊäÈë±àÒëÃüÁî¡£
ĬÈÏÇé¿öÏ£¬Óиömake -k³öÏÖÔÚminibuffer¡£ÎÒ»¹²»ÖªµÀËýµÄÄ¿µÄ¡£
¸÷λ¸ßÊÖ¿ÉÒÔ¸ø¸öÌáʾ¡£
±ÈÈçÉÏÀý£¬ÓÃÃüÁîg++ -o hello hello.cpp£¬»Ø³µºó£¬³öÏÖÒ»¸ö±àÒë½á¹û´°¿Ú¡£
£¨4£©Ö´ÐÐÉú³ÉµÄ½á¹ûÎļþ¡£Ö´ÐÐEsc-x shell£¬»Ø³µºó³öÏÖÒ»¸öÃüÁîÐд°¿Ú¡£
ÔÚÆäÖÐÖ´ÐÐÃüÁî $ ./hello¡£
£¨5£©»Øµ½Ô´Âë´°¿Ú¡£Ö´ÐÐ C-x b£¬³öÏÖminibuffer£¬ÌáʾÄãÊäÈëÒª»»µ½Äĸö»º³å¡£
ÊäÈ뻺³åÃû³Æ¼´¿É¡£ÈôËýÌáʾµÄÈ´Éú»º³å¾ÍÊÇÄãҪȥµÄ´°¿Ú£¬Ö±½Ó»Ø³µ¼´¿É¡£
£¨6£©²»ÏëÔÚminibufferÖÐÊäÈëÈκζ«Î÷£¬Ö´ÐÐC-g£¬¾ÍÀ뿪ÁËÕâ¸öminibuffer¡£
£¨7£©É±ËÀij¸ö»º³å¡£Ö´ÐÐ C-x k£¬³öÏÖminibuffer£¬ÌáʾÄãÊäÈëÊÇÄĸö»º³å¡£
ÊäÈëÃû³Æ£¬»Ø³µ¼´¿É¡£
£¨8£©Ö»±£Áôµ±Ç°¹â±êËùÔڵĴ°¿Ú£¬ÆäËû´°¿Ú¹Ø±Õ¡£Ö´ÐÐ C-x 1¡£
ÆÁÄ»ÉϳöÏÖ¶à¸ö´°¿Úʱ£¬´ÓÒ»¸ö´°¿ÚÌøµ½ÁíÒ»¸ö´°¿Ú£¬Ö´ÐÐ C-x o£¨× ......

linux emacs c (Ò»£©

²»À뿪EmacsÍê³É¼òµ¥C³ÌÐòµÄ±à¼­±àÒëÔËÐУ¨×ª£©
£¨1£©´ò¿ªEmacs£¬Ö´ÐÐ
$ emacs
£¨2£©½¨Á¢Ò»¸öеijÌÐòÎļþ. Ö´ÐÐ C-x C-f£¬
È»ºóÔÚÆÁÄ»µÄµ×²¿³öÏÖminibuffer£¬¹â±êÌáʾÄãÊäÈëÎļþÃû³Æ£¬
ÎļþÃû³ÆÒª´øÉϺó׺Ãû£¬Èçhello.cpp¡£»Ø³µ£¬È»ºó¿ªÊ¼±à¼­Ô´´úÂë¡£
£¨3£©±àÒë´úÂë¡£Ö´ÐÐEsc-x compile£¬³öÏÖminibuffer£¬ÌáʾÄãÊäÈë±àÒëÃüÁî¡£
ĬÈÏÇé¿öÏ£¬Óиömake -k³öÏÖÔÚminibuffer¡£ÎÒ»¹²»ÖªµÀËýµÄÄ¿µÄ¡£
¸÷λ¸ßÊÖ¿ÉÒÔ¸ø¸öÌáʾ¡£
±ÈÈçÉÏÀý£¬ÓÃÃüÁîg++ -o hello hello.cpp£¬»Ø³µºó£¬³öÏÖÒ»¸ö±àÒë½á¹û´°¿Ú¡£
£¨4£©Ö´ÐÐÉú³ÉµÄ½á¹ûÎļþ¡£Ö´ÐÐEsc-x shell£¬»Ø³µºó³öÏÖÒ»¸öÃüÁîÐд°¿Ú¡£
ÔÚÆäÖÐÖ´ÐÐÃüÁî $ ./hello¡£
£¨5£©»Øµ½Ô´Âë´°¿Ú¡£Ö´ÐÐ C-x b£¬³öÏÖminibuffer£¬ÌáʾÄãÊäÈëÒª»»µ½Äĸö»º³å¡£
ÊäÈ뻺³åÃû³Æ¼´¿É¡£ÈôËýÌáʾµÄÈ´Éú»º³å¾ÍÊÇÄãҪȥµÄ´°¿Ú£¬Ö±½Ó»Ø³µ¼´¿É¡£
£¨6£©²»ÏëÔÚminibufferÖÐÊäÈëÈκζ«Î÷£¬Ö´ÐÐC-g£¬¾ÍÀ뿪ÁËÕâ¸öminibuffer¡£
£¨7£©É±ËÀij¸ö»º³å¡£Ö´ÐÐ C-x k£¬³öÏÖminibuffer£¬ÌáʾÄãÊäÈëÊÇÄĸö»º³å¡£
ÊäÈëÃû³Æ£¬»Ø³µ¼´¿É¡£
£¨8£©Ö»±£Áôµ±Ç°¹â±êËùÔڵĴ°¿Ú£¬ÆäËû´°¿Ú¹Ø±Õ¡£Ö´ÐÐ C-x 1¡£
ÆÁÄ»ÉϳöÏÖ¶à¸ö´°¿Úʱ£¬´ÓÒ»¸ö´°¿ÚÌøµ½ÁíÒ»¸ö´°¿Ú£¬Ö´ÐÐ C-x o£¨× ......

cºÍjavaÖеĶþ½øÖÆÎļþ


×î½üÐèҪдһ¶Î³ÌÐò£¬Íê³ÉÒÔÏµĹ¤×÷£¬ÓÃjava½«Êý¾ÝÒÔ¶þ½øÖƵÄÐÎʽдÈëÎļþÖУ¬È»ºóÓÃC¶Á³ö´Ë¶þ½øÖÆÎļþ¡£
¿ªÊ¼µÄʱºòûÓп¼ÂÇ»úÆ÷µÄ×Ö½ÚÐò£¬Ö±½Ó¸ã³ösegment fault.ÏëÁ˺ܾ㬲ÅÃ÷°×Ô­À´ÊÇjavaºÍCµÄ×Ö½ÚÐòÊDz»Ò»ÑùµÄ¡£
javaÖеÄ×Ö½ÚÐòÊÇbig endianµÄ£¬ËüÊÇÓë»úÆ÷Î޹صġ£¶øcµÄ×Ö»úÐòÊÇ»úÆ÷Ïà¹ØµÄ£¬¶øµ±Ç°ÓõĻúÆ÷ÊÇx84_64½á¹¹£¬ÊÇlittle endianµÄ£¬
ËùÒÔ³ö´í¾Í²»×ãΪÆæÁË¡£
±³¾°ÖªÊ¶£º
Ö÷»ú×Ö½ÚÐò
²»Í¬µÄCPUÓв»Í¬µÄ×Ö½ÚÐòÀàÐÍ ÕâЩ×Ö½ÚÐòÊÇÖ¸ÕûÊýÔÚÄÚ´æÖб£´æµÄ˳Ðò Õâ¸ö½Ð×öÖ÷»úÐò
×î³£¼ûµÄÓÐÁ½ÖÖ
1£® Little endian£º½«µÍÐò×Ö½Ú´æ´¢ÔÚÆðʼµØÖ·
2£® Big endian£º½«¸ßÐò×Ö½Ú´æ´¢ÔÚÆðʼµØÖ·
LE little-endian
×î·ûºÏÈ˵Ä˼άµÄ×Ö½ÚÐò
µØÖ·µÍλ´æ´¢ÖµµÄµÍλ
µØÖ·¸ßλ´æ´¢ÖµµÄ¸ßλ
Ôõô½²ÊÇ×î·ûºÏÈ˵Ä˼άµÄ×Ö½ÚÐò£¬ÊÇÒòΪ´ÓÈ˵ĵÚÒ»¹Û¸ÐÀ´Ëµ
µÍλֵС£¬¾ÍÓ¦¸Ã·ÅÔÚÄÚ´æµØַСµÄµØ·½£¬Ò²¼´ÄÚ´æµØÖ·µÍλ
·´Ö®£¬¸ßλֵ¾ÍÓ¦¸Ã·ÅÔÚÄÚ´æµØÖ·´óµÄµØ·½£¬Ò²¼´ÄÚ´æµØÖ·¸ßλ
BE big-endian
×îÖ±¹ÛµÄ×Ö½ÚÐò
µØÖ·µÍλ´æ´¢ÖµµÄ¸ßλ
µØÖ·¸ßλ´æ´¢ÖµµÄµÍλ
Ϊʲô˵ֱ¹Û£¬²»Òª¿¼ÂǶÔÓ¦¹Øϵ
Ö»ÐèÒª°ÑÄÚ´æµØÖ·´Ó×óµ½ÓÒ°´ÕÕÓɵ͵½¸ßµÄ˳Ðòд³ö
°ÑÖµ°´ÕÕͨ³£µÄ¸ßλµ½µÍλµ ......

cºÍjavaÖеĶþ½øÖÆÎļþ


×î½üÐèҪдһ¶Î³ÌÐò£¬Íê³ÉÒÔÏµĹ¤×÷£¬ÓÃjava½«Êý¾ÝÒÔ¶þ½øÖƵÄÐÎʽдÈëÎļþÖУ¬È»ºóÓÃC¶Á³ö´Ë¶þ½øÖÆÎļþ¡£
¿ªÊ¼µÄʱºòûÓп¼ÂÇ»úÆ÷µÄ×Ö½ÚÐò£¬Ö±½Ó¸ã³ösegment fault.ÏëÁ˺ܾ㬲ÅÃ÷°×Ô­À´ÊÇjavaºÍCµÄ×Ö½ÚÐòÊDz»Ò»ÑùµÄ¡£
javaÖеÄ×Ö½ÚÐòÊÇbig endianµÄ£¬ËüÊÇÓë»úÆ÷Î޹صġ£¶øcµÄ×Ö»úÐòÊÇ»úÆ÷Ïà¹ØµÄ£¬¶øµ±Ç°ÓõĻúÆ÷ÊÇx84_64½á¹¹£¬ÊÇlittle endianµÄ£¬
ËùÒÔ³ö´í¾Í²»×ãΪÆæÁË¡£
±³¾°ÖªÊ¶£º
Ö÷»ú×Ö½ÚÐò
²»Í¬µÄCPUÓв»Í¬µÄ×Ö½ÚÐòÀàÐÍ ÕâЩ×Ö½ÚÐòÊÇÖ¸ÕûÊýÔÚÄÚ´æÖб£´æµÄ˳Ðò Õâ¸ö½Ð×öÖ÷»úÐò
×î³£¼ûµÄÓÐÁ½ÖÖ
1£® Little endian£º½«µÍÐò×Ö½Ú´æ´¢ÔÚÆðʼµØÖ·
2£® Big endian£º½«¸ßÐò×Ö½Ú´æ´¢ÔÚÆðʼµØÖ·
LE little-endian
×î·ûºÏÈ˵Ä˼άµÄ×Ö½ÚÐò
µØÖ·µÍλ´æ´¢ÖµµÄµÍλ
µØÖ·¸ßλ´æ´¢ÖµµÄ¸ßλ
Ôõô½²ÊÇ×î·ûºÏÈ˵Ä˼άµÄ×Ö½ÚÐò£¬ÊÇÒòΪ´ÓÈ˵ĵÚÒ»¹Û¸ÐÀ´Ëµ
µÍλֵС£¬¾ÍÓ¦¸Ã·ÅÔÚÄÚ´æµØַСµÄµØ·½£¬Ò²¼´ÄÚ´æµØÖ·µÍλ
·´Ö®£¬¸ßλֵ¾ÍÓ¦¸Ã·ÅÔÚÄÚ´æµØÖ·´óµÄµØ·½£¬Ò²¼´ÄÚ´æµØÖ·¸ßλ
BE big-endian
×îÖ±¹ÛµÄ×Ö½ÚÐò
µØÖ·µÍλ´æ´¢ÖµµÄ¸ßλ
µØÖ·¸ßλ´æ´¢ÖµµÄµÍλ
Ϊʲô˵ֱ¹Û£¬²»Òª¿¼ÂǶÔÓ¦¹Øϵ
Ö»ÐèÒª°ÑÄÚ´æµØÖ·´Ó×óµ½ÓÒ°´ÕÕÓɵ͵½¸ßµÄ˳Ðòд³ö
°ÑÖµ°´ÕÕͨ³£µÄ¸ßλµ½µÍλµ ......

CµÄ18¸ö¾­µäÎÊÌâ¡£

1.ÕâÑùµÄ³õʼ»¯ÓÐʲôÎÊÌ⣿char *p = malloc(10); ±àÒëÆ÷Ìáʾ“·Ç·¨³õʼʽ” ÔÆÔÆ¡£
´ð:Õâ¸öÉùÃ÷ÊǾ²Ì¬»ò·Ç¾Ö
²¿±äÁ¿Â𣿺¯Êýµ÷ÓÃÖ»ÄܳöÏÖÔÚ×Ô¶¯±äÁ¿(¼´¾Ö²¿·Ç¾²Ì¬±äÁ¿) µÄ³õʼʽÖС£
ÒòΪ¾²Ì¬±äÁ¿µÄµØÖ·±ØÐëÔÚ±àÒëµÄ¹ý³ÌÖоÍÈ·¶¨ÏÂÀ´¶ømalloc()Éê
ÇëµÄÄÚ´æµØÖ·ÊÇÔÚÔËÐÐʱȷ¶¨µÄ¡£
2. *p++ ×ÔÔöp »¹ÊÇp ËùÖ¸ÏòµÄ±äÁ¿?
´ð:ºó׺++ ºÍ--
²Ù×÷·û±¾ÖÊÉϱÈǰ׺һĿ²Ù×÷µÄÓÅÏȼ¶¸ß, Òò´Ë*p++ ºÍ*(p++) µÈ¼Û, Ëü×ÔÔöp ²¢·µ»Øp ×ÔÔö֮ǰËùÖ¸ÏòµÄÖµ¡£
Òª×ÔÔöp
Ö¸ÏòµÄÖµ, ʹÓÃ(*p)++, Èç¹û¸±×÷ÓõÄ˳ÐòÎ޹ؽôÒªÒ²¿ÉÒÔʹÓÃ++*p¡£
3 ÎÒÓÐÒ»¸öchar * ÐÍÖ¸ÕëÕýÇÉÖ¸ÏòһЩint
ÐͱäÁ¿, ÎÒÏëÌø¹ýËüÃÇ¡£ÎªÊ²Ã´ÈçϵĴúÂë((int *)p)++; ²»ÐÐ?
´ð:ÔÚC ÓïÑÔÖÐ,
ÀàÐÍת»»Òâζ×Å“°ÑÕâЩ¶þ½øÖÆλ¿´×÷ÁíÒ»ÖÖÀàÐÍ, ²¢×÷ÏàÓ¦µÄ¶Ô´ý”; ÕâÊÇÒ»¸öת»»²Ù×÷·û, 
¸ù¾Ý¶¨ÒåËüÖ»ÄÜÉú³ÉÒ»¸öÓÒÖµ(rvalue)¡£
¶øÓÒÖµ¼È²»Äܸ³Öµ, Ò²²»ÄÜÓÃ++ ×ÔÔö¡£(Èç¹û±àÒëÆ÷Ö§³ÖÕâÑùµÄÀ©Õ¹, 
ÄÇҪôÊÇÒ»¸ö´íÎó, ҪôÊÇÓÐÒâ×÷³öµÄ·Ç±ê×¼À©Õ¹¡£)
Òª´ïµ½ÄãµÄÄ¿µÄ¿ÉÒÔÓÃ:p = (char *)((int *)p + 1);
»òÕß,ÒòΪp ÊÇchar * ÐÍ, Ö±½ÓÓÃp +=
sizeof(int);
4.¿ÕÖ¸ÕëºÍδ³õʼ»¯µ ......

Beautify your c/c++ source code

http://uncrustify.sourceforge.net/
Ident code, aligning on parens, assignments, etc
Align on '=' and variable definitions
Align structure initializers
Align #define stuff
Align backslash-newline stuff
Reformat comments (a little bit)
Fix inter-character spacing
Add or remove parens on return statements
Add or remove braces on single-statement if/do/while/for statements
Supports embedded SQL 'EXEC SQL' stuff
Highly configurable - 385 configurable options as of version 0.56
Output :
const char *token_names[] =
{
[CT_POUND] = "POUND",
[CT_PREPROC] = "PREPROC",
[CT_PREPROC_BODY] = "PREPROC_BODY",
[CT_PP] = "PP",
};
int main(int argc, char *argv[])
{
struct junk a[] =
{
{ "version", 0, 0, 0 },
{ "file", 1, 150, 'f' },
{ "config", 1, 0, 'c' },
{ "parsed", 25, 0, 'p' },
{ NULL, 0, 0, 0 }
};
}
color_t colors[] =
{
{ "red", { 255, 0, 0 } }, { "blue", { 0 ......

Beautify your c/c++ source code

http://uncrustify.sourceforge.net/
Ident code, aligning on parens, assignments, etc
Align on '=' and variable definitions
Align structure initializers
Align #define stuff
Align backslash-newline stuff
Reformat comments (a little bit)
Fix inter-character spacing
Add or remove parens on return statements
Add or remove braces on single-statement if/do/while/for statements
Supports embedded SQL 'EXEC SQL' stuff
Highly configurable - 385 configurable options as of version 0.56
Output :
const char *token_names[] =
{
[CT_POUND] = "POUND",
[CT_PREPROC] = "PREPROC",
[CT_PREPROC_BODY] = "PREPROC_BODY",
[CT_PP] = "PP",
};
int main(int argc, char *argv[])
{
struct junk a[] =
{
{ "version", 0, 0, 0 },
{ "file", 1, 150, 'f' },
{ "config", 1, 0, 'c' },
{ "parsed", 25, 0, 'p' },
{ NULL, 0, 0, 0 }
};
}
color_t colors[] =
{
{ "red", { 255, 0, 0 } }, { "blue", { 0 ......

C±à³Ì¾«´â

¹æÔò»ò½¨Ò顣ÿÌõ×¼Ôò¶¼ÓÐÀýÍâ
1£¬¼ÙÏëµÄ±àÒë³ÌÐò
ʹÓñàÒë³ÌÐòËùÓеĿÉÑ¡¾¯¸æÉèÊ©
ʹÓÃlintÀ´²é³ö±àÒë³ÌÐò©µôµÄ´íÎó
Èç¹ûÓе¥Ôª²âÊÔ£¬¾Í½øÐе¥Ôª²âÊÔ
2£¬×Ô¼ºÉè¼Æ²¢Ê¹ÓöÏÑÔ
¼ÈҪά»¤³ÌÐòµÄ½»¸¶°æ±¾£¬ÓÖҪά»¤³ÌÐòµÄµ÷ÊÔ°æ±¾
ҪʹÓöÏÑÔ¶Ôº¯Êý²ÎÊý½øÐÐÈ·ÈÏ
Òª´Ó³ÌÐòÖÐɾȥÎÞ¶¨ÒåµÄÌØÐÔ£¬»òÕßÔÚ³ÌÐòÖÐʹÓöÏÑÔÀ´¼ì²é³öÎÞ¶¨ÒåÌØÐԵķǷ¨Ê¹ÓÃ
²»ÒªÀ˷ѱðÈ˵Äʱ¼ä-Ïêϸ˵Ã÷²»Çå³þµÄ¶ÏÑÔ
Ïû³ýËù×öµÄÒþʽ¼Ù¶¨£¬»òÕßÀûÓöÏÑÔ¼ì²éÆäÕýÈ·ÐÔ
ÀûÓöÏÑÔÀ´¼ì²é²»¿ÉÄÜ·¢ÉúµÄÇé¿ö
ÔÚ½øÐзÀ´íÐÔ³ÌÐòÉè¼Æʱ£¬²»ÒªÒþÂ÷´íÎó
ÒªÀûÓò»Í¬µÄËã·¨¶Ô³ÌÐòµÄ½á¹û½øÐÐÈ·ÈÏ
²»ÒªµÈ´ý´íÎó·¢Éú£¬ÒªÊ¹Óóõʼ¼ì²é³ÌÐò
3£¬Îª×ÓϵͳÉè·À ......
×ܼǼÊý:2015; ×ÜÒ³Êý:336; ÿҳ6 Ìõ; Ê×Ò³ ÉÏÒ»Ò³ [2] [3] [4] [5] 6 [7] [8] [9] [10] [11]  ÏÂÒ»Ò³ βҳ
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ