ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2007/05/16/11:30:50

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Cesar Rabak <csrabak AT yahoo DOT com DOT br>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: How to count the occurance of a character in a string?
Date: Wed, 16 May 2007 12:16:57 -0300
Organization: Aioe.org NNTP Server
Lines: 59
Message-ID: <f2f79a$1i6$1@aioe.org>
References: <20070511181210 DOT GT3209 AT freenet DOT de> <f22p42$bu7$1 AT aioe DOT org> <20070512111553 DOT GO1881 AT freenet DOT de> <f24kg3$k88$1 AT aioe DOT org> <20070515164057 DOT GC1818 AT freenet DOT de>
NNTP-Posting-Host: 706n4sxHUJAce8c14xLqtw.user.aioe.org
Mime-Version: 1.0
X-Complaints-To: abuse AT aioe DOT org
In-Reply-To:
User-Agent: Thunderbird 1.5.0.8 (X11/20061109)
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Michelle Konzack escreveu:
> Am 2007-05-12 12:00:42, schrieb Cesar Rabak:
>> Michelle,
>>
>> Let's see what we have so far: you need a way of finding the dot 
>> character in about 1000 strings, you said IIRC.
>>
>> What exactly do you mean by "split the Courier-imap folder hierarchie"?
> ------------------------- END OF REPLIED MESSAGE -------------------------
> 
> In Courier-Imap, you have no real folders like
> 
> ~/Maildir/
>           .ML_devel/
>                     .djgpp/
> 
> instead, each level has a full path like
> 
> ~/INBOX/
> ~/INBOX.ML_devel/
> ~/INBOX.ML_devel.djgpp/
> 
> So if you have a Mailprogram, you need to split the FullPath,
> where the "." DOT is the separator...
> 
> My program is using under Linux GTK+ 2.8 but can run on the console
> with GtkPixbuff (framebuffer) or as fallback with ncurses.
> 
> Since I have the need to run the program under DOS too, the solution
> I am searching for must work on Linux AND Dos.  I think, no big deal.
> 
> The problem is the routine, which create the directory tree, which
> then can be used in a GtkTreeView and in the ncurses interface.
> 
> I need something like
> 
> 0	/INBOX/
> 1	/INBOX.ML_devel/
> 2	/INBOX.ML_devel.djgpp/
> 
OK Michelle,

I think I'm _almost_ understood what you need (or perhaps not ;-) let's see:

It seems obvious at this time that just counting the number of dots in 
the strings is not what you need/want, as this is trivial in C.

So would you like to build a function in C that receiving as argument a 
string like:

	~/INBOX/ returns ~/INBOX/
	/INBOX.ML_devel/ returns .ML_devel/
	/INBOX.ML_devel.djgpp/ returns .djgpp/

Is it there near of your needs?

--
Cesar Rabak

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019