comparison src/alloc.c @ 109179:8cfee7d2955f

Convert DEFUNs to standard C. * src/alloc.c: Convert DEFUNs to standard C. * src/buffer.c: * src/bytecode.c: * src/callint.c: * src/callproc.c: * src/casefiddle.c: * src/casetab.c: * src/category.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/dosfns.c: * src/editfns.c: * src/emacs.c: * src/eval.c: * src/fileio.c: * src/filelock.c: * src/floatfns.c: * src/fns.c: * src/font.c: * src/fontset.c: * src/frame.c: * src/fringe.c: * src/image.c: * src/indent.c: * src/insdel.c: * src/keyboard.c: * src/keymap.c: * src/lread.c: * src/macros.c: * src/marker.c: * src/menu.c: * src/minibuf.c: * src/msdos.c: * src/nsfns.m: * src/nsmenu.m: * src/nsselect.m: * src/print.c: * src/process.c: * src/search.c: * src/sound.c: * src/syntax.c: * src/term.c: * src/terminal.c: * src/textprop.c: * src/undo.c: * src/w16select.c: * src/w32console.c: * src/w32fns.c: * src/w32font.c: * src/w32menu.c: * src/w32proc.c: * src/w32select.c: * src/window.c: * src/xdisp.c: * src/xfaces.c: * src/xfns.c: * src/xmenu.c: * src/xselect.c: * src/xsettings.c: * src/xsmfns.c: Likewise.
author Dan Nicolaescu <dann@ics.uci.edu>
date Thu, 08 Jul 2010 14:25:08 -0700
parents 750db9f3e6d8
children 60516122d066
comparison
equal deleted inserted replaced
109178:53f8ebcd9a97 109179:8cfee7d2955f
2248 2248
2249 DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0, 2249 DEFUN ("make-string", Fmake_string, Smake_string, 2, 2, 0,
2250 doc: /* Return a newly created string of length LENGTH, with INIT in each element. 2250 doc: /* Return a newly created string of length LENGTH, with INIT in each element.
2251 LENGTH must be an integer. 2251 LENGTH must be an integer.
2252 INIT must be an integer that represents a character. */) 2252 INIT must be an integer that represents a character. */)
2253 (length, init) 2253 (Lisp_Object length, Lisp_Object init)
2254 Lisp_Object length, init;
2255 { 2254 {
2256 register Lisp_Object val; 2255 register Lisp_Object val;
2257 register unsigned char *p, *end; 2256 register unsigned char *p, *end;
2258 int c, nbytes; 2257 int c, nbytes;
2259 2258
2292 2291
2293 2292
2294 DEFUN ("make-bool-vector", Fmake_bool_vector, Smake_bool_vector, 2, 2, 0, 2293 DEFUN ("make-bool-vector", Fmake_bool_vector, Smake_bool_vector, 2, 2, 0,
2295 doc: /* Return a new bool-vector of length LENGTH, using INIT for each element. 2294 doc: /* Return a new bool-vector of length LENGTH, using INIT for each element.
2296 LENGTH must be a number. INIT matters only in whether it is t or nil. */) 2295 LENGTH must be a number. INIT matters only in whether it is t or nil. */)
2297 (length, init) 2296 (Lisp_Object length, Lisp_Object init)
2298 Lisp_Object length, init;
2299 { 2297 {
2300 register Lisp_Object val; 2298 register Lisp_Object val;
2301 struct Lisp_Bool_Vector *p; 2299 struct Lisp_Bool_Vector *p;
2302 int real_init, i; 2300 int real_init, i;
2303 int length_in_chars, length_in_elts, bits_per_value; 2301 int length_in_chars, length_in_elts, bits_per_value;
2685 cons_free_list = ptr; 2683 cons_free_list = ptr;
2686 } 2684 }
2687 2685
2688 DEFUN ("cons", Fcons, Scons, 2, 2, 0, 2686 DEFUN ("cons", Fcons, Scons, 2, 2, 0,
2689 doc: /* Create a new cons, give it CAR and CDR as components, and return it. */) 2687 doc: /* Create a new cons, give it CAR and CDR as components, and return it. */)
2690 (car, cdr) 2688 (Lisp_Object car, Lisp_Object cdr)
2691 Lisp_Object car, cdr;
2692 { 2689 {
2693 register Lisp_Object val; 2690 register Lisp_Object val;
2694 2691
2695 /* eassert (!handling_signal); */ 2692 /* eassert (!handling_signal); */
2696 2693
2781 2778
2782 DEFUN ("list", Flist, Slist, 0, MANY, 0, 2779 DEFUN ("list", Flist, Slist, 0, MANY, 0,
2783 doc: /* Return a newly created list with specified arguments as elements. 2780 doc: /* Return a newly created list with specified arguments as elements.
2784 Any number of arguments, even zero arguments, are allowed. 2781 Any number of arguments, even zero arguments, are allowed.
2785 usage: (list &rest OBJECTS) */) 2782 usage: (list &rest OBJECTS) */)
2786 (nargs, args) 2783 (int nargs, register Lisp_Object *args)
2787 int nargs;
2788 register Lisp_Object *args;
2789 { 2784 {
2790 register Lisp_Object val; 2785 register Lisp_Object val;
2791 val = Qnil; 2786 val = Qnil;
2792 2787
2793 while (nargs > 0) 2788 while (nargs > 0)
2799 } 2794 }
2800 2795
2801 2796
2802 DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0, 2797 DEFUN ("make-list", Fmake_list, Smake_list, 2, 2, 0,
2803 doc: /* Return a newly created list of length LENGTH, with each element being INIT. */) 2798 doc: /* Return a newly created list of length LENGTH, with each element being INIT. */)
2804 (length, init) 2799 (register Lisp_Object length, Lisp_Object init)
2805 register Lisp_Object length, init;
2806 { 2800 {
2807 register Lisp_Object val; 2801 register Lisp_Object val;
2808 register int size; 2802 register int size;
2809 2803
2810 CHECK_NATNUM (length); 2804 CHECK_NATNUM (length);
2977 2971
2978 2972
2979 DEFUN ("make-vector", Fmake_vector, Smake_vector, 2, 2, 0, 2973 DEFUN ("make-vector", Fmake_vector, Smake_vector, 2, 2, 0,
2980 doc: /* Return a newly created vector of length LENGTH, with each element being INIT. 2974 doc: /* Return a newly created vector of length LENGTH, with each element being INIT.
2981 See also the function `vector'. */) 2975 See also the function `vector'. */)
2982 (length, init) 2976 (register Lisp_Object length, Lisp_Object init)
2983 register Lisp_Object length, init;
2984 { 2977 {
2985 Lisp_Object vector; 2978 Lisp_Object vector;
2986 register EMACS_INT sizei; 2979 register EMACS_INT sizei;
2987 register int index; 2980 register int index;
2988 register struct Lisp_Vector *p; 2981 register struct Lisp_Vector *p;
3001 2994
3002 DEFUN ("vector", Fvector, Svector, 0, MANY, 0, 2995 DEFUN ("vector", Fvector, Svector, 0, MANY, 0,
3003 doc: /* Return a newly created vector with specified arguments as elements. 2996 doc: /* Return a newly created vector with specified arguments as elements.
3004 Any number of arguments, even zero arguments, are allowed. 2997 Any number of arguments, even zero arguments, are allowed.
3005 usage: (vector &rest OBJECTS) */) 2998 usage: (vector &rest OBJECTS) */)
3006 (nargs, args) 2999 (register int nargs, Lisp_Object *args)
3007 register int nargs;
3008 Lisp_Object *args;
3009 { 3000 {
3010 register Lisp_Object len, val; 3001 register Lisp_Object len, val;
3011 register int index; 3002 register int index;
3012 register struct Lisp_Vector *p; 3003 register struct Lisp_Vector *p;
3013 3004
3025 The arguments should be the arglist, bytecode-string, constant vector, 3016 The arguments should be the arglist, bytecode-string, constant vector,
3026 stack size, (optional) doc string, and (optional) interactive spec. 3017 stack size, (optional) doc string, and (optional) interactive spec.
3027 The first four arguments are required; at most six have any 3018 The first four arguments are required; at most six have any
3028 significance. 3019 significance.
3029 usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */) 3020 usage: (make-byte-code ARGLIST BYTE-CODE CONSTANTS DEPTH &optional DOCSTRING INTERACTIVE-SPEC &rest ELEMENTS) */)
3030 (nargs, args) 3021 (register int nargs, Lisp_Object *args)
3031 register int nargs;
3032 Lisp_Object *args;
3033 { 3022 {
3034 register Lisp_Object len, val; 3023 register Lisp_Object len, val;
3035 register int index; 3024 register int index;
3036 register struct Lisp_Vector *p; 3025 register struct Lisp_Vector *p;
3037 3026
3109 3098
3110 3099
3111 DEFUN ("make-symbol", Fmake_symbol, Smake_symbol, 1, 1, 0, 3100 DEFUN ("make-symbol", Fmake_symbol, Smake_symbol, 1, 1, 0,
3112 doc: /* Return a newly allocated uninterned symbol whose name is NAME. 3101 doc: /* Return a newly allocated uninterned symbol whose name is NAME.
3113 Its value and function definition are void, and its property list is nil. */) 3102 Its value and function definition are void, and its property list is nil. */)
3114 (name) 3103 (Lisp_Object name)
3115 Lisp_Object name;
3116 { 3104 {
3117 register Lisp_Object val; 3105 register Lisp_Object val;
3118 register struct Lisp_Symbol *p; 3106 register struct Lisp_Symbol *p;
3119 3107
3120 CHECK_STRING (name); 3108 CHECK_STRING (name);
3271 return val; 3259 return val;
3272 } 3260 }
3273 3261
3274 DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0, 3262 DEFUN ("make-marker", Fmake_marker, Smake_marker, 0, 0, 0,
3275 doc: /* Return a newly allocated marker which does not point at any place. */) 3263 doc: /* Return a newly allocated marker which does not point at any place. */)
3276 () 3264 (void)
3277 { 3265 {
3278 register Lisp_Object val; 3266 register Lisp_Object val;
3279 register struct Lisp_Marker *p; 3267 register struct Lisp_Marker *p;
3280 3268
3281 val = allocate_misc (); 3269 val = allocate_misc ();
4000 3988
4001 static double avg_live; 3989 static double avg_live;
4002 3990
4003 DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "", 3991 DEFUN ("gc-status", Fgc_status, Sgc_status, 0, 0, "",
4004 doc: /* Show information about live and zombie objects. */) 3992 doc: /* Show information about live and zombie objects. */)
4005 () 3993 (void)
4006 { 3994 {
4007 Lisp_Object args[8], zombie_list = Qnil; 3995 Lisp_Object args[8], zombie_list = Qnil;
4008 int i; 3996 int i;
4009 for (i = 0; i < nzombies; i++) 3997 for (i = 0; i < nzombies; i++)
4010 zombie_list = Fcons (zombies[i], zombie_list); 3998 zombie_list = Fcons (zombies[i], zombie_list);
4794 4782
4795 DEFUN ("purecopy", Fpurecopy, Spurecopy, 1, 1, 0, 4783 DEFUN ("purecopy", Fpurecopy, Spurecopy, 1, 1, 0,
4796 doc: /* Make a copy of object OBJ in pure storage. 4784 doc: /* Make a copy of object OBJ in pure storage.
4797 Recursively copies contents of vectors and cons cells. 4785 Recursively copies contents of vectors and cons cells.
4798 Does not copy symbols. Copies strings without text properties. */) 4786 Does not copy symbols. Copies strings without text properties. */)
4799 (obj) 4787 (register Lisp_Object obj)
4800 register Lisp_Object obj;
4801 { 4788 {
4802 if (NILP (Vpurify_flag)) 4789 if (NILP (Vpurify_flag))
4803 return obj; 4790 return obj;
4804 4791
4805 if (PURE_POINTER_P (XPNTR (obj))) 4792 if (PURE_POINTER_P (XPNTR (obj)))
4896 (USED-MARKERS . FREE-MARKERS) USED-STRING-CHARS USED-VECTOR-SLOTS 4883 (USED-MARKERS . FREE-MARKERS) USED-STRING-CHARS USED-VECTOR-SLOTS
4897 (USED-FLOATS . FREE-FLOATS) (USED-INTERVALS . FREE-INTERVALS) 4884 (USED-FLOATS . FREE-FLOATS) (USED-INTERVALS . FREE-INTERVALS)
4898 (USED-STRINGS . FREE-STRINGS)) 4885 (USED-STRINGS . FREE-STRINGS))
4899 However, if there was overflow in pure space, `garbage-collect' 4886 However, if there was overflow in pure space, `garbage-collect'
4900 returns nil, because real GC can't be done. */) 4887 returns nil, because real GC can't be done. */)
4901 () 4888 (void)
4902 { 4889 {
4903 register struct specbinding *bind; 4890 register struct specbinding *bind;
4904 struct catchtag *catch; 4891 struct catchtag *catch;
4905 struct handler *handler; 4892 struct handler *handler;
4906 char stack_top_variable; 4893 char stack_top_variable;
6113 6100
6114 DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, 0, 6101 DEFUN ("memory-limit", Fmemory_limit, Smemory_limit, 0, 0, 0,
6115 doc: /* Return the address of the last byte Emacs has allocated, divided by 1024. 6102 doc: /* Return the address of the last byte Emacs has allocated, divided by 1024.
6116 This may be helpful in debugging Emacs's memory usage. 6103 This may be helpful in debugging Emacs's memory usage.
6117 We divide the value by 1024 to make sure it fits in a Lisp integer. */) 6104 We divide the value by 1024 to make sure it fits in a Lisp integer. */)
6118 () 6105 (void)
6119 { 6106 {
6120 Lisp_Object end; 6107 Lisp_Object end;
6121 6108
6122 XSETINT (end, (EMACS_INT) sbrk (0) / 1024); 6109 XSETINT (end, (EMACS_INT) sbrk (0) / 1024);
6123 6110
6135 except for VECTOR-CELLS and STRING-CHARS, which count the total length of 6122 except for VECTOR-CELLS and STRING-CHARS, which count the total length of
6136 objects consed. 6123 objects consed.
6137 MISCS include overlays, markers, and some internal types. 6124 MISCS include overlays, markers, and some internal types.
6138 Frames, windows, buffers, and subprocesses count as vectors 6125 Frames, windows, buffers, and subprocesses count as vectors
6139 (but the contents of a buffer's text do not count here). */) 6126 (but the contents of a buffer's text do not count here). */)
6140 () 6127 (void)
6141 { 6128 {
6142 Lisp_Object consed[8]; 6129 Lisp_Object consed[8];
6143 6130
6144 consed[0] = make_number (min (MOST_POSITIVE_FIXNUM, cons_cells_consed)); 6131 consed[0] = make_number (min (MOST_POSITIVE_FIXNUM, cons_cells_consed));
6145 consed[1] = make_number (min (MOST_POSITIVE_FIXNUM, floats_consed)); 6132 consed[1] = make_number (min (MOST_POSITIVE_FIXNUM, floats_consed));