-static Subject *subject_study(Subject * self)
-{
- if (self->a == NULL) {
- return self;
- }
- if (self->b == NULL) {
- fprintf(self->out, "%s", self->a);
- return self;
- }
- if (strcmp(self->a, self->b) == 0) {
- self->recurrence++;
- } else {
- fprintf(self->out, "%s", self->a);
- self->recurrence = 0;
- }
- return self;
-}
-
-static int
-set_file_pointers(int schema, FILE ** in, FILE ** out, char **argv)
-{
- switch (schema) {
- case 0:
- *in = stdin;
- *out = stdout;
- break;
- case 1:
- *in = fopen(argv[0], "r");
- *out = stdout;
- break;
- case 2:
- *in = fopen(argv[0], "r");
- *out = fopen(argv[1], "w");
- break;
- }
- if (*in == NULL) {
- fprintf(stderr, "uniq: %s: %s\n", argv[0], strerror(errno));
- return errno;
- }
- if (*out == NULL) {
- fprintf(stderr, "uniq: %s: %s\n", argv[1], strerror(errno));
- return errno;
- }
- return 0;
-}
-
-
-/* one variable is the decision algo */
-/* another variable is the printing algo */
-
-/* I don't think I have to have more than a 1 line memory
- this is the one constant */
-
-/* it seems like GNU/uniq only takes one or two files as an option */
-
-/* ________________________________________________________________________ */