free(ptr);
}
+void afs_osi_FreeStr(char *ptr)
+{
+ free(ptr);
+}
+
void *osi_AllocLargeSpace(size_t size)
{
AFS_STATCNT(osi_AllocLargeSpace);
afs_int32 i, sn;
struct cell *tcell;
- RX_AFS_GLOCK();
+#ifdef RX_ENABLE_LOCKS
+ AFS_GLOCK();
+#endif /* RX_ENABLE_LOCKS */
AFS_STATCNT(SRXAFSCB_GetCellByNum);
a_hosts->serverList_val = 0;
tcell = afs_GetCellStale(a_cellnum, READ_LOCK);
if (!tcell) {
*a_name = afs_strdup("");
- RX_AFS_GUNLOCK();
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
return 0;
}
ReleaseReadLock(&tcell->lock);
afs_PutCell(tcell, READ_LOCK);
- RX_AFS_GUNLOCK();
+#ifdef RX_ENABLE_LOCKS
+ AFS_GUNLOCK();
+#endif /* RX_ENABLE_LOCKS */
return 0;
}
#endif
}
+void afs_osi_FreeStr(char *x)
+{
+ afs_osi_Free(x, strlen(x) + 1);
+}
/* ? is it moderately likely that there are dirty VM pages associated with
* this vnode?
extern char *afs_cv2string(char *ttp, afs_uint32 aval);
extern int afs_strcasecmp(char *s1, char *s2);
extern char *afs_strchr(char *s, int c);
+extern char *afs_strdup(char *s);
extern void print_internet_address(char *preamble, struct srvAddr *sa,
char *postamble, int flag);
extern afs_int32 afs_data_pointer_to_int32(const void *p);
return NULL;
}
+int afs_strcasecmp(char *s1, char *s2)
+{
+ while (*s1 && *s2) {
+ char c1, c2;
+
+ c1 = *s1++;
+ c2 = *s2++;
+ if (c1 >= 'A' && c1 <= 'Z') c1 += 0x20;
+ if (c2 >= 'A' && c2 <= 'Z') c2 += 0x20;
+ if (c1 != c2)
+ return c1-c2;
+ }
+
+ return *s1 - *s2;
+}
+
+char *afs_strdup(char *s)
+{
+ char *n;
+ int cc;
+
+ cc = strlen(s) + 1;
+ n = (char *) afs_osi_Alloc(cc);
+ if (n)
+ memcpy(n, s, cc);
+
+ return n;
+}
+
void print_internet_address(char *preamble, struct srvAddr *sa,
char *postamble, int flag)
{