Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

editeur texte langage C

21 réponses
Avatar
titio
Bonsoir,

j'ai besoin d'un programme en C =E0 l'instar d'un =E9diteur de texte qui
donne un acc=E9s =E0 l'utilisateur pour =E9crire, copier, coller et
supprimer du texte.=20

Merci

10 réponses

1 2 3
Avatar
AG
titio wrote:
Bonsoir,

j'ai besoin d'un programme en C à l'instar d'un éditeur de texte qui
donne un accés à l'utilisateur pour écrire, copier, coller et
supprimer du texte.

Merci

En quoi le fait qu'il soit en C est-il si important ? Avez vous besoin

du programme ou de son code source ?

Si c'est les sources, en voilà :

http://www.vim.org/sources.php


AG.

Avatar
Stephane Zuckerman
En quoi le fait qu'il soit en C est-il si important ? Avez vous besoin
du programme ou de son code source ?

Si c'est les sources, en voilà :

http://www.vim.org/sources.php
C'est pas bien de faire les devoirs des autres !

--
"Je deteste les ordinateurs : ils font toujours ce que je dis, jamais ce
que je veux !"
"The obvious mathematical breakthrough would be development of an easy
way to factor large prime numbers." (Bill Gates, The Road Ahead)

Avatar
Vincent Lefevre
Dans l'article <429428a7$0$6808$,
AG écrit:

Si c'est les sources, en voilà :

http://www.vim.org/sources.php


Ce n'est pas du C. :)

--
Vincent Lefèvre - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

Avatar
Sk4RoTT35
Stephane Zuckerman wrote:
En quoi le fait qu'il soit en C est-il si important ? Avez vous besoin
du programme ou de son code source ?

Si c'est les sources, en voilà :

http://www.vim.org/sources.php


C'est pas bien de faire les devoirs des autres !


de toute facon s'il sert le code source de vim a son prof... ca va se voir.


Avatar
Sk4RoTT35


Ce n'est pas du C. :)

"e CTRL_X_THESAURUS (10 + CTRL_X_WANT_IDENT)

#define CTRL_X_CMDLINE 11

#define CHECK_KEYS_TIME 30

#define CTRL_X_MSG(i) ctrl_x_msgs[(i) & ~CTRL_X_WANT_IDENT]

static char *ctrl_x_msgs[] {
N_(" Keyword completion (^N^P)"), /* ctrl_x_mode == 0, ^P/^N compl. */
N_(" ^X mode (^E^Y^L^]^F^I^K^D^V^N^P)"),
/* Scroll has it's own msgs, in it's place there is the msg for local
* ctrl_x_mode = 0 (eg continue_status & CONT_LOCAL) -- Acevedo */
N_(" Keyword Local completion (^N^P)"),
N_(" Whole line completion (^L^N^P)"),
N_(" File name completion (^F^N^P)"),
N_(" Tag completion (^]^N^P)"),"

c'est pas du C ca? en l'occurence, il s'agit du debut du fichier edit.c
extrait des sources de Vim6.3... au risque de te contredire.

Avatar
Yves ROMAN
"Sk4RoTT35" <"skarottes -atchoum- numericable.fr"> a écrit dans le message
de news: 42a8e615$0$166$



Ce n'est pas du C. :)

[...]



c'est pas du C ca? en l'occurence, il s'agit du debut du fichier edit.c
extrait des sources de Vim6.3... au risque de te contredire.



Autre extrait de edit.c :

int
edit(cmdchar, startln, count)
int cmdchar;
int startln; /* if set, insert at start of line */
long count;

Ca m'a pas l'air tout jeune ça.....


Avatar
Antoine Leca
En <news:d8bgu3$r89$, Yves ROMAN va escriure:
int
edit(cmdchar, startln, count)
int cmdchar;
int startln; /* if set, insert at start of line */
long count;

Ca m'a pas l'air tout jeune ça.....


Cela démontre seulement que le programme en question est supposément
portable vers des compilateurs non ANSI. Il y a seulement 10 ans c'était
encore une proportion notable. Et 1995 pour un éditeur de textes orienté
caractère, c'est vraiment une date de naissance maximum (à titre de
comparaison, vi a environ 26 ans, et [q]ed beaucoup plus/trop).

C'est vrai que la question originale du TP est bizarre. Aujourd'hui, écrire
un éditeur de texte cela revient à insérer
CEdit m_Edit;
dans la déclaration... (et non, ce n'est pas du C).

Mais bon, pour aider l'auteur initial s'il n'a pas encore fini:

En <news:,
titio va escriure:
: j'ai besoin d'un programme en C à l'instar d'un éditeur de texte qui
: donne un accés à l'utilisateur pour écrire, copier, coller et
: supprimer du texte.


http://www.tuhs.org/Archive/PDP-11/Trees/V6/usr/source/s1/ed.c
(1332 lignes incluant stdio et les expressions régulières!)


Antoine

Avatar
Vincent Lefevre
Dans l'article <42a8e615$0$166$,
Sk4RoTT35 <"skarottes -atchoum- numericable.fr"> écrit:

c'est pas du C ca? en l'occurence, il s'agit du debut du fichier
edit.c extrait des sources de Vim6.3... au risque de te contredire.


Ce n'est pas en citant juste un bout que tu vas prouver quelque chose.

--
Vincent Lefèvre - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / SPACES project at LORIA

Avatar
Emmanuel Delahaye
Antoine Leca wrote on 10/06/05 :
http://www.tuhs.org/Archive/PDP-11/Trees/V6/usr/source/s1/ed.c
(1332 lignes incluant stdio et les expressions régulières!)


Je vais tenter un portage, mais c'est pas gagné!

main.c:73: parse error before '-' token
main.c:80: parse error before '-' token
main.c:82: parse error before '-' token
main.c:86: parse error before "errfunc"
main.c:86: warning: type defaults to `int' in declaration of `errfunc'
main.c:86: `errfunc' redeclared as different kind of symbol
main.c:85: previous declaration of `errfunc'
main.c:86: warning: data definition has no type or storage class
main.c:87: parse error before string constant
main.c:93: warning: return type defaults to `int'
main.c: In function `main_':
main.c:93: warning: type of `argc' defaults to `int'
main.c:98: warning: implicit declaration of function `signal'
main.c:102: `vflag' undeclared (first use in this function)
main.c:102: (Each undeclared identifier is reported only once
main.c:102: for each function it appears in.)
main.c:114: warning: suggest parentheses around assignment used as
truth value
main.c:117: warning: implicit declaration of function `sbrk'
main.c:117: warning: assignment makes pointer from integer without a
cast
main.c:118: warning: implicit declaration of function `init'
main.c:121: warning: implicit declaration of function `setexit'
main.c:122: warning: implicit declaration of function `commands'
main.c:123: warning: implicit declaration of function `unlink'
main.c: At top level:
main.c:127: warning: return type defaults to `int'
main.c: In function `commands':
main.c:129: warning: type defaults to `int' in declaration of `a1'
main.c:129: warning: type defaults to `int' in declaration of `c'
main.c:143: warning: implicit declaration of function `address'
main.c:143: warning: assignment makes pointer from integer without a
cast
main.c:158: warning: implicit declaration of function `setdot'
main.c:159: warning: implicit declaration of function `newline'
main.c:160: warning: implicit declaration of function `append'
main.c:164: warning: implicit declaration of function `delete'
main.c:173: warning: implicit declaration of function `setnoaddr'
main.c:186: warning: implicit declaration of function `filename'
main.c:192: warning: implicit declaration of function `global'
main.c:197: warning: implicit declaration of function `nonzero'
main.c:212: warning: implicit declaration of function `move'
main.c:230: warning: implicit declaration of function `getline'
main.c:230: warning: passing arg 1 of `puts' makes pointer from integer
without a cast
main.c:240: too few arguments to function `exit'
main.c:245: warning: implicit declaration of function `open'
main.c:249: warning: implicit declaration of function `setall'
main.c:252: warning: implicit declaration of function `exfile'
main.c:258: warning: implicit declaration of function `substitute'
main.c:273: warning: implicit declaration of function `creat'
main.c:275: warning: implicit declaration of function `putfile'
main.c:283: warning: implicit declaration of function `putd'
main.c:288: warning: implicit declaration of function `unix'
main.c:292: warning: `return' with no value, in function returning
non-void
main.c:130: warning: unused variable `p' main.c:131: warning: unused
variable `r'
main.c:175: label `errlab' used but not defined
main.c: At top level:
main.c:300: warning: return type defaults to `int'
main.c: In function `address':
main.c:301: warning: type defaults to `int' in declaration of `a1'
main.c:301: warning: type defaults to `int' in declaration of `minus'
main.c:301: warning: type defaults to `int' in declaration of `c'
main.c:311: invalid type argument of `unary *'
main.c:319: warning: assignment makes pointer from integer without a
cast
main.c:346: warning: implicit declaration of function `compile'
main.c:358: warning: implicit declaration of function `execute'
main.c:385: warning: assignment makes pointer from integer without a
cast
main.c:388: warning: return makes integer from pointer without a cast
main.c:361: label `errlab' used but not defined
main.c: At top level:
main.c:396: warning: return type defaults to `int'
main.c: In function `setdot':
main.c:400: label `errlab' used but not defined
main.c: At top level:
main.c:404: warning: return type defaults to `int'
main.c:415: warning: return type defaults to `int'
main.c: In function `setnoaddr': main.c:417: label `errlab' used but
not defined
main.c: At top level:
main.c:421: warning: return type defaults to `int'
main.c: In function `nonzero':
main.c:423: label `errlab' used but not defined
main.c: At top level:
main.c:427: warning: return type defaults to `int'
main.c: In function `newline':
main.c:428: warning: type defaults to `int' in declaration of `c'
main.c:431: warning: `return' with no value, in function returning
non-void
main.c:437: warning: `return' with no value, in function returning
non-void
main.c:439: label `errlab' used but not defined
main.c: At top level:
main.c:443: warning: return type defaults to `int'
main.c: In function `filename':
main.c:445: warning: type defaults to `int' in declaration of `c'
main.c:454: warning: suggest parentheses around assignment used as
truth value
main.c:455: warning: `return' with no value, in function returning
non-void
main.c:470: warning: suggest parentheses around assignment used as
truth value
main.c:452: label `errlab' used but not defined
main.c: At top level:
main.c:475: warning: return type defaults to `int'
main.c: In function `exfile':
main.c:476: warning: implicit declaration of function `close'
main.c:478: `vflag' undeclared (first use in this function)
main.c: At top level: main.c:485: warning: return type defaults to
`int'
main.c: In function `onintr':
main.c:489: label `errlab' used but not defined
main.c: At top level:
main.c:493: warning: return type defaults to `int'
main.c:493: `errfunc' redeclared as different kind of symbol
main.c:86: previous declaration of `errfunc'
main.c: In function `errfunc':
main.c:494: warning: type defaults to `int' in declaration of `c'
main.c:499: warning: implicit declaration of function `seek'
main.c:510: warning: implicit declaration of function `reset'
main.c: At top level:
main.c:514: warning: return type defaults to `int'
main.c: In function `getchar':
main.c:515: warning: suggest parentheses around assignment used as
truth value
main.c:525: warning: implicit declaration of function `read'
main.c:527: invalid lvalue in unary `&'
main.c: At top level:
main.c:532: warning: return type defaults to `int'
main.c: In function `gettty':
main.c:533: warning: type defaults to `int' in declaration of `c'
main.c:533: warning: type defaults to `int' in declaration of `gf'
main.c:537: warning: assignment makes integer from pointer without a
cast
main.c:544: invalid lvalue in unary `&'
main.c:548: label `errlab' used but not defined
main.c: At top level:
main.c:557: warning: return type defaults to `int'
main.c: In function `getfile':
main.c:558: warning: type defaults to `int' in declaration of `c'
main.c:570: label `errlab' used but not defined
main.c: At top level:
main.c:584: warning: return type defaults to `int'
main.c: In function `putfile':
main.c:587: warning: type defaults to `int' in declaration of `nib'
main.c:593: warning: assignment makes pointer from integer without a
cast
main.c:596: warning: implicit declaration of function `write'
main.c: At top level:
main.c:612: warning: return type defaults to `int'
main.c: In function `append':
main.c:612: warning: type of `a' defaults to `int'
main.c:614: warning: type defaults to `int' in declaration of `a1'
main.c:614: warning: type defaults to `int' in declaration of `a2'
main.c:614: warning: type defaults to `int' in declaration of `rdot'
main.c:616: warning: unnamed struct/union that defines no instances
main.c:619: warning: assignment makes pointer from integer without a
cast
main.c:624: request for member `integer' in something not a structure
or union
main.c:626: warning: implicit declaration of function `putline'
main.c:623: label `errlab' used but not defined
main.c: At top level:
main.c:639: warning: return type defaults to `int'
main.c: In function `unix':
main.c:640: warning: type defaults to `int' in declaration of `savint'
main.c:640: warning: type defaults to `int' in declaration of `pid'
main.c:640: warning: type defaults to `int' in declaration of `rpid'
main.c:644: warning: implicit declaration of function `fork'
main.c:647: warning: implicit declaration of function `execl'
main.c:648: too few arguments to function `exit'
main.c:651: warning: implicit declaration of function `wait'
main.c: At top level:
main.c:657: warning: return type defaults to `int'
main.c: In function `delete':
main.c:658: warning: type defaults to `int' in declaration of `a1'
main.c:658: warning: type defaults to `int' in declaration of `a2'
main.c:658: warning: type defaults to `int' in declaration of `a3'
main.c:666: wrong type argument to unary minus
main.c: At top level:
main.c:677: warning: return type defaults to `int' main.c: In function
`getline': main.c:677: warning: type of `tl' defaults to `int'
main.c:679: warning: type defaults to `int' in declaration of `nl'
main.c:682: warning: implicit declaration of function `getblock'
main.c:682: warning: assignment makes pointer from integer without a
cast
main.c:684: invalid lvalue in unary `&'
main.c:685: warning: suggest parentheses around assignment used as
truth value
main.c:687: warning: assignment makes pointer from integer without a
cast
main.c:690: warning: return makes integer from pointer without a cast
main.c: At top level:
main.c:694: warning: return type defaults to `int'
main.c: In function `putline':
main.c:696: warning: type defaults to `int' in declaration of `nl'
main.c:701: warning: assignment makes pointer from integer without a
cast
main.c:703: invalid lvalue in unary `&'
main.c:704: warning: suggest parentheses around assignment used as
truth value
main.c:711: warning: assignment makes pointer from integer without a
cast
main.c: At top level:
main.c:721: warning: return type defaults to `int'
main.c: In function `getblock':
main.c:721: warning: type of `atl' defaults to `int'
main.c:721: warning: type of `iof' defaults to `int'
main.c:722: warning: type defaults to `int' in declaration of `read'
main.c:722: warning: type defaults to `int' in declaration of `write'
main.c:723: warning: type defaults to `int' in declaration of `bno'
main.c:723: warning: type defaults to `int' in declaration of `off'
main.c:728: `TMPERR' undeclared (first use in this function)
main.c:732: `iblock' undeclared (first use in this function)
main.c:733: parse error before '|' token
main.c:734: warning: return makes integer from pointer without a cast
main.c:736: `oblock' undeclared (first use in this function)
main.c:737: warning: return makes integer from pointer without a cast
main.c:740: warning: implicit declaration of function `blkio'
main.c:744: warning: return makes integer from pointer without a cast
main.c:749: warning: return makes integer from pointer without a cast
main.c:729: label `errlab' used but not defined
main.c: At top level:
main.c:753: warning: return type defaults to `int'
main.c: In function `blkio':
main.c:753: warning: type of `b' defaults to `int'
main.c:753: warning: type of `buf' defaults to `int'
main.c:755: `tfile' undeclared (first use in this function)
main.c:757: `TMPERR' undeclared (first use in this function)
main.c:758: label `errlab' used but not defined
main.c: At top level:
main.c:763: warning: return type defaults to `int'
main.c: In function `init':
main.c:765: warning: type defaults to `int' in declaration of `pid'
main.c:767: `tfile' undeclared (first use in this function)
main.c:769: `iblock' undeclared (first use in this function)
main.c:770: `oblock' undeclared (first use in this function)
main.c:773: warning: implicit declaration of function `getpid'
main.c:776: parse error before '>>' token
main.c:780: warning: implicit declaration of function `brk'
main.c: At top level:
main.c:786: warning: return type defaults to `int'
main.c: In function `global':
main.c:786: warning: type of `k' defaults to `int'
main.c:788: warning: type defaults to `int' in declaration of `c'
main.c:815: invalid lvalue in unary `&'
main.c:817: parse error before '|' token
main.c:816: warning: empty body in an if-statement
main.c:821: invalid lvalue in unary `&'
main.c:793: label `errlab' used but not defined
main.c: At top level:
main.c:831: warning: return type defaults to `int'
main.c: In function `substitute':
main.c:831: warning: type of `inglob' defaults to `int'
main.c:832: warning: type defaults to `int' in declaration of `gsubf'
main.c:832: warning: type defaults to `int' in declaration of `a1'
main.c:832: warning: type defaults to `int' in declaration of `nl'
main.c:835: warning: implicit declaration of function `compsub'
main.c:839: parse error before '|' token
main.c:840: warning: implicit declaration of function `dosub'
main.c:850: warning: assignment makes pointer from integer without a
cast
main.c:851: warning: assignment makes pointer from integer without a
cast
main.c:854: label `errlab' used but not defined
main.c: At top level:
main.c:858: warning: return type defaults to `int'
main.c: In function `compsub':
main.c:859: warning: type defaults to `int' in declaration of `seof'
main.c:859: warning: type defaults to `int' in declaration of `c'
main.c:861: warning: unused variable `gsubf'
main.c:864: label `errlab' used but not defined
main.c: At top level:
main.c:890: warning: return type defaults to `int'
main.c: In function `getsub':
main.c:896: warning: suggest parentheses around assignment used as
truth value
main.c: At top level:
main.c:902: warning: return type defaults to `int'
main.c: In function `dosub':
main.c:911: warning: suggest parentheses around assignment used as
truth value
main.c:913: warning: implicit declaration of function `place'
main.c:913: warning: assignment makes pointer from integer without a
cast
main.c:915: invalid lvalue in unary `&'
main.c:916: warning: assignment makes pointer from integer without a
cast
main.c:924: invalid operands to binary +
main.c:925: warning: suggest parentheses around assignment used as
truth value
main.c:930: warning: suggest parentheses around assignment used as
truth value
main.c:921: label `errlab' used but not defined
main.c: At top level:
main.c:934: warning: return type defaults to `int'
main.c: In function `place':
main.c:934: warning: type of `asp' defaults to `int'
main.c:934: warning: type of `al1' defaults to `int'
main.c:934: warning: type of `al2' defaults to `int'
main.c:937: warning: assignment makes pointer from integer without a
cast
main.c:938: warning: assignment makes pointer from integer without a
cast
main.c:939: warning: assignment makes pointer from integer without a
cast
main.c:945: warning: return makes integer from pointer without a cast
main.c:943: label `errlab' used but not defined
main.c: At top level:
main.c:949: warning: return type defaults to `int'
main.c: In function `move':
main.c:949: warning: type of `cflag' defaults to `int'
main.c:955: warning: assignment makes pointer from integer without a
cast
main.c:969: warning: `return' with no value, in function returning
non-void
main.c:970: warning: implicit declaration of function `reverse'
main.c:956: label `errlab' used but not defined
main.c: At top level:
main.c:983: warning: return type defaults to `int'
main.c: In function `reverse':
main.c:983: warning: type of `aa1' defaults to `int'
main.c:983: warning: type of `aa2' defaults to `int'
main.c:986: warning: assignment makes pointer from integer without a
cast
main.c:987: warning: assignment makes pointer from integer without a
cast
main.c:991: warning: `return' with no value, in function returning
non-void
main.c: At top level:
main.c:998: warning: return type defaults to `int'
main.c:1006: warning: return type defaults to `int'
main.c: In function `compile':
main.c:1006: warning: type of `aeof' defaults to `int'
main.c:1007: warning: type defaults to `int' in declaration of `eof'
main.c:1007: warning: type defaults to `int' in declaration of `c'
main.c:1021: warning: `return' with no value, in function returning
non-void
main.c:1037: warning: `return' with no value, in function returning
non-void
main.c:1075: parse error before '|' token
main.c:1020: label `errlab' used but not defined main.c: At top level:
main.c:1115: warning: return type defaults to `int' main.c: In function
`execute': main.c:1115: warning: type of `gf' defaults to `int'
main.c:1124: warning: suggest parentheses around assignment used as
truth value
main.c:1129: warning: assignment makes pointer from integer without a
cast
main.c:1135: warning: implicit declaration of function `advance'
main.c: At top level:
main.c:1161: warning: return type defaults to `int'
main.c: In function `advance':
main.c:1161: warning: type of `alp' defaults to `int'
main.c:1161: warning: type of `aep' defaults to `int'
main.c:1165: warning: assignment makes pointer from integer without a
cast
main.c:1166: warning: assignment makes pointer from integer without a
cast
main.c:1189: warning: implicit declaration of function `cclass'
main.c:1190: warning: assignment makes pointer from integer without a
cast
main.c:1197: warning: assignment makes pointer from integer without a
cast main.c:1203: warning: array subscript has type `char'
main.c:1207: warning: array subscript has type `char'
main.c:1225: warning: assignment makes pointer from integer without a
cast
main.c:1163: warning: unused variable `nextep'
main.c:1239: label `errlab' used but not defined
main.c: At top level:
main.c:1244: warning: return type defaults to `int'
main.c: In function `cclass':
main.c:1244: warning: type of `aset' defaults to `int'
main.c:1244: warning: type of `ac' defaults to `int'
main.c:1244: warning: type of `af' defaults to `int'
main.c:1246: warning: type defaults to `int' in declaration of `n'
main.c:1248: warning: assignment makes pointer from integer without a
cast
main.c: At top level:
main.c:1259: warning: return type defaults to `int'
main.c: In function `putd':
main.c:1260: warning: type defaults to `int' in declaration of `r'
main.c:1261: warning: type defaults to `int' in declaration of `ldivr'
main.c:1263: too many arguments to function `ldiv'
main.c:1263: incompatible types in assignment
main.c: At top level:
main.c:1272: warning: return type defaults to `int'
main.c: In function `puts':
main.c:1272: warning: type of `as' defaults to `int'
main.c:1272: argument `as' doesn't match prototype
C:/DEV-CPP/include/stdio.h:248: prototype declaration
main.c:1275: warning: assignment makes pointer from integer without a
cast
main.c: At top level: main.c:1283: parse error before "line"
main.c:1283: warning: type defaults to `int' in declaration of `line'
main.c:1283: conflicting types for `line'
main.c:1282: previous declaration of `line'
main.c:1283: warning: data definition has no type or storage class
main.c:1286: warning: return type defaults to `int' main.c: In function
`putchar': main.c:1286: warning: type of `ac' defaults to `int'
main.c:1288: warning: type defaults to `int' in declaration of `c'
main.c:1290: `linp' undeclared (first use in this function)
main.c:1321: subscripted value is neither array nor pointer
main.c:1324: warning: `return' with no value, in function returning
non-void

--
Emmanuel
The C-FAQ: http://www.eskimo.com/~scs/C-faq/faq.html
The C-library: http://www.dinkumware.com/refxc.html

"There are 10 types of people in the world today;
those that understand binary, and those that dont."

Avatar
Harpo
Emmanuel Delahaye wrote:

Je vais tenter un portage, mais c'est pas gagné!

main.c:73: parse error before '-' token


Avez-vous lu la doc ?

Vim est le logiciel que j'utilise le plus, en 10 ans je ne l'ai jamais
vu se planter une seule fois, vous n'avez pas à le porter, c'est déjà
fait, mais d'abord RTFM.
Il n'est pas non plus impossible que je ne puisse pas compiler les
sources de windows sur mon système, je vous laisse deviner la raison
qui est à l'origine de cette litote.

1 2 3