C Board  

Go Back   C Board > Community Boards > General Discussions

Reply
 
LinkBack Thread Tools Display Modes
Old 03-31-2007, 02:09 PM   #16
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,698
Quote:
Originally Posted by zacs7 View Post
DWKS, perhaps look into the <pre></pre> tags and keep tabs?, Rather than converting them to spaces...?

Think about it, its an extra 3 bytes per tab... It all adds up. Not to mention it makes the highlighted source easier to "cut & paste" while keeping its original formatting.

Anywho just thought i'd comment.
Actually right now codeform prints all whitespace verbatim into the output file. Any tabs, spaces, or newlines in your source file will also be in the output file.

The HTML output format does indeed use <pre></pre> tags. (See the files rules/_html.)

If you wanted to have tabs converted to spaces or vice versa you could either do it yourself with a separate program -- it's quite easy; I think I have at least five programs that do it -- or create rules that look like this:
Code:
=keyword
<tab>::<space><space><space><space>:# converts tabs to spaces
<space><space><space><space>:<tab>:# converts spaces to tabs
Note that I don't know if that will work; keywords containing spaces might not match properly. (And codeform isn't on this computer so I can't test it.) It should however and if it doesn't just give me a shout.

Comments are much appreciated.
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
dwks is offline   Reply With Quote
Old 03-31-2007, 05:13 PM   #17
Woof, woof!
 
zacs7's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 3,295
You should make a CGI version to perhaps?
__________________
"I.T. gets the chicky-babes" - M. Kelly
bakefile | vim
zacs7 is offline   Reply With Quote
Old 03-31-2007, 05:58 PM   #18
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,698
Guess what? I was doing just that. If you'd signed up before the board crashed, I could link you to the thread, but alas it is gone. I wrote a Perl script which ran codeform on the remote server. It worked perfectly, but codeform was running as a priviledged user, opening up tons of security holes. Unfortunately there doesn't seem to be a user called nobody on that server. So I guess I could host codeform version 1.2.0 online, as it is called, but would it be a good idea? . . . .

My only idea was to restrict the input file to, say, 32KB, to reduce the risk of buffer overruns. Codeform, as I mentioned, does not have any memory leaks when run through Valgrind, but it does have lots of "Invalid read"s. I don't know what those are but I'm guessing they're related to buffer overruns. Once I fix those I think I will host codeform online. We'll see.

If you have a server that will run Perl scripts that can execute other programs which may or may not have buffer overruns, let me know.
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
dwks is offline   Reply With Quote
Old 03-31-2007, 06:14 PM   #19
Woof, woof!
 
zacs7's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 3,295
I did sign-up before the board crashed I lost my account...

Anywho, as you mentioned in the other thread perhaps link to standard-c functions ?

And maybe something for the future: use anchors for user declared functions so you can 'skip' to their declarations, eg

Code:
<pre>

void Foo(void);

int main(void)
{
	<a href="#foo">Foo</a>();
	return 0;
}

<a name="foo"></a>
void Foo(void)
{
	return;
}

</pre>
Sorry, I don't currently have access to a server , specially not one with, DuN-DUN-DUN PERL!:P
__________________
"I.T. gets the chicky-babes" - M. Kelly
bakefile | vim

Last edited by zacs7; 03-31-2007 at 06:18 PM.
zacs7 is offline   Reply With Quote
Old 03-31-2007, 06:23 PM   #20
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,698
Quote:
I did sign-up before the board crashed :frown: I lost my account...
That's too bad. All I lost was 300 posts. You lost your join date etc . . .

Quote:
Anywho, as you mentioned in the other thread perhaps link to standard-c functions ?
Actually I just did that really quickly . . . here's the gist of it.
Code:
linkfuncbb=[url=
linkfuncba=]
linkfunca=[/url]
linkfuncurl=http://www.opengroup.org/pubs/online/7908799/xsh/

=keyword
atoi:$(linkfuncbb)$(linkfuncurl)atoi$(linkfuncba):$(linkfunca)
printf:$(linkfuncbb)$(linkfuncurl)printf$(linkfuncba):$(linkfunca) 
(Highlighted with codeform. ) I still need to find a list of C functions, though. (Feel free to find one. :P) It's used like so:
Code:
$ codeform -f rules/c_1_vbb -f rules/clinkfunc
Quote:
And maybe something for the future: use anchors for user declared functions so you can 'skip' to their declarations, eg
Code:
<pre>

void Foo(void);

int main(void)
{
	<a href="#foo">Foo</a>();
	return 0;
}

<a name="foo"></a>
void Foo(void)
{
	return;
}

</pre>
Unfortunately codeform is currently a single-pass parser. Doing something like that would be impossible. I plan to change it however.

Quote:
Sorry, I don't currently have access to a server , specially not one with, DuN-DUN-DUN PERL!:P
I can find tons of free web hosts that support Perl, but none of them like me executing codeform from within the Perl script . . . not surprisingly.
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
dwks is offline   Reply With Quote
Old 03-31-2007, 06:33 PM   #21
Woof, woof!
 
zacs7's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 3,295
I created a IRC bot a while ago, in the process I made a list of most of the standard C functions....

See the attachment, I know it doesn't contain URLS, but its a start - and it does explain what each does. Perhaps you could add tooltips for the standard funcs instead (so it doesn't rely on the internet)
Attached Files
File Type: txt functions.lib.txt (22.0 KB, 97 views)
__________________
"I.T. gets the chicky-babes" - M. Kelly
bakefile | vim
zacs7 is offline   Reply With Quote
Old 03-31-2007, 06:44 PM   #22
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,698
Thanks for the list. I'll transform it into some codeform files as soon as I can (probably by tomorrow night). One to turn "printf" into
Code:
$(clinkfuncbb)$(clinkfuncurl)printf$(clinkfuncba)printf$(clinkfunca)
or
Code:
[url=http://www.opengroup.org/pubs/online/7908799/xsh/printf]printf[/url]
and one for
Code:
<a alt="printf(f, ...) is equivalent to fprintf(stdout, f, ...)">printf</a>
perhaps with a link too. I may re-create the alts though. That printf one isn't too helpful.
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
dwks is offline   Reply With Quote
Old 04-01-2007, 04:13 AM   #23
Woof, woof!
 
zacs7's Avatar
 
Join Date: Mar 2007
Location: Australia
Posts: 3,295
yes well :P, I didn't write the descriptions they're from the web...
__________________
"I.T. gets the chicky-babes" - M. Kelly
bakefile | vim
zacs7 is offline   Reply With Quote
Old 04-02-2007, 12:01 PM   #24
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,698
Sorry, I haven't finished the clinkfunc rules (as they are to be called) yet. My estimates are always off . . . six months before I first released codeform I said "codeform should be finished within two weeks or maybe three."

I have implemented doubling-the-allocated-memory-size. It hasn't been uploaded yet though. (It's a simple two line change to get_string().)

I have attached the latest version of codeform online's Perl script in case anyone's interested. [edit] I attached the wrong file. I'm also attaching the Perl script now. [/edit]
Attached Files
File Type: txt functions.txt (22.0 KB, 112 views)
File Type: txt codeform.pl.txt (3.6 KB, 118 views)
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.

Last edited by dwks; 04-02-2007 at 02:56 PM.
dwks is offline   Reply With Quote
Old 04-02-2007, 12:38 PM   #25
Crazy Fool
 
Perspective's Avatar
 
Join Date: Jan 2003
Location: Canada
Posts: 2,596
how about linking standard (or common lib) functions to online definitions (like online man pages or something).
Perspective is offline   Reply With Quote
Old 04-02-2007, 01:53 PM   #26
Registered User
 
kryptkat's Avatar
 
Join Date: Dec 2002
Posts: 487
note. i did put math.h functions names in winapi list. they are included just the names.

note 2. if anyone wants dx9 list. i may start on it sometime.
kryptkat is offline   Reply With Quote
Old 04-02-2007, 02:52 PM   #27
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,698
Quote:
how about linking standard (or common lib) functions to online definitions (like online man pages or something).
That's exactly what this clinkfunc will do. In theory. Here's an example of what it should look like: http://cboard.cprogramming.com/showp...67&postcount=8

Quote:
note. i did put math.h functions names in winapi list. they are included just the names.
Okay, good to know.
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
dwks is offline   Reply With Quote
Old 04-02-2007, 05:02 PM   #28
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,698
I've decided to risk it and host codeform version 1.2.0 online. Perhaps it should have a new thread -- but too late now.

Codeform version 1.2.0 online: http://dwks.theprogrammingsite.com/m...e/cfonline.htm

Tell me how you like it. If you find any bugs please let me know. Just as before, input files are limited to 32KB in size. The Windows API rules are also supported (only for style 1).

I may not keep codeform online up and running forever, but if I stop hosting it I'll let everyone know here.

[edit] The Perl script is attached, with .txt added. [/edit]
Attached Files
File Type: txt codeform.pl.txt (4.1 KB, 127 views)
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
dwks is offline   Reply With Quote
Old 04-02-2007, 05:37 PM   #29
MENTAL DETECTOR
 
whiteflags's Avatar
 
Join Date: Apr 2006
Location: United States
Posts: 3,295
> If you find any bugs please let me know.
The browser will parse #include <header> as #include, and template stuff will also act up,
which is wrong. At least let your users knw this is the case to avoid a surprise.

Other than that, you've done a nifty job so far.
whiteflags is offline   Reply With Quote
Old 04-03-2007, 11:46 AM   #30
Frequently Quite Prolix
 
dwks's Avatar
 
Join Date: Apr 2005
Location: Canada
Posts: 7,698
What do you mean?
Code:
#include <stdio.h>

template <typename t> 
It works pretty well for me. Post the code you messed it up with. [edit] That's how it's supposed to look BTW. If you were thinking it should look like
Code:
#include <stdio.h>
well, that wasn't how it was designed. twomers wanted the same thing however. It's relatively easy to implement; just get rid of the "#" comment and add these keywords:
Code:
=keyword
#include:[color=green]:[/color]
#define:...etc...
I may add an option in codeform online to do that. [/edit]

Quote:
Other than that, you've done a nifty job so far.
Thank you.
__________________
dwk

Seek and ye shall find. quaere et invenies.

"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell


Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net

My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.

Last edited by dwks; 04-03-2007 at 12:16 PM.
dwks is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
No Version info tab in file properties? cpjust Windows Programming 2 06-03-2008 03:42 PM
How to set File Version of VC++ 6 dll mercury529 Windows Programming 3 12-08-2006 02:49 PM
Finding the windows version... The_Muffin_Man Windows Programming 1 06-10-2004 11:39 PM
Dev C++ Version 5 Zoalord C++ Programming 3 08-30-2003 01:56 PM
Problem building Quake source Silvercord Game Programming 14 01-25-2003 10:01 PM


All times are GMT -6. The time now is 02:46 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22