Definition of string_incr()

Previous: update: Actually changing procdef versions! ] [ Top: The procdef manager ] [ Next: The procdef manager ]

A handy little string utility function. I like alpha-only markers (think of them as base-26 numbers.)
 
char * string_incr (char * string)
{
   if (!*string) {
      string[0] = 'a';
      string[1] = '\0';
      return (string);
   }

   if (*string == 'z') {
      string[0] = 'a';
      string_incr (string + 1);
      return (string);
   }

   string[0]++;
   return (string);
}
Previous: update: Actually changing procdef versions! ] [ Top: lpml alpha ] [ Next: The procdef manager ]


This code and documentation are released under the terms of the GNU license. They are additionally copyright (c) 2000, Vivtek. All rights reserved except those explicitly granted under the terms of the GNU license.