Add doxygen conf

Adding doxyconf as rA default conf for doxygen and for people if they
wish to build their doc.
Adding tools/build_doc to check app for building doc and to update
version number in documentation.
Fix few typo in src
This commit is contained in:
lighta 2013-11-14 14:31:47 -05:00
parent b2d1932e36
commit 1c5a53f25e
9 changed files with 1660 additions and 34 deletions

3
.gitignore vendored
View File

@ -43,6 +43,9 @@
/conf/import
/conf/msg_conf/import
# /doc/
/doc/doxygen
# /log/
/log/*.log
/log/*.leaks

1561
doxyconf Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2026,8 +2026,7 @@ void mmo_char_send(int fd, struct char_session_data* sd){
char_charlist_notify(fd,sd);
char_block_character(fd,sd);
}
//@FIXME dump from kro doesn't show 6b transmission
mmo_char_send006b(fd,sd);
else mmo_char_send006b(fd,sd);
}
int char_married(int pl1, int pl2)
@ -2235,7 +2234,7 @@ int mapif_parse_ReqBankInfo(int fd){
else {
uint32 aid = RFIFOL(fd,2);
RFIFOSKIP(fd,6);
loginif_BankingReq(aid, 1, 0);
loginif_BankingReq(aid, 1, 0);
}
return 1;
}

View File

@ -962,8 +962,8 @@ int parse_fromchar(int fd){
accounts->save(accounts, &acc);
WBUFB(buf,10) = 1;
} else {
WBUFB(buf,10) = 0;
}
WBUFB(buf,10) = 0;
}
// announce to other servers
WBUFW(buf,0) = 0x2741;
WBUFL(buf,2) = account_id;

View File

@ -4691,8 +4691,7 @@ ACMD_FUNC(jailfor)
}
//By Coltaro
ACMD_FUNC(jailtime)
{
ACMD_FUNC(jailtime){
int year, month, day, hour, minute, second;
char timestr[CHAT_SIZE_MAX];
@ -4719,6 +4718,7 @@ ACMD_FUNC(jailtime)
clif_displaymessage(fd, atcmd_output);
time2str(timestr,"%Y-%m-%d %H:%M",sd->sc.data[SC_JAILED]->val1*60);
sprintf(atcmd_output,"Release date is: %s",timestr);
clif_displaymessage(fd, atcmd_output);
return 0;
}

View File

@ -6318,7 +6318,7 @@ void clif_parse_BankDeposit(int fd, struct map_session_data* sd) {
struct s_packet_db* info = &packet_db[sd->packet_ver][RFIFOW(fd,0)];
int aid = RFIFOL(fd,info->pos[0]); //unused should we check vs fd ?
int money = RFIFOL(fd,info->pos[1]);
if(sd->status.account_id == aid){
enum e_BANKING_DEPOSIT_ACK reason = pc_bank_deposit(sd,max(0,money));
clif_bank_deposit(sd,reason);
@ -17613,7 +17613,7 @@ void packetdb_readdb(void)
// copy from previous version into new version and continue
// - indicating all following packets should be read into the newer version
memcpy(&packet_db[packet_ver], &packet_db[prev_ver], sizeof(packet_db[0]));
memcpy(&packet_db_ack[packet_ver], &packet_db_ack[prev_ver], sizeof(packet_db_ack[0]));
memcpy(&packet_db_ack[packet_ver], &packet_db_ack[prev_ver], sizeof(packet_db_ack[0]));
continue;
} else if(strcmpi(w1,"packet_db_ver")==0) {
if(strcmpi(w2,"default")==0) //This is the preferred version.
@ -17660,15 +17660,15 @@ void packetdb_readdb(void)
ARR_FIND( 0, ARRAYLENGTH(clif_parse_func), j, clif_parse_func[j].name != NULL && strcmp(str[2],clif_parse_func[j].name)==0 );
if( j < ARRAYLENGTH(clif_parse_func) )
packet_db[packet_ver][cmd].func = clif_parse_func[j].func;
else { //search if it's a mapped ack func
ARR_FIND( 0, ARRAYLENGTH(clif_ack_func), j, clif_ack_func[j].name != NULL && strcmp(str[2],clif_ack_func[j].name)==0 );
if( j < ARRAYLENGTH(clif_ack_func)) {
int fidx = clif_ack_func[j].funcidx;
packet_db_ack[packet_ver][fidx] = cmd;
//ShowInfo("Added %s, <=> %X i=%d for v=%d\n",clif_ack_func[j].name,cmd,fidx,packet_ver);
}
}
else { //search if it's a mapped ack func
ARR_FIND( 0, ARRAYLENGTH(clif_ack_func), j, clif_ack_func[j].name != NULL && strcmp(str[2],clif_ack_func[j].name)==0 );
if( j < ARRAYLENGTH(clif_ack_func)) {
int fidx = clif_ack_func[j].funcidx;
packet_db_ack[packet_ver][fidx] = cmd;
//ShowInfo("Added %s, <=> %X i=%d for v=%d\n",clif_ack_func[j].name,cmd,fidx,packet_ver);
}
}
// set the identifying cmd for the packet_db version
if (strcmp(str[2],"wanttoconnection")==0)
clif_config.connect_cmd[packet_ver] = cmd;

View File

@ -2202,9 +2202,9 @@ int intif_parse(int fd)
int packet_len, cmd;
cmd = RFIFOW(fd,0);
// Verify ID of the packet
if(cmd<0x3800 || cmd>=0x3800+(sizeof(packet_len_table)/sizeof(packet_len_table[0])) ||
packet_len_table[cmd-0x3800]==0){
return 0;
if(cmd<0x3800 || cmd>=0x3800+ARRAYLENGTH(packet_len_table) ||
packet_len_table[cmd-0x3800]==0){
return 0;
}
// Check the length of the packet
packet_len = packet_len_table[cmd-0x3800];

View File

@ -1002,18 +1002,9 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim
// Checks and fixes to character status data, that are required
// in case of configuration change or stuff, which cannot be
// checked on char-server.
if( sd->status.hair < MIN_HAIR_STYLE || sd->status.hair > MAX_HAIR_STYLE )
{
sd->status.hair = MIN_HAIR_STYLE;
}
if( sd->status.hair_color < MIN_HAIR_COLOR || sd->status.hair_color > MAX_HAIR_COLOR )
{
sd->status.hair_color = MIN_HAIR_COLOR;
}
if( sd->status.clothes_color < MIN_CLOTH_COLOR || sd->status.clothes_color > MAX_CLOTH_COLOR )
{
sd->status.clothes_color = MIN_CLOTH_COLOR;
}
sd->status.hair = cap_value(sd->status.hair,MIN_HAIR_STYLE,MAX_HAIR_STYLE);
sd->status.hair_color = cap_value(sd->status.hair_color,MIN_HAIR_COLOR,MAX_HAIR_COLOR);
sd->status.clothes_color = cap_value(sd->status.clothes_color,MIN_CLOTH_COLOR,MAX_CLOTH_COLOR);
//Initializations to null/0 unneeded since map_session_data was filled with 0 upon allocation.
if(!sd->status.hp) pc_setdead(sd);
@ -10384,7 +10375,7 @@ void pc_show_version(struct map_session_data *sd) {
else if( git[0] != UNKNOWN_VERSION )
sprintf(buf,msg_txt(sd,1295),"Git Hash: ",git); //rAthena Version Git Hash: %s
else
sprintf(buf,msg_txt(sd,1296)); //Cannot determine SVN/Git version.
sprintf(buf,"%s",msg_txt(sd,1296)); //Cannot determine SVN/Git version.
clif_displaymessage(sd->fd,buf);
}

72
tools/build_doc.pl Normal file
View File

@ -0,0 +1,72 @@
#!/usr/bin/perl
# building documentation using doxygen and updation versionning number
use strict;
use File::Basename;
my $sDocFile = "doxyconf";
my $outputdir = "doc/doxygen";
my @line = ();
my $repoversion;
my $gitversion;
my $doxyversion;
my $chked;
my($filename, $dir, $suffix) = fileparse($0);
chdir "../$dir"; #put ourself like was called in tools
#checking for doxygen
open PIPE,"doxygen --version |" or die $!;
@line = grep { /\d.\d.\d/ } <PIPE>;
$doxyversion = $line[0];
print "doxyversion = [ $doxyversion ]\n";
if($doxyversion eq ""){
die "Please install doxygen to proceed";
}
close PIPE;
#cheking for git cli
open PIPE,"git --version |" or die $!;
@line = grep { /\d.\d.\d.\d/ } <PIPE>;
$gitversion = $line[0];
$gitversion =~ s/[^\d.\d.\d.\d]//g;
print "doxyversion = [ $gitversion ]\n";
if($gitversion eq ""){
die "Please install git to proceed";
}
close PIPE;
open PIPE,"git rev-parse --short HEAD |" or die $!;
@line = grep { /\w/ } <PIPE>;
$repoversion = $line[0];
print "Git hash is : $repoversion";
close PIPE;
unless(-r "$outputdir"){
mkdir "$outputdir" or die "Can't create output directory for documentation (outdir=$outputdir)\n";
}
die "$sDocFile doesn't seem to exist or coudldn't be read" unless(-r "$sDocFile");
print "Updating doxygen file version (doxyconf=$sDocFile)\n";
open FHIN,"$sDocFile" || die "couldn't openfile/create $sDocFile \n";
open FHOUT,">doxyconf.tmp" || die "couldn't openfile/create doxyconf.tmp \n";
while(<FHIN>){
if(($chked&1)==0 && $_ =~ /^PROJECT_NUMBER/) {
@line = split(" ",$_);
print FHOUT "PROJECT_NUMBER = $repoversion";
print "Updated project number\n";
$chked &=1;
}
elsif(($chked&2)==0 && $_ =~ /^OUTPUT_DIRECTORY/){
print FHOUT "OUTPUT_DIRECTORY = $outputdir";
print "Updated output dir\n";
$chked &=2;
}
else { print FHOUT $_; }
}
close FHIN;
close FHOUT;
unlink $sDocFile;
rename "doxyconf.tmp", $sDocFile;
print "Building doc\n";
system("doxygen doxyconf");