webpage bookmark program in C

C

Chris

I have been learning C and want to write a program and need someone to
point me in the write direction.
I want to write a program to store all my webpage bookmarks in
possibly one file. I want it to be a GUI. The webpage addresses will
be viewed in a tree-like structure eg.
Search Engines
- Google
- Yahoo
News
- BBC
- CNN
So it will be a small database of a few fields. I can add and remove
webpage addresses easily and the topics as well eg Search Engines,
News.
Can I have it as one .exe file storing the code and data together?
That way it is very portable.
Should I use linked list indexes? How should I store the data? I know
i can connect it to a backend database but I want to avoid this. And I
want to do it only in C.
I just need to be pointed in the right direction. I have a copy of
Borland C++.
Can anyone give me an idea of how to start this?

Thanks,
Chris
 
C

CBFalconer

Chris said:
I have been learning C and want to write a program and need
someone to point me in the write direction.
I want to write a program to store all my webpage bookmarks
in possibly one file. I want it to be a GUI. The webpage
addresses will be viewed in a tree-like structure eg.
.... snip ...

Very simple. Use Netscape (or Mozilla). Bookmarks are kept in an
html file. However the subject is Off Topic on c.l.c.
 
S

SM Ryan

(e-mail address removed) (Chris) wrote:
# I have been learning C and want to write a program and need someone to
# point me in the write direction.
# I want to write a program to store all my webpage bookmarks in
# possibly one file. I want it to be a GUI. The webpage addresses will
# be viewed in a tree-like structure eg.

I would suggest not using C. There are other languages like Tcl/Tk which
can do this far easier and far more portably than C.

# Can I have it as one .exe file storing the code and data together?
# That way it is very portable.

That would be using something like a Macintosh resource fork. Not every
operating system provides such beasts, and those that do are very system
specific. To actually modify the relocatable itself is perilous and
requires detailed knowledge of the executable format.

Again, with script languages like Tcl or Perl the executable is text file,
and it is easier and safer to modify these text files.

# Should I use linked list indexes? How should I store the data? I know
# i can connect it to a backend database but I want to avoid this. And I
# want to do it only in C.

In most scripting languages, you have associative arrays (similar to
hash tables) built into the language, and you can use these as a database.

# I just need to be pointed in the right direction. I have a copy of
# Borland C++.

If you want an didactic exercise, you can restrict yourself particular
GUI framework on a particular machine. You might also check with a c++
group, because I think c++ has an extensive library of data structures
including hash table, search trees, and methods to input and output
them.
 
C

Chris

I have been learning C and want to write a program and need someone to
point me in the write direction.
I want to write a program to store all my webpage bookmarks in
possibly one file. I want it to be a GUI. The webpage addresses will
be viewed in a tree-like structure eg.
Search Engines
- Google
- Yahoo
News
- BBC
- CNN
So it will be a small database of a few fields. I can add and remove
webpage addresses easily and the topics as well eg Search Engines,
News.
Can I have it as one .exe file storing the code and data together?
That way it is very portable.
Should I use linked list indexes? How should I store the data? I know
i can connect it to a backend database but I want to avoid this. And I
want to do it only in C.
I just need to be pointed in the right direction. I have a copy of
Borland C++.
Can anyone give me an idea of how to start this?

Thanks,
Chris

Anyone else got any thoughts on this? I beleive it can be done and it
will be done in C. I just need to be pointed in the right direction.
Maybe I will have to make a sacrifice eg the data and the executable
are 2 seperate files.

Thanks,
Chris
 
C

Christopher Benson-Manica

Chris said:
Anyone else got any thoughts on this? I beleive it can be done and it
will be done in C. I just need to be pointed in the right direction.
Maybe I will have to make a sacrifice eg the data and the executable
are 2 seperate files.

These links will help you understand why it cannot be done in standard
C, the subject of this newsgroup:

http://www.ungerhu.com/jxh/clc.welcome.txt
http://www.eskimo.com/~scs/C-faq/top.html
http://benpfaff.org/writings/clc/off-topic.html

In particular, you will have to go elsewhere for any discussion of the
GUI whatsoever. You have a Borland compiler; newsgroups.borland.com
has several groups that can help you. It's a C++ compiler; you can
make your life easier by using the additional capabilities of C++,
which you can find out more about by reading the FAQ for comp.lang.c++:

http://www.slack.net/~shiva/welcome.txt
http://www.parashift.com/c++-faq-lite/

Of course, should you choose C, some parts of your project may be
topical here (parsing a bookmark file, for example).

I don't see why you'd want the data to be bound up in the executable;
if you came up with a good file format, you could edit your bookmarks
with a simple text editor without recompiling the executable.
 
M

Michael Wojcik

I have been learning C and want to write a program and need someone to
point me in the write direction.

Many people feel designing your program before you begin to write
it is a good idea.
I want to write a program to store all my webpage bookmarks in
possibly one file. I want it to be a GUI.

Note that the C language does not include a GUI. There are many
GUI APIs which can be used from C, but you'll have to go elsewhere
for advice on that. (I recommend figuring out on what platform your
program will be implemented, then asking in the group for that
platform; they should be able to offer recommendations. Many GUI
APIs have their own groups as well.)
Can I have it as one .exe file storing the code and data together?

This is a platform-specific question - the C language says nothing
about how translated programs are stored - but most of the hosted C
implementations I'm familiar with do not directly and conveniently
support storing data and program together.
Should I use linked list indexes?

Not a C question. comp.programming would be more appropriate, but
your question is so vague I'm not sure how anyone could give you a
useful answer.
How should I store the data? I know
i can connect it to a backend database but I want to avoid this. And I
want to do it only in C.

C itself provides only one mechanism for the persistent storage of
data: files. The library functions fopen, fclose, fread, fwrite,
fprintf, fscanf, etc are C's data storage mechanism. Anything else
is implementation-specific.
I just need to be pointed in the right direction. I have a copy of
Borland C++.

C++ is not C. C++ implementations can handle most C code in a manner
roughly equivalent to a C implementation, provide the code avoids
the additional keywords and reserved identifiers of C++, makes some
casts that are unnecessary in C, and so forth. Whether this is a
good thing is a matter of contention.

If you actually want to write good C code, I recommend using a C
implementation. There are free ones available for most platforms.

To be honest, though, it sounds like you might be tackling this
project prematurely. I recommend deciding what language you're
really going to use (C or C++), deciding what platform-specific
APIs you'll use (GUI toolkit and so forth), putting together the
appropriate development environment, then working through some
simpler programs first. A tutorial on writing GUI applications
for your target platform, in your target language, would probably
be a good idea.
 
R

Rich Grise

Christopher said:
Chris <[email protected]> spoke thus: ....
http://www.slack.net/~shiva/welcome.txt
http://www.parashift.com/c++-faq-lite/

Of course, should you choose C, some parts of your project may be
topical here (parsing a bookmark file, for example).

I don't see why you'd want the data to be bound up in the executable;
if you came up with a good file format, you could edit your bookmarks
with a simple text editor without recompiling the executable.
A bookmark file? Nothin' to it:
-----------------------------------------
rich@entheos:~/.kde/share/apps/konqueror
$ cat bookmarks.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xbel>
<xbel folded="no" >
<folder folded="no" icon="bookmark_folder" >
<title>Programming</title>
<bookmark icon="favicons/www.research.att.com"
href="http://www.research.att.com/~bs/3rd.html" >
<title>Stroustrup: The C++ Programming Language (Third Edition)</title>
<info>
<metadata>
<time_added>1094248724</time_added>
<time_visited>1094248724</time_visited>
<visit_count>2</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="www"
href="http://www.zib.de/Visual/people/mueller/Course/Tutorial/tutorial.html" <title>Introduction to Object-Oriented Programming Using C++</title>
<info>
<metadata>
<time_added>1093059412</time_added>
<time_visited>1094170600</time_visited>
<visit_count>20</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="www" href="http://tclspice.sourceforge.net/" >
<title>TclSpice</title>
<info>
<metadata>
<time_added>1092269494</time_added>
<time_visited>1092269520</time_visited>
<visit_count>3</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="favicons/www.cgi101.com"
href="http://www.cgi101.com/book/ch1/text.html" >
<title>CGI Programming 101: Chapter 1: Getting Started</title>
<info>
<metadata>
<time_added>1091760970</time_added>
<time_visited>1091762280</time_visited>
<visit_count>3</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="www" href="http://www.cplusplus.com/doc/tutorial/" >
<title>C++ language tutorial</title>
<info>
<metadata>
<time_added>1091654777</time_added>
<time_visited>1093321685</time_visited>
<visit_count>16</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="www" href="http://doc.trolltech.com/2.3/index.html" >
<title>Qt Reference Documentation</title>
<info>
<metadata>
<time_added>1092345307</time_added>
<time_visited>1092345308</time_visited>
<visit_count>2</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="html"
href="file:/usr/doc/qt-3.3.2/html/designer-manual.html" >
<title>Qt Designer Manual</title>
<info>
<metadata>
<time_added>1091402413</time_added>
<time_visited>1093294333</time_visited>
<visit_count>35</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="html"
href="file:/home/rich/Programming/C%2B%2B/Books/Preface.html" >
<title>Preface</title>
<info>
<metadata>
<time_added>1094298549</time_added>
<time_visited>1094298981</time_visited>
<visit_count>6</visit_count>
</metadata>
</info>
</bookmark>
</folder>
<bookmark icon="favicons/my.yahoo.com" href="http://my.yahoo.com/" >
<title>My Yahoo!</title>
<info>
<metadata>
<time_added>1090805190</time_added>
<time_visited>1094440062</time_visited>
<visit_count>311</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="favicons/www.jibjab.com_jibjab"
href="http://www.jibjab.com/" >
<title>JibJab</title>
<info>
<metadata>
<time_added>1091141454</time_added>
<time_visited>1091141501</time_visited>
<visit_count>3</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="www" href="http://www.linuxguruz.com/iptables/" >
<title>LinuxGuruz Netfilter IPTABLES Firewall Page</title>
<info>
<metadata>
<time_added>1091495417</time_added>
<time_visited>1091495419</time_visited>
<visit_count>3</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="favicons/www.sfgate.com"
href="http://www.sfgate.com/cgi-bin/article.cgi?file=/chronicle/archive/2004/01/04/INGPQ40MB81.DTL" <title>Quarantining dissent / How the Secret Service protects Bush from
free speech</title>
<info>
<metadata>
<time_added>1091141144</time_added>
<time_visited>1091978818</time_visited>
<visit_count>4</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="favicons/www.dogstar.dantimax.dk_tubestuf_favicon"
href="http://www.dogstar.dantimax.dk/tubestuf/dzindex.htm" >
<title>Introducing DOGZILLA</title>
</bookmark>
<bookmark icon="favicons/www.brainbashers.com"
href="http://www.brainbashers.com/" >
<title>Brain Teasers and Puzzles: BrainBashers [TM]</title>
<info>
<metadata>
<time_added>1092384689</time_added>
<time_visited>1092384801</time_visited>
<visit_count>17</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="favicons/www.tripod.lycos.com"
href="http://www.tripod.lycos.com/" >
<title>Tripod</title>
<info>
<metadata>
<time_added>1091760147</time_added>
<time_visited>1091760234</time_visited>
<visit_count>4</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="www"
href="http://www.clearlight.com/~mhieb/WVFossils/ice_ages.html" >
<title>Global Warming:A Chilling Perspective</title>
</bookmark>
<bookmark icon="www" href="https://onlinebanking.downeysavings.com/" >
<title>Downey Savings SignOn Frameset</title>
<info>
<metadata>
<time_added>1092790174</time_added>
<time_visited>1094234821</time_visited>
<visit_count>16</visit_count>
</metadata>
</info>
</bookmark>
<bookmark icon="www"
href="http://wombat.san-francisco.ca.us/faqomatic/cache/74.html" >
<title>alt.os.linux.slackware FAQ: THE BOZO MINI-HOWTO VERSION 0.2</title>
</bookmark>
<bookmark icon="favicons/www.tech-edv.co.at"
href="http://www.tech-edv.co.at/lunix/CAD.html" >
<title>LUnIx . . . CAD &amp; Linux</title>
</bookmark>
<bookmark icon="favicons/www.macromedia.com"
href="http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" <title>Macromedia Flash Player Download Center</title>
</bookmark>
<bookmark icon="www" href="http://www.ntia.doc.gov/osmhome/allochrt.pdf" >
<title>http://www.ntia.doc.gov/osmhome/allochrt.pdf</title>
</bookmark>
<bookmark icon="favicons/www.edafe.org_ico_favicon"
href="http://www.edafe.org/slack.html" >
<title>edafe.org: slackware</title>
</bookmark>
<bookmark icon="favicons/www.hpl.hp.com"
href="http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/" >
<title>Linux &amp; Wireless LANs</title>
</bookmark>
<bookmark icon="www" href="http://www.packetpro.com/thinkpad_t30.html" >
<title>Slackware Linux 9.0 on a IBM ThinkPad T30</title>
</bookmark>
</xbel>
rich@entheos:~/.kde/share/apps/konqueror
$
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,146
Messages
2,570,832
Members
47,374
Latest member
anuragag27

Latest Threads

Top