Git Product home page Git Product logo

libst's Introduction

libst - simple terminal library
--------------------
libst is a library for simple terminal emulators.


Credits
-------
Based on Aurélien APTEL <aurelien dot aptel at gmail dot com> bt source code.

libst's People

Contributors

aaptel avatar k0gamsx avatar jeremybobbin avatar hiltjo avatar djpohly avatar colona avatar avih avatar frign avatar medgar123 avatar electronicru avatar garbeam avatar ericpruitt avatar schachmat avatar pickfire avatar blackbit42 avatar lotheac avatar michaelforney avatar suiginsoft avatar esjeon avatar rpmohn avatar mvdan avatar radare avatar osandov avatar pilona avatar v4hn avatar agonrex avatar wengxt avatar mihailzenkov avatar jceb avatar brandoninvergo avatar

Stargazers

Bocke avatar Rick Blundell avatar Jorge Gomez avatar

Watchers

James Cloos avatar  avatar  avatar

Forkers

rpmohn

libst's Issues

Some general clean up

I'm enjoying experimenting with the libst library, thanks for doing this! It makes really good sense to have this as a library and I hope the st project takes it up.

This isn't an issue as much as some clean up suggestions. I can submit a pull request if you'd like, but I'm not sure if you'll agree with all of them.

Unused function declarations

These functions are declared in libst.h but aren't defined in libst.c. I also don't see them used in any of the examples, so it should be safe to just remove them.

void selclear(Term *);
void selinit(Term *);
void selstart(Term *, int, int, int);
void selextend(Term *, int, int, int, int);
int selected(Term *, int, int);
char *getsel(Term *);

Convenience typedef aliases

These typedef aliases of unsigned types are nice to have, but I don't think they belong in this library header file. They are not necessary to use the library and might be redefined in code that's trying to use the library, potentially causing conflict. I think it's better to move them into libst.c, and then copy them to the st.c example where they are also used.

typedef unsigned char uchar;
typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned short ushort;

Convenience functions

These convenience functions are also nice to have, but again I don't think they should be offered as functions in this library's header file. die() in particular is a function that many programs define on their own, and having it in libst.h could cause a conflict. Similarly for the other three functions. I recommend moving the declarations into libst.c and then copying them into the st.c example where they are also used.

void die(const char *, ...);

void *xmalloc(size_t);
void *xrealloc(void *, size_t);
char *xstrdup(char *);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.