pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/joedavis/snprintf

e-bedb41adf21fe337.css" /> GitHub - joedavis/snprintf: Freestanding implementation of snprintf
Skip to content

joedavis/snprintf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Freestanding snprintf and vsnprintf

Included in this repository is a relatively simple implementation of snprintf and vsnprintf that I wrote in the course of an hour or two for use in a hobbyist microkernel. I've found myself writing this code or similar several times in the past, so decided to write a reasonably comprehensive implementation of snprintf that covers most of my use cases.

It does not include support for:

  • Floating point: FP shouldn't be used in a kernel, and printing floating point isn't something I'm interesting in figuring out at the moment.
  • %n: I've never needed it. It would be reasonably trivial (5 or 6 lines) to implement.
  • Wide characters: I don't plan on supporting anything other than UTF-8. Again, this should be a short patch if you need it.
  • * precision, i.e. specifying precision in the next argument: I haven't needed it in the kernel. If you need it, it's a short patch away.
  • POSIX extensions such as %m$ and *n$ style format specifiers, as well as the ' (thousands separator) format flag. These are avoided purely for simplicity of the implementation.

The code has been written with extensibility in mind, so all but the POSIX extensions and floating point support would be easy to add if needed.

License: ISC

Copyright © 2018, Joe Davis me@jo.ie

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

About

Freestanding implementation of snprintf

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy