1、计算机软件著作权登记源代码范本计算机软件著作权登记-源代码范本 注意事项:常见的源代码包含:C语言,VB,C+,JAVA,.NET等。 提交的代码必须是源代码的开头载入程序,第30页必须断开,第60页是软件的程序结尾,代码中不得出现与申请表内容不符合的日期,著作权人,软件名字等,不能出现开源代码,不能出现任何版权纠纷。格式要求:一、源代码应提交前、后各连续30页,不足60页的,应当全部提交。二、源代码页眉应标注软件的名称和版本号,应当与申请表中名称完全一致,页眉右上应标注页码,源代码每页不少于50行。范例如下:#include #include #include #include #inclu
2、de #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define NS_MAIN 1#include #endif#ifdef DLZ#include #endifstatic tybs_boolean_t want_stats = TYBS_FALSE;static char program_nameTYBS_DIR_NAMEMAX = named;static char absolut
3、e_conffileTYBS_DIR_PATHMAX;static char saved_command_line512;static char version512;static unsigned int maxsocks = 0;voidns_main_earlywarning(const char *format, .) va_list args; va_start(args, format); if (ns_g_lctx != NULL) tybs_log_vwrite(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS
4、_LOG_WARNING, format, args); else fprintf(stderr, %s: , program_name); vfprintf(stderr, format, args); fprintf(stderr, n); fflush(stderr); va_end(args);Void ns_main_earlyfatal(const char *format, .) va_list args; va_start(args, format); if (ns_g_lctx != NULL) tybs_log_vwrite(ns_g_lctx, NS_LOGCATEGOR
5、Y_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, format, args); tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, exiting (due to early fatal error); else fprintf(stderr, %s: , program_name); vfprintf(stderr, format, args); fprintf(stderr, n); fflush(stderr); va
6、_end(args); exit(1);static voidassertion_failed(const char *file, int line, tybs_assertiontype_t type, const char *cond) if (ns_g_lctx != NULL) tybs_assertion_setcallback(NULL); tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, %s:%d: %s(%s) failed, file, line,
7、tybs_assertion_typetotext(type), cond); tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, exiting (due to assertion failure); else fprintf(stderr, %s:%d: %s(%s) failedn, file, line, tybs_assertion_typetotext(type), cond); fflush(stderr); if (ns_g_coreok) abort()
8、; exit(1);static voidlibrary_fatal_error(const char *file, int line, const char *format, va_list args) TYBS_FORMAT_PRINTF(3, 0);static voidlibrary_fatal_error(const char *file, int line, const char *format, va_list args) if (ns_g_lctx != NULL) tybs_error_setfatal(NULL); tybs_log_write(ns_g_lctx, NS_
9、LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, %s:%d: fatal error:, file, line); tybs_log_vwrite(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, format, args); tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_CRITICAL, exiting (due to
10、 fatal error in library); else fprintf(stderr, %s:%d: fatal error: , file, line); vfprintf(stderr, format, args); fprintf(stderr, n); fflush(stderr); if (ns_g_coreok) abort(); exit(1);static voidlibrary_unexpected_error(const char *file, int line, const char *format, va_list args) TYBS_FORMAT_PRINTF
11、(3, 0);static voidlibrary_unexpected_error(const char *file, int line, const char *format, va_list args) if (ns_g_lctx != NULL) tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_ERROR, %s:%d: unexpected error:, file, line); tybs_log_vwrite(ns_g_lctx, NS_LOGCATEGORY_GENERA
12、L, NS_LOGMODULE_MAIN, TYBS_LOG_ERROR, format, args); else fprintf(stderr, %s:%d: fatal error: , file, line); vfprintf(stderr, format, args); fprintf(stderr, n); fflush(stderr); static voidlwresd_usage(void) fprintf(stderr, usage: lwresd -4|-6 -c conffile | -C resolvconffile -d debugleveln -f|-g -n n
13、umber_of_cpus -p port -P listen-port -sn -t chrootdir -u username -i pidfilen -m usage|trace|record|size|mctxn);static voidusage(void) if (ns_g_lwresdonly) lwresd_usage(); return; fprintf(stderr, usage: named -4|-6 -c conffile -d debuglevel -f|-g -n number_of_cpusn -p port -s -t chrootdir -u usernam
14、en -m usage|trace|record|size|mctxn);static voidsave_command_line(int argc, char *argv) int i; char *src; char *dst; char *eob; const char truncated = .; tybs_boolean_t quoted = TYBS_FALSE; dst = saved_command_line; eob = saved_command_line + sizeof(saved_command_line); for (i = 1; i argc & dst eob;
15、 i+) *dst+ = ; src = argvi; while (*src != 0 & dst = sizeof(truncated); if (dst = eob) strcpy(eob - sizeof(truncated), truncated); else *dst = 0;static intparse_int(char *arg, const char *desc) char *endp; int tmp; long int ltmp; ltmp = strtol(arg, &endp, 10); tmp = (int) ltmp; if (*endp != 0) ns_ma
16、in_earlyfatal(%s %s must be numeric, desc, arg); if (tmp name != NULL; def+) if (arglen = (int)strlen(def-name) & memcmp(arg, def-name, arglen) = 0) *ret |= def-value; goto found; ns_main_earlyfatal(unrecognized flag %.*s, arglen, arg); found: if (*end = 0) break; arg = end + 1; static voidparse_com
17、mand_line(int argc, char *argv) int ch; int port; tybs_boolean_t disable6 = TYBS_FALSE; tybs_boolean_t disable4 = TYBS_FALSE; save_command_line(argc, argv); tybs_commandline_errprint = TYBS_FALSE; while (ch = tybs_commandline_parse(argc, argv, 46c:C:d:fgi:lm:n:N:p:P: sS:t:T:u:vVx:) != -1) switch (ch
18、) case 4: if (disable4) ns_main_earlyfatal(cannot specify -4 and -6); if (tybs_net_probeipv4() != TYBS_R_SUCCESS) ns_main_earlyfatal(IPv4 not supported by OS); tybs_net_disableipv6(); disable6 = TYBS_TRUE; break; case 6: if (disable6) ns_main_earlyfatal(cannot specify -4 and -6); if (tybs_net_probei
19、pv6() != TYBS_R_SUCCESS) ns_main_earlyfatal(IPv6 not supported by OS); tybs_net_disableipv4(); disable4 = TYBS_TRUE; break; case c: ns_g_conffile = tybs_commandline_argument; lwresd_g_conffile = tybs_commandline_argument; if (lwresd_g_useresolvconf) ns_main_earlyfatal(cannot specify -c and -C); ns_g
20、_conffileset = TYBS_TRUE; break; case C: lwresd_g_resolvconffile = tybs_commandline_argument; if (ns_g_conffileset) ns_main_earlyfatal(cannot specify -c and -C); lwresd_g_useresolvconf = TYBS_TRUE; break; case d: ns_g_debuglevel = parse_int(tybs_commandline_argument, debug level); break; case f: ns_
21、g_foreground = TYBS_TRUE; break; case g: ns_g_foreground = TYBS_TRUE; ns_g_logstderr = TYBS_TRUE; break; /* XXXBEW -i should be removed */ case i: lwresd_g_defaultpidfile = tybs_commandline_argument; break; case l: ns_g_lwresdonly = TYBS_TRUE; break; case m: set_flags(tybs_commandline_argument, mem_
22、debug_flags, &tybs_mem_debugging); break; case N: /* Deprecated. */ case n: ns_g_cpus = parse_int(tybs_commandline_argument, number of cpus); if (ns_g_cpus = 0) ns_g_cpus = 1; break; case p: port = parse_int(tybs_commandline_argument, port); if (port 65535) ns_main_earlyfatal(port %s out of range, t
23、ybs_commandline_argument); ns_g_port = port; break; /* XXXBEW Should -P be removed? */ case P: port = parse_int(tybs_commandline_argument, port); if (port 65535) ns_main_earlyfatal(port %s out of range, tybs_commandline_argument); lwresd_g_listenport = port; break; case s: want_stats = TYBS_TRUE; br
24、eak; case S: maxsocks = parse_int(tybs_commandline_argument, max number of sockets); break; case t: ns_g_chrootdir = tybs_commandline_argument; break; case T: if (strcmp(tybs_commandline_argument, clienttest) = 0) ns_g_clienttest = TYBS_TRUE; else fprintf(stderr, unknown -T flag %sn, tybs_commandline_argument); break; case u: ns_g_username = tybs_commandline_argument; break; case v: printf(BIND %sn, ns_g_version); exit(0); case V: printf(BIND %s built with %sn
copyright@ 2008-2023 冰点文库 网站版权所有
经营许可证编号:鄂ICP备19020893号-2