jeremybobbin / libst Goto Github PK
View Code? Open in Web Editor NEWSuckless Terminal ANSI parser
License: MIT License
Suckless Terminal ANSI parser
License: MIT License
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.
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.
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 *);
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;
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 *);
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.