Back to index

php5  5.3.10
fpm_str.h
Go to the documentation of this file.
00001 
00002        /* $Id: fpm_str.h,v 1.3 2008/05/24 17:38:47 anight Exp $ */
00003        /* (c) 2007,2008 Andrei Nigmatulin */
00004 
00005 #ifndef FPM_STR_H
00006 #define FPM_STR_H 1
00007 
00008 static inline char *str_purify_filename(char *dst, char *src, size_t size) /* {{{ */
00009 {
00010        char *d, *end;
00011 
00012        d = dst;
00013        end = dst + size - 1;
00014 
00015        for (; d < end && *src; ++d, ++src) {
00016               if (* (unsigned char *) src < ' ' || * (unsigned char *) src > '\x7f') {
00017                      *d = '.';
00018               } else {
00019                      *d = *src;
00020               }
00021        }
00022 
00023        *d = '\0';
00024 
00025        return d;
00026 }
00027 /* }}} */
00028 
00029 #endif