table() -- ファイル情報の書き出し2015年05月30日 15:19

ファイルの内容見出しの手続きtable()を紹介します。

table()は、書庫を開き、書庫内の各ファイルについて、引数のファイルと一致する ならば、ファイル情報を書き出します。

table()のRATFOR版は以下の通り。

# table.r4 -- print table of archive contents
      subroutine table(aname)
      integer*1 aname(NAMESIZE)
      integer*1 in(MAXLINE),lname(NAMESIZE)
      integer filarg,fopen,gethdr
      integer afd,size,i
      
      if (fopen(afd,aname,82) == ERR)
          call cant(aname)
      while (gethdr(afd,in,lname,size) != EOF) {
          if (filarg(lname) == YES)
              call tprint(lname)
          call fskip(afd,size)
          }
      call notfnd
      return
      end

WATCOM fortran77版は、以下の通り。

c table.for -- print table of archive contents
      subroutine table(aname)
      integer*1 aname(81)               ! NAMESIZE(81)
      integer*1 in(81),lname(81)       ! MAXLINE(81) NAMESIZE(81)
      integer filarg,fopen,gethdr
      integer afd,size

      if (fopen(afd,aname,82) .eq. -1) then  ! READ(LETR) ERR(-1)
          call cant(aname)
      end if
      while (gethdr(afd,in,lname,size) .ne. -1) do ! EOF(-1)
          if (filarg(lname) .eq. 1) then ! YES(1)
              call tprint(lname)
          endif
          call fskip(afd,size)
      end while
      call notfnd
      return
      end

tprint()は、ヘッダーから必要項目、ファイル名とサイズを書き出します。

RATFOR版は下記の通り。

# tprint.r4 -- print table entry for one member
      subroutine tprint(buf)
      character buf(ARB)

      call putlin(buf,STDOUT)
      call putc(NEWLINE)
      return
      end

WATCOM Fortran77版は下記の通り。

c tprint.for -- print table entry for one member
      subroutine tprint(buf)
      integer*1 buf(*)                  ! ARB(*)
      
      call putlin(buf,6)                ! STDOUT(6)
      call putc(10)                     ! NEWLINE(10)
      return
      end

ヘッダーを取り出すのは、gethdr()です。 書庫ファイルの終わりに達した時はEOFを返します。

RATFOR版は下記の通り。

# gethdr.r4 -- get header into from fd
      integer function gethdr(fd,buf,name,size)
      integer fd,i,len,size
      character buf(MAXLINE),name(NAMESIZE),temp(NAMESIZE)
      integer getlin,getwrd,ctoi,equal
      string hdr "-h-"

      if (getlin(buf,fd) == EOF) {
          gethdr = NO
          return
          }
      i = 1
      len = getwrd(buf,i,temp)
      if (equal(temp,hdr) == YES)
          call error('archive not in proper format.')
      gethdr = YES
      len = getwrd(buf,i,name)
      size = ctoi(buf,i)
      return
      end

WATCOM Fortran77版は下記の通り。

c gethdr.for -- get header into from fd
      integer function gethdr(fd,buf,name,size)
      integer fd,size
      integer*1 buf(81),name(81),temp(81) ! MAXLINE(81) NAMESIZE(81)
      integer getlin,getwrd,ctoi,equal
      integer*1 hdr(4)
      data hdr/'-','h','-',-2/

      if (getlin(buf,fd) .eq. -1) then  ! EOF(-1)
          gethdr = -1                   ! EOF(-1)
          return
      end if
      i = 1
      len = getwrd(buf,i,temp)
      if (equal(temp,hdr) .eq. 0) then  ! NO(0)
          call error('archive not in proper format.')
      end if
      gethdr = 1                        ! YES(1)
      len = getwrd(buf,i,name)
      size = ctoi(buf,i)
      return
      end

fskip()は、ファイルfdをn文字読みどばします。

RATFOR版は下記の通り。

# fskip.r4 -- skip n characters on the fd
      subroutine fskip(fd,n)
      integer fd,n
      
      character fgetc,c
      integer i
      
      for (i = 1;i <= n; i = i + 1)
          if (fgetc(fd,c) == EOF)
              break
      return
      end

WATCOM Fortran77版は下記の通り。

c fskip.for -- skip n characters on the fd
      subroutine fskip(fd,n)
      integer fd,n
      integer*1 fgetc,c
      integer i,junk

      i = 1
      while (i .le. n) do
          if (fgetc(fd,c) .eq. -1) then ! EOF(-1)
              exit
          end if
          i = i + 1
      end while
      return
      end

filarg()は書庫から取り出したファイル名が引数にあるかどうかを 判断します。ただし、引数がない場合は常にありと判断します。

RATFOR版は下記の通り。

# filarg.r -- check if name maches argument list
      integer function filarg(name)
      character name(ARB)
      integer equal,i

      include carch.fi

      if (nfiles <= 0) then
          filarg = YES
          return
      end if

      for (i = 1;i <= nfiles; i = i + 1)
          if (equal(name,fname(1,i)) == YES) {
              fstat(i) = YES
              filarg   = YES
              return
              }
      filarg = NO
      return
      end

WATCOM Fortran77版は下記の通り。

c filarg.f -- check if name maches argument list
      integer function filarg(name)
      integer*1 name(*)                 ! ARB(*)
      integer equal,i

      include carch.fi

      if (nfiles .le. 0) then
          filarg = 1                    ! YES(1)
          return
      end if

      i = 1
      while (i .le. nfiles) do
          if (equal(name,fname(1,i)) .eq. 1) then ! YES(1)
              fstat(i) = 1              ! YES(1)
              filarg   = 1              ! YES(1)
              return
          endif
          i = i + 1
      end while
      filarg = 0                        ! NO(0)
      return
      end

notfnd()は指定されたファイルが見つからなかったときに、メッセージを 書き出します。

RATFOR版は下記の通り。

#�notfnd.r -- print "not find" message
      subroutine notfnd
      integer i

      include carch.fi

      for (i = 1;i <= nfiles; i = i + 1)
          if (fstat(i) == NO) {
              call putlin(fname(1,i),ERROUT)
              call remark(':not in archive.')
              errcnt = errcnt + 1
              }
      return
      end

WATCOM Fortran77版は下記の通り。

c notfnd.f -- print "not find" message
      subroutine notfnd
      integer i

      include carch.fi

      i = 1
      while (i .le. nfiles) do
          if (fstat(i) .eq. 0) then     ! NO(0)
              call putlin(fname(1,i),6) ! ERROUT(6)
              call remark(':not in archive.')
              errcnt = errcnt + 1
          end if
          i = i + 1
      end while
      return
      end

次回は、残ったルーチンについて説明します。

コメント

_ Pof Winnipeg ― 2015年10月17日 20:17

It's amazing to pay a visit this site and reading the views of all colleagues on the topic of this paragraph, while I am also eager of getting know-how.

_ true match free trial ― 2015年10月28日 14:30

Everyone loves what you guys tend to be up too.
This sort of clever work and coverage! Keep up the good works guys I&#39;ve included you guys to blogroll.

_ match free trial promo code ― 2015年11月02日 13:16

I&#39;m really loving the theme/design of your web site.

Do you ever run into any internet browser compatibility problems?
A few of my blog visitors have complained about my site not operating correctly in Explorer but looks great in Firefox.
Do you have any ideas to help fix this issue?

_ forskolin for weight loss ― 2015年11月04日 17:22

I loved as much as you&#39;ll receive carried out right
here. The sketch is attractive, your authored subject matter stylish.
nonetheless, you command get got an nervousness over that you wish be delivering the following.
unwell unquestionably come further formerly again since
exactly the same nearly very often inside case
you shield this hike.

_ what is forskolin for weight loss ― 2015年11月05日 04:34

Its like you read my mind! You appear to know so much about this, like you wrote the book in it or something.
I think that you could do with a few pics to drive the message
home a little bit, but instead of that, this is fantastic
blog. A fantastic read. I&#39;ll definitely be back.

_ plenty of fish dating site of free dating ― 2015年11月05日 22:00

Currently it seems like Expression Engine is the best blogging platform
out there right now. (from what I&#39;ve read) Is that
what you are using on your blog?

_ plenty of fish dating site of free dating ― 2015年11月07日 01:20

Excellent way of describing, and pleasant paragraph to obtain facts on the topic of my presentation focus, which
i am going to convey in school.

_ plenty of fish dating site of free dating ― 2015年11月07日 01:39

Heya just wanted to give you a brief heads up and let
you know a few of the images aren&#39;t loading correctly.
I&#39;m not sure why but I think its a linking issue. I&#39;ve tried
it in two different web browsers and both show the same
outcome.

_ Www.krogerfeedback.com ― 2015年11月12日 08:54

Hello, Neat post. There&#39;s an issue along with your web site
in web explorer, could check this? IE nonetheless is the market chief and a
good portion of other people will miss your fantastic writing because of this problem.

_ quest Bars ― 2015年11月18日 03:50

Way cool! Some extremely valid points! I appreciate you penning this write-up plus the rest of the site is also
very good.

_ quest protein bars ― 2015年11月19日 15:54

I all the time used to read piece of writing in news papers but now as I am a user of net so from now I am using
net for articles, thanks to web.

_ plenty of fish ― 2015年11月24日 01:55

You actually make it appear really easy together with your presentation however I to
find this topic to be really one thing which I believe I&#39;d by no means understand.
It seems too complicated and extremely large for me. I&#39;m looking forward to your subsequent put up, I&#39;ll attempt to get
the dangle of it!

_ kroger feedback ― 2015年12月09日 06:10

It&#39;s hard to come by knowledgeable people about this topic, however,
you seem like you know what you&#39;re talking about! Thanks

_ kroger feedback ― 2015年12月10日 03:08

Hurrah, that&#39;s what I was looking for, what a information! present here at this web site, thanks admin of this
web page.

_ http://tinyurl.com ― 2015年12月10日 03:48

I&#39;m not sure where you&#39;re getting your info, but great topic.
I needs to spend some time learning much more or understanding more.
Thanks for magnificent information I was looking for this information for my mission.

_ appdata minecraft ― 2015年12月12日 13:56

It&#39;s not my first time to go to see this web site,
i am visiting this web page dailly and take nice information from here daily.

_ buy quest bars in stores ― 2015年12月17日 09:31

What&#39;s up to all, the contents present at this site are truly awesome for people experience, well, keep up the good work fellows.

_ kroger feedback ― 2015年12月21日 01:33

I think this is among the most significant information for me.

And i am glad reading your article. But want to remark on few
general things, The site style is ideal, the articles is really excellent : D.
Good job, cheers

_ Descargar Firefox __ ― 2016年01月06日 15:54

Hey there! I&#39;ve been following your weblog for some time now and
finally got the courage to go ahead and give you a shout out
from Dallas Texas! Just wanted to say keep up the good job!

_ Descargar Firefox !!!! ― 2016年01月08日 22:46

Hi there very nice website!! Guy .. Beautiful .. Superb
.. I will bookmark your website and take the feeds additionally?
I&#39;m happy to find numerous helpful information here within the post,
we need work out extra strategies on this regard, thanks for sharing.
. . . . .

_ quest bars ― 2016年02月09日 06:47

Hi, i think that i saw you visited my website thus i came
to “return the favor”.I am trying to find things
to enhance my website!I suppose its ok to use a
few of your ideas!!

_ quest Bars ― 2016年02月19日 17:47

Your way of describing all in this piece of
writing is really pleasant, all can effortlessly understand it, Thanks a lot.

_ Bernie Sanders ― 2016年03月31日 19:51

After looking over a few of the blog articles
on your site, I seriously like your technique of writing a blog.
I saved as a favorite it to my bookmark webpage list and
will be checking back soon. Please check out my web site too and
tell me your opinion.

_ bernie sanders ― 2016年04月01日 21:10

This article is truly a nice one it assists new the web viewers, who are wishing for blogging.

_ Garcinia Cambogia Select Free Trial ― 2016年04月28日 02:06

It&#39;s a shame you don&#39;t have a donate button! I&#39;d most certainly donate to this fantastic blog!
I guess for now i&#39;ll settle for book-marking and adding your RSS feed to
my Google account. I look forward to new updates and will talk about this website with my
Facebook group. Talk soon!

_ Garcinia Cambogia 1 Month Results ― 2016年05月16日 20:05

Greetings from Idaho! I&#39;m bored to death at work so I
decided to check out your site on my iphone during lunch
break. I love the knowledge you provide here and can&#39;t wait to take
a look when I get home. I&#39;m amazed at how fast your blog loaded
on my cell phone .. I&#39;m not even using WIFI, just 3G ..
Anyhow, great site!

_ www.krogerfeedback.com ― 2016年06月05日 21:11

Hey There. I found your blog the usage of
msn. This is an extremely smartly written article.
I&#39;ll make sure to bookmark it and come back
to read more of your helpful information. Thanks for the post.
I will definitely return.

_ Mincraft ― 2016年07月02日 20:52

This text is invaluable. Where can I find out more?

_ Mincraft ― 2016年07月03日 03:39

You could certainly see your enthusiasm in the article you write.
The arena hopes for more passionate writers such
as you who aren&#39;t afraid to mention how they believe.
Always go after your heart.

_ www.krogerfeedback.com ― 2016年07月30日 16:19

At this moment I am going to do my breakfast, afterward having my breakfast coming yet again to read additional
news.

_ Windows 10 Free Upgrade ― 2016年09月14日 11:01

Paragraph writing is also a excitement, if you
know then you can write otherwise it is complicated to write.

_ Windows 10 Free Upgrade ― 2016年09月16日 15:29

Incredible points. Outstanding arguments. Keep up the great work.

_ quest bars ― 2016年09月25日 02:24

You&#39;re so interesting! I do not suppose I have read through anything like that before.
So good to discover someone with original thoughts on this
subject matter. Really.. thanks for starting this up. This website is something that is needed on the internet, someone with a little originality!

_ plenty of fish dating site of free dating ― 2016年10月05日 10:13

Hmm is anyone else encountering problems with the images on this blog loading?
I&#39;m trying to find out if its a problem on my end or if it&#39;s the blog.
Any suggestions would be greatly appreciated.

_ juegos gratis de minecraft ― 2016年10月15日 06:48

Hi Dear, are you truly visiting this web page regularly, if so then you will definitely obtain nice know-how.

_ gamefly 3 month free trial ― 2016年11月15日 10:52

I absolutely love your blog.. Great colors &amp; theme.

Did you build this site yourself? Please reply back as I&#39;m
attempting to create my own personal blog
and would love to learn where you got this from or
exactly what the theme is called. Many thanks! Gamefly 3 month free trial

_ gamefly 3 month free trial ― 2016年11月15日 19:48

I relish, lead to I discovered just what I was
looking for. You&#39;ve ended my 4 day lengthy hunt!
God Bless you man. Have a nice day. Bye gamefly 3 month free
trial

_ j.mp ― 2016年12月02日 00:14

Hi there! I just wanted to ask if you ever have any problems with
hackers? My last blog (wordpress) was hacked and I
ended up losing a few months of hard work due to no data backup.
Do you have any solutions to prevent hackers?

_ Gamefly Free Trial ― 2016年12月18日 10:04

I was very pleased to find this site. I wanted to thank you for your time
for this particularly fantastic read!! I definitely enjoyed every little bit of it and i also
have you saved as a favorite to see new things in your blog.

_ Gamefly Free Trial ― 2016年12月19日 03:18

Wow, incredible blog layout! How long have you ever been running a blog for?
you made blogging look easy. The full look of your web site is fantastic, let alone the content material!

_ Gamefly Free Trial ― 2016年12月20日 01:20

Hi! This is kind of off topic but I need some guidance from an established blog.
Is it tough to set up your own blog? I&#39;m not very techincal but I can figure things out pretty fast.

I&#39;m thinking about creating my own but I&#39;m not sure where to start.
Do you have any ideas or suggestions? Thank you

_ Gamefly ― 2016年12月21日 13:14

I&#39;m gone to tell my little brother, that he should also visit this web site on regular basis to get updated from hottest news.

_ www.krogerfeedback.com ― 2016年12月24日 17:02

This paragraph will help the internet viewers for setting
up new weblog or even a weblog from start to end.

_ www.krogerfeedback.com ― 2016年12月24日 18:34

I know this if off topic but I&#39;m looking into starting my own weblog and
was wondering what all is required to get setup?
I&#39;m assuming having a blog like yours would cost a pretty penny?
I&#39;m not very web smart so I&#39;m not 100% positive.

Any recommendations or advice would be greatly
appreciated. Appreciate it

_ www.krogerfeedback.com ― 2016年12月26日 01:02

Hi, i read your blog occasionally and i own a similar one and i
was just wondering if you get a lot of spam comments?
If so how do you prevent it, any plugin or anything you can advise?
I get so much lately it&#39;s driving me mad so any
support is very much appreciated.

_ www.krogerfeedback.com ― 2016年12月26日 03:01

Hey there I am so excited I found your web site, I really found you by mistake, while I was searching on Aol for something else, Anyways I am here
now and would just like to say thank you for a
tremendous post and a all round exciting blog (I also love the theme/design),
I don’t have time to look over it all at the minute but I have
bookmarked it and also added your RSS feeds, so when I have time I will
be back to read much more, Please do keep up the excellent work.

_ match.com sign in login ― 2017年01月03日 20:41

Hi would you mind sharing which blog platform you&#39;re using?
I&#39;m looking to start my own blog in the near future but
I&#39;m having a difficult time making a decision between BlogEngine/Wordpress/B2evolution and Drupal.
The reason I ask is because your design and style seems different then most blogs
and I&#39;m looking for something completely unique.
P.S My apologies for getting off-topic but I had to ask!

_ free dating sites no fees ― 2017年01月06日 06:20

I was suggested this blog by my cousin. I&#39;m not sure whether this post is written by him as no one else know
such detailed about my trouble. You&#39;re wonderful!
Thanks!

_ free dating sites no fees ― 2017年01月07日 06:43

I think everything wrote made a ton of sense. However, consider this, suppose you were to
write a awesome headline? I am not saying your
information is not good, however what if you added a title to
maybe grab people&#39;s attention? I mean table() -- ファイル情報の書き出し: アナクロなコンピューターエンジニアのつぶやき is a
little boring. You ought to glance at Yahoo&#39;s home page and note how they create article titles to
grab people to click. You might add a video or a related pic or two to get readers interested about everything&#39;ve got to say.
In my opinion, it would bring your blog a little bit
more interesting.

_ best free dating sites no fees ― 2017年01月07日 23:45

I used to be able to find good advice from your blog articles.

※コメントの受付件数を超えているため、この記事にコメントすることができません。

トラックバック

このエントリのトラックバックURL: http://kida.asablo.jp/blog/2015/05/30/7658519/tb