收藏 分销(赏)

计算机软件著作权登记-源代码范本.doc

上传人:丰**** 文档编号:4109861 上传时间:2024-07-30 格式:DOC 页数:60 大小:285.01KB
下载 相关 举报
计算机软件著作权登记-源代码范本.doc_第1页
第1页 / 共60页
计算机软件著作权登记-源代码范本.doc_第2页
第2页 / 共60页
计算机软件著作权登记-源代码范本.doc_第3页
第3页 / 共60页
计算机软件著作权登记-源代码范本.doc_第4页
第4页 / 共60页
计算机软件著作权登记-源代码范本.doc_第5页
第5页 / 共60页
点击查看更多>>
资源描述

1、60天一博胜企业管理软件V1.0 源代码 计算机软件著作权登记-源代码范本 注意事项:常见的源代码包含:C语言,VB,C+,JAVA,.NET等。 提交的代码必须是源代码的开头载入程序,第30页必须断开,第60页是软件的程序结尾,代码中不得出现与申请表内容不符合的日期,著作权人,软件名字等,不能出现开源代码,不能出现任何版权纠纷。格式要求:一、源代码应提交前、后各连续30页,不足60页的,应当全部提交。二、源代码页眉应标注软件的名称和版本号,应当与申请表中名称完全一致,页眉右上应标注页码,源代码每页不少于50行。范例如下:#include #include #include #include

2、#include #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_twant_stats = TYBS_FALSE;static charprogram_nameTYBS_DIR_NAMEMAX = named;static charabso

3、lute_conffileTYBS_DIR_PATHMAX;static charsaved_command_line512;static charversion512;static unsigned intmaxsocks = 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_L

4、OG_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_LOGCATEGORY_GENERA

5、L, 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_end(args);ex

6、it(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, tybs_assertion_t

7、ypetotext(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();exit(1);static voidl

8、ibrary_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_LOGCATEGORY_GENERAL, NS_

9、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 fatal error in library);

10、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(3, 0);static voidlibrary_unexpe

11、cted_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_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_ERR

12、OR, 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 number_of_cpus -p port -P listen-port -s

13、n -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 usernamen -m usage|trace|record|size|mctxn);stati

14、c 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; i+) *dst+ = ;src = argvi;while (*src != 0 & dst =

15、 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_main_earlyfatal(%s %s must be numeric, desc, arg);if (tmp name !

16、= 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_command_line(int argc, char *argv) int ch;int port;tybs_boolean_t disabl

17、e6 = 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) case 4:if (disable4)ns_main_earlyfatal(cannot specify -4 and -6);if (tybs

18、_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_probeipv6() != TYBS_R_SUCCESS)ns_main_earlyfatal(IPv6 not supported by OS);tybs_net_disablei

19、pv4();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_conffileset = TYBS_TRUE;break;case C:lwresd_g_resolvconffile = tybs_commandline_argument;if (ns

20、_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_g_foreground = TYBS_TRUE;break;case g:ns_g_foreground = TYBS_TRUE;ns_g_logstderr = TYBS_TRUE;break;/* XXXBEW

21、 -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_debug_flags, &tybs_mem_debugging);break;case N: /* Deprecated. */case n:ns_g_cpus = parse_int(tybs_commandline_argument, n

22、umber 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, tybs_commandline_argument);ns_g_port = port;break;/* XXXBEW Should -P be removed? */case P:port = parse_int(tybs_commandline_argument,

23、 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;break;case S:maxsocks = parse_int(tybs_commandline_argument, max number of sockets);break;case t:ns_g_chrootdir = tybs_commandline_argument;break;c

24、ase T:if (strcmp(tybs_commandline_argument, clienttest) = 0)ns_g_clienttest = TYBS_TRUE;elsefprintf(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,

25、ns_g_version,ns_g_configargs);exit(0);case ?:usage();if (tybs_commandline_option = ?)exit(0);ns_main_earlyfatal(unknown option -%c, tybs_commandline_option);default:ns_main_earlyfatal(parsing options returned %d, ch);argc -= tybs_commandline_index;argv += tybs_commandline_index;if (argc 0) usage();n

26、s_main_earlyfatal(extra command line arguments);static tybs_result_tcreate_managers(void) tybs_result_t result;unsigned int socks;#ifdef TYBS_PLATFORM_USETHREADSunsigned int cpus_detected;#endif#ifdef TYBS_PLATFORM_USETHREADScpus_detected = tybs_os_ncpus();if (ns_g_cpus = 0)ns_g_cpus = cpus_detected

27、;tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, TYBS_LOG_INFO, found %u CPU%s, using %u worker thread%s, cpus_detected, cpus_detected = 1 ? : s, ns_g_cpus, ns_g_cpus = 1 ? : s);#elsens_g_cpus = 1;#endifresult = tybs_taskmgr_create(ns_g_mctx, ns_g_cpus, 0, &ns_g_taskmgr);if (r

28、esult != TYBS_R_SUCCESS) UNEXPECTED_ERROR(_FILE_, _LINE_, tybs_taskmgr_create() failed: %s, tybs_result_totext(result);return (TYBS_R_UNEXPECTED);result = tybs_timermgr_create(ns_g_mctx, &ns_g_timermgr);if (result != TYBS_R_SUCCESS) UNEXPECTED_ERROR(_FILE_, _LINE_, tybs_timermgr_create() failed: %s,

29、 tybs_result_totext(result);return (TYBS_R_UNEXPECTED);result = tybs_socketmgr_create2(ns_g_mctx, &ns_g_socketmgr, maxsocks);if (result != TYBS_R_SUCCESS) UNEXPECTED_ERROR(_FILE_, _LINE_, tybs_socketmgr_create() failed: %s, tybs_result_totext(result);return (TYBS_R_UNEXPECTED);result = tybs_socketmg

30、r_getmaxsockets(ns_g_socketmgr, &socks);if (result = TYBS_R_SUCCESS) tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_SERVER, TYBS_LOG_INFO, using up to %u sockets, socks);result = tybs_entropy_create(ns_g_mctx, &ns_g_entropy);if (result != TYBS_R_SUCCESS) UNEXPECTED_ERROR(_FILE_, _LIN

31、E_, tybs_entropy_create() failed: %s, tybs_result_totext(result);return (TYBS_R_UNEXPECTED);result = tybs_hash_create(ns_g_mctx, ns_g_entropy, DNS_NAME_MAXWIRE);if (result != TYBS_R_SUCCESS) UNEXPECTED_ERROR(_FILE_, _LINE_, tybs_hash_create() failed: %s, tybs_result_totext(result);return (TYBS_R_UNE

32、XPECTED);return (TYBS_R_SUCCESS);static voiddestroy_managers(void) ns_lwresd_shutdown();tybs_entropy_detach(&ns_g_entropy);if (ns_g_fallbackentropy != NULL)tybs_entropy_detach(&ns_g_fallbackentropy);tybs_taskmgr_destroy(&ns_g_taskmgr);tybs_timermgr_destroy(&ns_g_timermgr);tybs_socketmgr_destroy(&ns_

33、g_socketmgr);tybs_hash_destroy();static voidsetup(void) tybs_result_t result;#ifdef HAVE_LIBSCFchar *instance = NULL;#endifns_os_inituserinfo(ns_g_username);ns_os_tzset();ns_os_opendevnull();#ifdef HAVE_LIBSCFresult = ns_smf_get_instance(&instance, 0, ns_g_mctx);if (result = TYBS_R_SUCCESS)ns_smf_go

34、t_instance = 1;elsens_smf_got_instance = 0;if (instance != NULL)tybs_mem_free(ns_g_mctx, instance);#endif /* HAVE_LIBSCF */#ifdef PATH_RANDOMDEVif (ns_g_chrootdir != NULL) result = tybs_entropy_create(ns_g_mctx, &ns_g_fallbackentropy);if (result != TYBS_R_SUCCESS)ns_main_earlyfatal(tybs_entropy_crea

35、te() failed: %s, tybs_result_totext(result);result = tybs_entropy_createfilesource(ns_g_fallbackentropy, PATH_RANDOMDEV);if (result != TYBS_R_SUCCESS) ns_main_earlywarning(could not open pre-chroot entropy source %s: %s, PATH_RANDOMDEV, tybs_result_totext(result);tybs_entropy_detach(&ns_g_fallbacken

36、tropy);#endifns_os_chroot(ns_g_chrootdir);ns_os_minprivs();result = ns_log_init(TYBS_TF(ns_g_username != NULL);if (result != TYBS_R_SUCCESS)ns_main_earlyfatal(ns_log_init() failed: %s, tybs_result_totext(result);if (!ns_g_foreground)ns_os_daemonize();result = tybs_app_start();if (result != TYBS_R_SU

37、CCESS)ns_main_earlyfatal(tybs_app_start() failed: %s, tybs_result_totext(result);tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_NOTICE, starting BIND %s%s, ns_g_version, saved_command_line);tybs_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL, NS_LOGMODULE_MAIN, TYBS_LOG_NOTICE, built with %s, ns_g_configargs);(void)tybs_resource_getlimit(tybs_resource_stacksize, &ns_g_initstack

展开阅读全文
部分上传会员的收益排行 01、路***(¥15400+),02、曲****(¥15300+),
03、wei****016(¥13200+),04、大***流(¥12600+),
05、Fis****915(¥4200+),06、h****i(¥4100+),
07、Q**(¥3400+),08、自******点(¥2400+),
09、h*****x(¥1400+),10、c****e(¥1100+),
11、be*****ha(¥800+),12、13********8(¥800+)。
相似文档                                   自信AI助手自信AI助手
搜索标签

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        获赠5币

©2010-2024 宁波自信网络信息技术有限公司  版权所有

客服电话:4008-655-100  投诉/维权电话:4009-655-100

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :gzh.png    weibo.png    LOFTER.png 

客服