repo_name
stringlengths
6
97
path
stringlengths
3
341
text
stringlengths
8
1.02M
frankjas/libjr
libjr/syscalls/async_fn.c
<filename>libjr/syscalls/async_fn.c #include "async_fn.h" static jr_int InitializedTree = 0; static jr_AVL_Tree HandlerTree[1]; static jr_int CurrentTime = 0; static jr_int AlarmTime = 0; static jr_int NumAlarms = 0; static struct sigaction OldAction[1]; jr_int jr_AddAsyncFunction ( vo...
frankjas/libjr
libjr/llist/llistfnd.c
<reponame>frankjas/libjr #include "project.h" void *jr_LListFindElementPtr (list, obj, cmpfn) jr_LList *list; void *obj; jr_int (*cmpfn) (); { void *lep; jr_LListForEachElementPtr (list, lep) { if (! (*cmpfn) (obj, lep)) return (lep); } return (0); } void *jr_LListFindAppendPtr (list, obj, cmpfn) jr_LLi...
frankjas/libjr
libjr/misc/linsrch.c
<filename>libjr/misc/linsrch.c #include "ezport.h" #include <stdio.h> #include <ctype.h> #include "jr/string.h" void *jr_LinearSearch(base_arg, num_items, sizeof_each_item, compf, key_or_pattern) const void * base_arg ; jr_int num_items ; jr_int sizeof_each_item ; jr_int (*compf)() ; const void * key_or_p...
frankjas/libjr
libjr/syscalls/sighndlr.c
<reponame>frankjas/libjr<gh_stars>0 #define _POSIX_SOURCE 1 #include "ezport.h" #include <sys/wait.h> #include "jr/syscalls.h" void jr_SigChildHandler (signum) jr_int signum; { while (waitpid(-1, 0, WNOHANG) > 0); }
frankjas/libjr
libjr/io/jr_tar.c
#define _POSIX_SOURCE 1 #include "ezport.h" #include <string.h> #include <errno.h> #include <unistd.h> #include <sys/stat.h> #include "jr/malloc.h" #include "jr/error.h" #include "jr/tar.h" #include "jr/syscalls.h" jr_int jr_TarEntryInitFromRfp (tar_entry_ptr, rfp, error_buf) jr_TarEntryType * tar_entry_ptr ; ...
frankjas/libjr
libjr/struct/ptrmap.c
<gh_stars>0 #include "ptrmap.h" void jr_PtrMapInit (ptr_map, max_category_size, ptr_data_size) jr_PtrMapType * ptr_map; jr_int max_category_size; jr_int ptr_data_size; { memset (ptr_map, 0, sizeof (jr_PtrMapType)); ptr_map->max_category_size = max_category_size; ptr_map->ptr_data_size = ptr_data_...
frankjas/libjr
libjr/syscalls/jr_sleep.c
#include "ezport.h" #include <apr-1/apr_time.h> #ifdef ostype_winnt #else # include <sys/select.h> #endif #include "jr/syscalls.h" void jr_sleep (sleep_sec, sleep_usec) jr_int sleep_sec; jr_int sleep_usec; { apr_interval_time_t apr_interval; apr_interval = sleep_sec * 1000000LL + sleep_usec; apr_sleep...
frankjas/libjr
libjr/misc/trace.c
<filename>libjr/misc/trace.c #define is_libjr_build #include "ezport.h" #include <stdio.h> #include <string.h> #include "jr/trace.h" #include "jr/malloc.h" #include "jr/misc.h" void jr_check_trace(trace_num, file_name, line_number) jr_int trace_num; const char * file_name ; jr_int line_number; { /* ** 3/2/...
frankjas/libjr
libjr/missing/noinfo.c
<filename>libjr/missing/noinfo.c #include "ezport.h" #include <stdlib.h> /* ** 4-15-2011: Fix the C++ problem wrt linking debug builds ** against no-debug libraries. The no-debug libraries call ** _invalid_parameter_noinfo(), but that isn't provided ** when linking agains the debug standard libraries. ** ** The foll...
frankjas/libjr
include/jr/htable.h
<reponame>frankjas/libjr #ifndef _htableh #define _htableh #include "ezport.h" #include <stdio.h> #include <stdarg.h> #include "jr/alist.h" typedef struct { jr_int hash_value; /* makes rehashing easier */ jr_int next_index; /* next entry element */ } jr_HTableElementStruct; typedef struct { jr_int e...
frankjas/libjr
include/jr/ptrmap.h
<gh_stars>0 #ifndef __jr_ptrmap_h___ #define __jr_ptrmap_h___ #include "ezport.h" #include "jr/alist.h" typedef struct { jr_AList category_list[1]; jr_int max_category_size; jr_int ptr_data_size; } jr_PtrMapType; typedef struct { jr_int min_value; jr_int num_values; jr_int next_deleted_desc; jr_int nu...
frankjas/libjr
libjr/misc/exceptn.c
<reponame>frankjas/libjr #include "exn_proj.h" jr_HTable jr_ExceptionTable [1]; static jr_int DidInit = 0; jr_int jr_ExceptionRaiseWithCoreDump (exception_name, core_dump, opt_error_buf) char * exception_name; jr_int core_dump; char * opt_error_buf; { jr_ExceptionStack * exception_stack; jr_ExceptionTy...
frankjas/libjr
libjr/missing/getcwd.c
#define _POSIX_SOURCE 1 #include "ezport.h" #ifdef missing_getcwd_objects #include <stdio.h> #include <sys/types.h> #include <errno.h> #include <string.h> /* getcwd should be declared extern in unistd.h */ #include <unistd.h> char * getcwd(dirname_buf_arg, buffer_length) char * dirname_buf_arg ; size_t buffer_...
frankjas/libjr
libjr/io/logfile.c
#include "logfile.h" jr_LogType *jr_LogCreate() { jr_LogType * log_info = jr_malloc (sizeof (jr_LogType)); jr_LogInit( log_info); return log_info; } void jr_LogInit( jr_LogType * log_info) { memset (log_info, 0, sizeof (*log_info)); jr_file_init( log_info->file_info); jr_AListInit (log_info->transactio...
frankjas/libjr
include/jr/prefix.h
#ifndef __jr_prefix_h___ #define __jr_prefix_h___ #include "ezport.h" #include <stdarg.h> typedef struct { char * container_name; void * container_ptr; jr_int prefix_id; jr_int prefix_size; jr_int (*element_prefix_size_fn) (); void (*prefix_transform_fn) (); void (*set_prefix_size_fn) (); unsigned n...
frankjas/libjr
include/jr/alist.h
#ifndef __ALIST_HEADER__ #define __ALIST_HEADER__ #include "ezport.h" #include <string.h> #include <stdarg.h> typedef struct { char * buffer; /* buffer where elements are stored */ jr_int buffer_capacity; /* maximum number of objects allowed */ char * free_ptr; jr_int objsize; jr_int free_index; jr_int...
frankjas/libjr
libjr/syscalls/jr_poll.h
<gh_stars>0 #ifndef _jr_poll_proj_h___ #define _jr_poll_proj_h___ #include "ezport.h" #include <string.h> #include <apr-1/apr_pools.h> #include <apr-1/apr_poll.h> #include <apr-1/apr_errno.h> #include "jr/poll.h" #include "jr/apr.h" #include "jr/error.h" #include "jr/syscalls.h" #include "jr/misc.h" #define MIN_APR...
frankjas/libjr
libjr/missing/memmove.c
#define _POSIX_SOURCE 1 #include "ezport.h" #include <string.h> /* * This routine conforms to the ANSI standard * description for 'memmove(dest,src,nbytes)' * used for copying arbitrary byte streams from * one location in memory to another even if those * locations overlap. We provide the source because * som...
frankjas/libjr
libjr/syscalls/remove.c
#define _POSIX_SOURCE 1 #include "ezport.h" #include <errno.h> #include <string.h> #include <unistd.h> #include "jr/syscalls.h" #include "jr/error.h" #include "jr/malloc.h" jr_int jr_RemovePath ( const char * path_name, char * error_buf) { jr_int is_dir; char * cmd_buf = 0; jr_int status; ...
frankjas/libjr
libjr/struct/att_list.c
#include "att_mngr.h" void jr_AttributeListInit(attribute_list, manager) jr_AttributeList * attribute_list ; jr_AttributeManagerType * manager ; { attribute_list->list_id = jr_AttributeManagerGetListId (manager); attribute_list->manager = manager ; jr_DListInit(attribute_list->list_of_pairs, sizeof(jr_Attrib...
frankjas/libjr
libjr/syscalls/login.c
<reponame>frankjas/libjr #define _POSIX_SOURCE 1 #include "ezport.h" #include <stdio.h> #include <string.h> #include <stdlib.h> #include "jr/misc.h" #include "jr/string.h" #include "jr/malloc.h" #include "jr/syscalls.h" #include "jr/error.h" #include "jr/login.h" jr_LoginInfoType * jr_LoginInfoCreate(user_name_arg,...
frankjas/libjr
libjr/string/strnchr.c
#include "ezport.h" #include "jr/string.h" char *jr_strnchr ( const char * str, jr_int c, jr_int len) { jr_int q; for (q=0; str[q] && q < len; q++) { if (str[q] == c) { return (char *) str + q; } } return 0; } char *jr_rstrchr ( const char * end_str, const char * str, jr_int c) { for (; end_...
frankjas/libjr
include/jr/malloc.h
<gh_stars>0 #ifndef _jr_malloch #define _jr_malloch #include "ezport.h" #include <stdio.h> /* required for args to jr_MallocStatPrint */ jr_EXTERN(void *) jr_malloc PROTO ((size_t amt_requested)) ; jr_EXTERN(void *) jr_calloc PROTO ((size_t num_elem, size_t elem_size)) ; #if defined (realloc) || defined...
frankjas/libjr
libjr/misc/geometry.c
<reponame>frankjas/libjr<filename>libjr/misc/geometry.c #include "ezport.h" #include <math.h> #include <stdio.h> #include "jr/misc.h" #include "jr/math.h" /* -225deg | Q1 135deg | (-10, 10) | * | * (10, 10) 45deg counter-clockwise | -265d...
frankjas/libjr
libjr/string/vector.c
#include "ezport.h" #include <stdio.h> #include "jr/vector.h" #include "jr/malloc.h" void * jr_VectorCreateWithOneItem (zeroth_item_value) const void * zeroth_item_value; { void ** new_vector; new_vector = (void **) jr_malloc (2 * sizeof (void *)); new_vector[0] = (void *) zeroth_item_value; new_vector[1] ...
frankjas/libjr
libjr/struct/strtab.h
<filename>libjr/struct/strtab.h #ifndef __strtab_h___ #define __strtab_h___ #define _POSIX_SOURCE 1 #include "ezport.h" #include <assert.h> #include "jr/strtab.h" #include "jr/string.h" #include "jr/misc.h" #include "jr/malloc.h" extern void jr_StringTableEntryInit PROTO (( jr_StringTableEntryType * s...
frankjas/libjr
libjr/misc/cmpint.c
<gh_stars>0 #include "ezport.h" #include "jr/misc.h" jr_int jr_intcmp(n,m) jr_int n, m ; { if (n < 0 && m > 0) { return -1; } if (n > 0 && m < 0) { return 1; } return((n)-(m)) ; } jr_int jr_intpcmp (void_arg_1, void_arg_2) const void * void_arg_1; const void * void_arg_2; { const jr_int * np = voi...
frankjas/libjr
libjr/string/isident.c
<filename>libjr/string/isident.c #include "ezport.h" #include "jr/string.h" jr_int jr_StringIsValidIdentifier (str) const char * str; { /* * first character must be alphabetic or underscore */ if ((!isalpha(*str)) && (*str != '_')) { return (0); } str++; for (; *str; str++) { if (!isalnum(*str) && *st...
frankjas/libjr
include/jr/circbuf.h
<filename>include/jr/circbuf.h #ifndef __CIRCBUF_HEADER__ #define __CIRCBUF_HEADER__ #include "ezport.h" typedef struct { char *element_array; char *head; char *tail; jr_int size; jr_int num_elements; jr_int max_size; jr_int element_size; } jr_CB_CircularBuffer; extern void jr_CB_CircularBufferInit PROTO((j...
frankjas/libjr
libjr/string/ctlstrc.c
<reponame>frankjas/libjr<filename>libjr/string/ctlstrc.c<gh_stars>0 #include "ezport.h" #include <string.h> #include "jr/string.h" const char * jr_EscapedStringFromControlChar(c) jr_int c ; { static char buf[16] ; char * escape_string ; escape_string = buf ; switch(c) { case '\a': escape_string = "\\a" ; b...
frankjas/libjr
libjr/syscalls/jr_pool.c
#include "ezport.h" #include <apr-1/apr_pools.h> #include "jr/apr.h" #include "jr/malloc.h" void jr_pool_init ( jr_pool_t * pool_ptr, jr_pool_t * opt_parent_pool_ptr) { memset (pool_ptr, 0, sizeof (*pool_ptr)); pool_ptr->parent_pool_ptr = opt_parent_pool_ptr; jr_apr_initialize(); } void jr_pool_undo ...
frankjas/libjr
libjr/syscalls/jr_socket.c
<filename>libjr/syscalls/jr_socket.c #include "ezport.h" #include <string.h> #include <apr-1/apr_pools.h> #include <apr-1/apr_network_io.h> #include <apr-1/apr_lib.h> #include <apr-1/apr_portable.h> #include "jr/apr.h" #include "jr/error.h" #include "jr/malloc.h" #include "jr/misc.h" #include "jr/nettype.h" extern ...
frankjas/libjr
libjr/missing/dup2.c
<reponame>frankjas/libjr<filename>libjr/missing/dup2.c #define _POSIX_SOURCE 1 #include "ezport.h" #ifdef missing_dup2 #include <stdio.h> #include <errno.h> #include <sys/errno.h> #include <fcntl.h> #include <unistd.h> int dup2(oldd, target_descriptor) int oldd ; int target_descriptor ; { jr_int descriptor_set[F...
frankjas/libjr
libjr/io/copyfp.c
#define _POSIX_SOURCE 1 #include "ezport.h" #include <stdio.h> #include <errno.h> #include <string.h> /*| begin jr_FileNameCopy_decl |*/ #include "jr/io.h" #include "jr/syscalls.h" int jr_FileNameCopy (dest_file_name, src_file_name, error_buf) const char * dest_file_name; const char * src_file_name; char * ...
frankjas/libjr
libjr/syscalls/timelock.c
#define _POSIX_SOURCE 1 #include "ezport.h" #include <stdio.h> #include <sys/file.h> #include <signal.h> #include <unistd.h> #include <setjmp.h> #include "jr/trace.h" #define __jr_compiling_timelock #include "jr/syscalls.h" #define ENDPERM (S_IREAD | S_IWRITE | 0660 ) /*--------------------------------*/ static s...
frankjas/libjr
libjr/avl_tree/avl_find.c
<reponame>frankjas/libjr<gh_stars>0 #include "project.h" /*| begin jr_AVL_TreeFindElementPtr_decl |*/ void *jr_AVL_TreeFindElementPtrUsingKey (avl_tree, obj) jr_AVL_Tree * avl_tree; const void * obj ; { jr_int comp_val; const void * curr_node = avl_tree->root_node; while (curr_node != 0) { comp_val = (*av...
frankjas/libjr
libjr/syscalls/isinput.c
<gh_stars>0 #define _POSIX_SOURCE 1 #include "ezport.h" #include <stdio.h> #include <sys/types.h> #include <sys/ioctl.h> #include <unistd.h> #include <stdlib.h> #include <errno.h> #include "jr/syscalls.h" jr_int jr_FileDescHasPendingInput(fd) jr_int fd ; { # ifdef FIONREAD { long nchars = 0 ; if (ioctl(fd, F...
frankjas/libjr
libjr/jr_malloc/memdiag.c
#include "project.h" /* ** 4/6/07: ok to use static vars since the code below is protected by mutexes. ** ** Note: do not use jr_esprintf() which could call jr_malloc(). */ char * jr_MallocTrapFileName = jr_MALLOC_TRAP_FILE_NAME; char * jr_MallocTraceFileName = jr_MALLOC_TRACE_FILE_NAME; int jr_MallocCalledByNew =...
frankjas/libjr
include/jr/dlist.h
#ifndef _dlisth #define _dlisth 1 #include "ezport.h" #include <string.h> #include <stdarg.h> typedef struct { void * tail; void * head; jr_int objsize; jr_int prefix_size; unsigned allocates_elements : 1; } jr_DList; extern void jr_DListInit PROTO ((jr_DList *list, jr_int objsize)); extern jr_DList ...
frankjas/libjr
include/jr/mime.h
#ifndef __jr_mime_h___ #define __jr_mime_h___ #include "jr/htable.h" /******** Mime Table ********/ #define jr_MIME_FILE_LINE_COMMENT_CHAR '#' #define jr_MIME_FILE_LINE_COMMENT_STR "//" #define jr_MIME_FILE_WORD_DELIMITERS "\t \n" #define jr_MIME_TABLE_FLAG_REDEFINITIONS 0x0001 #define jr_MIM...
frankjas/libjr
libjr/struct/jr_heap.c
#include "jr/heap.h" #include "jr/misc.h" void jr_HeapInsert (heap, obj, cmpfn) jr_AList *heap; void *obj; jr_int (*cmpfn) (); { memcpy (jr_AListNewTailPtr (heap), obj, jr_HeapElementSize(heap)); if (jr_HeapSize(heap) > 1) { jr_HeapPercolateUp (heap, jr_HeapLastLeafIndex(heap), cmpfn); } } void jr_HeapDelet...
frankjas/libjr
libjr/syscalls/jr_aprbuf.c
<reponame>frankjas/libjr #include "ezport.h" #include <string.h> #include <apr-1/apr_pools.h> #include <apr-1/apr_lib.h> #include "jr/apr.h" #include "jr/malloc.h" /* ** 3/29/08: jr_aprbuf_t defined here to avoid exposing APR headers ** jr_aprbuf_t must by type compatible with apr_vformatter_buff_t, which ** must b...
frankjas/libjr
libjr/syscalls/jr_socket_unix.c
<reponame>frankjas/libjr #include "ezport.h" #ifndef ostype_winnt #include <string.h> #include <sys/socket.h> #include <sys/un.h> #include <unistd.h> #include <apr-1/apr_pools.h> #include <apr-1/apr_portable.h> #include "jr/apr.h" #include "jr/error.h" jr_int jr_socket_connect_unix ( jr_socket_t * socket_info...
frankjas/libjr
include/jr/syscalls.h
#ifndef __jr_syscalls_h___ #define __jr_syscalls_h___ #include "ezport.h" #include <stdio.h> #include <sys/types.h> #include "jr/time.h" /******** permissions ********/ #define jr_PERM_S_OWNER 02000 #define jr_PERM_S_GROUP 01000 #define jr_PERM_R_OWNER 00400 #define jr_PERM_W_OWNER 00200 ...
frankjas/libjr
libjr/string/vlsout.c
#define _POSIX_SOURCE 1 #include "ezport.h" #include <stdio.h> #include <string.h> #include "jr/vector.h" void jr_VectorDisplayLikeLs(wfp, vector_arg, num_items_in_vector, display_width) FILE * wfp ; const char ** vector_arg ; jr_int num_items_in_vector ; jr_int display_width ; { jr_int max_length_e...
frankjas/libjr
libjr/string/substrix.c
#include "ezport.h" #include <string.h> #include "jr/string.h" jr_int jr_SubStringIndex(search_string, pattern) const char * search_string ; const char * pattern ; { char * substring_location ; substring_location = strstr((char *) search_string, (char *) pattern) ; if (substring_location == 0) { return(-1)...
frankjas/libjr
libjr/missing/rewinddir.c
<gh_stars>0 #define _POSIX_SOURCE 1 #include "ezport.h" #ifdef missing_rewinddir_objects #include <dirent.h> void rewinddir(dirp) DIR * dirp; { seekdir (dirp, 0L); } #else static void NotCalled () /* define this so ranlib doesn't complain */ { NotCalled (); /* use it so the compiler doesn't complain */ } ...
frankjas/libjr
libjr/misc/jr_uuid.c
<reponame>frankjas/libjr #define _POSIX_SOURCE 1 #include "ezport.h" #include <apr-1/apr_uuid.h> #include "jr/uuid.h" void jr_UUIdAsgnRandom (uuid_info) jr_UUIdStruct * uuid_info; { apr_uuid_get ((apr_uuid_t *) uuid_info); } void jr_UUIdAsgnTime (uuid_info) jr_UUIdStruct * uuid_info; { apr_uuid_get ((apr...
frankjas/libjr
libjr/htable/htable.c
#include "project.h" jr_HTable *jr_HTableCreate (element_size, hashfn, cmpfn) jr_int element_size; jr_int (*hashfn) PROTO ((const void *)); jr_int (*cmpfn) PROTO ((const void *, const void *)); { jr_HTable *htable = (jr_HTable *) jr_malloc (sizeof (jr_HTable)); jr_HTableInit (htable, element_size, hashfn, cmp...
frankjas/libjr
libjr/missing/pathconf.c
#define _POSIX_SOURCE 1 #include "ezport.h" #ifdef missing_pathconf_objects #include <errno.h> #include <unistd.h> #include <sys/param.h> #include <sys/dir.h> long pathconf(file_name, desired_value) const char * file_name ; int desired_value ; { switch(desired_value) { case _PC_LINK_MAX : ...
frankjas/libjr
libjr/missing/memcpy.c
<gh_stars>0 #define _POSIX_SOURCE 1 #include "ezport.h" #include <string.h> /* * This routine conforms to the ANSI standard * description for 'memcpy(dest,src,nbytes)' * used for copying arbitrary byte streams from * one location in memory to another even if those * locations overlap. We provide the source bec...
frankjas/libjr
libjr/dlist/dlistpfx.c
#include "project.h" void jr_DListSetContainers ( jr_DList * list, ...) { va_list arg_list; va_start (arg_list, list); jr_DListSetContainersFromVA_List (list, arg_list); va_end (arg_list); } void jr_DListSetContainersFromVA_List (list, arg_list) jr_DList * list; va_list arg_list; { jr_Prefix...
frankjas/libjr
libjr/string/endword.c
#include "ezport.h" #include <stdio.h> #include <ctype.h> #include <string.h> #include "jr/string.h" jr_int jr_RemoveTrailingWhiteSpace (word_arg) char * word_arg; { char * end_ptr ; jr_int count = 0; if (*word_arg == 0) return count; end_ptr = (char *) strchr(word_arg, 0) ; end_ptr-- ; /* to back of...
frankjas/libjr
libjr/struct/inputbuf.c
#include "ezport.h" #include <stdio.h> #include <string.h> #include "jr/string.h" #include "jr/malloc.h" #include "jr/misc.h" #include "jr/inputbuf.h" jr_int jr_IB_NumCharReadCalls; jr_int jr_IB_NumCharsRead; jr_int jr_IB_NumCharsFromString; jr_int jr_IB_NumCharsUnRead; void jr_IB_InputBufferInit (input_buffer) j...
frankjas/libjr
include/jr/ezport/types.h
#ifndef __jr_EZPORT_TYPES_H___ #define __jr_EZPORT_TYPES_H___ /* ** use #defines so 'unsigned jr_short' is valid syntax ** use jr_int for all 32 bit quantities */ #include <limits.h> #include <stdint.h> #if defined (__GNUC__) /* ** 10/26/05 <float.h> is in gcc's private include dir, /usr/lib/gcc/... ** is indicated...
frankjas/libjr
include/jr/nettype.h
<reponame>frankjas/libjr #ifndef _net_inth #define _net_inth #include "ezport.h" #include <sys/types.h> #include "jr/long.h" #include "jr/misc.h" extern unsigned jr_int jr_bswap_32 (unsigned jr_int value); extern unsigned jr_int jr_bswap_16 (unsigned jr_short value); extern unsigned jr_int jr_inet_ho...
frankjas/libjr
libjr/missing/sigaction.c
<reponame>frankjas/libjr #define _POSIX_SOURCE 1 #include "ezport.h" #ifdef missing_sigaction_objects #include <stdio.h> #include <sys/types.h> #include <unistd.h> #include <signal.h> int sigaction(signal_number, new_action, old_action) int signal_number ; const struct sigaction * new_action ; ...
frankjas/libjr
libjr/replace/inet_ntoa.c
<reponame>frankjas/libjr<filename>libjr/replace/inet_ntoa.c<gh_stars>0 #include "ezport.h" #ifdef has_buggy_inet_ntoa #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> char *jr_inet_ntoa (sin_addr) struct in_addr sin_addr; { static char inet_str [32]; sprintf (inet_str, "%d.%d.%d.%d", sin...
frankjas/libjr
libjr/syscalls/jr_perms.c
<reponame>frankjas/libjr<filename>libjr/syscalls/jr_perms.c<gh_stars>0 #include "ezport.h" #include <sys/types.h> #include <sys/stat.h> #include <string.h> #include "jr/syscalls.h" jr_int jr_UnixModeToPerms ( mode_t unix_mode) { jr_int perm_flags = 0; if (unix_mode & S_ISUID) { perm_flags |= jr_PERM_S...
frankjas/libjr
libjr/misc/jr_iferr.c
#include "ezport.h" #include <stdio.h> #include "jr/errsim.h" #include "jr/misc.h" jr_int jr_iferr_sim ( jr_int is_err, jr_int is_orig_err, jr_int negate_err, const char * file_name, jr_int line_number) { return is_err; } #if 0 /* * 7/26/2005: Sample code with iferr() * Check output wi...
frankjas/libjr
libjr/missing/strstr.c
#define _POSIX_SOURCE 1 #include "ezport.h" #include <string.h> #include <ctype.h> /* * This routine conforms to the ANSI standard * description for 'strstr(string,pattern)' * used for finding a substring pattern in * a larger string. We provide the source because * some C environments are not provided with all...
frankjas/libjr
libjr/struct/att_mngr.h
#ifndef __att_mngr_h_ #define __att_mngr_h_ #include "ezport.h" #include <stdio.h> #include <string.h> #include "jr/malloc.h" #include "jr/string.h" #include "jr/misc.h" #include "jr/attribut.h" extern jr_int jr_AttributeManagerGetListId PROTO (( jr_AttributeManagerType * manager )); extern void jr...
frankjas/libjr
libjr/llist/llist.c
#include "project.h" jr_LList *jr_LListCreate (objsize) jr_int objsize; { jr_LList *ptr = (jr_LList *) jr_malloc (sizeof (jr_LList)); jr_LListInit (ptr, objsize); return (ptr); } void jr_LListInit (list, objsize) jr_LList *list; jr_int objsize; { static jr_int added_prefix_info = 0; if (!added_prefix_info...
frankjas/libjr
libjr/alist/alistcmp.c
<gh_stars>0 #include "project.h" jr_int jr_AListCmp (list1, list2, cmpfn) const jr_AList * list1 ; const jr_AList * list2 ; jr_int (*cmpfn)() ; { jr_int n1 ; jr_int n2 ; jr_int shortest ; jr_int diff ; jr_int i ; void * elem1 ; void * elem2 ; n1 = jr_AListSize(list1) ; n...
frankjas/libjr
include/jr/apr.h
<filename>include/jr/apr.h #ifndef _jr_apr_h___ #define _jr_apr_h___ #include <stdarg.h> #include <stddef.h> #include "jr/long.h" #include "jr/time.h" /******** APR Support ********/ extern void jr_apr_initialize (void); extern void jr_apr_terminate (void); extern jr_int jr_apr_is_initialized (void); exter...
frankjas/libjr
libjr/syscalls/jr_canon.c
<gh_stars>0 #include "ezport.h" #include "jr/syscalls.h" #include "jr/io.h" #include "jr/error.h" #include "jr/malloc.h" jr_int jr_GetCanonicalPath ( const char * user_path, char * path_buf, jr_int path_buf_size, char * error_buf) { const char * curr_path = 0; jr_int status; status...
frankjas/libjr
libjr/syscalls/tmpfile.c
#define _POSIX_SOURCE 1 #include "ezport.h" #include <string.h> #include <stdlib.h> #ifdef ostype_winnt #include <crtdefs.h> #include <io.h> #include <fcntl.h> #include <apr-1/apr_file_io.h> #include <apr-1/apr_errno.h> #else #include <sys/types.h> #include <unistd.h> #include <errno.h> #endif #include "jr/syscall...
frankjas/libjr
include/jr/mail.h
<reponame>frankjas/libjr<filename>include/jr/mail.h<gh_stars>0 #ifndef __jr_mail_h___ #define __jr_mail_h___ #include "ezport.h" #include "jr/alist.h" /******** Mail Library ********/ extern jr_int jr_MailStringMessage PROTO (( char * smtp_server_name, char * sender_full_address, char *...
frankjas/libjr
libjr/symtab/st_prnt.c
#include "project.h" jr_int jr_ST_PrintDeclaration (declarator_type, opt_declarator_name, prefix, wfp) jr_ST_TypeStruct * declarator_type; char * opt_declarator_name; char * prefix; FILE * wfp; { char dest_buf [1024]; jr_int status; status = jr_ST_DeclarationToString ( declarator_type...
frankjas/libjr
libjr/io/lineone.c
<filename>libjr/io/lineone.c #include "ezport.h" #include <stdio.h> #include <string.h> #include "jr/io.h" jr_int jr_FirstLineOfFileName(rfn, result_buf, result_buf_length) const char * rfn ; char * result_buf ; jr_int result_buf_length ; { FILE * rfp ; char * tp ; rfp = fopen(rfn, "r") ; if (rfp == NU...
frankjas/libjr
include/ezport.h
#ifndef __ezport_h__ #define __ezport_h__ #ifdef __cplusplus extern "C" { #endif /* ** 4-11-2011: the jr header files are all straight C */ #ifdef WIN32 # ifndef ostype_winnt # define ostype_winnt # endif #endif #ifdef __linux # ifndef ostype_linux # define ostype_linux # endif # define _GNU_SOURCE 1 # define m...
frankjas/libjr
include/jr/string.h
#ifndef __jr_string_h__ #define __jr_string_h__ #include "ezport.h" #include <stdio.h> #include <ctype.h> extern void jr_RemoveAllOfChar ( char * modifiable_string, jr_int char_val_removed) ; extern void jr_RemoveContiguousDuplicateChar ( char * string_with_possible_duplicate_chars, /* ...
frankjas/libjr
libjr/misc/pfx_proj.h
#ifndef __misc_prefix_h____ #define __misc_prefix_h____ #include "ezport.h" #include <stdlib.h> #include "jr/prefix.h" #include "jr/string.h" #include "jr/malloc.h" #include "jr/syscalls.h" #include "jr/apr.h" #include "jr/alist.h" #define jr_PREFIX_MAX_TYPES 256 extern jr_int jr_PrefixInfoElementPrefixSize ...
frankjas/libjr
libjr/avl_tree/project.h
#ifndef __project_h___ #define __project_h___ #include "ezport.h" #include <stdlib.h> #include <string.h> #include <assert.h> #include "jr/avl_tree.h" #include "jr/malloc.h" #include "jr/misc.h" #include "jr/alist.h" #include "jr/prefix.h" #define has_jr_avl_tree_with_prefix /* * These ifdefs enable this sourc...
frankjas/libjr
libjr/struct/jr_long.c
#include "ezport.h" #include "jr/misc.h" #include "jr/long.h" #ifdef jr_IS_64_BIT jr_int jr_LongCmp (long1, long2) jr_Long long1; jr_Long long2; { if (long1 > long2) { return (1); } if (long1 < long2) { return (-1); } return (0); } jr_int jr_LongCmpInt (long1, int_value) jr_Long long1; jr_int in...
frankjas/libjr
libjr/alist/alistsrt.c
<reponame>frankjas/libjr #include "project.h" void jr_AListSortRange (list, start_index, num_elements, cmpfn) jr_AList * list; jr_int start_index; jr_int num_elements; jr_int (*cmpfn) (); /* * using a selection sort since the most * time-consuming operation is the swap */ { register char * cu...
frankjas/libjr
include/jr/linebuf.h
<reponame>frankjas/libjr<filename>include/jr/linebuf.h #ifndef _linebufh #define _linebufh #include "ezport.h" typedef struct { char * buffer; char ** prev_buffers; jr_int * prev_lines; jr_int max_lines; jr_int line; jr_int column; jr_int max_size; jr_int tab_stops; } jr_LB_LineBuffer; extern voi...
frankjas/libjr
libjr/syscalls/nblk_io.c
#define _POSIX_SOURCE 1 #include "ezport.h" #include <errno.h> #include <fcntl.h> #include <string.h> #include <stdio.h> #include "jr/io.h" #include "jr/error.h" jr_int jr_FileDescInitNonBlockingIO (fd, error_buf) jr_int fd; char * error_buf; { jr_int flags; jr_int status; flags = fcntl (fd, F_GETFL,...
frankjas/libjr
libjr/jr_malloc/memstats.c
<gh_stars>0 #include "project.h" jr_int jr_MallocMaxPrintBucketVar = 10; static unsigned jr_int InitialBucketSizes [MAX_MALLOC_BUCKETS + 1] = MALLOC_BUCKET_SIZES; void jr_MallocStatInit (msp) jr_MallocStatStruct *msp; { jr_int b; memset (msp, 0, sizeof (jr_MallocStatStruct)); msp->did_initialization = 1 ; ...
frankjas/libjr
include/jr/poll.h
#ifndef __jr_poll_h___ #define __jr_poll_h___ #include "ezport.h" #include "jr/htable.h" #include "jr/dlist.h" #include "jr/time.h" #include "jr/apr.h" /* ** 2/22/07: Separate from jr/apr.h due to the additional data structures. */ /******** Polled I/O ********/ typedef struct jr_poll { void * apr_pollset_ptr;...
frankjas/libjr
libjr/avl_tree/avl_indx.c
#include "project.h" void *jr_AVL_TreeFindElementPtrUsingIndex (avl_tree, index_value) jr_AVL_Tree * avl_tree; jr_int index_value; { void * curr_node; jr_int curr_index; void * left_child; jr_int left_tree_size; assert (jr_AVL_TreeMaintainsSize (avl_tree)); curr_node = avl_tree->root_node; curr...
frankjas/libjr
libjr/syscalls/jr_tty.c
#include "ezport.h" #include <unistd.h> #include <stdio.h> jr_int jr_IsInteractiveFilePtr ( FILE * fp, char * error_buf) { return isatty (fileno (fp)); }
frankjas/libjr
include/jr/llist.h
<reponame>frankjas/libjr<gh_stars>0 #ifndef _llisth #define _llisth #include "ezport.h" #include <string.h> #include <stdarg.h> typedef struct { void * tail; void * head; jr_int objsize; jr_int prefix_size; unsigned allocates_elements : 1; } jr_LList; extern jr_LList * jr_LListCreate PROTO ((jr_int obj...
frankjas/libjr
libjr/syscalls/pathrel.c
<gh_stars>0 #define _POSIX_SOURCE 1 #include "ezport.h" #include <string.h> #include <stdlib.h> #include <alloca.h> #include "jr/syscalls.h" #include "jr/string.h" void jr_FileNameToRelativePath(target_path_buf, buflen, source_path_arg, relative_to_here_arg) char * target_path_buf ; jr_int buflen ; const cha...
frankjas/libjr
libjr/htable/htablsts.c
#include "project.h" void jr_HTableHashDist (htable, wfp, heading_string) jr_HTable * htable; FILE * wfp; char * heading_string; { jr_int * hashdist; jr_int allzeros; jr_int bucket; jr_int curr_index; jr_int num_elements; jr_int i; hashdist = (jr_int *) jr_malloc (htable->num_buckets * siz...
frankjas/libjr
libjr/missing/siglist.c
<filename>libjr/missing/siglist.c #define _POSIX_SOURCE 1 #include "ezport.h" #ifdef missing_sys_siglist_objects #include <signal.h> #ifdef ostype_winnt /* ** 1/27/07: don't make these globally available, since ** other code may have ifdefs based on the existence ** of these signals (coredump(), for example) */ #de...
frankjas/libjr
libjr/htable/htablemt.c
#include "project.h" void jr_HTableEmpty (htable) jr_HTable * htable ; { jr_int i; for (i = 0; i < htable->num_buckets; i++) { htable->buckets_array[i] = -1; } jr_AListEmpty (htable->entry_array); htable->delete_list = -1 ; /* end-of-list marker */ htable->num_deletes = 0 ; }
frankjas/libjr
libjr/syscalls/jr_noapr.c
#include "ezport.h" /* ** 5-17-2011: implementation that avoid dependency on APR ** to allow export of jr_malloc() w/o requiring APR. */ #ifdef ostype_winnt # include <windows.h> # include <stdlib.h> # include <io.h> #else # include <unistd.h> # include <string.h> # include <errno.h> #endif #include "jr/syscalls.h" ...
frankjas/libjr
libjr/string/vsigsepi.c
<gh_stars>0 #include "ezport.h" #include <stdio.h> #include <string.h> #include "jr/malloc.h" #include "jr/misc.h" #include "jr/vector.h" jr_int jr_VectorizeWithSkipSeparatorsInPlace(str, significant_sep, skip_sep, vector, vector_size) char * str ; const char * significant_sep ; const char * skip_sep ; char **...
frankjas/libjr
include/jr/symtab.h
#ifndef _stableh #define _stableh #include "ezport.h" #include <stdio.h> #include "jr/avl_tree.h" #include "jr/llist.h" #include "jr/alist.h" #include "jr/htable.h" #include "jr/ansi_c/exprnode.h" /******** jr_ST_TypeStructs, jr_ST_Symbols, and jr_ST_Identifiers ********/ typedef struct { char * str; void * ...
frankjas/libjr
libjr/alist/project.h
<reponame>frankjas/libjr #ifndef __project_h___ #define __project_h___ #define _POSIX_SOURCE 1 #include "ezport.h" #include <assert.h> #include <stdarg.h> #include "jr/alist.h" #include "jr/malloc.h" #include "jr/misc.h" #include "jr/string.h" #include "jr/prefix.h" extern void jr_AListTransformPrefixes PROTO ((...
frankjas/libjr
libjr/missing/getpw.c
#define _POSIX_SOURCE 1 #include "ezport.h" #ifdef missing_passwd_funcs #include <pwd.h> #include <stdio.h> # ifdef has_hesiod struct passwd *getpwuid(uid) jr_int uid ; { char uid_string[128] ; static struct passwd pw_entry[1] ; static char pw_name[128] ; static char pw_passwd[128] ; static char pw_com...
frankjas/libjr
libjr/llist/llistcmp.c
<filename>libjr/llist/llistcmp.c #include "project.h" jr_int jr_LListCmp (list1, list2, cmpfn) jr_LList *list1, *list2; jr_int (*cmpfn) (); { char *obj_p1, *obj_p2; jr_int comp; obj_p1 = jr_LListHeadPtr (list1); obj_p2 = jr_LListHeadPtr (list2); while (obj_p1 && obj_p2) { comp = (*cmpfn) (obj_p1, obj_p2); ...
frankjas/libjr
include/jr/errsim.h
#ifndef _jr_errsim_h___ #define _jr_errsim_h___ extern jr_int jr_iferr_sim ( jr_int is_err, jr_int is_orig_err, jr_int negate_err, const char * file_name, jr_int line_number); #ifdef jr_IFERR_ID # define iferr(v) \ iferr_macro (jr_IFERR_ID, __LINE_...
frankjas/libjr
libjr/struct/net_flt.c
<gh_stars>0 #define _POSIX_SOURCE 1 #include "ezport.h" #include "jr/nettype.h" #include "jr/xdr.h" static XDR FloatEncodeXDR[1]; static XDR FloatDecodeXDR[1]; static jr_int DidInit = 0; static float FloatEncodeBuf[16]; static float FloatDecodeBuf[16]; /* * Only need 1 float, verified by examining source fo...
frankjas/libjr
include/jr/bitset.h
<filename>include/jr/bitset.h #ifndef __BINSET_HEADER__ #define __BINSET_HEADER__ #include "ezport.h" #include <stdio.h> typedef struct { jr_int num_bits; unsigned jr_int * int_array; } jr_BitSet; /* * 7/23/2005: can't use small in array local to the struct * since then the object can't be moved. */ exter...
frankjas/libjr
include/jr/ezport/apr.h
#ifndef _jr_ezport_apr_h___ #define _jr_ezport_apr_h___ /* ** 11/21/06: Match apr-1 compiling options ** Need to define before any other files are included */ #ifdef ostype_linux # ifndef _GNU_SOURCE # define _GNU_SOURCE 1 # endif # if !defined(LINUX) && (__version__ >= 2000) # define LINUX 2 # endif # ifndef _R...
frankjas/libjr
libjr/string/isstring.c
#include "ezport.h" #include <ctype.h> #include "jr/string.h" jr_int jr_IsString (data_ptr, data_length) char * data_ptr; jr_int data_length; { jr_int i; for (i=0; i < data_length - 1; i++) { if (data_ptr [i] == 0) break; if (!isprint (data_ptr [i]) && !isspace (data_ptr [i])) { return (0); } } ...
Sestowner/dwm
config.h
<reponame>Sestowner/dwm /* See LICENSE file for copyright and license details. */ #include <X11/XF86keysym.h> /* appearance */ static const unsigned int borderpx = 1; /* border pixel of MODKEY */ static const unsigned int snap = 32; /* snap pixel */ static const unsigned int systraypinning = 0; /* 0: sloppy systray...
robot-dreams/secp256k1-zkp
src/modules/ecdsa_adaptor/tests_impl.h
#ifndef SECP256K1_MODULE_ECDSA_ADAPTOR_TESTS_H #define SECP256K1_MODULE_ECDSA_ADAPTOR_TESTS_H #include "include/secp256k1_ecdsa_adaptor.h" void rand_scalar(secp256k1_scalar *scalar) { unsigned char buf32[32]; secp256k1_testrand256(buf32); secp256k1_scalar_set_b32(scalar, buf32, NULL); } void rand_point(s...