文字バッファの表現と文書行の管理 ― 2016年03月06日 20:30
編集するテキストは、バッファbuf()にしまい込む。この中には、行と行をリンクさせる 指標も含む。
buf(k+0) PREV 前の行の指標 buf(k+4) NEXT 次の行の指標 buf(k+8) MARK 広域指定の処理に使用 buf(k+9) TEXT 文字列の第一文字 buf(k+10) ... 第二文字・・・
このバッファを操作するルーチンをは、下記の通り。
setbuf() バッファを初期化して、第0行をだけを含む状態にする。 clrbuf() 作業ファイルを捨てる。現状の版では、何もしない。 inject(lin) linのテキストをバッファに転写する。 curlinは、最後に送り込まれた行を指させる。 getind(n) 行番号nをその行を占める指標に変換する。 gettxt() 行の内容を共通領域ctxtのtxtに転写する。 relink(k1,k2,k3,k4) 指標のつなぎ替えを行う。k2の逆方向の指標にk1をささせる。 k3の順方向の指標にはk4を指させる。
文字バッファbufは共通領域cbufに置かれる。 共通領域cbufのRATFOR版は、以下の通り。
# cbuf.ri common /cbuf/buf,lastbf character buf(MAXBUF) # buffer for pointers plus text integer lastbf # last element used in buf
WATCOM Fortran77版は以下の通り。
c cbuf.fi common /cbuf/buf,lastbf integer*1 buf(20000000) ! MAXBUF(20000000) buffer for pointers plus text integer lastbf ! last element used in buf
文字バッファの文書は必要に応じてバッファtxtに転写される。 バッファtxtは共通領域ctxtに置かれる。 共通領域ctxtのRATFOR版は、以下の通り。
# ctxt.ri common /ctxt/txt character txt(MAXLINE) # text line for matching and output
WATCOM Fortran77版は以下の通り。
c ctxt.fi common /ctxt/txt integer*1 txt(81) ! MAXLINE(81) text line for matching and output
setbuf()のRATFOR版は、以下の通り。
# setbuf.r4 (in memory) -- initialize line storage buffer subroutine setbuf logical addset,junk include cbuf.ri include clines.ri call relink(LINE0,LINE0,LINE0,LINE0) lastbf = LINE0 + TEXT junk = addset(EOF,buf,lastbf,MAXBUF) curln = 0 lastln = 0 return end
WATCOM Fortran77版は以下の通り。
c setbuf.f (in memory) -- initialize line storage buffer subroutine setbuf integer addset,junk include cbuf.fi include clines.fi call relink(1,1,1,1) ! LINE0(1) lastbf = 1 + 12 ! LINE0(1) TEXT(12) junk = addset(-2,buf,lastbf,20000000) ! EOS(-2) MAXBUF(20000000) curln = 0 lastln = 0 return end
clrbuf()のRATFOR版は、以下の通り。
# clrbuf.r4 -- initialize for new file subroutine clrbuf return # nothing to do end
WATCOM Fortran77版は以下の通り。
c clrbuf.for -- initialize for new file subroutine clrbuf return ! nothing to do end
getind()のRATFOR版は、以下の通り。getbufptr()は、バッファbufから、integerの 指標を取り出すためのルーチンである。
# getind.r4 -- locate line index in buffer integer function getind(line) integer line integer j,k,getbufptr include cbuf.fi k = LINE0 for (j = 0; j < line; j = j + 1) k = getbufptr(buf(k+NEXT)) getind = k return end
WATCOM Fortran77版は以下の通り。
c getind.f -- locate line index in buffer integer function getind(line) integer line integer j,k,getbufptr include cbuf.fi k = 1 ! LINE0(1) j = 0 while (j .lt. line) do k = getbufptr(buf(k+4)) ! NEXT(4) j = j + 1 end while getind = k return end
getbufptr()のRATFOR版は、以下の通り。
# getbufptr.r4 integer function getbufptr(buf) integer buf getbufptr = buf return end
WATCOM Fortran77版は以下の通り。
c getbufptr.for integer function getbufptr(buf) integer buf getbufptr = buf return end
inject()のRATFOR版は、以下の通り。
# inject.f -- put text from line after curln integer function inject(lin) character lin(MAXLINE) integer addset,junk integer getind,nextln integer i,k1,k2,k3 include cbuf.ri include clines.ri for (i = 1; lin(i) != EOS; ) { k3 = lastbf lastbf = lastbf + TEXT while (lin(i) != EOS) { junk = addset(lin(i),buf,lastbf,MAXBUF) i = i + 1 if (lin(i-1) == NEWLINE) break } if (addset(EOS,buf,lastbf,MAXBUF) == NO) { inject = ERR break } k1 = getind(curln) k2 = getind(nextln(curln)) call relink(k1,k3,k3,k2) call relink(k3,k2,k1,k3) curln = curln + 1 lastln = lastln + 1 inject = OK } return end
WATCOM Fortran77版は以下の通り。
c inject.f -- put text from line after curln integer function inject(lin) integer*1 lin(*) integer addset,junk integer getind,nextln integer i,k1,k2,k3 include cbuf.fi include clines.fi i = 1 while (lin(i) .ne. -2) do ! EOS(-2) k3 = lastbf lastbf = lastbf + 12 ! TEXT(12) while (lin(i) .ne. -2) do ! EOS(-2) junk = addset(lin(i),buf,lastbf,20000000) ! MAXBUF(20000000) i = i + 1 if (lin(i-1) .eq. 10) then ! NEWLINE(10) exit end if end while if (addset(-2,buf,lastbf,20000000) .eq. 0) then ! NO(0) MAXBUF(20000000) inject = -3 ! ERR(-3) exit end if k1 = getind(curln) k2 = getind(nextln(curln)) call relink(k1,k3,k3,k2) call relink(k3,k2,k1,k3) curln = curln + 1 lastln = lastln + 1 inject = -2 ! OK(-2) end while return end
relink()のRATFOR版は、以下の通り。
# relink.r4 -- rewrite two harf links subroutine relink(a,x,y,b) integer a,b,x,y include cbuf.ri call setbufptr(a,buf(x+PREV)) call setbufptr(b,buf(y+NEXT)) return end
WATCOM Fortran77版は以下の通り。
c relink.f -- rewrite two harf links subroutine relink(a,x,y,b) integer a,b,x,y include cbuf.fi call setbufptr(a,buf(x+0)) ! PREV(0) call setbufptr(b,buf(y+4)) ! NEXT(4) return end
ここで、setbufptr()は指標をセットするルーチン。
setbufptr()のRATFOR版は、以下の通り。
# setbufptr.r4 subroutine setbufptr(ptr,buf) integer ptr,buf buf = ptr return end
WATCOM Fortran77版は以下の通り。
c setbufptr.for subroutine setbufptr(ptr,buf) integer ptr,buf buf = ptr return end
コメント
_ Payoneer 限度額 ― 2016年05月12日 00:11
_ www.krogerfeedback.com ― 2016年06月05日 19:08
Plz reply as I'm looking to create my own blog and would like to know where u got this from.
thanks
_ Mincraft ― 2016年07月03日 03:43
approximately your article on AOL? I need an expert in this house to unravel my problem.
Maybe that's you! Looking ahead to look you.
_ migre.me ― 2016年07月09日 15:45
say concerning this piece of writing, in my view its truly amazing
in support of me.
_ www.krogerfeedback.com ― 2016年07月14日 20:36
_ www.krogerfeedback.com ― 2016年07月26日 05:06
_ kroger digital coupons ― 2016年07月28日 17:35
_ Mincraft ― 2016年08月12日 15:33
this web site dailly and take pleasant facts from here daily.
_ fix connections to bluetooth audio devices and wireless displays in windows 10 ― 2016年08月19日 06:42
user of web therefore from now I am using net for posts,
thanks to web.
_ quest bars ― 2016年09月09日 05:07
then you have to apply such strategies to your won weblog.
_ ShoeLifts ― 2016年09月11日 05:52
_ Windows 10 Free Upgrade ― 2016年09月14日 18:03
arguments and telling everything on the topic of that.
_ south chicago healthcare ― 2016年09月22日 15:24
a lot of work? I've virtually no expertise in programming but I had been hoping to start
my own blog in the near future. Anyway, should you have any ideas or techniques for new blog
owners please share. I know this is off subject however I just needed to ask.
Thanks!
_ quest bars ― 2016年09月24日 16:47
_ minecraft awesome and sweet ― 2016年10月02日 03:15
_ minecraft sweet and awesome lucky block ― 2016年10月02日 22:15
thanks admin
_ plenty of fish dating site of free dating ― 2016年10月05日 11:00
I am gonna watch out for brussels. I will be grateful if you continue this in future.
Numerous people will be benefited from your writing. Cheers!
_ quest bars ― 2016年10月06日 03:43
to in finding things to enhance my site!I assume its ok
to make use of some of your ideas!!
_ descargar minecraft 1.7.2 para pc ― 2016年10月10日 04:30
of valuable familiarity concerning unexpected emotions.
_ como descargar minecraft 1.9 ― 2016年10月13日 02:19
bit of it. I have got you book marked to check out new stuff
you post…
_ como descargar minecraft ― 2016年10月14日 10:47
nice, keep it up! I'll go ahead and bookmark your website to come
back later on. Cheers
_ gamefly 3 month free trial ― 2016年11月15日 22:08
_ who carries quest bars ― 2016年11月20日 02:19
well check things out. I like what I see so i am just following you.
Look forward to looking over your web page for a second time.
_ j.mp ― 2016年12月01日 20:04
a few of the posts I realized it's new to me. Regardless, I'm certainly delighted I discovered it and
I'll be bookmarking it and checking back often!
_ free dating sites no fees ― 2016年12月10日 12:32
Do you have any? Kindly let me realize so that I may just
subscribe. Thanks.
_ Gamefly Free Trial ― 2016年12月18日 11:08
guidance from an established blog. Is it difficult to set
up your own blog? I'm not very techincal but I can figure things out pretty quick.
I'm thinking about creating my own but I'm not sure where to start.
Do you have any tips or suggestions? Appreciate it
_ Gamefly ― 2016年12月18日 19:33
articles or blog posts on this sort of space .
Exploring in Yahoo I ultimately stumbled upon this site.
Studying this info So i am satisfied to convey that
I've an incredibly just right uncanny feeling I found out exactly what I needed.
I such a lot indisputably will make sure to don?t put out
of your mind this web site and provides it a look regularly.
_ Gamefly ― 2016年12月21日 06:40
an established blog. Is it tough to set up your own blog?
I'm not very techincal but I can figure things out pretty quick.
I'm thinking about making my own but I'm not
sure where to begin. Do you have any points or suggestions?
With thanks
_ www.krogerfeedback.com ― 2016年12月25日 06:29
who to ask.
_ www.krogerfeedback.com ― 2016年12月25日 08:27
have to manually code with HTML. I'm starting a blog soon but have no
coding skills so I wanted to get advice from someone with experience.
Any help would be greatly appreciated!
_ www.krogerfeedback.com ― 2016年12月26日 01:50
News. Do you have any tips on how to get listed in Yahoo News?
I've been trying for a while but I never seem to get there!
Appreciate it
_ www.krogerfeedback.com ― 2016年12月26日 03:35
provide. It's nice to come across a blog every once in a while that isn't the same out
of date rehashed material. Wonderful read! I've saved your
site and I'm including your RSS feeds to my Google account.
_ match.com reviews 2017 ― 2017年01月04日 00:55
_ free dating sites no fees ― 2017年01月06日 19:09
can you offer guest writers to write content in your case?
I wouldn't mind composing a post or elaborating on many of the subjects you write concerning here.
Again, awesome website!
_ absolutely free dating sites ― 2017年01月07日 19:24
more from this site, and your views are fastidious in favor of
new users.
_ absolutely free dating sites ― 2017年01月08日 15:56
the issues. It was definitely informative. Your site is useful.
Many thanks for sharing!
_ quest bars canada cheapest ― 2017年01月10日 09:15
_ gamefly free trial ― 2017年01月11日 14:29
I really hope to see the same high-grade blog posts from you later on as well.
In fact, your creative writing abilities has motivated me to get my own, personal
blog now ;)
_ www.krogerfeedback.com ― 2017年01月12日 00:16
weblog and wished to say that I have truly enjoyed surfing around your blog posts.
In any case I will be subscribing to your rss feed and I hope
you write again soon!
_ www.krogerfeedback.com ― 2017年01月13日 07:08
Looking at this post reminds me of my previous roommate!
He continually kept preaching about this. I am going to forward this post to him.
Pretty sure he's going to have a great read.
Thanks for sharing!
_ www.krogerfeedback.com ― 2017年01月14日 03:00
My last blog (wordpress) was hacked and I ended up losing a few months of hard work due to no backup.
Do you have any solutions to prevent hackers?
_ www.krogerfeedback.com ― 2017年01月14日 12:24
Anyway I will be subscribing for your augment or even I success you get entry
to consistently rapidly.
_ www.krogerfeedback.com ― 2017年01月15日 06:49
I appreciate you taking the time and energy to put
this content together. I once again find myself spending a significant amount of time both reading
and posting comments. But so what, it was still worthwhile!
_ www.krogerfeedback.com ― 2017年01月21日 04:45
you are simply extremely fantastic. I actually like what you have
obtained here, really like what you are stating and the way during which you say it.
You're making it enjoyable and you still care for to stay it smart.
I can't wait to read far more from you. That is actually
a tremendous web site.
_ take a look at the www.krogerfeedback.com webpage ― 2017年01月27日 14:56
after checking through some of the post I realized
it's new to me. Anyways, I'm definitely glad I found it and I'll be bookmarking and checking back often!
_ http://wisewomensport.com/ ― 2017年01月28日 08:52
amusement account it. Look advanced to far
added agreeable from you! However, how could we communicate?
_ http://tinyurl.com/jz2m2g8 ― 2017年01月29日 10:04
I am shocked why this twist of fate did not happened in advance!
I bookmarked it.
_ g ― 2017年01月30日 13:22
sort of house . Exploring in Yahoo I finally
stumbled upon this site. Reading this info So i am happy to show that I've
an incredibly good uncanny feeling I came upon just what I needed.
I so much without a doubt will make sure to
don?t forget this web site and provides it a glance on a constant basis.
_ match.com ― 2017年01月31日 01:21
subject. Well with your permission let me to grab your feed to keep up to date with forthcoming post.
Thanks a million and please carry on the gratifying work.
_ match.com ― 2017年01月31日 04:25
who has been doing a little homework on this. And he actually ordered me breakfast because I discovered it for him...
lol. So allow me to reword this.... Thank YOU for the
meal!! But yeah, thanx for spending the time to discuss this topic
here on your web page.
※コメントの受付件数を超えているため、この記事にコメントすることができません。
トラックバック
このエントリのトラックバックURL: http://kida.asablo.jp/blog/2016/03/06/8040800/tb
website, I have read all that, so at this time me also
commenting at this place.