summaryrefslogtreecommitdiffstats
path: root/blog
diff options
context:
space:
mode:
authorin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-31 21:39:18 +0800
committerin2 <in2@63ad8ddf-47c3-0310-b6dd-a9e9d9715204>2003-05-31 21:39:18 +0800
commit736e655db85cdda4198aa8459280a69056e98312 (patch)
treecbe5632e2d16c86e1255b4b883b20f6e27b44a3f /blog
parent7938b2357a3d6e730cb191ff97b3bc16d6d0d2c9 (diff)
downloadpttbbs-736e655db85cdda4198aa8459280a69056e98312.tar
pttbbs-736e655db85cdda4198aa8459280a69056e98312.tar.gz
pttbbs-736e655db85cdda4198aa8459280a69056e98312.tar.bz2
pttbbs-736e655db85cdda4198aa8459280a69056e98312.tar.lz
pttbbs-736e655db85cdda4198aa8459280a69056e98312.tar.xz
pttbbs-736e655db85cdda4198aa8459280a69056e98312.tar.zst
pttbbs-736e655db85cdda4198aa8459280a69056e98312.zip
code for inserting data inside linked-list
git-svn-id: http://opensvn.csie.org/pttbbs/pttbbs/trunk/pttbbs@916 63ad8ddf-47c3-0310-b6dd-a9e9d9715204
Diffstat (limited to 'blog')
-rwxr-xr-xblog/builddb.pl11
1 files changed, 10 insertions, 1 deletions
diff --git a/blog/builddb.pl b/blog/builddb.pl
index 74bd5d99..b5262017 100755
--- a/blog/builddb.pl
+++ b/blog/builddb.pl
@@ -146,7 +146,16 @@ sub builddata($$$$$$)
$dat{last} = $currid;
}
else{ # inside ? @_@;;;
- debugmsg("not implement yet");
+ my($p, $c);
+ for( $p = $dat{last} ; $p>$currid ; $p = $dat{"$p.prev"} ){
+ ;
+ }
+ $c = $dat{"$p.next"};
+
+ $dat{"$currid.next"} = $c;
+ $dat{"$currid.prev"} = $p;
+ $dat{"$p.next"} = $currid;
+ $dat{"$c.prev"} = $currid;
}
$dat{$currid} = 1;
}