软件著作权-源代码范本注意事项:常见的源代码包含:C语言,VB,C++,JAVA,.NET等。
提交的代码必须是源代码的开头载入程序,第30页必须断开,第60页是软件的程序结尾,代码中不得出现与申请表内容不符合的日期,著作权人,软件名字等,不能出现开源代码,不能出现任何版权纠纷。
格式要求:一、源代码应提交前、后各连续30页,不足60页的,应当全部提交。
、源代码页眉应标注软件的名称和版本号,应当与申请表中名称完全一致,页眉右上应标注页码,源代码每页不少于50行。
范例如下:#i nclude <tybs/comma ndli ne.h> #in elude <tybs/dir.h> #i nclude <tybs/e ntropy.h> #in elude <tybs/file.h>#in elude <tybs/hash.h> #i nclude <tybs/os.h> #i nclude <tybs/platform.h> #i nclude <tybs/resouree.h> #i nclude <tybs/stdio.h> #in clude <tybs/stri ng.h> #in clude <tybs/task.h> #in clude <tybs/timer.h> #in clude <tybs/util.h> #in clude <tybscc/result.h> #in clude <dn s/dispatch.h> #in clude <dns/n ame.h> #in clude <dn s/result.h> #in clude <dn s/view.h> #in clude <dst/result.h>#defi ne NS_MAIN 1#i nclude <n amed/ns_smf_globals.h> #en dif#ifdef DLZ#in clude <dlz/dlz_drivers.h>#en difstatic tybs_boolean_t wan t_stats = TYBS_FALSE;static charstatic charstatic charstatic charstatic un sig ned program_ name[TYBS_DIR_NAMEMAX] = "n amed";absolute_co nffile[TYBS_DIR_PATHMAX];saved_comma nd_li ne[512];versio n[512];maxsocks = 0;n s_ma in _earlywar nin g(c onst char *format, ...) {va_list args; va_start(args, format); if (ns_g」ctx != NULL) { tybs_log_vwrite( ns_g」ctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_W ARNING, format, args);} else {fprin tf(stderr, "%s: ", program_ name);vfprin tf(stderr, format, args);fprin tf(stderr, "\n");fflush(stderr);}va_e nd(args);}Void n s_ma in _earlyfatal(c onst char *format, ...) {va_list args; va_start(args, format);if (ns_g」ctx != NULL) {tybs_log_vwrite( ns_g」ctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, format, args);tybs_log_write( ns_g」ctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, "exit ing (due to early fatal error)");} else {fprin tf(stderr, "%s: ", program, name);vfprin tf(stderr, format, args);fprin tf(stderr, "\n"); fflush(stderr);}va_e nd(args);exit(1);}static voidassert ion _failed(c onst char *file, in t li ne, tybs_assert ion type_t type,const char *cond){if (ns_g」ctx != NULL) {tybs_assert ion _setcallback(NULL); tybs_log_write( ns_g」ctx, NS_LOGCATEGORY_GENERAL,NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, "%s:%d: %s(%s) failed", file, li ne, tybs_assertion _typetotext(type), con d); tybs_log_write( ns_g」ctx, NS_LOGCATEGORY_GENERAL,NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, "exit ing (due to asserti on failure)");} else {fprin tf(stderr, "%s:%d: %s(%s) failed\n",file, li ne, tybs_assert ion _typetotext(type), con d); fflush(stderr);}if (n s_g_coreok)abort();exit(1);}static voidlibrary_fatal_error(c onst char *file, i nt li ne, const char *format,va_list args) TYBS_FORMAT_PRINTF(3, 0);static voidlibrary_fatal_error(c onst char *file, i nt li ne, const char *format,va_list args){if (ns_g」ctx != NULL) {tybs_error_setfatal(NULL); tybs_log_write( ns_g」ctx, NS_LOGCATEGORY_GENERAL,NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, "%s:%d: fatal error:", file, li ne);tybs_log_vwrite( ns_g」ctx, NS_LOGCATEGORY_GENERAL,NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, format, args);tybs_log_write( ns_g」ctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, "exit ing (due to fatal error in library)");} else {fprintf(stderr, "%s:%d: fatal error: ", file, line);vfprin tf(stderr, format, args);fprin tf(stderr, "\n");fflush(stderr);}if (n s_g_coreok)abort();exit(1);}static voidlibrary_ un expected_error(c onst char *file, i nt li ne, const char *format, va_list args)TYBS_FORMAT_PRINTF(3, 0);static voidlibrary_ un expected_error(c onst char *file, i nt li ne, const char *format, va_list args){if (ns_g」ctx != NULL) {tybs_log_write( ns_g」ctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_ERROR, "%s:%d: un expected error:", file, li ne);tybs_log_vwrite( ns_g」ctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_ERROR, format, args);} else {fprin tf(stderr, "%s:%d: fatal error: ", file, li ne);vfprin tf(stderr, format, args);fprin tf(stderr, "\n");fflush(stderr);}}static voidlwresd_usage(void) {fprin tf(stderr,"usage: lwresd 卜4卜6] [-c con ffile | -C resolvco nffile]""[-d debuglevel]\n"" [-f|-g] [_n n umber_of_cpus] [_p port]""[-P liste n-port] [-s]\n"" [-t chrootdir] [-u user name] [-i pidfile]\n"" [-m {usage|trace|record|size|mctx}]\n");}static voidusage(void) {if (n s_g_lwresdo nly) {lwresd_usage();return;}fprin tf(stderr,"usage: named 卜4卜6] [-c con ffile] [-d debuglevel]""[-f|-g] [_n nu mber_of_cpus]\n"" [-p port] [-s] [-t chrootdir] [-u user name]' n"" [-m {usage|trace|record|size|mctx}]\n");}static voidsave_comma nd」in e(i nt argc, char *argv[]) {int i;char *src;char *dst;char *eob;const char trun cated[]="...";tybs_boolean_t quoted = TYBS_FALSE;dst = saved_comma nd_li ne;eob = saved_comma nd_li ne + sizeof(saved_comma nd_li ne);for (i = 1; i < argc && dst < eob; i++) {*dst++ ='';src = argv[i];while (*src != '\0' && dst < eob) {if (quoted || isal nu m(*src & Oxff) ||*src == '-' || *src == '_' ||*src == '.' || *src == '/') {*dst++ = *src++;quoted = TYBS_FALSE;} else {*dst++ = '\\';quoted = TYBS_TRUE;}}}INSIST(sizeof(saved_comma nd_li ne) >= sizeof(tr un cated)); if (dst == eob)strcpy(eob - sizeof(tr un cated), trun cated);else*dst = '\0';}static intparse_ in t(char *arg, const char *desc) {char *en dp;int tmp;long int ltmp;ltmp = strtol(arg, &en dp, 10);tmp = (int) ltmp;if (*en dp != '\0')n s_ma in _earlyfatal("%s '%s' must be nu meric", desc, arg); if (tmp < 0 || tmp != ltmp) n s_ma in _earlyfatal("%s '%s' out of ran ge", desc, arg);。