Mercurial > emacs
comparison src/ccl.c @ 109126:aec1143e8d85
Convert (most) functions in src to standard C.
* src/alloc.c: Convert function definitions to standard C.
* src/atimer.c:
* src/bidi.c:
* src/bytecode.c:
* src/callint.c:
* src/callproc.c:
* src/casefiddle.c:
* src/casetab.c:
* src/category.c:
* src/ccl.c:
* src/character.c:
* src/charset.c:
* src/chartab.c:
* src/cmds.c:
* src/coding.c:
* src/composite.c:
* src/data.c:
* src/dbusbind.c:
* src/dired.c:
* src/dispnew.c:
* src/doc.c:
* src/doprnt.c:
* src/ecrt0.c:
* src/editfns.c:
* src/fileio.c:
* src/filelock.c:
* src/filemode.c:
* src/fns.c:
* src/font.c:
* src/fontset.c:
* src/frame.c:
* src/fringe.c:
* src/ftfont.c:
* src/ftxfont.c:
* src/gtkutil.c:
* src/indent.c:
* src/insdel.c:
* src/intervals.c:
* src/keymap.c:
* src/lread.c:
* src/macros.c:
* src/marker.c:
* src/md5.c:
* src/menu.c:
* src/minibuf.c:
* src/prefix-args.c:
* src/print.c:
* src/ralloc.c:
* src/regex.c:
* src/region-cache.c:
* src/scroll.c:
* src/search.c:
* src/sound.c:
* src/strftime.c:
* src/syntax.c:
* src/sysdep.c:
* src/termcap.c:
* src/terminal.c:
* src/terminfo.c:
* src/textprop.c:
* src/tparam.c:
* src/undo.c:
* src/unexelf.c:
* src/window.c:
* src/xfaces.c:
* src/xfns.c:
* src/xfont.c:
* src/xftfont.c:
* src/xgselect.c:
* src/xmenu.c:
* src/xrdb.c:
* src/xselect.c:
* src/xsettings.c:
* src/xsmfns.c:
* src/xterm.c: Likewise.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Sun, 04 Jul 2010 00:50:25 -0700 |
parents | b465aa3255ed |
children | 750db9f3e6d8 |
comparison
equal
deleted
inserted
replaced
109125:12b02558bf51 | 109126:aec1143e8d85 |
---|---|
860 | 860 |
861 /* For the moment, we only support depth 256 of stack. */ | 861 /* For the moment, we only support depth 256 of stack. */ |
862 static struct ccl_prog_stack ccl_prog_stack_struct[256]; | 862 static struct ccl_prog_stack ccl_prog_stack_struct[256]; |
863 | 863 |
864 void | 864 void |
865 ccl_driver (ccl, source, destination, src_size, dst_size, charset_list) | 865 ccl_driver (struct ccl_program *ccl, int *source, int *destination, int src_size, int dst_size, Lisp_Object charset_list) |
866 struct ccl_program *ccl; | |
867 int *source, *destination; | |
868 int src_size, dst_size; | |
869 Lisp_Object charset_list; | |
870 { | 866 { |
871 register int *reg = ccl->reg; | 867 register int *reg = ccl->reg; |
872 register int ic = ccl->ic; | 868 register int ic = ccl->ic; |
873 register int code = 0, field1, field2; | 869 register int code = 0, field1, field2; |
874 register Lisp_Object *ccl_prog = ccl->prog; | 870 register Lisp_Object *ccl_prog = ccl->prog; |
1793 The return value is a vector (CCL itself or a new vector in which | 1789 The return value is a vector (CCL itself or a new vector in which |
1794 all symbols are resolved), Qt if resolving of some symbol failed, | 1790 all symbols are resolved), Qt if resolving of some symbol failed, |
1795 or nil if CCL contains invalid data. */ | 1791 or nil if CCL contains invalid data. */ |
1796 | 1792 |
1797 static Lisp_Object | 1793 static Lisp_Object |
1798 resolve_symbol_ccl_program (ccl) | 1794 resolve_symbol_ccl_program (Lisp_Object ccl) |
1799 Lisp_Object ccl; | |
1800 { | 1795 { |
1801 int i, veclen, unresolved = 0; | 1796 int i, veclen, unresolved = 0; |
1802 Lisp_Object result, contents, val; | 1797 Lisp_Object result, contents, val; |
1803 | 1798 |
1804 result = ccl; | 1799 result = ccl; |
1865 code. If necessary, resolve symbols in the compiled code to index | 1860 code. If necessary, resolve symbols in the compiled code to index |
1866 numbers. If we failed to get the compiled code or to resolve | 1861 numbers. If we failed to get the compiled code or to resolve |
1867 symbols, return Qnil. */ | 1862 symbols, return Qnil. */ |
1868 | 1863 |
1869 static Lisp_Object | 1864 static Lisp_Object |
1870 ccl_get_compiled_code (ccl_prog, idx) | 1865 ccl_get_compiled_code (Lisp_Object ccl_prog, int *idx) |
1871 Lisp_Object ccl_prog; | |
1872 int *idx; | |
1873 { | 1866 { |
1874 Lisp_Object val, slot; | 1867 Lisp_Object val, slot; |
1875 | 1868 |
1876 if (VECTORP (ccl_prog)) | 1869 if (VECTORP (ccl_prog)) |
1877 { | 1870 { |
1908 of the CCL program or the already compiled code (vector). | 1901 of the CCL program or the already compiled code (vector). |
1909 Return 0 if we succeed this setup, else return -1. | 1902 Return 0 if we succeed this setup, else return -1. |
1910 | 1903 |
1911 If CCL_PROG is nil, we just reset the structure pointed by CCL. */ | 1904 If CCL_PROG is nil, we just reset the structure pointed by CCL. */ |
1912 int | 1905 int |
1913 setup_ccl_program (ccl, ccl_prog) | 1906 setup_ccl_program (struct ccl_program *ccl, Lisp_Object ccl_prog) |
1914 struct ccl_program *ccl; | |
1915 Lisp_Object ccl_prog; | |
1916 { | 1907 { |
1917 int i; | 1908 int i; |
1918 | 1909 |
1919 if (! NILP (ccl_prog)) | 1910 if (! NILP (ccl_prog)) |
1920 { | 1911 { |
1951 | 1942 |
1952 | 1943 |
1953 /* Check if CCL is updated or not. If not, re-setup members of CCL. */ | 1944 /* Check if CCL is updated or not. If not, re-setup members of CCL. */ |
1954 | 1945 |
1955 int | 1946 int |
1956 check_ccl_update (ccl) | 1947 check_ccl_update (struct ccl_program *ccl) |
1957 struct ccl_program *ccl; | |
1958 { | 1948 { |
1959 Lisp_Object slot, ccl_prog; | 1949 Lisp_Object slot, ccl_prog; |
1960 | 1950 |
1961 if (ccl->idx < 0) | 1951 if (ccl->idx < 0) |
1962 return 0; | 1952 return 0; |
2313 return index; | 2303 return index; |
2314 } | 2304 } |
2315 | 2305 |
2316 | 2306 |
2317 void | 2307 void |
2318 syms_of_ccl () | 2308 syms_of_ccl (void) |
2319 { | 2309 { |
2320 staticpro (&Vccl_program_table); | 2310 staticpro (&Vccl_program_table); |
2321 Vccl_program_table = Fmake_vector (make_number (32), Qnil); | 2311 Vccl_program_table = Fmake_vector (make_number (32), Qnil); |
2322 | 2312 |
2323 Qccl = intern_c_string ("ccl"); | 2313 Qccl = intern_c_string ("ccl"); |