* (c) Lawrence Manning, 2001
* Contains library functions.
*/
-
+
#include "libsmooth.h"
#include <libintl.h>
free(buf);
newtFormAddComponent(f, t);
-
+
s = newtScale(1, 3, width - 2, lines);
newtScaleSet(s, progress);
-
+
newtFormAddComponent(f, s);
newtDrawForm(f);
goto EXIT;
}
setvbuf(p, NULL, _IOLBF, 255);
-
+
while (fgets(buffer, STRING_SIZE, p)) {
newtScaleSet(s, ++progress);
- newtRefresh();
+ newtRefresh();
}
rc = pclose(p);
-
+
EXIT:
newtFormDestroy(f);
newtPopWindow();
-
+
return rc;
}
fprintf(stderr, "Unable to open /proc/modules in checkformodule()\n");
return 0;
}
-
+
while (fgets(buffer, STRING_SIZE, file))
{
if (strncmp(buffer, module, strlen(module)) == 0)
}
}
}
-
+
EXIT:
fclose(file);
-
+
return result;
-}
-
+}
+
int _replace_string(char string[], char *from, char *to)
{
int fromlen = strlen(from);
if (strlen(to) > 0) {
/* Replace string */
ret = _replace_string (temp, from, to);
-
+
/* Write string to new file */
fputs(temp, file2);
} else {
/* Remove string when to is NULL */
- if (!strstr(temp, from))
+ if (!strstr(temp, from))
fputs(temp, file2);
}
}
/* Move the file */
rename (filename2, filename1);
-
+
return (ret);
}