/*^M
   strrev - An inplementation of Microsoft Visual C's strrev function^M
   Copyright (C) 2002 John Ericson^M
*/^M
^M
#include "strrev.h"

#ifndef MSVC

char *strrev(char *str) {

   int i;
   char tmp,
        *ret;

   i = strlen(str) - 1;
   ret = str;

   /* Works is way from both ends towards the middle and
      exchanges the chars on both ends with eachother */
   for(; *str && i > 0; str++, i-=2) {
      tmp      = *str;
      *str     = *(str+i);
      *(str+i) = tmp;
   }

   return ret;
}

#endif