.


:




:

































 

 

 

 





, serverSK . 12.3 , DLL, . , , toupper.

, . , , , , , , , :

. , , .

, .

, , , .

, , , , , , .

, , , , , , . , , , , , DLL.

12.3 DLL, .

12.3. command:

/* 12. commands.. */

/* serverSK . */

/* , DLLs. */

/* */

/* . */

/* : arg1 arg2 argn */

/* ( ), . */

 

static void extract_token(int, char *, char *);

 

_declspec(dllexport)

int wcip(char * command, char * output_file)

/* ; . */

/* : ; , wc. */

{

extract_token(1, command, input_file);

fin = fopen(input_file, "r");

/* */

ch = nw = nc = nl = 0;

while ((c = fgetc(fin))!= EOF) {

/* */

}

fclose(fin);

/* . */

fout = fopen(output_file, "w");

if (fout == NULL) return 2;

fprintf(fout, " %9d %9d %9d %s\n", nl, nw, nc, input_file);

fclose(fout);

return 0;

}

 

_declspec(dllexport)

int toupperip(char * command, char * output_file)

/* ; . */

/* ( "toupperip"). */

{

/* */

extract_token(1, command, input_file);

fin = fopen(input_file, "r");

if (fin == NULL) return 1;

fout = fopen(output_file, "w");

if (fout == NULL) return 2;

while ((c = fgetc (fin))!= EOF) {

if (c == '\0') break;

if (isalpha(c)) = toupper(c);

fputc(c, fout);

}

fclose(fin);

fclose(fout);

return 0;

}

 

static void extract_token(int it, char * command, char * token) {

/* "" "it" ( */

/* "0"). "" (token) */

/* . */

return;

}





:


: 2015-09-20; !; : 487 |


:

:

, , .
==> ...

1875 - | 1507 -


© 2015-2024 lektsii.org - -

: 0.008 .