home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / js / src / jsarray.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.6 KB  |  57 lines

  1. /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef jsarray_h___
  20. #define jsarray_h___
  21. /*
  22.  * JS Array interface.
  23.  */
  24. #include "jsprvtd.h"
  25. #include "jspubtd.h"
  26.  
  27. PR_BEGIN_EXTERN_C
  28.  
  29. extern JSClass js_ArrayClass;
  30.  
  31. extern JSObject *
  32. js_InitArrayClass(JSContext *cx, JSObject *obj);
  33.  
  34. extern JSObject *
  35. js_NewArrayObject(JSContext *cx, jsint length, jsval *vector);
  36.  
  37. extern JSBool
  38. js_GetArrayLength(JSContext *cx, JSObject *obj, jsint *lengthp);
  39.  
  40. extern JSBool
  41. js_SetArrayLength(JSContext *cx, JSObject *obj, jsint length);
  42.  
  43. extern JSProperty *
  44. js_HasLengthProperty(JSContext *cx, JSObject *obj);
  45.  
  46. /*
  47.  * JS-specific qsort function.
  48.  */
  49. typedef int (*JSComparator)(const void *a, const void *b, void *arg);
  50.  
  51. extern PRBool
  52. js_qsort(void *vec, size_t nel, size_t elsize, JSComparator cmp, void *arg);
  53.  
  54. PR_END_EXTERN_C
  55.  
  56. #endif /* jsarray_h___ */
  57.