+
+ for (walk = format; *walk != '\0'; walk++) {
+ if (*walk != '%') {
+ *(outwalk++) = *walk;
+ continue;
+ }
+
+ if (strncmp(walk+1, "status", strlen("status")) == 0) {
+ outwalk += sprintf(outwalk, "%s", statusbuf);
+ walk += strlen("status");
+ } else if (strncmp(walk+1, "percentage", strlen("percentage")) == 0) {
+ outwalk += sprintf(outwalk, "%s", percentagebuf);
+ walk += strlen("percentage");
+ } else if (strncmp(walk+1, "remaining", strlen("remaining")) == 0) {
+ outwalk += sprintf(outwalk, "%s", remainingbuf);
+ walk += strlen("remaining");
+ } else if (strncmp(walk+1, "emptytime", strlen("emptytime")) == 0) {
+ outwalk += sprintf(outwalk, "%s", emptytimebuf);
+ walk += strlen("emptytime");
+ }
+ }
+
+ OUTPUT_FULL_TEXT(buffer);