亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? style-guide.txt

?? 手機嵌入式Linux下可用的busybox源碼
?? TXT
?? 第 1 頁 / 共 2 頁
字號:
		ret = my_func(bar, baz);		if (!ret)			return -1;		#ifdef BB_FEATURE_FUNKY			maybe_do_funky_stuff(bar, baz);		#endif	Do this instead:	(in .h header file)		#ifdef BB_FEATURE_FUNKY		static inline void maybe_do_funky_stuff (int bar, int baz)		{			/* lotsa code in here */		}		#else		static inline void maybe_do_funky_stuff (int bar, int baz) {}		#endif	(in the .c source file)		ret = my_func(bar, baz);		if (!ret)			return -1;		maybe_do_funky_stuff(bar, baz);The great thing about this approach is that the compiler will optimize awaythe "no-op" case (the empty function) when the feature is turned off.Note also the use of the word 'maybe' in the function name to indicateconditional execution.Notes on Strings----------------Strings in C can get a little thorny. Here's some guidelines for dealing withstrings in Busybox. (There is surely more that could be added to thissection.)String Files~~~~~~~~~~~~Put all help/usage messages in usage.c. Put other strings in messages.c.Putting these strings into their own file is a calculated decision designed toconfine spelling errors to a single place and aid internationalizationefforts, if needed. (Side Note: we might want to use a single file - maybecalled 'strings.c' - instead of two, food for thought).Testing String Equivalence~~~~~~~~~~~~~~~~~~~~~~~~~~There's a right way and a wrong way to test for sting equivalence withstrcmp():	The wrong way:		if (!strcmp(string, "foo")) {			...	The right way:		if (strcmp(string, "foo") == 0){			...The use of the "equals" (==) operator in the latter example makes it much moreobvious that you are testing for equivalence. The former example with the"not" (!) operator makes it look like you are testing for an error. In a moreperfect world, we would have a streq() function in the string library, butthat ain't the world we're living in.Avoid Dangerous String Functions~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Unfortunately, the way C handles strings makes them prone to overruns whencertain library functions are (mis)used. The following table  offers a summaryof some of the more notorious troublemakers:function     overflows         preferred----------------------------------------strcpy       dest string       strncpystrcat       dest string       strncatgets         string it gets    fgetsgetwd        buf string        getcwd[v]sprintf   str buffer        [v]snprintfrealpath     path buffer       use with pathconf[vf]scanf    its arguments     just avoid itThe above is by no means a complete list. Be careful out there.Avoid Big Static Buffers------------------------First, some background to put this discussion in context: Static buffers looklike this in code:	/* in a .c file outside any functions */	static char *buffer[BUFSIZ]; /* happily used by any function in this file,	                                but ick! big! */The problem with these is that any time any busybox app is run, you pay amemory penalty for this buffer, even if the applet that uses said buffer isnot run. This can be fixed, thusly:	static char *buffer;	...	other_func()	{		strcpy(buffer, lotsa_chars); /* happily uses global *buffer */	...	foo_main()	{		buffer = xmalloc(sizeof(char)*BUFSIZ);	...However, this approach trades bss segment for text segment. Rather thanmallocing the buffers (and thus growing the text size), buffers can bedeclared on the stack in the *_main() function and made available globally byassigning them to a global pointer thusly:	static char *pbuffer;	...	other_func()	{		strcpy(pbuffer, lotsa_chars); /* happily uses global *pbuffer */	...	foo_main()	{		char *buffer[BUFSIZ]; /* declared locally, on stack */		pbuffer = buffer;     /* but available globally */	...This last approach has some advantages (low code size, space not used untilit's needed), but can be a problem in some low resource machines that havevery limited stack space (e.g., uCLinux).A macro is declared in busybox.h that implements compile-time selectionbetween xmalloc() and stack creation, so you can code the line in question as		RESERVE_BB_BUFFER(buffer, BUFSIZ);and the right thing will happen, based on your configuration.Miscellaneous Coding Guidelines-------------------------------The following are important items that don't fit into any of the abovesections.Model Busybox Applets After GNU Counterparts~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~When in doubt about the proper behavior of a Busybox program (output,formatting, options, etc.), model it after the equivalent GNU program.Doesn't matter how that program behaves on some other flavor of *NIX; doesn'tmatter what the POSIX standard says or doesn't say, just model Busyboxprograms after their GNU counterparts and it will make life easier on (nearly)everyone.The only time we deviate from emulating the GNU behavior is when:	- We are deliberately not supporting a feature (such as a command line	  switch)	- Emulating the GNU behavior is prohibitively expensive (lots more code	  would be required, lots more memory would be used, etc.)	- The difference is minor or cosmeticA note on the 'cosmetic' case: Output differences might be consideredcosmetic, but if the output is significant enough to break other scripts thatuse the output, it should really be fixed.Scope~~~~~If a const variable is used only in a single source file, put it in the sourcefile and not in a header file. Likewise, if a const variable is used in onlyone function, do not make it global to the file. Instead, declare it insidethe function body. Bottom line: Make a conscious effort to limit declarationsto the smallest scope possible.Inside applet files, all functions should be declared static so as to keep theglobal name space clean. The only exception to this rule is the "applet_main"function which must be declared extern.If you write a function that performs a task that could be useful outside theimmediate file, turn it into a general-purpose function with no ties to anyapplet and put it in the utility.c file instead.Brackets Are Your Friends~~~~~~~~~~~~~~~~~~~~~~~~~Please use brackets on all if and else statements, even if it is only oneline. Example:	Don't do this:		if (foo)			stmt1;		stmt2		stmt3;	Do this instead:		if (foo) {			stmt1;		}		stmt2		stmt3;The "bracketless" approach is error prone because someday you might add a linelike this:		if (foo)			stmt1;			new_line();		stmt2		stmt3;And the resulting behavior of your program would totally bewilder you. (Don'tlaugh, it happens to us all.) Remember folks, this is C, not Python.Function Declarations~~~~~~~~~~~~~~~~~~~~~Do not use old-style function declarations that declare variable types betweenthe parameter list and opening bracket. Example:	Don't do this:		int foo(parm1, parm2)			char parm1;			float parm2;		{			....	Do this instead:		int foo(char parm1, float parm2)		{			....The only time you would ever need to use the old declaration syntax is tosupport ancient, antediluvian compilers. To our good fortune, we have accessto more modern compilers and the old declaration syntax is neither necessarynor desired.Emphasizing Logical Blocks~~~~~~~~~~~~~~~~~~~~~~~~~~Organization and readability are improved by putting extra newlines aroundblocks of code that perform a single task. These are typically blocks thatbegin with a C keyword, but not always.Furthermore, you should put a single comment (not necessarily one line, justone comment) before the block, rather than commenting each and every line.There is an optimal ammount of commenting that a program can have; you cancomment too much as well as too little.A picture is really worth a thousand words here, the following exampleillustrates how to emphasize logical blocks:	while (line = get_line_from_file(fp)) {		/* eat the newline, if any */		chomp(line);		/* ignore blank lines */		if (strlen(file_to_act_on) == 0) {			continue;		}		/* if the search string is in this line, print it,		 * unless we were told to be quiet */		if (strstr(line, search) && !be_quiet) {			puts(line);		}		/* clean up */		free(line);	}Processing Options with getopt~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~If your applet needs to process  command-line switches, please use getopt() todo so. Numerous examples can be seen in many of the existing applets, butbasically it boils down to two things: at the top of the .c file, have thisline in the midst of your #includes:	#include <getopt.h>And a code block similar to the following near the top of your applet_main()routine:    while ((opt = getopt(argc, argv, "abc")) > 0) {             switch (opt) {            case 'a':                do_a_opt = 1;                break;            case 'b':                do_b_opt = 1;                break;            case 'c':                do_c_opt = 1;                break;            default:                show_usage();    /* in utility.c */            }    }If your applet takes no options (such as 'init'), there should be a linesomewhere in the file reads:	/* no options, no getopt */That way, when people go grepping to see which applets need to be converted touse getopt, they won't get false positives.Additional Note: Do not use the getopt_long library function and do not try tohand-roll your own long option parsing. Busybox applets should only supportshort options. Explanations and examples of the short options should bedocumented in usage.h.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区三区99| 日韩欧美三级在线| 欧美美女激情18p| 日韩欧美激情在线| 国产清纯白嫩初高生在线观看91| 国产免费观看久久| 一区二区激情小说| 麻豆91在线播放| jvid福利写真一区二区三区| 欧美亚洲禁片免费| 日韩视频国产视频| 一区精品在线播放| 日韩精品亚洲专区| 国产精品一级黄| 色网综合在线观看| 精品国产乱码久久久久久夜甘婷婷| 国产精品看片你懂得| 日韩制服丝袜先锋影音| 丁香亚洲综合激情啪啪综合| 欧美二区在线观看| 中文字幕av在线一区二区三区| 亚洲一区在线观看网站| 国产一区二区日韩精品| 一本到高清视频免费精品| 日韩精品综合一本久道在线视频| 亚洲女厕所小便bbb| 久久国产精品99精品国产| 91同城在线观看| 欧美精品一区二区三区蜜桃| 国产精品久久一级| 日韩av电影免费观看高清完整版| 成人午夜视频福利| 91精品国产乱码| 亚洲精品国产视频| 极品销魂美女一区二区三区| 欧美日韩国产美女| 国产精品国产三级国产| 久久精品av麻豆的观看方式| 精品视频免费看| 国产精品久久久久久久久免费樱桃 | 欧美xxxxxxxx| 亚洲一区二区偷拍精品| a美女胸又www黄视频久久| 欧美tk—视频vk| 五月综合激情网| 91久色porny | 欧美日韩午夜影院| 亚洲人午夜精品天堂一二香蕉| 激情五月播播久久久精品| 欧美丰满一区二区免费视频| 一区二区在线观看免费视频播放| 国产在线观看一区二区| 欧美一卡二卡在线| 亚洲午夜在线观看视频在线| 99精品视频免费在线观看| 国产亚洲欧美日韩日本| 极品瑜伽女神91| 日韩精品一区二区三区在线| 午夜精品久久久| 91成人在线精品| 亚洲视频一区二区免费在线观看| 国产999精品久久久久久绿帽| 精品国产百合女同互慰| 久久99热狠狠色一区二区| 欧美精品成人一区二区三区四区| 亚洲一区二区综合| 在线免费观看视频一区| 亚洲激情综合网| 色综合激情久久| 一区二区三区在线观看网站| 91欧美一区二区| 亚洲少妇屁股交4| 成人黄色网址在线观看| 国产欧美日韩三区| 国产丶欧美丶日本不卡视频| 欧美国产日韩亚洲一区| 成人午夜视频免费看| 中文字幕中文字幕一区二区| av中文字幕一区| 亚洲欧美福利一区二区| 91污在线观看| 亚洲高清不卡在线观看| 欧美精品久久天天躁| 美女高潮久久久| www国产成人| 成人激情小说乱人伦| 国产精品不卡一区| 欧洲日韩一区二区三区| 午夜精品一区二区三区电影天堂 | 亚洲女人****多毛耸耸8| 日本丶国产丶欧美色综合| 亚洲精选一二三| 欧美视频日韩视频在线观看| 日韩高清不卡一区二区| 日韩色在线观看| 国产精品综合久久| 国产精品久久网站| 在线亚洲高清视频| 日韩高清在线观看| 久久色.com| 99久久精品国产观看| 亚洲一区二区视频| 欧美大片在线观看| 国产黑丝在线一区二区三区| 中文字幕制服丝袜成人av| 91蝌蚪porny| 日本vs亚洲vs韩国一区三区| xfplay精品久久| av亚洲精华国产精华精华| 一区二区激情小说| 欧美xfplay| 99国产精品视频免费观看| 亚洲成人一区在线| 久久嫩草精品久久久精品| 色综合久久综合网97色综合| 奇米色一区二区| 中文字幕久久午夜不卡| 欧美视频一区二区三区在线观看 | 久久久久97国产精华液好用吗| youjizz国产精品| 五月天丁香久久| 国产色综合一区| 欧美亚男人的天堂| 国产在线视视频有精品| 亚洲免费三区一区二区| 日韩午夜电影在线观看| 成人av在线看| 毛片一区二区三区| 亚洲日本中文字幕区| 日韩一级黄色片| 99麻豆久久久国产精品免费| 日韩高清不卡一区二区| 中文字幕日韩欧美一区二区三区| 欧美精品在欧美一区二区少妇| 国产九色sp调教91| 婷婷综合在线观看| 国产精品久久午夜夜伦鲁鲁| 日韩欧美黄色影院| 91久久精品一区二区三区| 国内精品在线播放| 亚洲国产精品尤物yw在线观看| 国产日韩欧美精品一区| 欧美日韩一区高清| 懂色中文一区二区在线播放| 日韩1区2区3区| 1区2区3区欧美| 欧美成人艳星乳罩| 欧美中文字幕亚洲一区二区va在线| 国产综合成人久久大片91| 亚洲风情在线资源站| 国产精品二区一区二区aⅴ污介绍| 欧美一区二区三区播放老司机| 99久久精品国产一区二区三区| 久久精品国产一区二区三区免费看| 亚洲影视资源网| 国产精品久久久久影院| 久久影院午夜论| 日韩午夜激情av| 欧美日韩国产区一| 91福利小视频| 91亚洲大成网污www| 高清在线观看日韩| 韩日欧美一区二区三区| 日韩高清一区二区| 午夜欧美大尺度福利影院在线看| 综合在线观看色| 中文字幕精品—区二区四季| 久久久国产精品麻豆| 精品sm捆绑视频| 欧美一二三四在线| 欧美精品在线视频| 欧美精品v国产精品v日韩精品| 欧美在线免费观看视频| 欧洲一区在线电影| 色天天综合久久久久综合片| 成人精品视频.| 成人中文字幕合集| 国产suv精品一区二区6| 国产一区二区精品在线观看| 黄色成人免费在线| 九一久久久久久| 国内偷窥港台综合视频在线播放| 麻豆精品视频在线观看视频| 日本欧美加勒比视频| 天堂久久久久va久久久久| 亚洲mv大片欧洲mv大片精品| 亚洲成人动漫av| 视频一区在线视频| 秋霞影院一区二区| 麻豆久久久久久久| 精彩视频一区二区三区| 国产一区二区91| 成人综合在线网站| 99久久er热在这里只有精品15 | 亚洲丝袜自拍清纯另类| 亚洲裸体xxx| 亚洲国产成人av| 毛片av中文字幕一区二区| 精品一区二区三区香蕉蜜桃| 国精产品一区一区三区mba视频|