计算机软件著作权登记源代码范本.docx
《计算机软件著作权登记源代码范本.docx》由会员分享,可在线阅读,更多相关《计算机软件著作权登记源代码范本.docx(100页珍藏版)》请在冰豆网上搜索。
计算机软件著作权登记源代码范本
计算机软件著作权登记-源代码范本
注意事项:
常见的源代码包含:
C语言,VB,C++,JAVA,.NET等。
提交的代码必须是源代码的开头载入程序,第30页必须断开,第60页是软件的程序结尾,代码中不得出现与申请表内容不符合的日期,著作权人,软件名字等,不能出现开源代码,不能出现任何版权纠纷。
格式要求:
一、源代码应提交前、后各连续30页,不足60页的,应当全部提交。
二、源代码页眉应标注软件的名称和版本号,应当与申请表中名称完全一致,页眉右上应标注页码,源代码每页不少于50行。
范例如下:
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#defineNS_MAIN1
#include
#endif
#ifdefDLZ
#include
#endif
statictybs_boolean_twant_stats=TYBS_FALSE;
staticcharprogram_name[TYBS_DIR_NAMEMAX]="named";
staticcharabsolute_conffile[TYBS_DIR_PATHMAX];
staticcharsaved_command_line[512];
staticcharversion[512];
staticunsignedintmaxsocks=0;
void
ns_main_earlywarning(constchar*format,...){
va_listargs;
va_start(args,format);
if(ns_g_lctx!
=NULL){
tybs_log_vwrite(ns_g_lctx,NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN,TYBS_LOG_WARNING,
format,args);
}else{
fprintf(stderr,"%s:
",program_name);
vfprintf(stderr,format,args);
fprintf(stderr,"\n");
fflush(stderr);
}
va_end(args);
}
Voidns_main_earlyfatal(constchar*format,...){
va_listargs;
va_start(args,format);
if(ns_g_lctx!
=NULL){
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(duetoearlyfatalerror)");
}else{
fprintf(stderr,"%s:
",program_name);
vfprintf(stderr,format,args);
fprintf(stderr,"\n");
fflush(stderr);
}
va_end(args);
exit
(1);
}
staticvoid
assertion_failed(constchar*file,intline,tybs_assertiontype_ttype,
constchar*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_typetotext(type),cond);
tybs_log_write(ns_g_lctx,NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN,TYBS_LOG_CRITICAL,
"exiting(duetoassertionfailure)");
}else{
fprintf(stderr,"%s:
%d:
%s(%s)failed\n",
file,line,tybs_assertion_typetotext(type),cond);
fflush(stderr);
}
if(ns_g_coreok)
abort();
exit
(1);
}
staticvoid
library_fatal_error(constchar*file,intline,constchar*format,
va_listargs)TYBS_FORMAT_PRINTF(3,0);
staticvoid
library_fatal_error(constchar*file,intline,constchar*format,
va_listargs)
{
if(ns_g_lctx!
=NULL){
tybs_error_setfatal(NULL);
tybs_log_write(ns_g_lctx,NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN,TYBS_LOG_CRITICAL,
"%s:
%d:
fatalerror:
",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(duetofatalerrorinlibrary)");
}else{
fprintf(stderr,"%s:
%d:
fatalerror:
",file,line);
vfprintf(stderr,format,args);
fprintf(stderr,"\n");
fflush(stderr);
}
if(ns_g_coreok)
abort();
exit
(1);
}
staticvoid
library_unexpected_error(constchar*file,intline,constchar*format,
va_listargs)TYBS_FORMAT_PRINTF(3,0);
staticvoid
library_unexpected_error(constchar*file,intline,constchar*format,
va_listargs)
{
if(ns_g_lctx!
=NULL){
tybs_log_write(ns_g_lctx,NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN,TYBS_LOG_ERROR,
"%s:
%d:
unexpectederror:
",file,line);
tybs_log_vwrite(ns_g_lctx,NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_MAIN,TYBS_LOG_ERROR,
format,args);
}else{
fprintf(stderr,"%s:
%d:
fatalerror:
",file,line);
vfprintf(stderr,format,args);
fprintf(stderr,"\n");
fflush(stderr);
}
}
staticvoid
lwresd_usage(void){
fprintf(stderr,
"usage:
lwresd[-4|-6][-cconffile|-Cresolvconffile]"
"[-ddebuglevel]\n"
"[-f|-g][-nnumber_of_cpus][-pport]"
"[-Plisten-port][-s]\n"
"[-tchrootdir][-uusername][-ipidfile]\n"
"[-m{usage|trace|record|size|mctx}]\n");
}
staticvoid
usage(void){
if(ns_g_lwresdonly){
lwresd_usage();
return;
}
fprintf(stderr,
"usage:
named[-4|-6][-cconffile][-ddebuglevel]"
"[-f|-g][-nnumber_of_cpus]\n"
"[-pport][-s][-tchrootdir][-uusername]\n"
"[-m{usage|trace|record|size|mctx}]\n");
}
staticvoid
save_command_line(intargc,char*argv[]){
inti;
char*src;
char*dst;
char*eob;
constchartruncated[]="...";
tybs_boolean_tquoted=TYBS_FALSE;
dst=saved_command_line;
eob=saved_command_line+sizeof(saved_command_line);
for(i=1;i*dst++='';
src=argv[i];
while(*src!
='\0'&&dstif(quoted||isalnum(*src&0xff)||
*src=='-'||*src=='_'||
*src=='.'||*src=='/'){
*dst++=*src++;
quoted=TYBS_FALSE;
}else{
*dst++='\\';
quoted=TYBS_TRUE;
}
}
}
INSIST(sizeof(saved_command_line)>=sizeof(truncated));
if(dst==eob)
strcpy(eob-sizeof(truncated),truncated);
else
*dst='\0';
}
staticint
parse_int(char*arg,constchar*desc){
char*endp;
inttmp;
longintltmp;
ltmp=strtol(arg,&endp,10);
tmp=(int)ltmp;
if(*endp!
='\0')
ns_main_earlyfatal("%s'%s'mustbenumeric",desc,arg);
if(tmp<0||tmp!
=ltmp)
ns_main_earlyfatal("%s'%s'outofrange",desc,arg);
return(tmp);
}
staticstructflag_def{
constchar*name;
unsignedintvalue;
}mem_debug_flags[]={
{"trace",TYBS_MEM_DEBUGTRACE},
{"record",TYBS_MEM_DEBUGRECORD},
{"usage",TYBS_MEM_DEBUGUSAGE},
{"size",TYBS_MEM_DEBUGSIZE},
{"mctx",TYBS_MEM_DEBUGCTX},
{NULL,0}
};
staticvoid
set_flags(constchar*arg,structflag_def*defs,unsignedint*ret){
for(;;){
conststructflag_def*def;
constchar*end=strchr(arg,',');
intarglen;
if(end==NULL)
end=arg+strlen(arg);
arglen=end-arg;
for(def=defs;def->name!
=NULL;def++){
if(arglen==(int)strlen(def->name)&&
memcmp(arg,def->name,arglen)==0){
*ret|=def->value;
gotofound;
}
}
ns_main_earlyfatal("unrecognizedflag'%.*s'",arglen,arg);
found:
if(*end=='\0')
break;
arg=end+1;
}
}
staticvoid
parse_command_line(intargc,char*argv[]){
intch;
intport;
tybs_boolean_tdisable6=TYBS_FALSE;
tybs_boolean_tdisable4=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("cannotspecify-4and-6");
if(tybs_net_probeipv4()!
=TYBS_R_SUCCESS)
ns_main_earlyfatal("IPv4notsupportedbyOS");
tybs_net_disableipv6();
disable6=TYBS_TRUE;
break;
case'6':
if(disable6)
ns_main_earlyfatal("cannotspecify-4and-6");
if(tybs_net_probeipv6()!
=TYBS_R_SUCCESS)
ns_main_earlyfatal("IPv6notsupportedbyOS");
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("cannotspecify-cand-C");
ns_g_conffileset=TYBS_TRUE;
break;
case'C':
lwresd_g_resolvconffile=tybs_commandline_argument;
if(ns_g_conffileset)
ns_main_earlyfatal("cannotspecify-cand-C");
lwresd_g_useresolvconf=TYBS_TRUE;
break;
case'd':
ns_g_debuglevel=parse_int(tybs_commandline_argument,
"debuglevel");
break;
case'f':
ns_g_foreground=TYBS_TRUE;
break;
case'g':
ns_g_foreground=TYBS_TRUE;
ns_g_logstderr=TYBS_TRUE;
break;
/*XXXBEW-ishouldberemoved*/
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,
"numberofcpus");
if(ns_g_cpus==0)
ns_g_cpus=1;
break;
case'p':
port=parse_int(tybs_commandline_argument,"port");
if(port<1||port>65535)
ns_main_earlyfatal("port'%s'outofrange",
tybs_commandline_argument);
ns_g_port=port;
break;
/*XXXBEWShould-Pberemoved*/
case'P':
port=parse_int(tybs_commandline_argument,"port");
if(port<1||port>65535)
ns_main_earlyfatal("port'%s'outofrange",
tybs_commandline_argument);
lwresd_g_listenport=port;
break;
case's':
want_stats=TYBS_TRUE;
break;
case'S':
maxsocks=parse_int(tybs_commandline_argument,
"maxnumberofsockets");
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-Tflag'%s\n",
tybs_commandline_argument);
break;
case'u':
ns_g_username=tybs_commandline_argument;
break;
case'v':
printf("BIND%s\n",ns_g_version);
exit(0);
case'V':
printf("BIND%sbuiltwith%s\n",ns_g_version,
ns_g_configargs);
exit(0);
case'':
usage();
if(tybs_commandline_option=='')
exit(0);
ns_main_earlyfatal("unknownoption'-%c'",
ty