Q:

how to change the input of this program? (C Language)

How can I replace the use of (FILE) and (fopen) with (scanf) to get the input values and send in these 2 functions?
I want to use this function in Objective-c code.
For more info you can see the whole code here link
static void stemfile(FILE * f)
{  while(TRUE)
{  int ch = getc(f);
    if (ch == EOF) return;
    if (LETTER(ch))
    {  int i = 0;
        while(TRUE)
        {  if (i == i_max) increase_s();

            ch = tolower(ch); /* forces lower case */

            s[i] = ch; i++;
            ch = getc(f);
            if (!LETTER(ch)) { ungetc(ch,f); break; }
        }
        s[stem(s,0,i-1)+1] = 0;
        /* the previous line calls the stemmer and uses its result to
         zero-terminate the string in s */
        printf("%s",s);
    }
    else putchar(ch);
}
}

int main(int argc, char * argv[])
{  int i;
    s = (char *) malloc(i_max+1);
    for (i = 1; i < argc; i++)
    {  FILE * f = fopen(argv[i],"r");
        if (f == 0) { fprintf(stderr,"File %s not found\n",argv[i]); exit(1); }
        stemfile(f);
    }
    free(s);
    return 0;
}

A:

I'm still not sure why you would want to use scanf() in main().  It would presumably mean changing the interface of stemfile() (including the name since it would no longer be processing a file) to take a character string as input.  And scanf() is going to make life difficult; it will read strings separated by blanks, which may be part of its attraction, but it will include any punctuation that is included in the 'word'.
As Randall noted, the code in the existing function is a little obsure; I think it could be written more simply as follows:
#include <stdio.h>
#include <ctype.h>
#define LETTER(x) isalpha(x)

extern int stem(char *s, int lo, int hi);

static void stemfile(FILE * f)
{
    int ch;
    while ((ch = getc(f)) != EOF)
    {
        if (LETTER(ch))
        {
            char s[1024];
            int i = 0;
            s[i++] = ch; 
            while ((ch = getc(f)) != EOF && LETTER(ch))
                s[i++] = ch;
            if (ch != EOF)
                ungetc(ch, f);
            s[i] = '\0';
            s[stem(s, 0, i-1)+1] = 0;
            /* the previous line calls the stemmer and uses its result to
               zero-terminate the string in s */
            printf("%s", s);
        }
        else
            putchar(ch);
    }
}

I've slightly simplified things by making s into a simple local variable (it appears to have been a global, as does imax), removing imax and the increase_s() function.  Those are largely incidental to the operation of the function.
If you want this to process a (null-terminated) string instead, then:
static void stemstring(const char *src)
{
    char ch;
    while ((ch = *src++) != '\0')
    {
        if (LETTER(ch))
        {
            int i = 0;
            char s[1024];
            s[i++] = ch;
            while ((ch = *src++) != '\0' && LETTER(ch))
                s[i++] = ch;
            if (ch != '\0')
                src--;
            s[i-1] = '\0';
            s[stem(s,0,i-1)+1] = 0;
            /* the previous line calls the stemmer and uses its result to
               zero-terminate the string in s */
            printf("%s",s);
        }
        else
            putchar(ch);
    }
}

This systematically changes getc(f) into *src++, EOF into \0, and ungetc() into src--.  It also (safely) changes the type of ch from int (necessary for I/O) to char.  If you are worried about buffer overflow, you have to work a bit harder in the function, but few words in practice will be even 1024 bytes (and you could use 4096 as easily as 1024, with correspondingly smaller - infinitesimal - chance of real data overflowing the buffer.  You need to judge whether that is a 'real' risk for you.
The main program can become quite simply:
int main(void)
{
    char string[1024];
    while (scanf("%1023s", string) == 1)
        stemstring(string);
    return(0);
}

Clearly, because of the '1023' in the format, this will never overflow the inner buffer.  (NB: Removed the . from "%.1023s" in first version of this answer; scanf() is not the same as printf()!).

Challenged: does this work?
Yes - this code below (adding a dummy stem() function and slightly modifying the printing) works reasonably well for me:
#include <stdio.h>
#include <ctype.h>
#include <assert.h>

#define LETTER(x) isalpha(x)
#define MAX(x, y) (((x) > (y)) ? (x) : (y))

static int stem(const char *s, int begin, int end)
{
    assert(s != 0);
    return MAX(end - begin - 3, 3);
}

static void stemstring(const char *src)
{
    char ch;
    while ((ch = *src++) != '\0')
    {
        if (LETTER(ch))
        {
            int i = 0;
            char s[1024];
            s[i++] = ch;
            while ((ch = *src++) != '\0' && LETTER(ch))
                s[i++] = ch;
            if (ch != '\0')
                src--;
            s[i-1] = '\0';
            s[stem(s,0,i-1)+1] = 0;
            /* the previous line calls the stemmer and uses its result to
               zero-terminate the string in s */
            printf("<<%s>>\n",s);
        }
        else
            putchar(ch);
    }
    putchar('\n');
}

int main(void)
{
    char string[1024];
    while (scanf("%1023s", string) == 1)
        stemstring(string);
    return(0);
}

Example dialogue
H:  assda23
C:  <<assd>>
C:  23
H:  3423///asdrrrf12312
C:  3423///<<asdr>>
C:  12312
H:  12//as//12
C:  12//<<a>>
C:  //12

The lines marked H: are human input (the H: was not part of the input); the lines marked C: are computer output.

Next attempt
The trouble with concentrating on grotesquely overlong words (1023-characters and more) is that you can overlook the simple.  With scanf() reading data, you automatically get single 'words' with no spaces in them as input.  Here's a debugged version of stemstring() with debugging printing code in place.  The problem was two off-by-one errors.  One was in the assignment s[i-1] = '\0'; where the -1 was not needed.  The other was in the handling of the end of a string of letters; the while ((ch = *src++) != '\0') leftsrcone place too far, which led to interesting effects with short words entered after long words (when the difference in length was 2 or more).  There's a fairly detailed trace of the test case I devised, using words such as 'great' and 'book' which you diagnosed (correctly) as being mishandled.  Thestem()` function here simply prints its inputs and outputs, and returns the full length of the string (so there is no stemming occurring).
#include <stdio.h>
#include <ctype.h>
#include <assert.h>

#define LETTER(x) isalpha(x)
#define MAX(x, y) (((x) > (y)) ? (x) : (y))

static int stem(const char *s, int begin, int end)
{
    int len = end - begin + 1;
    assert(s != 0);
    printf("ST (%d,%d) <<%*.*s>> RV %d\n", begin, end, len, len, s, len);
//    return MAX(end - begin - 3, 3);
    return len;
}

static void stemstring(const char *src)
{
    char ch;
    printf("-->> stemstring: <<%s>>\n", src);
    while ((ch = *src++) != '\0')
    {
        if (ch != '\0')
            printf("LP <<%c%s>>\n", ch, src);
        if (LETTER(ch))
        {
            int i = 0;
            char s[1024];
            s[i++] = ch;
            while ((ch = *src++) != '\0' && LETTER(ch))
                s[i++] = ch;
            src--;
            s[i] = '\0';
            printf("RD (%d) <<%s>>\n", i, s);
            s[stem(s, 0, i-1)+1] = '\0';
            /* the previous line calls the stemmer and uses its result to
               zero-terminate the string in s */
            printf("RS <<%s>>\n", s);
        }
        else
            printf("NL <<%c>>\n", ch);
    }
    //putchar('\n');
    printf("<<-- stemstring\n");
}

int main(void)
{
    char string[1024];
    while (scanf("%1023s", string) == 1)
        stemstring(string);
    return(0);
}

The debug-laden output is shown (the first line is the typed input; the rest is the output from the program):
what a great book this is! What.hast.thou.done?
-->> stemstring: <<what>>
LP <<what>>
RD (4) <<what>>
ST (0,3) <<what>> RV 4
RS <<what>>
<<-- stemstring
-->> stemstring: <<a>>
LP <<a>>
RD (1) <<a>>
ST (0,0) <<a>> RV 1
RS <<a>>
<<-- stemstring
-->> stemstring: <<great>>
LP <<great>>
RD (5) <<great>>
ST (0,4) <<great>> RV 5
RS <<great>>
<<-- stemstring
-->> stemstring: <<book>>
LP <<book>>
RD (4) <<book>>
ST (0,3) <<book>> RV 4
RS <<book>>
<<-- stemstring
-->> stemstring: <<this>>
LP <<this>>
RD (4) <<this>>
ST (0,3) <<this>> RV 4
RS <<this>>
<<-- stemstring
-->> stemstring: <<is!>>
LP <<is!>>
RD (2) <<is>>
ST (0,1) <<is>> RV 2
RS <<is>>
LP <<!>>
NL <<!>>
<<-- stemstring
-->> stemstring: <<What.hast.thou.done?>>
LP <<What.hast.thou.done?>>
RD (4) <<What>>
ST (0,3) <<What>> RV 4
RS <<What>>
LP <<.hast.thou.done?>>
NL <<.>>
LP <<hast.thou.done?>>
RD (4) <<hast>>
ST (0,3) <<hast>> RV 4
RS <<hast>>
LP <<.thou.done?>>
NL <<.>>
LP <<thou.done?>>
RD (4) <<thou>>
ST (0,3) <<thou>> RV 4
RS <<thou>>
LP <<.done?>>
NL <<.>>
LP <<done?>>
RD (4) <<done>>
ST (0,3) <<done>> RV 4
RS <<done>>
LP <<?>>
NL <<?>>
<<-- stemstring

The techniques shown - printing diagnostic information at key points in the program - is one way of debugging a program such as this.  The alternative is stepping through the code with a source code debugger - gdb or its equivalent.  I probably more often use print statements, but I'm an old fogey who finds IDE's too hard to use (because they don't behave like the command line I'm used to).
Granted, it isn't your code any more, but I do think you should have been able to do most of the debugging yourself.  I'm grateful that you reported the trouble with my code.  However, you also need to learn how to diagnose problems in other people's code; how to instrument it; how to characterize and locate the problems.  You could then report the problem with precision - "you goofed with your end of word condition, and ...".

