From HI-TECH C for CP/M Fan WIKI(EN)
Jump to: navigation, search



Diederick de Vries <diederick@diederickdevries.net>, April 2006


LIBPOSIX is a set of Posix compliant functions for Hi-tech C on MSX-DOS which I needed but did not find in either Hi-tech C's LIBC or Arnold Metselaar's LIBFIX. As I need more over time, I will probably add more.

The code is based heavily on what I could find on the web. Most of it isn't mine at all, I just gathered and adapted it. The copyright notices that apply are in the source files they refer to. Anything that has no such notice is copyright by me, GPL applies (http://www.gnu.org/copyleft/gpl.html).


For information on how to link against a library, I refer you to page 7 of the the Hi-tech C manual. Usually you should do something like this:


Thanks to Arnold Metselaar and the #msxdev folks for helping me get this started!


Below is a list of the files in this archive.

This text.
The library
Header file
c source file containing the strcspn function
c source file containing the strtok function
c source file containing the strspn function
c source file containing the strpbrk function


int strcspn (char *s1, char *s2)
#    This program is free software; you can redistribute it and#or modify  #
#    it under the terms of the GNU General Public License as published by  #
#    the Free Software Foundation; either version 2 of the License, or     #
#    (at your option) any later version.                                   #
char *strpbrk (char *s1, char *s2)
search a string for any of a set of characters
POSIX compliant port by Diederick de Vries <diederick@diederickdevries.net>, April 2006
strpbrk() returns a pointer to the character in s that matches one of the characters in accept, or NULL if no such character is found.
int strspn(char *string, char *accept)
search a string for a set of characters
POSIX compliant port by Diederick de Vries <diederick@diederickdevries.net>, April 2006
strspn() returns the number of characters of the initial segment of string which consists entirely of characters in accept.
char *strtok (char *s, char *delim) {
Copyright (c) 1990, 1991, 1992 X Consortium
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
([comment by editor]Skips. Please refer source code for detailes)
A version of strtok for systems that do not have it

Comments from Wiki editors

We translated from README.TXT up to "FILES", except chaptor names are appended by us. "Functions" chaptor is a edited and integrated text from source files of each functions.

If you need more information, please refer original source files or POSIX standard related files.