Re: Embeddable editor C source?

> >Does anyone know of C source code for embedding > >a simple editor that communicates via serial port with > >an ANSI terminal? I'm currently writing something > > BusyBox includes a pretty good vi clone.

Look for ed, in the gnu sources. That is precisely what it was designed to do. The book "Software Tools" will lead you to a simpler version. If "Ansi Terminal" means handling Ansi escape sequences then you can go much further, but code is more complex. ed is a line editor. vi usually uses it as the underlying editor.

--
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
 Click to see the full signature
Reply to
CBFalconer
Loading thread data ...

CBFalconer wrote: [...]

Well, let's say vi *used to* be just a full-screen front-end to an underlying line editor --- thus its name: "Visual Interface". But AFAIK, that line editor was 'ex', the extended version of 'ed'.

But nowadays, for the majority of people having a vi installed, that will actually be VIM or one of the other modern versions, which have their 'ex' built right into it. I.e. the common situation is:

lrwxrwxrwx /bin/ex -> vi lrwxrwxrwx /bin/rvi -> vi

-rwxr-xr-x /bin/vi

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

Woudn't using GNU GPL source code in the project require distribution all the code for the device?

Reply to
Dingo

If it is a separate program, why? If it is embedded in something else, yes, but that was not the OPs question.

--
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
 Click to see the full signature
Reply to
CBFalconer

Using GPL source requires that you give source for the program which uses GPL code.

You are not prohibited from using GPL programs with non-GPL programs. As long as the source code for the GPL program is separate.

Tivo, for example, releases a lot of GPL source code, but the programs they developed themselves are not GPL, and this is prefectly acceptable.

For an interesting spin on busybox, see the busybox hall of shame:

formatting link

--buddy

--
Remove '.spaminator' and '.invalid' from email address
when replying.
Reply to
buddy.spaminator.smith

Well, this _is_ c.a.embedded, and the subject is an embeddable editor (for an 8-bit platform, too, which probably makes use of GNU ed a non-option, anyway).

While I'm certainly not a lawyer, I don't think one can have separate programs inside an actual embedded system so as to wiggle out of the so-called "GPL virus" clause that way.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

Thanks, hadn't thought of looking in "Software Tools" event though the book is right on the bookshelf in front of me. I did look now and got some ideas but they correctly warn that their editor is very large, more than 900 lines of code! Not much on on my PC but more than I wanted to spend on my 8051.

Anyway, I'm continuing with my homegrown editor for now...

Andrew

Reply to
andrew queisser

There are several vi clones, I assume that there are some BSD licensed as well... googling...

formatting link

If you have an OS it won't be difficult - but that might create to much demand on the HW.

/RogerL

--
Roger Larsson
Skellefteå
 Click to see the full signature
Reply to
Roger Larsson

I think you will find a large portion of that is regular expression processing, and somehow I doubt you really need that.

--
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
 Click to see the full signature
Reply to
CBFalconer

I think an argument could probably be made for a separate executable running under a heavyweight RTOS (VxWorks, QNX, etc.). In any case I'm sure the FSF would find some way to disagree.

George (also not a lawyer)

============================================== Send real email to GNEUNER2 at COMCAST dot NET

Reply to
George Neuner

I don't think so. You, OTOH, seem to be jumping to conclusions quite quickly.

To pick a nit: definitely not for "all programs containing GPL source code". Only for those I distributed binaries of.

But that's not the issue I was talking about anyway.

That issue is whether, on a typical embedded system (no OS, no user interface to run individual programs from), you ever _have_ more than one PROGRAM on the entire thing, in legalese terms. It's essentially the old question 'what does "linking" really mean?', asked in a rather different set of circumstances than usual.

It's the question of whether including a copy of what would usually be built as a separate program, run by an OS, into the rather monolithic piece of software running on an embedded device like this will invoke the "you have to provide source to _all_ of it" clause. To avoid that, you would have to provide a means for the user to replace that "program" by an updated version, at any time, without any need for assistance by you. On a small embedded system like the one discussed in this thread, that's hardly ever going to be feasible.

Those are pretty untypical for the class of embedded systems, actually. This may be changing with time, but in the case we're discussing, using something as big as Linux would be a non-option anyway --- GNU "ed" alone could easily be larger than that system's entire code memory!

Please don't go assuming things about my understanding of the GPL if you don't grasp the context I was mentioning it in.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

Hans-Bernhard Broeker wrote: : : While I'm certainly not a lawyer, I don't think one can have separate : programs inside an actual embedded system so as to wiggle out of the : so-called "GPL virus" clause that way. :

You are incorrect. The GPL refers to PROGRAMS. As long as you're distributing a binary, whether it's on a CD or inside a flash filesystem, you are required to release source to all programs containing GPL source code.

Other programs, which do not contain GPL source, can be licensed however you want.

If you don't believe me, look at the myriad of devices using linux. Linksys routers, Tivos, Satellite boxes, etc. I can guarantee that they do not release all of their internal source code. However, they do release source code for GPL applications that they use (modified or not), as this is required.

Please don't go assuming things about the GPL if you don't understand it. I would recommend that you visit the FSF website

formatting link

Also, if you WANT to use GPL source, but need to put it inside your own program, you can always email the developer and ask for permission. Most of the time they don't care.

ttyl,

--buddy [ed: superceded post to correct my grammar. apologies] -- Remove '.spaminator' and '.invalid' from email address when replying.

Reply to
buddy.spaminator.smith

On 20 Feb 2004 14:42:43 GMT, Hans-Bernhard Broeker wrote: [snip...snip...]

The GNU family has some libraries that are released under the LGPL (was "Library GPL", now translates as "Lesser GPL").

formatting link
goes into some detail regarding the licensing that applies to works that link to LGPL libraries, much more so than I'd feel comfortable summarizing here.

I'm sure H-B B and many of the previous posters are aware of the LGPL and its terms but I thought this might be a good spot mention it in this thread, since some folks might not know of it.

--
Rich Webb   Norfolk, VA
Reply to
Rich Webb

Your 80x86 is only capable of executing one instruction stream at a time, although this is somewhat hidden under caches, look aheads, speculative execution, etc. Linux is a program running on that system that makes it appear to be able to execute multiple programs simultaneously, or in sequence, or whatever.

If your little embedded application can be told to execute various discrete packages, it is also an OS. It may not be as capable as Linux. If it uses GPL code to do that, you need to publish all its code. If it just loads a module and provides some services for it, the fact that that module uses GPL code only requires that that modules code be published.

At least as I see it. IANAL.

--
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
 Click to see the full signature
Reply to
CBFalconer

The point you are missing is that a lot of embedded systems are delivered as a single executable ... even systems which are based on a RTOS can be a single executable with the OS kernel embedded within. And don't forget that many small systems have no file system to store a separate "program".

George ============================================== Send real email to GNEUNER2 at COMCAST dot NET

Reply to
George Neuner

The editor code in question are not among them.

George ============================================== Send real email to GNEUNER2 at COMCAST dot NET

Reply to
George Neuner

Anthony C Howe wrote a tiny editor for the International obfuscated C code contest. The non-obfuscated version - including comments and blank lines - is less than 300 lines of C source.

It includes commands to move the cursor around, insertion and deletion, and save-file and quit.

It uses Curses for terminal I/O. For a project I had a while back, I found it pretty easy to replace the curses interface with a simple ansi terminal interface, change the vi-like interface to be more like what I prefer, plus, add a few new commands.

He (Anthony C Howe) has a home page, with a software section that includes the non-obfuscated version of the editor. I don't remember the URL, but it should be easy enough to find.

Anyway, it worked for me, perhaps it will for you too.

Reply to
Ed Davis

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.